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>
1

the 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() → {Spherical}

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

Returns:
Type: 
Spherical

copy(other) → {Spherical}

Copies the values of the passed Spherical's radius, phi and theta properties to this spherical.

Parameters:
NameTypeDescription
otherSpherical
Returns:
Type: 
Spherical

makeSafe() → {Spherical}

Restrict phi to be betwee EPS and PI-EPS.

Returns:
Type: 
Spherical

set(radius, phi, theta) → {Spherical}

Sets values of this spherical's radius, phi and theta properties.

Parameters:
NameTypeDescription
radiusnumber
phinumber
thetanumber
Returns:
Type: 
Spherical

setFromVector3(vec3) → {Spherical}

Sets values of this spherical's radius, phi and theta properties from the Vector3.

Parameters:
NameTypeDescription
vec3Vector3
Returns:
Type: 
Spherical