vec.vec2f

Classes


Public Protected Private

Global Functions

goog.vec.vec2f.abs(vec0resultVec) !goog.vec.vec2f.Type
Takes the absolute value of each component of vec0 storing the result in resultVec.
Arguments:
vec0 : goog.vec.vec2f.Type
The source vector.
resultVec : goog.vec.vec2f.Type
The vector to receive the result. May be vec0.
Returns: !goog.vec.vec2f.Type  Return resultVec so that operations can be chained together.
code »
goog.vec.vec2f.add(vec0vec1resultVec) !goog.vec.vec2f.Type
Performs a component-wise addition of vec0 and vec1 together storing the result into resultVec.
Arguments:
vec0 : goog.vec.vec2f.Type
The first addend.
vec1 : goog.vec.vec2f.Type
The second addend.
resultVec : goog.vec.vec2f.Type
The vector to receive the result. May be vec0 or vec1.
Returns: !goog.vec.vec2f.Type  Return resultVec so that operations can be chained together.
code »
goog.vec.vec2f.componentDivide(vec0vec1resultVec) !goog.vec.vec2f.Type
Divides each component of vec0 with the matching element of vec0 storing the divisor into resultVec.
Arguments:
vec0 : !goog.vec.vec2f.Type
The first vector.
vec1 : !goog.vec.vec2f.Type
The second vector.
resultVec : !goog.vec.vec2f.Type
The vector to receive the result. May be vec0.
Returns: !goog.vec.vec2f.Type  Return resultVec so that operations can be chained together.
code »
goog.vec.vec2f.componentMultiply(vec0vec1resultVec) !goog.vec.vec2f.Type
Multiplies each component of vec0 with the matching element of vec0 storing the products into resultVec.
Arguments:
vec0 : !goog.vec.vec2f.Type
The first vector.
vec1 : !goog.vec.vec2f.Type
The second vector.
resultVec : !goog.vec.vec2f.Type
The vector to receive the result. May be vec0.
Returns: !goog.vec.vec2f.Type  Return resultVec so that operations can be chained together.
code »
goog.vec.vec2f.create() !goog.vec.vec2f.Type
Creates a vec2f with all elements initialized to zero.
Returns: !goog.vec.vec2f.Type  The new vec2f.
code »
goog.vec.vec2f.direction(vec0vec1resultVec) !goog.vec.vec2f.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.vec2f.Type
Origin point.
vec1 : goog.vec.vec2f.Type
Target point.
resultVec : goog.vec.vec2f.Type
The vector to receive the results (may be vec0 or vec1).
Returns: !goog.vec.vec2f.Type  Return resultVec so that operations can be chained together.
code »
goog.vec.vec2f.distance(vec0vec1) number
Returns the distance between two points.
Arguments:
vec0 : goog.vec.vec2f.Type
First point.
vec1 : goog.vec.vec2f.Type
Second point.
Returns: number  The distance between the points.
code »
goog.vec.vec2f.distanceSquared(vec0vec1) number
Returns the squared distance between two points.
Arguments:
vec0 : goog.vec.vec2f.Type
First point.
vec1 : goog.vec.vec2f.Type
Second point.
Returns: number  The squared distance between the points.
code »
goog.vec.vec2f.dot(vec0vec1) number
Returns the scalar product of vectors vec0 and vec1.
Arguments:
vec0 : goog.vec.vec2f.Type
The first vector.
vec1 : goog.vec.vec2f.Type
The second vector.
Returns: number  The scalar product.
code »
goog.vec.vec2f.equals(vec0vec1) boolean
Returns true if the components of vec0 are equal to the components of vec1.
Arguments:
vec0 : goog.vec.vec2f.Type
The first vector.
vec1 : goog.vec.vec2f.Type
The second vector.
Returns: boolean  True if the vectors are equal, false otherwise.
code »
goog.vec.vec2f.lerp(vec0vec1fresultVec) !goog.vec.vec2f.Type
Linearly interpolate from vec0 to vec1 according to f. The value of f should be in the range [0..1] otherwise the results are undefined.
Arguments:
vec0 : goog.vec.vec2f.Type
The first vector.
vec1 : goog.vec.vec2f.Type
The second vector.
f : number
The interpolation factor.
resultVec : goog.vec.vec2f.Type
The vector to receive the results (may be vec0 or vec1).
Returns: !goog.vec.vec2f.Type  Return resultVec so that operations can be chained together.
code »
goog.vec.vec2f.magnitude(vec0) number
Returns the magnitude of the given vector.
Arguments:
vec0 : goog.vec.vec2f.Type
The vector.
Returns: number  The magnitude of the vector.
code »
goog.vec.vec2f.magnitudeSquared(vec0) number
Returns the magnitudeSquared of the given vector.
Arguments:
vec0 : goog.vec.vec2f.Type
The vector.
Returns: number  The magnitude of the vector.
code »
goog.vec.vec2f.max(vec0limitresultVec) !goog.vec.vec2f.Type
Compares the components of vec0 with the components of another vector or scalar, storing the larger values in resultVec.
Arguments:
vec0 : goog.vec.vec2f.Type
The source vector.
limit : goog.vec.vec2f.Type | number
The limit vector or scalar.
resultVec : goog.vec.vec2f.Type
The vector to receive the results (may be vec0 or limit).
Returns: !goog.vec.vec2f.Type  Return resultVec so that operations can be chained together.
code »
goog.vec.vec2f.min(vec0limitresultVec) !goog.vec.vec2f.Type
Compares the components of vec0 with the components of another vector or scalar, storing the smaller values in resultVec.
Arguments:
vec0 : goog.vec.vec2f.Type
The source vector.
limit : goog.vec.vec2f.Type | number
The limit vector or scalar.
resultVec : goog.vec.vec2f.Type
The vector to receive the results (may be vec0 or limit).
Returns: !goog.vec.vec2f.Type  Return resultVec so that operations can be chained together.
code »
goog.vec.vec2f.negate(vec0resultVec) !goog.vec.vec2f.Type
Negates vec0, storing the result into resultVec.
Arguments:
vec0 : goog.vec.vec2f.Type
The vector to negate.
resultVec : goog.vec.vec2f.Type
The vector to receive the result. May be vec0.
Returns: !goog.vec.vec2f.Type  Return resultVec so that operations can be chained together.
code »
goog.vec.vec2f.normalize(vec0resultVec) !goog.vec.vec2f.Type
Normalizes the given vector storing the result into resultVec.
Arguments:
vec0 : goog.vec.vec2f.Type
The vector to normalize.
resultVec : goog.vec.vec2f.Type
The vector to receive the result. May be vec0.
Returns: !goog.vec.vec2f.Type  Return resultVec so that operations can be chained together.
code »
goog.vec.vec2f.scale(vec0scalarresultVec) !goog.vec.vec2f.Type
Multiplies each component of vec0 with scalar storing the product into resultVec.
Arguments:
vec0 : goog.vec.vec2f.Type
The source vector.
scalar : number
The value to multiply with each component of vec0.
resultVec : goog.vec.vec2f.Type
The vector to receive the result. May be vec0.
Returns: !goog.vec.vec2f.Type  Return resultVec so that operations can be chained together.
code »
goog.vec.vec2f.setFromArray(vecsrc) !goog.vec.vec2f.Type
Initializes vec2f vec from Array src.
Arguments:
vec : goog.vec.vec2f.Type
The destination vector.
src : Array.<number>
The source vector.
Returns: !goog.vec.vec2f.Type  Return vec so that operations can be chained together.
code »
goog.vec.vec2f.setFromValues(vecv0v1) !goog.vec.vec2f.Type
Initializes the vector with the given values.
Arguments:
vec : goog.vec.vec2f.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.
Returns: !goog.vec.vec2f.Type  Return vec so that operations can be chained together.
code »
goog.vec.vec2f.setFromVec2d(vecsrc) !goog.vec.vec2f.Type
Initializes vec2f vec from vec2d src (typed as a Float64Array to avoid circular goog.requires).
Arguments:
vec : goog.vec.vec2f.Type
The destination vector.
src : Float64Array
The source vector.
Returns: !goog.vec.vec2f.Type  Return vec so that operations can be chained together.
code »
goog.vec.vec2f.setFromVec2f(vecsrc) !goog.vec.vec2f.Type
Initializes vec2f vec from vec2f src.
Arguments:
vec : goog.vec.vec2f.Type
The destination vector.
src : goog.vec.vec2f.Type
The source vector.
Returns: !goog.vec.vec2f.Type  Return vec so that operations can be chained together.
code »
goog.vec.vec2f.subtract(vec0vec1resultVec) !goog.vec.vec2f.Type
Performs a component-wise subtraction of vec1 from vec0 storing the result into resultVec.
Arguments:
vec0 : goog.vec.vec2f.Type
The minuend.
vec1 : goog.vec.vec2f.Type
The subtrahend.
resultVec : goog.vec.vec2f.Type
The vector to receive the result. May be vec0 or vec1.
Returns: !goog.vec.vec2f.Type  Return resultVec so that operations can be chained together.
code »

Global Properties

goog.vec.vec2f.Type :
No description.
Code »

Package vec

Package Reference