Functions for complex numbers in cartesian or polar representation.
Complex numbers are represented as maps with the keys ':real' and ':img' in cartesian representation and ':r' and ':phi' in polar representation.
Functions for complex numbers in cartesian or polar representation. Complex numbers are represented as maps with the keys ':real' and ':img' in cartesian representation and ':r' and ':phi' in polar representation.
(add c1 c2)
Adds two complex numbers c1
and c2
given in cartesian representation.
Adds two complex numbers `c1` and `c2` given in cartesian representation.
(conjugate c)
Calculates the conjugate of the complex number c
given in cartesian representation.
Calculates the conjugate of the complex number `c` given in cartesian representation.
(div-polar p1 p2)
Divides the complex numbers p1
and p2
given in polar representation.
Divides the complex numbers `p1` and `p2` given in polar representation.
(divide c1 c2)
Multiplies two complex numbers c1
and c2
given in cartesian representation.
Multiplies two complex numbers `c1` and `c2` given in cartesian representation.
The complex number i in cartesian representation
The complex number i in cartesian representation
(inverse c)
Calculates the conjugate of the complex number c
given in cartesian representation.
If c is zero, an exception is thrown.
Calculates the conjugate of the complex number `c` given in cartesian representation. If c is zero, an exception is thrown.
(mult-polar p1 p2)
Multiplies the complex numbers p1
and p2
given in polar representation.
Multiplies the complex numbers `p1` and `p2` given in polar representation.
(multiply c1 c2)
Multiplies two complex numbers c1
and c2
given in cartesian representation.
Multiplies two complex numbers `c1` and `c2` given in cartesian representation.
(norm c)
Calculates the norm or absolute value of the complex number c
given in cartesian representation.
Calculates the norm or absolute value of the complex number `c` given in cartesian representation.
The complex number one in cartesian representation.
The complex number one in cartesian representation.
(scalar-product c x)
Calculates the scalar product of the complex number c
with the real number x
Calculates the scalar product of the complex number `c` with the real number `x`
(sqr c)
Calculates the square of the complex number c
given in cartesian repmresentation.
Calculates the square of the complex number `c` given in cartesian repmresentation.
(sqrt c)
Calculates the principal square root of the complex number c
given in cartesian representation.
Calculates the principal square root of the complex number `c` given in cartesian representation.
(sqrt-polar p)
Calculates the principal square root of the complex number p
given in polar representation.
Calculates the principal square root of the complex number `p` given in polar representation.
(substract c1 c2)
Substracts two complex numbers c1
and c2
given in cartesian representation'.
Substracts two complex numbers `c1` and `c2` given in cartesian representation'.
(to-cartesian p)
Retuns the cartesian representation of the complex number p
given in polar representation.
Retuns the cartesian representation of the complex number `p` given in polar representation.
(to-polar c)
Retuns the polar representation of the complex number c
given in cartesian representation.
Retuns the polar representation of the complex number `c` given in cartesian representation.
The complex number zero in cartesian representation.
The complex number zero in cartesian representation.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close