vec3.js
No description.

File Location

/goog/math/vec3.js

Classes

goog.math.Vec3
Class for a three-dimensional vector object and assorted functions useful for manipulation. Inherits from goog.math.Coordinate3 so that a Vec3 may be passed in to any function that requires a Coordinate.

Public Protected Private

Global Functions

goog.math.Vec3.cross(ab) !goog.math.Vec3
Returns the cross-product of two vectors.
Arguments:
a : goog.math.Vec3
The first vector.
b : goog.math.Vec3
The second vector.
Returns: !goog.math.Vec3  The cross-product of the two vectors.
code »
goog.math.Vec3.difference(ab) !goog.math.Vec3
Returns the difference of two vectors as a new Vec3.
Arguments:
a : goog.math.Vec3
The first vector.
b : goog.math.Vec3
The second vector.
Returns: !goog.math.Vec3  The difference vector.
code »
goog.math.Vec3.distance(ab) number
Returns the distance between two vectors.
Arguments:
a : goog.math.Vec3
The first vector.
b : goog.math.Vec3
The second vector.
Returns: number  The distance.
code »
goog.math.Vec3.dot(ab) number
Returns the dot-product of two vectors.
Arguments:
a : goog.math.Vec3
The first vector.
b : goog.math.Vec3
The second vector.
Returns: number  The dot-product of the two vectors.
code »
goog.math.Vec3.equals(ab) boolean
Compares vectors for equality.
Arguments:
a : goog.math.Vec3
The first vector.
b : goog.math.Vec3
The second vector.
Returns: boolean  True if the vectors have equal x, y, and z coordinates.
code »
goog.math.Vec3.fromCoordinate3(a) !goog.math.Vec3
Returns a new Vec3 object from a given coordinate.
Arguments:
a : goog.math.Coordinate3
The coordinate.
Returns: !goog.math.Vec3  A new vector object.
code »
goog.math.Vec3.lerp(abx) !goog.math.Vec3
Returns a new Vec3 that is the linear interpolant between vectors a and b at scale-value x.
Arguments:
a : goog.math.Vec3
Vector a.
b : goog.math.Vec3
Vector b.
x : number
The proportion between a and b.
Returns: !goog.math.Vec3  The interpolated vector.
code »
goog.math.Vec3.random() !goog.math.Vec3
Generates a random vector inside the unit sphere.
Returns: !goog.math.Vec3  A random vector.
code »
goog.math.Vec3.randomUnit() !goog.math.Vec3
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 »
goog.math.Vec3.squaredDistance(ab) number
Returns the squared distance between two vectors.
Arguments:
a : goog.math.Vec3
The first vector.
b : goog.math.Vec3
The second vector.
Returns: number  The squared distance.
code »
goog.math.Vec3.sum(ab) !goog.math.Vec3
Returns the sum of two vectors as a new Vec3.
Arguments:
a : goog.math.Vec3
The first vector.
b : goog.math.Vec3
The second vector.
Returns: !goog.math.Vec3  The sum vector.
code »

Directory math

File Reference