rect<R extends num, I extends num> function
Implementation
Complex<R, I> rect<R extends num, I extends num>(Complex complex) {
var r = abs(complex);
var phi = phase(complex);
var rl = r * math.cos(phi) as R;
var img = r * math.sin(phi) as I;
return Complex<R, I>(rl, img);
}