Spherical

A point's spherical coordinates.

Constructor

Spherical(radius : Float, phi : Float, theta : Float)

radius — the radius, or the Euclidean distance (straight-line distance) from the point to the origin. Default is 1.0.
phi — polar angle in radians from the y (up) axis. Default is 0.
theta — equator angle in radians around the y (up) axis. Default is 0.

The poles (phi) are at the positive and negative y axis. The equator (theta) starts at positive z.

Properties

.radius : Float

.phi : Float

.theta : Float

Methods

.clone() → Spherical

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

.copy(s : Spherical) → this

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

.makeSafe() → this

Restricts the polar angle phi to be between 0.000001 and pi - 0.000001.

.set(radius : Float, phi : Float, theta : Float) → this

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

.setFromVector3(vec3 : Vector3) → this

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

.setFromCartesianCoords(x : Float, y : Float, z : Float) → this

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

Source

For more info on how to obtain the source code of this module see this page.