Capítulo 366 de 859

Chapter 366: Spherical

Core Idea

This class can be used to represent points in 3D space as Spherical coordinates.

Key Concepts

  • phi : number: The polar angle in radians from the y (up) axis.
  • radius : number: The radius, or the Euclidean distance (straight-line distance) from the point to the origin.
  • theta : number: The equator/azimuthal angle in radians around the y (up) axis.

Reference Tables

Constructor

Signature
new Spherical( radius : number, phi : number, theta : number )

Properties

PropertyDescription
.phi : numberThe polar angle in radians from the y (up) axis.
.radius : numberThe radius, or the Euclidean distance (straight-line distance) from the point to the origin.
.theta : numberThe equator/azimuthal angle in radians around the y (up) axis.

Methods

MethodDescription
.clone() : SphericalReturns a new spherical with copied values from this instance.
.copy( other : Spherical ) : SphericalCopies the values of the given spherical to this instance.
.makeSafe() : SphericalRestricts the polar angle [page:.phi phi] to be between 0.000001 and pi - 0.000001.
.set( radius : number, phi : number, theta : number ) : SphericalSets the spherical components by copying the given values.
.setFromCartesianCoords( x : number, y : number, z : number ) : SphericalSets the spherical components from the given Cartesian coordinates.
.setFromVector3( v : Vector3 ) : SphericalSets the spherical components from the given vector which is assumed to hold Cartesian coordinates.

Key Takeaways

  1. Most relevant properties: phi, radius, theta.
  2. Key methods: clone, copy, makeSafe, set.

Connects To