goog.vec.mat3d
Functions
addMat( mat0, mat1, resultMat ) → Float64Array
Float64Array
Performs a per-component addition of the matrices mat0 and mat1, storing the result into resultMat.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
create() → Float64Array
Float64Array
Creates a mat3d with all elements initialized to zero.
Parameters | None. | ||
---|---|---|---|
Returns |
|
createIdentity() → Float64Array
Float64Array
equals( mat0, mat1 ) → boolean
boolean
Returns true if the components of mat0 are equal to the components of mat1.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
getColumn( mat, column, vec ) → Float64Array
Float64Array
Retrieves the specified column from the matrix into the given vector array.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
getColumns( mat, vec0, vec1, vec2 ) → void
void
Retrieves the column values from the given matrix into the given vector elements.
Parameters |
|
---|
getElement( mat, row, column ) → number
number
getRow( mat, row, vec ) → Float64Array
Float64Array
Retrieves the row values into the given vector.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
getRows( mat, vec0, vec1, vec2 ) → void
void
Retrieves the rows of the matrix into the supplied vectors.
Parameters |
|
---|
invert( mat0, resultMat ) → boolean
boolean
Computes the inverse of mat0 storing the result into resultMat. If the inverse is defined, this function returns true, false otherwise.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
makeEulerZXZ( mat, theta1, theta2, theta3 ) → Float64Array
Float64Array
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.
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
makeIdentity( mat ) → Float64Array
Float64Array
Makes the given 3x3 matrix the identity matrix.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
makeRotate( mat, angle, ax, ay, az ) → Float64Array
Float64Array
Makes the given 3x3 matrix a rotation matrix with the given rotation angle about the axis defined by the vector (ax, ay, az).
Parameters |
| ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
makeRotateX( mat, angle ) → Float64Array
Float64Array
Makes the given 3x3 matrix a rotation matrix with the given rotation angle about the X axis.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
makeRotateY( mat, angle ) → Float64Array
Float64Array
Makes the given 3x3 matrix a rotation matrix with the given rotation angle about the Y axis.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
makeRotateZ( mat, angle ) → Float64Array
Float64Array
Makes the given 3x3 matrix a rotation matrix with the given rotation angle about the Z axis.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
makeScale( mat, x, y, z ) → Float64Array
Float64Array
Makes the given 3x3 matrix a scale matrix with x, y, and z scale factors.
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
makeTranslate( mat, x, y ) → Float64Array
Float64Array
makeZero( mat ) → Float64Array
Float64Array
Makes the given 3x3 matrix the zero matrix.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
multMat( mat0, mat1, resultMat ) → Float64Array
Float64Array
Multiplies the two matrices mat0 and mat1 using matrix multiplication, storing the result into resultMat.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
multScalar( mat, scalar, resultMat ) → Float64Array
Float64Array
Multiplies matrix mat0 with the given scalar, storing the result into resultMat.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
multVec3( mat, vec, resultVec ) → Float64Array
Float64Array
Transforms the given vector with the given matrix storing the resulting, transformed matrix into resultVec.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
rotate( mat, angle, x, y, z ) → Float64Array
Float64Array
Rotate the given matrix by angle about the x,y,z axis. Equivalent to: goog.vec.mat3d.multMat( mat, goog.vec.mat3d.makeRotate(goog.vec.mat3d.create(), angle, x, y, z), mat);
Parameters |
| ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
rotateX( mat, angle ) → Float64Array
Float64Array
Rotate the given matrix by angle about the x axis. Equivalent to: goog.vec.mat3d.multMat( mat, goog.vec.mat3d.makeRotateX(goog.vec.mat3d.create(), angle), mat);
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
rotateY( mat, angle ) → Float64Array
Float64Array
Rotate the given matrix by angle about the y axis. Equivalent to: goog.vec.mat3d.multMat( mat, goog.vec.mat3d.makeRotateY(goog.vec.mat3d.create(), angle), mat);
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
rotateZ( mat, angle ) → Float64Array
Float64Array
Rotate the given matrix by angle about the z axis. Equivalent to: goog.vec.mat3d.multMat( mat, goog.vec.mat3d.makeRotateZ(goog.vec.mat3d.create(), angle), mat);
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
setColumn( mat, column, vec ) → Float64Array
Float64Array
Sets the specified column with the value from the supplied array.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
setColumnValues( mat, column, v0, v1, v2 ) → Float64Array
Float64Array
Sets the specified column with the supplied values.
Parameters |
| ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
setColumns( mat, vec0, vec1, vec2 ) → Float64Array
Float64Array
Sets the columns of the matrix from the set of vector elements.
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
setDiagonal( mat, vec ) → Float64Array
Float64Array
Sets the diagonal values of the matrix from the given vector.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
setDiagonalValues( mat, v00, v11, v22 ) → Float64Array
Float64Array
setElement( mat, row, column, value ) → Float64Array
Float64Array
Sets the element at the requested row and column.
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
setFromArray( mat, src ) → Float64Array
Float64Array
setFromMat3d( mat, src ) → Float64Array
Float64Array
Initializes mat3d mat from mat3d src.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
setFromMat3f( mat, src ) → Float64Array
Float64Array
Initializes mat3d mat from mat3f src (typed as a Float32Array to avoid circular goog.requires).
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
setFromValues( mat, v00, v10, v20, v01, v11, v21, v02, v12, v22 ) → Float64Array
Float64Array
Initializes the matrix from the set of values. Note the values supplied are in column major order.
Parameters |
| ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
setRow( mat, row, vec ) → Float64Array
Float64Array
Sets the row values from the supplied vector.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
setRowValues( mat, row, v0, v1, v2 ) → Float64Array
Float64Array
Sets the row values from the supplied values.
Parameters |
| ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
setRows( mat, vec0, vec1, vec2 ) → Float64Array
Float64Array
Sets the rows of the matrix from the supplied vectors.
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
subMat( mat0, mat1, resultMat ) → Float64Array
Float64Array
Performs a per-component subtraction of the matrices mat0 and mat1, storing the result into resultMat.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
toEulerZXZ( mat, euler, opt_theta2IsNegative ) → Float64Array
Float64Array
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.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
transpose( mat, resultMat ) → Float64Array
Float64Array
Transposes the given matrix mat storing the result into resultMat.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
Properties
Type → Float64Array
Float64Array
No information.