diff --git a/complex.hh b/complex.hh index b3cc5e5..50905f8 100644 --- a/complex.hh +++ b/complex.hh @@ -126,5 +126,11 @@ static constexpr T arg(Complex a) return atan2(a.imag(), a.real()); } +template +static constexpr Complex polar(T a, T b) +{ + return Complex(a * cos(b), a * sin(b)); +} + }