Complex.polar constructor
Factory for creating complex numbers in polar or exponential form.
Accepts the modulus (r) and the angle theta in radians.
Implementation
factory Complex.polar(double modulus, double theta) {
final re = modulus * math.cos(theta);
final im = modulus * math.sin(theta);
return Complex._service(re, im, modulus, theta, calculateTheta2(theta));
}