Complex.polar constructor

Complex.polar(
  1. double modulus,
  2. double theta
)

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));
}