with Standard_Mathematical_Functions; use Standard_Mathematical_Functions;
package body Standard_Complex_Numbers_Polar is
function Radius ( c : Complex_Number ) return double_float is
begin
return SQRT(REAL_PART(c)**2 + IMAG_PArt(c)**2);
end Radius;
function Angle ( c : Complex_Number ) return double_float is
begin
return Standard_Mathematical_Functions.Angle(IMAG_PART(c),REAL_PART(c));
end Angle;
function Root ( c : Complex_Number; n,i : natural ) return Complex_Number is
arg,radius_c,angle_c : double_float;
tmp : Complex_Number;
begin
arg := (2.0 * PI * double_float(i)) / double_float(n);
radius_c := RADIUS(c)**(1.0/double_float(n));
angle_c := ANGLE(c)/double_float(n);
tmp := Create(radius_c)*Create(COS(angle_c),SIN(angle_c));
return Create(COS(arg),SIN(arg))*tmp;
end Root;
end Standard_Complex_Numbers_Polar;