vec3d.js
No description.

File Location

/goog/vec/vec3d.js


Public Protected Private

Global Functions

goog.vec.vec3d.abs(vec0resultVec) !goog.vec.vec3d.Type
Takes the absolute value of each component of vec0 storing the result in resultVec.
Arguments:
vec0 : goog.vec.vec3d.Type
The source vector.
resultVec : goog.vec.vec3d.Type
The vector to receive the result. May be vec0.
Returns: !goog.vec.vec3d.Type  Return resultVec so that operations can be chained together.
code »
goog.vec.vec3d.add(vec0vec1resultVec) !goog.vec.vec3d.Type
Performs a component-wise addition of vec0 and vec1 together storing the result into resultVec.
Arguments:
vec0 : goog.vec.vec3d.Type
The first addend.
vec1 : goog.vec.vec3d.Type
The second addend.
resultVec : goog.vec.vec3d.Type
The vector to receive the result. May be vec0 or vec1.
Returns: !goog.vec.vec3d.Type  Return resultVec so that operations can be chained together.
code »
goog.vec.vec3d.create() !goog.vec.vec3d.Type
Creates a vec3d with all elements initialized to zero.
Returns: !goog.vec.vec3d.Type  The new vec3d.
code »
goog.vec.vec3d.cross(v0v1resultVec) !goog.vec.vec3d.Type
Computes the vector (cross) product of v0 and v1 storing the result into resultVec.
Arguments:
v0 : goog.vec.vec3d.Type
The first vector.
v1 : goog.vec.vec3d.Type
The second vector.
resultVec : goog.vec.vec3d.Type
The vector to receive the results. May be either v0 or v1.
Returns: !goog.vec.vec3d.Type  Return resultVec so that operations can be chained together.
code »
goog.vec.vec3d.direction(vec0vec1resultVec) !goog.vec.vec3d.Type
Returns a unit vector pointing from one point to another. If the input points are equal then the result will be all zeros.
Arguments:
vec0 : goog.vec.vec3d.Type
Origin point.
vec1 : goog.vec.vec3d.Type
Target point.
resultVec : goog.vec.vec3d.Type
The vector to receive the results (may be vec0 or vec1).
Returns: !goog.vec.vec3d.Type  Return resultVec so that operations can be chained together.
code »
goog.vec.vec3d.distance(vec0vec1) number
Returns the distance between two points.
Arguments:
vec0 : goog.vec.vec3d.Type
First point.
vec1 : goog.vec.vec3d.Type
Second point.
Returns: number  The distance between the points.
code »
goog.vec.vec3d.distanceSquared(vec0vec1) number
Returns the squared distance between two points.
Arguments:
vec0 : goog.vec.vec3d.Type
First point.
vec1 : goog.vec.vec3d.Type
Second point.
Returns: number  The squared distance between the points.
code »
goog.vec.vec3d.dot(v0v1) number
Returns the scalar product of vectors v0 and v1.
Arguments:
v0 : goog.vec.vec3d.Type
The first vector.
v1 : goog.vec.vec3d.Type
The second vector.
Returns: number  The scalar product.
code »
goog.vec.vec3d.equals(v0v1) boolean
Returns true if the components of v0 are equal to the components of v1.
Arguments:
v0 : goog.vec.vec3d.Type
The first vector.
v1 : goog.vec.vec3d.Type
The second vector.
Returns: boolean  True if the vectors are equal, false otherwise.
code »
goog.vec.vec3d.lerp(v0v1fresultVec) !goog.vec.vec3d.Type
Linearly interpolate from vec0 to v1 according to f. The value of f should be in the range [0..1] otherwise the results are undefined.
Arguments:
v0 : goog.vec.vec3d.Type
The first vector.
v1 : goog.vec.vec3d.Type
The second vector.
f : number
The interpolation factor.
resultVec : goog.vec.vec3d.Type
The vector to receive the results (may be v0 or v1).
Returns: !goog.vec.vec3d.Type  Return resultVec so that operations can be chained together.
code »
goog.vec.vec3d.magnitude(vec0) number
Returns the magnitude of the given vector.
Arguments:
vec0 : goog.vec.vec3d.Type
The vector.
Returns: number  The magnitude of the vector.
code »
goog.vec.vec3d.magnitudeSquared(vec0) number
Returns the magnitudeSquared of the given vector.
Arguments:
vec0 : goog.vec.vec3d.Type
The vector.
Returns: number  The magnitude of the vector.
code »
goog.vec.vec3d.max(vec0limitresultVec) !goog.vec.vec3d.Type
Compares the components of vec0 with the components of another vector or scalar, storing the larger values in resultVec.
Arguments:
vec0 : goog.vec.vec3d.Type
The source vector.
limit : goog.vec.vec3d.Type | number
The limit vector or scalar.
resultVec : goog.vec.vec3d.Type
The vector to receive the results (may be vec0 or limit).
Returns: !goog.vec.vec3d.Type  Return resultVec so that operations can be chained together.
code »
goog.vec.vec3d.min(vec0limitresultVec) !goog.vec.vec3d.Type
Compares the components of vec0 with the components of another vector or scalar, storing the smaller values in resultVec.
Arguments:
vec0 : goog.vec.vec3d.Type
The source vector.
limit : goog.vec.vec3d.Type | number
The limit vector or scalar.
resultVec : goog.vec.vec3d.Type
The vector to receive the results (may be vec0 or limit).
Returns: !goog.vec.vec3d.Type  Return resultVec so that operations can be chained together.
code »
goog.vec.vec3d.negate(vec0resultVec) !goog.vec.vec3d.Type
Negates vec0, storing the result into resultVec.
Arguments:
vec0 : goog.vec.vec3d.Type
The vector to negate.
resultVec : goog.vec.vec3d.Type
The vector to receive the result. May be vec0.
Returns: !goog.vec.vec3d.Type  Return resultVec so that operations can be chained together.
code »
goog.vec.vec3d.normalize(vec0resultVec) !goog.vec.vec3d.Type
Normalizes the given vector storing the result into resultVec.
Arguments:
vec0 : goog.vec.vec3d.Type
The vector to normalize.
resultVec : goog.vec.vec3d.Type
The vector to receive the result. May be vec0.
Returns: !goog.vec.vec3d.Type  Return resultVec so that operations can be chained together.
code »
goog.vec.vec3d.scale(vec0scalarresultVec) !goog.vec.vec3d.Type
Multiplies each component of vec0 with scalar storing the product into resultVec.
Arguments:
vec0 : goog.vec.vec3d.Type
The source vector.
scalar : number
The value to multiply with each component of vec0.
resultVec : goog.vec.vec3d.Type
The vector to receive the result. May be vec0.
Returns: !goog.vec.vec3d.Type  Return resultVec so that operations can be chained together.
code »
goog.vec.vec3d.setFromArray(vecsrc) !goog.vec.vec3d.Type
Initializes vec3d vec from Array src.
Arguments:
vec : goog.vec.vec3d.Type
The destination vector.
src : Array.<number>
The source vector.
Returns: !goog.vec.vec3d.Type  Return vec so that operations can be chained together.
code »
goog.vec.vec3d.setFromValues(vecv0v1v2) !goog.vec.vec3d.Type
Initializes the vector with the given values.
Arguments:
vec : goog.vec.vec3d.Type
The vector to receive the values.
v0 : number
The value for element at index 0.
v1 : number
The value for element at index 1.
v2 : number
The value for element at index 2.
Returns: !goog.vec.vec3d.Type  Return vec so that operations can be chained together.
code »
goog.vec.vec3d.setFromVec3d(vecsrc) !goog.vec.vec3d.Type
Initializes vec3d vec from vec3d src.
Arguments:
vec : goog.vec.vec3d.Type
The destination vector.
src : goog.vec.vec3d.Type
The source vector.
Returns: !goog.vec.vec3d.Type  Return vec so that operations can be chained together.
code »
goog.vec.vec3d.setFromVec3f(vecsrc) !goog.vec.vec3d.Type
Initializes vec3d vec from vec3f src (typed as a Float32Array to avoid circular goog.requires).
Arguments:
vec : goog.vec.vec3d.Type
The destination vector.
src : Float32Array
The source vector.
Returns: !goog.vec.vec3d.Type  Return vec so that operations can be chained together.
code »
goog.vec.vec3d.subtract(vec0vec1resultVec) !goog.vec.vec3d.Type
Performs a component-wise subtraction of vec1 from vec0 storing the result into resultVec.
Arguments:
vec0 : goog.vec.vec3d.Type
The minuend.
vec1 : goog.vec.vec3d.Type
The subtrahend.
resultVec : goog.vec.vec3d.Type
The vector to receive the result. May be vec0 or vec1.
Returns: !goog.vec.vec3d.Type  Return resultVec so that operations can be chained together.
code »

Directory vec

File Reference