Complex.fromPolar constructor

Complex.fromPolar(
  1. double magnitude,
  2. double phase
)

Create a complex number from polar coordinates

Implementation

factory Complex.fromPolar(double magnitude, double phase) {
  return Complex(magnitude * math.cos(phase), magnitude * math.sin(phase));
}