Class Spherical
Index
Constructors
Properties
Methods
Constructors
constructor
-
Creates a new Spherical object from the given spherical coordinates
Parameters
- radius: number
spherical radius
- theta: number
angle from positive y axis to radial line from 0 to PI (vertical)
- phi: number
angle from positive x axis measured anticlockwise from -PI to PI (horizontal)
Returns Spherical
- radius: number
Properties
phi
angle from positive x axis measured anticlockwise from -PI to PI (horizontal)
radius
spherical radius
theta
angle from positive y axis to radial line from 0 to PI (vertical)
Methods
add
add In Place
add In Place From Floats
-
Adds the provided values to the current spherical
Parameters
- radius: number
the amount to add to the radius
- theta: number
the amount to add to the theta
- phi: number
the amount to add to the phi
Returns Spherical
the current spherical
- radius: number
add To Ref
as Array
-
Converts the current spherical to an array
Returns number[]
the current spherical as an array
clone
copy From
copy From Floats
-
Copies the given values into the current spherical
Parameters
- radius: number
the radius to use
- theta: number
the theta to use
- phi: number
the phi to use
Returns Spherical
the current spherical
- radius: number
divide
divide In Place
divide To Ref
get Class Name
-
Gets the class name
Returns string
the string "Spherical"
multiply
multiply In Place
multiply To Ref
scale
-
Scales the current spherical and returns a new spherical with the scaled coordinates
Parameters
- scale: number
defines the multiplication factor
Returns Spherical
the scaled spherical
- scale: number
scale In Place
-
Scales the current spherical
Parameters
- scale: number
defines the multiplication factor
Returns Spherical
the current spherical
- scale: number
scale To Ref
set
-
Sets the values of the current spherical
Parameters
- radius: number
the new radius
- theta: number
the new theta
- phi: number
the new phi
Returns Spherical
the current spherical
- radius: number
set All
-
Sets the values of the current spherical
Parameters
- value: number
the new values
Returns Spherical
the current spherical
- value: number
subtract
subtract From Floats
-
Subtracts the given floats from the current spherical
Parameters
- radius: number
the amount to subtract from the radius
- theta: number
the amount to subtract from the theta
- phi: number
the amount to subtract from the phi
Returns Spherical
the difference spherical
- radius: number
subtract From Floats To Ref
-
Subtracts the given floats from the current spherical
Parameters
- radius: number
the amount to subtract from the radius
- theta: number
the amount to subtract from the theta
- phi: number
the amount to subtract from the phi
- ref: Spherical
the spherical to store the result in
Returns Spherical
the updated ref
- radius: number
subtract In Place
subtract To Ref
to String
-
Converts the current spherical to a string
Returns string
the current spherical as a string
to Vector3
-
Gets a Vector3 from the current spherical coordinates
Returns Vector3
the (x, y,z) form of the current Spherical
to Vector3 To Ref
StaticFrom Array
-
Converts an array of floats to a spherical
Parameters
- array: number[]
the array to convert
Returns Spherical
the converted spherical
- array: number[]
StaticFrom Vector3
-
Gets a Spherical from a Vector3
Parameters
- vector: DeepImmutable<Vector3>
defines the vector in (x, y, z) coordinate space
Returns Spherical
a new Spherical
- vector: DeepImmutable<Vector3>
StaticFrom Vector3 To Ref
-
Assigns the spherical coordinates from a Vector3
Parameters
- vector: DeepImmutable<Vector3>
the vector to convert
- ref: Spherical
the Spherical to update
Returns Spherical
the updated ref
- vector: DeepImmutable<Vector3>
Class used for (radius, theta, phi) vector representation.