Creates a new Spherical
Distance from origin
Polar angle (radians) measured from +Y
Azimuthal angle (radians) measured from +Z
Angle in radians down from +Y: 0 points straight up, π / 2 lies level, π points straight
down
Distance from the origin
Angle in radians around +Y, measured from +Z toward +X
ReadonlytypeNames the shape without an instanceof check, like the type on pixi's 2D shapes
Copies other into this spherical
The spherical to copy from
This spherical, for chaining
Checks whether other matches this spherical
The spherical to compare with
true when radius, phi and theta match exactly (no epsilon tolerance)
Sets radius, phi and theta
Distance from origin
Polar angle (radians) measured from +Y
Azimuthal angle (radians) measured from +Z
This spherical, for chaining
Sets this spherical from Cartesian (x, y, z)
Zero-radius inputs collapse theta and phi to 0.
Position on the x axis
Position on the y axis
Position on the z axis
This spherical, for chaining
Sets this spherical from the Cartesian point v
The Cartesian point to convert
This spherical, for chaining
Advanced
Returns a readable string representation of this spherical
A string in the form [@pixi/3d/math:Spherical radius=1 phi=0 theta=0]
A point given as
radius,phiandthetaaround the origin: its distance, its angle down from +Y, and its angle around +Y, measured from +Z toward +XUse it for anything that orbits: convert a position in, change the angles, then convert back with Vector3#setFromSpherical.
Example