Home

# Class goog.math.Coordinate

Class for representing coordinates and positions.

Instance Method Summary
| `clone() ⇒ !goog.math.Coordinate` Returns a new copy of the coordinate.
| `toString() ⇒ string` Returns a nice string representing the coordinate.

Static Method Summary
| `difference(!goog.math.Coordinate a, !goog.math.Coordinate b) ⇒ !goog.math.Coordinate` Returns the difference between two coordinates as a new goog.math.Coordinate.
| `distance(!goog.math.Coordinate a, !goog.math.Coordinate b) ⇒ number` Returns the distance between two coordinates.
| `equals(?goog.math.Coordinate a, ?goog.math.Coordinate b) ⇒ boolean` Compares coordinates for equality.

`squaredDistance(!goog.math.Coordinate a, !goog.math.Coordinate 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.)

| `sum(!goog.math.Coordinate a, !goog.math.Coordinate b) ⇒ !goog.math.Coordinate` Returns the sum of two coordinates as a new goog.math.Coordinate.