goog.math.Coordinate |
goog.math.Vec2 | goog.math.Coordinate |
opt_x
: number=
Left, defaults to 0.
|
opt_y
: number=
Top, defaults to 0.
|
Rounds the x and y fields to the next larger integer values.
Returns: !goog.math.Coordinate
This coordinate with ceil'd fields.
|
code » | |||
Returns a new copy of the coordinate.
Returns: !goog.math.Coordinate
A clone of this coordinate.
|
code » | |||
Rounds the x and y fields to the next smaller integer values.
Returns: !goog.math.Coordinate
This coordinate with floored fields.
|
code » | |||
![]()
Rotates this coordinate clockwise about the origin (or, optionally, the given
center) by the given angle, in degrees.
Arguments:
|
code » | |||
![]()
Rotates this coordinate clockwise about the origin (or, optionally, the given
center) by the given angle, in radians.
Arguments:
|
code » | |||
Rounds the x and y fields to the nearest integer values.
Returns: !goog.math.Coordinate
This coordinate with rounded fields.
|
code » | |||
Scales this coordinate by the given scale factors. The x and y values are
scaled by
sx and opt_sy respectively. If opt_sy
is not given, then sx is used for both x and y.
Arguments:
Returns: !goog.math.Coordinate
This coordinate after scaling.
|
code » | |||
Returns a nice string representing the coordinate.
Returns: string
In the form (50, 73).
|
code » | |||
Translates this box by the given offsets. If a
goog.math.Coordinate
is given, then the x and y values are translated by the coordinate's x and y.
Otherwise, x and y are translated by tx and opt_ty
respectively.
Arguments:
Returns: !goog.math.Coordinate
This coordinate after translating.
|
code » |
Returns the angle from the origin to a coordinate.
Arguments:
Returns: number
The angle, in degrees, clockwise from the positive X
axis to
a .
|
code » | |||
Returns the difference between two coordinates as a new
goog.math.Coordinate.
Arguments:
|
code » | |||
Returns the distance between two coordinates.
Arguments:
|
code » | |||
Compares coordinates for equality.
Arguments:
Returns: boolean
True iff the coordinates are equal, or if both are null.
|
code » | |||
Returns the magnitude of a coordinate.
Arguments:
Returns: number
The distance between the origin and
a .
|
code » | |||
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:
|
code » | |||
Returns the sum of two coordinates as a new goog.math.Coordinate.
Arguments:
Returns: !goog.math.Coordinate
A Coordinate representing the sum of the two
coordinates.
|
code » |