Documentation for routine unpolar
assembled from the following pages:
Language documentation: Independent routines §
From Independent routines
(Independent routines) routine unpolar §
Defined as:
method unpolar(Real )multi sub unpolar(Real , Real )
Returns a Complex
with the coordinates corresponding to the angle in radians and magnitude corresponding to the object value or $mag
in the case it's being used as a sub
say 1.unpolar(⅓*pi);# OUTPUT: «0.5000000000000001+0.8660254037844386i»
Class: Cool §
From Cool
(Cool) method unpolar §
Defined as:
method unpolar(Numeric(Cool))
Coerces the arguments (including the invocant in the method form) to Numeric, and returns a complex number from the given polar coordinates. The invocant (or the first argument in sub form) is the magnitude while the argument (i.e. the second argument in sub form) is the angle. The angle is assumed to be in radians.
say sqrt(2).unpolar(pi/4); # OUTPUT: «1+1i»