complex library

Classes

Complex
Represents an immutable complex number z = re + im*i.

Constants

i → const Complex
The constant ‘i’, the imaginary number (0 + 1i).
one → const Complex
The constant ‘one’, the real number 1 (1 + 0i).
piHalf → const double
The numbers: ‘1’, ‘0’, and the number ‘i’ expressed as complex numbers. Fixed value of Pi divided by 2, used for constant definitions. It is necessary to use a pre-calculated value instead of math.pi / 2 because division is not a ‘const’ operation at compile time.
zero → const Complex
The constant ‘zero’, the complex zero (0 + 0i).

Functions

calculateTheta1(double re, double im) double
Calculate the argument (phase) in radians in the interval (-π, π].
calculateTheta2(double theta1) double
Calculates the argument (phase) in radians in the range [0, 2π).
degreesToRadians(double degrees) double
Converts an angle from degrees to radians.
radiansToDegrees(double radians) double
Converts an angle from radians to degrees.