Complex.polar constructor

Complex.polar(
  1. num rho,
  2. num theta
)

Creates a complex number from polar coordinates. rho is the magnitude, and theta is the phase angle in radians.

Implementation

factory Complex.polar(num rho, num theta) {
  return Complex(rho * math.cos(theta), rho * math.sin(theta));
}