coordinate.js
No description.

File Location

/goog/math/coordinate.js

Classes

goog.math.Coordinate
Class for representing coordinates and positions.

Public Protected Private

Global Functions

goog.math.Coordinate.azimuth(a) number
Returns the angle from the origin to a coordinate.
Arguments:
a : !goog.math.Coordinate
A Coordinate.
Returns: number  The angle, in degrees, clockwise from the positive X axis to a.
code »
goog.math.Coordinate.difference(ab) !goog.math.Coordinate
Returns the difference between two coordinates as a new goog.math.Coordinate.
Arguments:
a : !goog.math.Coordinate
A Coordinate.
b : !goog.math.Coordinate
A Coordinate.
Returns: !goog.math.Coordinate  A Coordinate representing the difference between a and b.
code »
goog.math.Coordinate.distance(ab) number
Returns the distance between two coordinates.
Arguments:
a : !goog.math.Coordinate
A Coordinate.
b : !goog.math.Coordinate
A Coordinate.
Returns: number  The distance between a and b.
code »
goog.math.Coordinate.equals(ab) boolean
Compares coordinates for equality.
Arguments:
a : goog.math.Coordinate
A Coordinate.
b : goog.math.Coordinate
A Coordinate.
Returns: boolean  True iff the coordinates are equal, or if both are null.
code »
goog.math.Coordinate.magnitude(a) number
Returns the magnitude of a coordinate.
Arguments:
a : !goog.math.Coordinate
A Coordinate.
Returns: number  The distance between the origin and a.
code »
goog.math.Coordinate.squaredDistance(ab) 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.)
Arguments:
a : !goog.math.Coordinate
A Coordinate.
b : !goog.math.Coordinate
A Coordinate.
Returns: number  The squared distance between a and b.
code »
goog.math.Coordinate.sum(ab) !goog.math.Coordinate
Returns the sum of two coordinates as a new goog.math.Coordinate.
Arguments:
a : !goog.math.Coordinate
A Coordinate.
b : !goog.math.Coordinate
A Coordinate.
Returns: !goog.math.Coordinate  A Coordinate representing the sum of the two coordinates.
code »

Directory math

File Reference