Polar

superclass: Number

Represents polar coordinates.

Creation

new(rho, theta)

Create a new polar coordinate with the given radius, rho, and angle in radians, theta.

Math

+ - * /

The math operations of addition, subtraction, multiplication and division are accomplished by

first converting to complex numbers.

scale(aNumber)

Scale the radius by some value.

rotate(aNumber)

Rotate the angle by some value.

neg

Rotate by pi.

Conversion

magnitude

Answer the radius.

angle

Answer the angle in radians

phase

Answer the angle in radians

real

Answer the real part.

imag

Answer the imaginary part.

asComplex

Convert to Complex

asPoint

Convert to Point