proj module

Todo

Add a modulus_squared function.

proj.sum_diff(a, b)[source]

Calculate the sum and the difference of two variables.

Parameters:
  • a – number
  • b – number
Return sum:

sum of a and b

Return diff:

difference between a and b

# Examples
sum(1, 3) # output 4, -2
sum(1+1j, -1j) # output 1, 1+2j
proj.modulus(z)[source]

Calculate the modulus |z| of a complex number z. The modulus is given by:

|z| = \sqrt{[\Re(z)]^2+[\Im(z)]^2}

Parameters:z – complex number
Return modulus:modulus of z

Note

Works for real variables too.