/** * @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 { Mat2Array, Vec2Array } from './common'; export type { Mat2Array }; /** * Creates a new identity mat2 * * @returns a new 2x2 matrix */ export declare function create(): Mat2Array; /** * Creates a new mat2 initialized with values from an existing matrix * * @param a matrix to clone * @returns a new 2x2 matrix */ export declare function clone(a: Mat2Array): Mat2Array; /** * Copy the values from one mat2 to another * * @param out the receiving matrix * @param a the source matrix * @returns out */ export declare function copy(out: Mat2Array, a: Mat2Array): Mat2Array; /** * Set a mat2 to the identity matrix * * @param out the receiving matrix * @returns out */ export declare function identity(out: Mat2Array): Mat2Array; /** * Transpose the values of a mat2 * * @param out the receiving matrix * @param a the source matrix * @returns out */ export declare function transpose(out: Mat2Array, a: Mat2Array): Mat2Array; /** * Inverts a mat2 * * @param out the receiving matrix * @param a the source matrix * @returns out */ export declare function invert(out: Mat2Array, a: Mat2Array): Mat2Array | null; /** * Calculates the adjugate of a mat2 * * @param out the receiving matrix * @param a the source matrix * @returns out */ export declare function adjoint(out: Mat2Array, a: Mat2Array): Mat2Array; /** * Calculates the determinant of a mat2 * * @param a the source matrix * @returns determinant of a */ export declare function determinant(a: Mat2Array): number; /** * Multiplies two mat2's * * @param out the receiving matrix * @param a the first operand * @param b the second operand * @returns out */ export declare function multiply(out: Mat2Array, a: Mat2Array, b: Mat2Array): Mat2Array; /** * Alias for {@link mat2.multiply} * @function */ export declare const mul: typeof multiply; /** * Rotates a mat2 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: Mat2Array, a: Mat2Array, rad: number): Mat2Array; /** * Scales the mat2 by the dimensions in the given vec2 * * @param out the receiving matrix * @param a the matrix to rotate * @param {vec2} v the vec2 to scale the matrix by * @returns out **/ export declare function scale(out: Mat2Array, a: Mat2Array, v: Vec2Array): Mat2Array; /** * Returns Frobenius norm of a mat2 * * @param a the matrix to calculate Frobenius norm of * @returns Frobenius norm */ export declare function frob(a: Mat2Array): number; /** * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix * @param L the lower triangular matrix * @param D the diagonal matrix * @param U the upper triangular matrix * @param a the input matrix to factorize */ export declare function LDU(L: Mat2Array, D: Mat2Array, U: Mat2Array, a: Mat2Array): Mat2Array[];