Skip to main content

Spherical

A point's spherical coordinates.

Constructor

Spherical

function Spherical( radius: Float, phi: Float, theta: Float ): void;  

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

radius: Float;  

phi

phi: Float;  

theta

theta: Float;  

Methods

clone

function clone( ): Spherical;  

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

copy

function copy( s: Spherical ): this;  

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

makeSafe

function makeSafe( ): this;  

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

set

function set( radius: Float, phi: Float, theta: Float ): this;  

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

setFromVector3

function setFromVector3( vec3: Vector3 ): this;  

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

setFromCartesianCoords

function setFromCartesianCoords( x: Float, y: Float, z: Float ): this;  

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

Source

src/math/Spherical.js