Complex.fromPolar constructor
Creates a complex number from the given polar coordinates where r
is the
radius and theta
is the angle.
By default the angle theta must be expressed in radians but setting
angleInRadians = false
allows the value to be in degrees.
Implementation
Complex.fromPolar(double r, double theta, {bool angleInRadians = true})
: real = r * math.cos(angleInRadians ? theta : degToRad(theta)),
imaginary = r * math.sin(angleInRadians ? theta : degToRad(theta));