goog.math.Coordinate3 | |
goog.math.Vec3 | goog.math.Coordinate3 |
x
: number
The x value for the vector.
|
y
: number
The y value for the vector.
|
z
: number
The z value for the vector.
|
Adds another vector to this vector in-place.
Arguments:
|
code » | ||
Creates a new copy of this Vec3.
Returns: !goog.math.Vec3
A new vector with the same coordinates as this one.
|
code » | ||
Compares this vector with another for equality.
Arguments:
Returns: boolean
True if this vector's x, y and z equal the given vector's
x, y, and z, respectively.
|
code » | ||
Reverses the sign of the vector. Equivalent to scaling the vector by -1.
Returns: !goog.math.Vec3
This vector, inverted.
|
code » | ||
Returns the magnitude of the vector measured from the origin.
Returns: number
The length of the vector.
|
code » | ||
Normalizes the current vector to have a magnitude of 1.
Returns: !goog.math.Vec3
This vector, normalized.
|
code » | ||
Scales the current vector by a constant.
Arguments:
Returns: !goog.math.Vec3
This vector, scaled.
|
code » | ||
Returns the squared magnitude of the vector measured from the origin.
NOTE(brenneman): Leaving out the square root is not a significant
optimization in JavaScript.
Returns: number
The length of the vector, squared.
|
code » | ||
Subtracts another vector from this vector in-place.
Arguments:
|
code » |
Returns a new copy of the coordinate.
Returns: !goog.math.Coordinate3
A clone of this coordinate.
|
code » | |
Returns the contents of this coordinate as a 3 value Array.
|
code » | |
Returns a nice string representing the coordinate.
Returns: string
In the form (50, 73, 31).
|
code » |
Returns the cross-product of two vectors.
Arguments:
Returns: !goog.math.Vec3
The cross-product of the two vectors.
|
code » | ||||
Returns the difference of two vectors as a new Vec3.
Arguments:
Returns: !goog.math.Vec3
The difference vector.
|
code » | ||||
Returns the distance between two vectors.
Arguments:
Returns: number
The distance.
|
code » | ||||
Returns the dot-product of two vectors.
Arguments:
Returns: number
The dot-product of the two vectors.
|
code » | ||||
Compares vectors for equality.
Arguments:
Returns: boolean
True if the vectors have equal x, y, and z coordinates.
|
code » | ||||
Returns a new Vec3 object from a given coordinate.
Arguments:
Returns: !goog.math.Vec3
A new vector object.
|
code » | ||||
Returns a new Vec3 that is the linear interpolant between vectors a and b at
scale-value x.
Arguments:
Returns: !goog.math.Vec3
The interpolated vector.
|
code » | ||||
Generates a random vector inside the unit sphere.
Returns: !goog.math.Vec3
A random vector.
|
code » | ||||
Generates a random unit vector.
http://mathworld.wolfram.com/SpherePointPicking.html
Using (6), (7), and (8) to generate coordinates.
Returns: !goog.math.Vec3
A random unit-length vector.
|
code » | ||||
Returns the squared distance between two vectors.
Arguments:
Returns: number
The squared distance.
|
code » | ||||
Returns the sum of two vectors as a new Vec3.
Arguments:
Returns: !goog.math.Vec3
The sum vector.
|
code » |
![]()
No description.
|
Code » |