/** * @license * Copyright (c) 2013, Brandon Jones, Colin MacKenzie IV. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ import { Mat2dArray, Mat3Array, Mat4Array, QuatArray, Vec2Array } from './common'; export type { Mat3Array }; /** * @class 3x3 Matrix * @name mat3 */ /** * Creates a new identity mat3 * * @returns a new 3x3 matrix */ export declare function create(): Mat3Array; /** * Copies the upper-left 3x3 values into the given mat3. * * @param out the receiving 3x3 matrix * @param {mat4} a the source 4x4 matrix * @returns out */ export declare function fromMat4(out: Mat3Array, a: Mat4Array): Mat3Array; /** * Creates a new mat3 initialized with values from an existing matrix * * @param a matrix to clone * @returns a new 3x3 matrix */ export declare function clone(a: Mat3Array): Mat3Array; /** * Copy the values from one mat3 to another * * @param out the receiving matrix * @param a the source matrix * @returns out */ export declare function copy(out: Mat3Array, a: Mat3Array): Mat3Array; /** * Set a mat3 to the identity matrix * * @param out the receiving matrix * @returns out */ export declare function identity(out: Mat3Array): Mat3Array; /** * Transpose the values of a mat3 * * @param out the receiving matrix * @param a the source matrix * @returns out */ export declare function transpose(out: Mat3Array, a: Mat3Array): Mat3Array; /** * Inverts a mat3 * * @param out the receiving matrix * @param a the source matrix * @returns out */ export declare function invert(out: Mat3Array, a: Mat3Array): Mat3Array | null; /** * Calculates the adjugate of a mat3 * * @param out the receiving matrix * @param a the source matrix * @returns out */ export declare function adjoint(out: Mat3Array, a: Mat3Array): Mat3Array; /** * Calculates the determinant of a mat3 * * @param a the source matrix * @returns determinant of a */ export declare function determinant(a: Mat3Array): number; /** * Multiplies two mat3's * * @param out the receiving matrix * @param a the first operand * @param b the second operand * @returns out */ export declare function multiply(out: Mat3Array, a: Mat3Array, b: Mat3Array): Mat3Array; /** * Alias for {@link mat3.multiply} * @function */ export declare const mul: typeof multiply; /** * Translate a mat3 by the given vector * * @param out the receiving matrix * @param a the matrix to translate * @param v vector to translate by * @returns out */ export declare function translate(out: Mat3Array, a: Mat3Array, v: Vec2Array): Mat3Array; /** * Rotates a mat3 by the given angle * * @param out the receiving matrix * @param a the matrix to rotate * @param rad the angle to rotate the matrix by * @returns out */ export declare function rotate(out: Mat3Array, a: Mat3Array, rad: number): Mat3Array; /** * Scales the mat3 by the dimensions in the given vec2 * * @param out the receiving matrix * @param a the matrix to rotate * @param v the vec2 to scale the matrix by * @returns out **/ export declare function scale(out: Mat3Array, a: Mat3Array, v: Vec2Array): Mat3Array; /** * Copies the values from a mat2d into a mat3 * * @param out the receiving matrix * @param a the matrix to copy * @returns out **/ export declare function fromMat2d(out: Mat3Array, a: Mat2dArray): Mat3Array; /** * Calculates a 3x3 matrix from the given quaternion * * @param out mat3 receiving operation result * @param q Quaternion to create matrix from * * @returns out */ export declare function fromQuat(out: Mat3Array, q: QuatArray): Mat3Array; /** * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix * * @param out mat3 receiving operation result * @param {mat4} a Mat4 to derive the normal matrix from * * @returns out */ export declare function normalFromMat4(out: Mat3Array, a: Mat4Array): Mat3Array | null; /** * Returns Frobenius norm of a mat3 * * @param a the matrix to calculate Frobenius norm of * @returns Frobenius norm */ export declare function frob(a: Mat3Array): number;