Spherical coordinates (r, θ, φ) as commonly used in physics (ISO 80000-2:2019 convention),
see https://en.wikipedia.org/wiki/Spherical_coordinate_system.
| Name | Type | Default | Description |
|---|---|---|---|
phi |
Number |
0
|
optional
azimuthal angle φ (phi) (angle of rotation from the initial meridian plane). |
theta |
Number |
0
|
optional
polar angle θ (theta) (angle with respect to polar axis). |
radius |
Number |
1
|
optional
radial distance r (distance to origin). |
Members
The phi component.
-
Default Value:
0.0
The radius component.
-
Default Value:
1.0
The theta component.
-
Default Value:
0.0
Methods
static Spherical.clone(spherical, result) → Spherical
Creates a duplicate of a Spherical.
| Name | Type | Description |
|---|---|---|
spherical |
Spherical |
The spherical to clone. |
result |
Spherical |
optional
The object to store the result into, if undefined a new instance will be created. |
Returns:
The modified result parameter or a new instance if result was undefined. (Returns undefined if spherical is undefined)
Returns true if the first spherical is equal to the second spherical, false otherwise.
| Name | Type | Description |
|---|---|---|
left |
Spherical |
The first Spherical to be compared. |
right |
Spherical |
The second Spherical to be compared. |
Returns:
true if the first spherical is equal to the second spherical, false otherwise.
Returns true if the first spherical is within the provided epsilon of the second spherical, false otherwise.
| Name | Type | Default | Description |
|---|---|---|---|
left |
Spherical |
The first Spherical to be compared. |
|
right |
Spherical |
The second Spherical to be compared. |
|
epsilon |
Number |
0.0
|
optional
The epsilon to compare against. |
Returns:
true if the first spherical is within the provided epsilon of the second spherical, false otherwise.
static Spherical.normalize(spherical, result) → Spherical
Computes the normalized version of the provided spherical.
| Name | Type | Description |
|---|---|---|
spherical |
Spherical |
The spherical to be normalized. |
result |
Spherical |
optional
The object to store the result into, if undefined a new instance will be created. |
Returns:
The modified result parameter or a new instance if result was undefined.
Returns a string representing this instance in the format (phi, theta, radius).
Returns:
A string representing this instance.