t3d. Spherical

Ref: https://en.wikipedia.org/wiki/Spherical_coordinate_system The poles (phi) are at the positive and negative y axis. The equator starts at positive z.

Constructor

new Spherical(radiusopt, phiopt, thetaopt)

Parameters:
NameTypeAttributesDefaultDescription
radiusNumber<optional>
1the radius, or the Euclidean distance (straight-line distance) from the point to the origin. Default is 1.0.
phiNumber<optional>
0- polar angle in radians from the y (up) axis. Default is 0.
thetaNumber<optional>
0- equator angle in radians around the y (up) axis. Default is 0.

Methods

clone() → {t3d.Spherical}

Returns a new spherical with the same radius, phi and theta properties as this one.
Returns:
Type: 
t3d.Spherical

copy(other) → {t3d.Spherical}

Copies the values of the passed Spherical's radius, phi and theta properties to this spherical.
Parameters:
NameTypeDescription
othert3d.Spherical
Returns:
Type: 
t3d.Spherical

makeSafe() → {t3d.Spherical}

Restrict phi to be betwee EPS and PI-EPS.
Returns:
Type: 
t3d.Spherical

set(radius, phi, theta)

Sets values of this spherical's radius, phi and theta properties.
Parameters:
NameTypeDescription
radiusNumber
phiNumber
thetaNumber

setFromVector3(vec3) → {t3d.Spherical}

Sets values of this spherical's radius, phi and theta properties from the Vector3.
Parameters:
NameTypeDescription
vec3t3d.Vector3
Returns:
Type: 
t3d.Spherical