unpolar
ErrorsCollection

unpolar

Synthesised documentation from type/independent-routines type/Cool

From type/independent-routines

See Original text in context

method unpolar(Real $angle)
multi sub unpolar(Real $magReal $angle)

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␤»

From type/Cool

See Original text in context

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␤»