vec.Mat3

Classes


Public Protected Private

Global Functions

goog.vec.Mat3.addMat(mat0mat1resultMat) goog.vec.Mat3.AnyType
Performs a per-component addition of the matrices mat0 and mat1, storing the result into resultMat.
Arguments:
mat0 : goog.vec.Mat3.AnyType
The first addend.
mat1 : goog.vec.Mat3.AnyType
The second addend.
resultMat : goog.vec.Mat3.AnyType
The matrix to receive the results (may be either mat0 or mat1).
Returns: goog.vec.Mat3.AnyType  return resultMat so that operations can be chained together.
code »
goog.vec.Mat3.clone(matrix) !goog.vec.Mat3.Type
Use cloneFloat32. Creates a clone of a 3x3 matrix of Float32.
Arguments:
matrix : goog.vec.Mat3.Mat3Like
The source 3x3 matrix.
Returns: !goog.vec.Mat3.Type  The new 3x3 element matrix.
code »
goog.vec.Mat3.cloneFloat32(matrix) !goog.vec.Mat3.Float32
Creates a clone of a 3x3 matrix of Float32.
Arguments:
matrix : goog.vec.Mat3.Float32
The source 3x3 matrix.
Returns: !goog.vec.Mat3.Float32  The new 3x3 element matrix.
code »
goog.vec.Mat3.cloneFloat64(matrix) !goog.vec.Mat3.Float64
Creates a clone of a 3x3 matrix of Float64.
Arguments:
matrix : goog.vec.Mat3.Float64
The source 3x3 matrix.
Returns: !goog.vec.Mat3.Float64  The new 3x3 element matrix.
code »
goog.vec.Mat3.create() !goog.vec.Mat3.Type
Use createFloat32. Creates the array representation of a 3x3 matrix of Float32. The returned matrix is cleared to all zeros.
Returns: !goog.vec.Mat3.Type  The new matrix.
code »
goog.vec.Mat3.createFloat32() !goog.vec.Mat3.Float32
Creates the array representation of a 3x3 matrix of Float32. The use of the array directly instead of a class reduces overhead. The returned matrix is cleared to all zeros.
Returns: !goog.vec.Mat3.Float32  The new matrix.
code »
goog.vec.Mat3.createFloat32FromArray(matrix) !goog.vec.Mat3.Float32
Creates a 3x3 matrix of Float32 initialized from the given array.
Arguments:
matrix : goog.vec.Mat3.AnyType
The array containing the matrix values in column major order.
Returns: !goog.vec.Mat3.Float32  The new, nine element array.
code »
goog.vec.Mat3.createFloat32FromValues(v00v10v20v01v11v21v02v12v22) !goog.vec.Mat3.Float32
Creates a 3x3 matrix of Float32 initialized from the given values.
Arguments:
v00 : number
The values at (0, 0).
v10 : number
The values at (1, 0).
v20 : number
The values at (2, 0).
v01 : number
The values at (0, 1).
v11 : number
The values at (1, 1).
v21 : number
The values at (2, 1).
v02 : number
The values at (0, 2).
v12 : number
The values at (1, 2).
v22 : number
The values at (2, 2).
Returns: !goog.vec.Mat3.Float32  The new, nine element array.
code »
goog.vec.Mat3.createFloat32Identity() !goog.vec.Mat3.Float32
Creates a 3x3 identity matrix of Float32.
Returns: !goog.vec.Mat3.Float32  The new 9 element array.
code »
goog.vec.Mat3.createFloat64() !goog.vec.Mat3.Float64
Creates the array representation of a 3x3 matrix of Float64. The returned matrix is cleared to all zeros.
Returns: !goog.vec.Mat3.Float64  The new matrix.
code »
goog.vec.Mat3.createFloat64FromArray(matrix) !goog.vec.Mat3.Float64
Creates a 3x3 matrix of Float64 initialized from the given array.
Arguments:
matrix : goog.vec.Mat3.AnyType
The array containing the matrix values in column major order.
Returns: !goog.vec.Mat3.Float64  The new, nine element array.
code »
goog.vec.Mat3.createFloat64FromValues(v00v10v20v01v11v21v02v12v22) !goog.vec.Mat3.Float64
Creates a 3x3 matrix of Float64 initialized from the given values.
Arguments:
v00 : number
The values at (0, 0).
v10 : number
The values at (1, 0).
v20 : number
The values at (2, 0).
v01 : number
The values at (0, 1).
v11 : number
The values at (1, 1).
v21 : number
The values at (2, 1).
v02 : number
The values at (0, 2).
v12 : number
The values at (1, 2).
v22 : number
The values at (2, 2).
Returns: !goog.vec.Mat3.Float64  The new, nine element array.
code »
goog.vec.Mat3.createFloat64Identity() !goog.vec.Mat3.Float64
Creates a 3x3 identity matrix of Float64.
Returns: !goog.vec.Mat3.Float64  The new 9 element array.
code »
goog.vec.Mat3.createFromArray(matrix) !goog.vec.Mat3.Type
Use createFloat32FromArray. Creates a 3x3 matrix of Float32 initialized from the given array.
Arguments:
matrix : goog.vec.Mat3.Mat3Like
The array containing the matrix values in column major order.
Returns: !goog.vec.Mat3.Type  The new, nine element array.
code »
goog.vec.Mat3.createFromValues(v00v10v20v01v11v21v02v12v22) !goog.vec.Mat3.Type
Use createFloat32FromValues. Creates a 3x3 matrix of Float32 initialized from the given values.
Arguments:
v00 : number
The values at (0, 0).
v10 : number
The values at (1, 0).
v20 : number
The values at (2, 0).
v01 : number
The values at (0, 1).
v11 : number
The values at (1, 1).
v21 : number
The values at (2, 1).
v02 : number
The values at (0, 2).
v12 : number
The values at (1, 2).
v22 : number
The values at (2, 2).
Returns: !goog.vec.Mat3.Type  The new, nine element array.
code »
goog.vec.Mat3.createIdentity() !goog.vec.Mat3.Type
Use createFloat32Identity. Creates the array representation of a 3x3 matrix of Float32. The returned matrix is cleared to all zeros.
Returns: !goog.vec.Mat3.Type  The new 9 element array.
code »
goog.vec.Mat3.createNumber() !goog.vec.Mat3.Number
Creates the array representation of a 3x3 matrix of Number. The returned matrix is cleared to all zeros.
Returns: !goog.vec.Mat3.Number  The new matrix.
code »
goog.vec.Mat3.createNumberIdentity() !goog.vec.Mat3.Number
Creates a 3x3 identity matrix of Number. The returned matrix is cleared to all zeros.
Returns: !goog.vec.Mat3.Number  The new 9 element array.
code »
goog.vec.Mat3.equals(mat0mat1) boolean
Returns true if the components of mat0 are equal to the components of mat1.
Arguments:
mat0 : goog.vec.Mat3.AnyType
The first matrix.
mat1 : goog.vec.Mat3.AnyType
The second matrix.
Returns: boolean  True if the the two matrices are equivalent.
code »
goog.vec.Mat3.getColumn(matcolumnvec) goog.vec.Vec3.AnyType
Retrieves the specified column from the matrix into the given vector array.
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix supplying the values.
column : number
The column to get the values from.
vec : goog.vec.Vec3.AnyType
The vector elements to receive the column.
Returns: goog.vec.Vec3.AnyType  return vec so that operations can be chained together.
code »
goog.vec.Mat3.getColumns(matvec0vec1vec2)
Retrieves the column values from the given matrix into the given vector elements.
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix supplying the columns.
vec0 : goog.vec.Vec3.AnyType
The vector to receive column 0.
vec1 : goog.vec.Vec3.AnyType
The vector to receive column 1.
vec2 : goog.vec.Vec3.AnyType
The vector to receive column 2.
code »
goog.vec.Mat3.getElement(matrowcolumn) number
Retrieves the element at the requested row and column.
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix containing the value to retrieve.
row : number
The row index.
column : number
The column index.
Returns: number  The element value at the requested row, column indices.
code »
goog.vec.Mat3.getRow(matrowvec) goog.vec.Vec3.AnyType
Retrieves the row values into the given vector.
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix supplying the values.
row : number
The index of the row supplying the values.
vec : goog.vec.Vec3.AnyType
The vector to receive the row.
Returns: goog.vec.Vec3.AnyType  return vec so that operations can be chained together.
code »
goog.vec.Mat3.getRows(matvec0vec1vec2)
Retrieves the rows of the matrix into the supplied vectors.
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix to supplying the values.
vec0 : goog.vec.Vec3.AnyType
The vector to receive row 0.
vec1 : goog.vec.Vec3.AnyType
The vector to receive row 1.
vec2 : goog.vec.Vec3.AnyType
The vector to receive row 2.
code »
goog.vec.Mat3.invert(mat0resultMat) boolean
Computes the inverse of mat0 storing the result into resultMat. If the inverse is defined, this function returns true, false otherwise.
Arguments:
mat0 : goog.vec.Mat3.AnyType
The matrix to invert.
resultMat : goog.vec.Mat3.AnyType
The matrix to receive the result (may be mat0).
Returns: boolean  True if the inverse is defined. If false is returned, resultMat is not modified.
code »
goog.vec.Mat3.makeEulerZXZ(mattheta1theta2theta3) goog.vec.Mat3.AnyType
Makes the given 3x3 matrix a rotation matrix given Euler angles using the ZXZ convention. Given the euler angles [theta1, theta2, theta3], the rotation is defined as rotation = rotation_z(theta1) * rotation_x(theta2) * rotation_z(theta3), with theta1 in [0, 2 * pi], theta2 in [0, pi] and theta3 in [0, 2 * pi]. rotation_x(theta) means rotation around the X axis of theta radians.
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix.
theta1 : number
The angle of rotation around the Z axis in radians.
theta2 : number
The angle of rotation around the X axis in radians.
theta3 : number
The angle of rotation around the Z axis in radians.
Returns: goog.vec.Mat3.AnyType  return mat so that operations can be chained.
code »
goog.vec.Mat3.makeIdentity(mat) goog.vec.Mat3.AnyType
Makes the given 3x3 matrix the identity matrix.
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix.
Returns: goog.vec.Mat3.AnyType  return mat so operations can be chained.
code »
goog.vec.Mat3.makeRotate(matangleaxayaz) goog.vec.Mat3.AnyType
Makes the given 3x3 matrix a rotation matrix with the given rotation angle about the axis defined by the vector (ax, ay, az).
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix.
angle : number
The rotation angle in radians.
ax : number
The x component of the rotation axis.
ay : number
The y component of the rotation axis.
az : number
The z component of the rotation axis.
Returns: goog.vec.Mat3.AnyType  return mat so that operations can be chained.
code »
goog.vec.Mat3.makeRotateX(matangle) goog.vec.Mat3.AnyType
Makes the given 3x3 matrix a rotation matrix with the given rotation angle about the X axis.
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix.
angle : number
The rotation angle in radians.
Returns: goog.vec.Mat3.AnyType  return mat so that operations can be chained.
code »
goog.vec.Mat3.makeRotateY(matangle) goog.vec.Mat3.AnyType
Makes the given 3x3 matrix a rotation matrix with the given rotation angle about the Y axis.
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix.
angle : number
The rotation angle in radians.
Returns: goog.vec.Mat3.AnyType  return mat so that operations can be chained.
code »
goog.vec.Mat3.makeRotateZ(matangle) goog.vec.Mat3.AnyType
Makes the given 3x3 matrix a rotation matrix with the given rotation angle about the Z axis.
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix.
angle : number
The rotation angle in radians.
Returns: goog.vec.Mat3.AnyType  return mat so that operations can be chained.
code »
goog.vec.Mat3.makeScale(matxyz) goog.vec.Mat3.AnyType
Makes the given 3x3 matrix a scale matrix with x, y, and z scale factors.
Arguments:
mat : goog.vec.Mat3.AnyType
The 3x3 (9-element) matrix array to receive the new scale matrix.
x : number
The scale along the x axis.
y : number
The scale along the y axis.
z : number
The scale along the z axis.
Returns: goog.vec.Mat3.AnyType  return mat so that operations can be chained.
code »
goog.vec.Mat3.makeTranslate(matxy) goog.vec.Mat3.AnyType
Makes the given 3x3 matrix a translation matrix with x and y translation values.
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix.
x : number
The translation along the x axis.
y : number
The translation along the y axis.
Returns: goog.vec.Mat3.AnyType  return mat so that operations can be chained.
code »
goog.vec.Mat3.makeZero(mat) goog.vec.Mat3.AnyType
Makes the given 3x3 matrix the zero matrix.
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix.
Returns: goog.vec.Mat3.AnyType  return mat so operations can be chained.
code »
goog.vec.Mat3.multMat(mat0mat1resultMat) goog.vec.Mat3.AnyType
Multiplies the two matrices mat0 and mat1 using matrix multiplication, storing the result into resultMat.
Arguments:
mat0 : goog.vec.Mat3.AnyType
The first (left hand) matrix.
mat1 : goog.vec.Mat3.AnyType
The second (right hand) matrix.
resultMat : goog.vec.Mat3.AnyType
The matrix to receive the results (may be either mat0 or mat1).
Returns: goog.vec.Mat3.AnyType  return resultMat so that operations can be chained together.
code »
goog.vec.Mat3.multScalar(matscalarresultMat) goog.vec.Mat3.AnyType
Multiplies matrix mat0 with the given scalar, storing the result into resultMat.
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix.
scalar : number
The scalar value to multiple to each element of mat.
resultMat : goog.vec.Mat3.AnyType
The matrix to receive the results (may be mat).
Returns: goog.vec.Mat3.AnyType  return resultMat so that operations can be chained together.
code »
goog.vec.Mat3.multVec3(matvecresultVec) goog.vec.Vec3.AnyType
Transforms the given vector with the given matrix storing the resulting, transformed matrix into resultVec.
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix supplying the transformation.
vec : goog.vec.Vec3.AnyType
The vector to transform.
resultVec : goog.vec.Vec3.AnyType
The vector to receive the results (may be vec).
Returns: goog.vec.Vec3.AnyType  return resultVec so that operations can be chained together.
code »
goog.vec.Mat3.rotate(matanglexyz) goog.vec.Mat3.AnyType
Rotate the given matrix by angle about the x,y,z axis. Equivalent to: goog.vec.Mat3.multMat( mat, goog.vec.Mat3.makeRotate(goog.vec.Mat3.create(), angle, x, y, z), mat);
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix.
angle : number
The angle in radians.
x : number
The x component of the rotation axis.
y : number
The y component of the rotation axis.
z : number
The z component of the rotation axis.
Returns: goog.vec.Mat3.AnyType  return mat so that operations can be chained.
code »
goog.vec.Mat3.rotateX(matangle) goog.vec.Mat3.AnyType
Rotate the given matrix by angle about the x axis. Equivalent to: goog.vec.Mat3.multMat( mat, goog.vec.Mat3.makeRotateX(goog.vec.Mat3.create(), angle), mat);
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix.
angle : number
The angle in radians.
Returns: goog.vec.Mat3.AnyType  return mat so that operations can be chained.
code »
goog.vec.Mat3.rotateY(matangle) goog.vec.Mat3.AnyType
Rotate the given matrix by angle about the y axis. Equivalent to: goog.vec.Mat3.multMat( mat, goog.vec.Mat3.makeRotateY(goog.vec.Mat3.create(), angle), mat);
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix.
angle : number
The angle in radians.
Returns: goog.vec.Mat3.AnyType  return mat so that operations can be chained.
code »
goog.vec.Mat3.rotateZ(matangle) goog.vec.Mat3.AnyType
Rotate the given matrix by angle about the z axis. Equivalent to: goog.vec.Mat3.multMat( mat, goog.vec.Mat3.makeRotateZ(goog.vec.Mat3.create(), angle), mat);
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix.
angle : number
The angle in radians.
Returns: goog.vec.Mat3.AnyType  return mat so that operations can be chained.
code »
goog.vec.Mat3.setColumn(matcolumnvec) goog.vec.Mat3.AnyType
Sets the specified column with the value from the supplied array.
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix to receive the values.
column : number
The column index to set the values on.
vec : goog.vec.Vec3.AnyType
The vector elements for the column.
Returns: goog.vec.Mat3.AnyType  return mat so that operations can be chained together.
code »
goog.vec.Mat3.setColumnValues(matcolumnv0v1v2) goog.vec.Mat3.AnyType
Sets the specified column with the supplied values.
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix to recieve the values.
column : number
The column index to set the values on.
v0 : number
The value for row 0.
v1 : number
The value for row 1.
v2 : number
The value for row 2.
Returns: goog.vec.Mat3.AnyType  return mat so that operations can be chained together.
code »
goog.vec.Mat3.setColumns(matvec0vec1vec2) goog.vec.Mat3.AnyType
Sets the columns of the matrix from the set of vector elements.
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix to receive the values.
vec0 : goog.vec.Vec3.AnyType
The values for column 0.
vec1 : goog.vec.Vec3.AnyType
The values for column 1.
vec2 : goog.vec.Vec3.AnyType
The values for column 2.
Returns: goog.vec.Mat3.AnyType  return mat so that operations can be chained together.
code »
goog.vec.Mat3.setDiagonal(matvec) goog.vec.Mat3.AnyType
Sets the diagonal values of the matrix from the given vector.
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix to receive the values.
vec : goog.vec.Vec3.AnyType
The vector containing the values.
Returns: goog.vec.Mat3.AnyType  return mat so that operations can be chained together.
code »
goog.vec.Mat3.setDiagonalValues(matv00v11v22) goog.vec.Mat3.AnyType
Sets the diagonal values of the matrix from the given values.
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix to receive the values.
v00 : number
The values for (0, 0).
v11 : number
The values for (1, 1).
v22 : number
The values for (2, 2).
Returns: goog.vec.Mat3.AnyType  return mat so that operations can be chained together.
code »
goog.vec.Mat3.setElement(matrowcolumnvalue) goog.vec.Mat3.AnyType
Sets the element at the requested row and column.
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix containing the value to retrieve.
row : number
The row index.
column : number
The column index.
value : number
The value to set at the requested row, column.
Returns: goog.vec.Mat3.AnyType  return mat so that operations can be chained together.
code »
goog.vec.Mat3.setFromArray(matvalues) goog.vec.Mat3.AnyType
Sets the matrix from the array of values stored in column major order.
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix to receive the values.
values : goog.vec.Mat3.AnyType
The column major ordered array of values to store in the matrix.
Returns: goog.vec.Mat3.AnyType  return mat so that operations can be chained together.
code »
goog.vec.Mat3.setFromRowMajorArray(matvalues) goog.vec.Mat3.AnyType
Sets the matrix from the array of values stored in row major order.
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix to receive the values.
values : goog.vec.Mat3.AnyType
The row major ordered array of values to store in the matrix.
Returns: goog.vec.Mat3.AnyType  return mat so that operations can be chained together.
code »
goog.vec.Mat3.setFromValues(matv00v10v20v01v11v21v02v12v22) goog.vec.Mat3.AnyType
Initializes the matrix from the set of values. Note the values supplied are in column major order.
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix to receive the values.
v00 : number
The values at (0, 0).
v10 : number
The values at (1, 0).
v20 : number
The values at (2, 0).
v01 : number
The values at (0, 1).
v11 : number
The values at (1, 1).
v21 : number
The values at (2, 1).
v02 : number
The values at (0, 2).
v12 : number
The values at (1, 2).
v22 : number
The values at (2, 2).
Returns: goog.vec.Mat3.AnyType  return mat so that operations can be chained together.
code »
goog.vec.Mat3.setRow(matrowvec) goog.vec.Mat3.AnyType
Sets the row values from the supplied vector.
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix to receive the row values.
row : number
The index of the row.
vec : goog.vec.Vec3.AnyType
The vector containing the values.
Returns: goog.vec.Mat3.AnyType  return mat so that operations can be chained together.
code »
goog.vec.Mat3.setRowValues(matrowv0v1v2) goog.vec.Mat3.AnyType
Sets the row values from the supplied values.
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix to receive the values.
row : number
The index of the row to receive the values.
v0 : number
The value for column 0.
v1 : number
The value for column 1.
v2 : number
The value for column 2.
Returns: goog.vec.Mat3.AnyType  return mat so that operations can be chained together.
code »
goog.vec.Mat3.setRows(matvec0vec1vec2) goog.vec.Mat3.AnyType
Sets the rows of the matrix from the supplied vectors.
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix to receive the values.
vec0 : goog.vec.Vec3.AnyType
The values for row 0.
vec1 : goog.vec.Vec3.AnyType
The values for row 1.
vec2 : goog.vec.Vec3.AnyType
The values for row 2.
Returns: goog.vec.Mat3.AnyType  return mat so that operations can be chained together.
code »
goog.vec.Mat3.subMat(mat0mat1resultMat) goog.vec.Mat3.AnyType
Performs a per-component subtraction of the matrices mat0 and mat1, storing the result into resultMat.
Arguments:
mat0 : goog.vec.Mat3.AnyType
The minuend.
mat1 : goog.vec.Mat3.AnyType
The subtrahend.
resultMat : goog.vec.Mat3.AnyType
The matrix to receive the results (may be either mat0 or mat1).
Returns: goog.vec.Mat3.AnyType  return resultMat so that operations can be chained together.
code »
goog.vec.Mat3.toEulerZXZ(mateuleropt_theta2IsNegative) goog.vec.Vec3.AnyType
Decomposes a rotation matrix into Euler angles using the ZXZ convention so that rotation = rotation_z(theta1) * rotation_x(theta2) * rotation_z(theta3), with theta1 in [0, 2 * pi], theta2 in [0, pi] and theta3 in [0, 2 * pi]. rotation_x(theta) means rotation around the X axis of theta radians.
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix.
euler : goog.vec.Vec3.AnyType
The ZXZ Euler angles in radians as [theta1, theta2, theta3].
opt_theta2IsNegative : boolean=
Whether theta2 is in [-pi, 0] instead of the default [0, pi].
Returns: goog.vec.Vec3.AnyType  return euler so that operations can be chained together.
code »
goog.vec.Mat3.transpose(matresultMat) goog.vec.Mat3.AnyType
Transposes the given matrix mat storing the result into resultMat.
Arguments:
mat : goog.vec.Mat3.AnyType
The matrix to transpose.
resultMat : goog.vec.Mat3.AnyType
The matrix to receive the results (may be mat).
Returns: goog.vec.Mat3.AnyType  return resultMat so that operations can be chained together.
code »

Global Properties

goog.vec.Mat3.AnyType :
No description.
Code »
goog.vec.Mat3.Float32 :
No description.
Code »
goog.vec.Mat3.Float64 :
No description.
Code »
goog.vec.Mat3.Mat3Like :
No description.
Code »
goog.vec.Mat3.Number :
No description.
Code »
goog.vec.Mat3.Type :
No description.
Code »

Package vec

Package Reference