Spherical

new Spherical(phi, theta, radius)

Spherical coordinates (r, θ, φ) as commonly used in physics (ISO 80000-2:2019 convention), see https://en.wikipedia.org/wiki/Spherical_coordinate_system. https://upload.wikimedia.org/wikipedia/commons/4/4f/3D_Spherical.svg

Name Type Default Description
phi Number 0 optional

azimuthal angle φ (phi) (angle of rotation from the initial meridian plane).

theta Number 0 optional

polar angle θ (theta) (angle with respect to polar axis).

radius Number 1 optional

radial distance r (distance to origin).

Members

phi : Number

The phi component.

Default Value: 0.0

radius : Number

The radius component.

Default Value: 1.0

theta : Number

The theta component.

Default Value: 0.0

Methods

static Spherical.clone(spherical, result)Spherical

Creates a duplicate of a Spherical.

Name Type Description
spherical Spherical

The spherical to clone.

result Spherical optional

The object to store the result into, if undefined a new instance will be created.

Returns:

The modified result parameter or a new instance if result was undefined. (Returns undefined if spherical is undefined)

static Spherical.equals(left, right)Boolean

Returns true if the first spherical is equal to the second spherical, false otherwise.

Name Type Description
left Spherical

The first Spherical to be compared.

right Spherical

The second Spherical to be compared.

Returns:

true if the first spherical is equal to the second spherical, false otherwise.

static Spherical.equalsEpsilon(left, right, epsilon)Boolean

Returns true if the first spherical is within the provided epsilon of the second spherical, false otherwise.

Name Type Default Description
left Spherical

The first Spherical to be compared.

right Spherical

The second Spherical to be compared.

epsilon Number 0.0 optional

The epsilon to compare against.

Returns:

true if the first spherical is within the provided epsilon of the second spherical, false otherwise.

static Spherical.normalize(spherical, result)Spherical

Computes the normalized version of the provided spherical.

Name Type Description
spherical Spherical

The spherical to be normalized.

result Spherical optional

The object to store the result into, if undefined a new instance will be created.

Returns:

The modified result parameter or a new instance if result was undefined.

toString()String

Returns a string representing this instance in the format (phi, theta, radius).

Returns:

A string representing this instance.