Polar:
Filter:
Classes | Math

Polar : Number : Magnitude : Object

Polar coordinates
Source: Polar.sc

Description

Represents polar coordinates.

Class Methods

Polar.new(rho, theta)

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

Inherited class methods

Instance Methods

Math

+(aNumber)

-(aNumber)

*(aNumber)

/(aNumber)

The math operations of addition, subtraction, multiplication and division are accomplished by first converting to complex numbers.

.scale(scale)

Scale the radius by some value.

.rotate(angle)

Rotate the angle by some value.

.neg

Rotate by pi.

.mirrorX: METHOD NOT FOUND!

Mirror x, reflecting across Y axis.

.mirrorY: METHOD NOT FOUND!

Mirror y, reflecting across the X axis.

.mirrorO: METHOD NOT FOUND!

Mirror across the origin.

Discussion:

A synonym for neg.

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

.asSpherical: METHOD NOT FOUND!

Convert to Spherical

.asCartesian: METHOD NOT FOUND!

Convert to Cartesian

.angles: METHOD NOT FOUND!

Answer the azimuth and elevation angles, theta and phi, in radians.

.angles: METHOD NOT FOUND!

Answer the azimuth and elevation angles, theta and phi, in radians.

Returns:

[ theta, 0 ]

.phases: METHOD NOT FOUND!

Answer the azimuth and elevation angles, theta and phi, in radians.

Returns:

[ theta, 0 ]

.x: METHOD NOT FOUND!

Answer the cartesian coordinate x of the receiver.

.y: METHOD NOT FOUND!

Answer the cartesian coordinate y of the receiver.

.z: METHOD NOT FOUND!

Answer the cartesian coordinate z of the receiver, 0.

Accessing

.rho

.rho = value

Get or set the rho coordinate value.

.theta

.theta = value

Get or set the theta coordinate value.

.phi: METHOD NOT FOUND!

Answers 0.

Testing

==(aPolar)

Answers a Boolean whether the receiver equals the argument.

.hash

Returns a hash value for the receiver.

Inherited instance methods

Undocumented instance methods

.asPolar

.performBinaryOpOnSomething(aSelector, thing, adverb)

.performBinaryOpOnUGen(aSelector, aUGen)