goog.math.Coordinate3
Instance Methods
this.clone() → goog.math.Coordinate3
goog.math.Coordinate3
Returns a new copy of the coordinate.
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.toString() → string
string
Returns a nice string representing the coordinate.
Parameters | None. | ||
---|---|---|---|
Returns |
|
Instance Properties
this.x → number
number
X-value
this.y → number
number
Y-value
this.z → number
number
Z-value
Static Functions
Coordinate3.difference( a, b ) → goog.math.Coordinate3
goog.math.Coordinate3
Returns the difference between two coordinates as a new goog.math.Coordinate3.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
Coordinate3.distance( a, b ) → number
number
Returns the distance between two coordinates.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
Coordinate3.equals( a, b ) → boolean
boolean
Compares coordinates for equality.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
Coordinate3.fromArray( a ) → goog.math.Coordinate3
goog.math.Coordinate3
Converts a three element array into a Coordinate3 object. If the value passed in is not an array, not array-like, or not of the right length, an error is thrown.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
| ||||
Throws |
|
Coordinate3.squaredDistance( a, b ) → number
number
Returns the squared distance between two coordinates. Squared distances can be used for comparisons when the actual value is not required.
Performance note: eliminating the square root is an optimization often used in lower-level languages, but the speed difference is not nearly as pronounced in JavaScript (only a few percent.)
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|