math.Coordinate3 Extends
Class for representing coordinates and positions in 3 dimensions.

Inheritance

Constructor

goog.math.Coordinate3(opt_xopt_yopt_z)

Parameters

opt_x : number=
X coordinate, defaults to 0.
opt_y : number=
Y coordinate, defaults to 0.
opt_z : number=
Z coordinate, defaults to 0.

Instance Methods

Public Protected Private
clone() !goog.math.Coordinate3
Returns a new copy of the coordinate.
Returns: !goog.math.Coordinate3  A clone of this coordinate.
code »
toArray() !Array.<number>
Returns the contents of this coordinate as a 3 value Array.
Returns: !Array.<number>  A new array.
code »
toString() string
Returns a nice string representing the coordinate.
Returns: string  In the form (50, 73, 31).
code »

Instance Properties

x :
X-value
Code »
y :
Y-value
Code »
z :
Z-value
Code »

Static Methods

goog.math.Coordinate3.difference(ab) !goog.math.Coordinate3
Returns the difference between two coordinates as a new goog.math.Coordinate3.
Arguments:
a : goog.math.Coordinate3
A Coordinate3.
b : goog.math.Coordinate3
A Coordinate3.
Returns: !goog.math.Coordinate3  A Coordinate3 representing the difference between a and b.
code »
goog.math.Coordinate3.distance(ab) number
Returns the distance between two coordinates.
Arguments:
a : goog.math.Coordinate3
A Coordinate3.
b : goog.math.Coordinate3
A Coordinate3.
Returns: number  The distance between a and b.
code »
goog.math.Coordinate3.equals(ab) boolean
Compares coordinates for equality.
Arguments:
a : goog.math.Coordinate3
A Coordinate3.
b : goog.math.Coordinate3
A Coordinate3.
Returns: boolean  True iff the coordinates are equal, or if both are null.
code »
goog.math.Coordinate3.fromArray(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.
Arguments:
a : Array.<number>
Array of numbers to become a coordinate.
Returns: !goog.math.Coordinate3  A new coordinate from the array values.
code »
goog.math.Coordinate3.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.Coordinate3
A Coordinate3.
b : goog.math.Coordinate3
A Coordinate3.
Returns: number  The squared distance between a and b.
code »

Package math

Package Reference