Home

# Class goog.math.Coordinate3

Class for representing coordinates and positions in 3 dimensions.

Instance Method Summary
| `clone() ⇒ !goog.math.Coordinate3` Returns a new copy of the coordinate.
| `toArray() ⇒ !Array` Returns the contents of this coordinate as a 3 value Array.
| `toString() ⇒ string` Returns a nice string representing the coordinate.

Static Method Summary
| `difference(?goog.math.Coordinate3 a, ?goog.math.Coordinate3 b) ⇒ !goog.math.Coordinate3` Returns the difference between two coordinates as a new goog.math.Coordinate3.
| `distance(?goog.math.Coordinate3 a, ?goog.math.Coordinate3 b) ⇒ number` Returns the distance between two coordinates.
| `equals(?goog.math.Coordinate3 a, ?goog.math.Coordinate3 b) ⇒ boolean` Compares coordinates for equality.
| `fromArray(?Array.<number> a) ⇒ !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.

`squaredDistance(?goog.math.Coordinate3 a, ?goog.math.Coordinate3 b) ⇒ 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.)