/** * @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, Vec2Array } from './common'; export type { Mat2dArray }; /** * @class 2x3 Matrix * @name mat2d * * @description * A mat2d contains six elements defined as: *
 * [a, c, tx,
 *  b, d, ty]
 * 
* This is a short form for the 3x3 matrix: *
 * [a, c, tx,
 *  b, d, ty,
 *  0, 0, 1]
 * 
* The last row is ignored so the array is shorter and operations are faster. */ /** * Creates a new identity mat2d * * @returns a new 2x3 matrix */ export declare function create(): Mat2dArray; /** * Creates a new mat2d initialized with values from an existing matrix * * @param a matrix to clone * @returns a new 2x3 matrix */ export declare function clone(a: Mat2dArray): Mat2dArray; /** * Copy the values from one mat2d to another * * @param out the receiving matrix * @param a the source matrix * @returns out */ export declare function copy(out: Mat2dArray, a: Mat2dArray): Mat2dArray; /** * Set a mat2d to the identity matrix * * @param out the receiving matrix * @returns out */ export declare function identity(out: Mat2dArray): Mat2dArray; /** * Inverts a mat2d * * @param out the receiving matrix * @param a the source matrix * @returns out */ export declare function invert(out: Mat2dArray, a: Mat2dArray): Mat2dArray | null; /** * Calculates the determinant of a mat2d * * @param a the source matrix * @returns determinant of a */ export declare function determinant(a: Mat2dArray): number; /** * Multiplies two mat2d's * * @param out the receiving matrix * @param a the first operand * @param b the second operand * @returns out */ export declare function multiply(out: Mat2dArray, a: Mat2dArray, b: Mat2dArray): Mat2dArray; /** * Alias for {@link export function multiply@function */ export declare const mul: typeof multiply; /** * Rotates a mat2d 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: Mat2dArray, a: Mat2dArray, rad: number): Mat2dArray; /** * Scales the mat2d by the dimensions in the given vec2 * * @param out the receiving matrix * @param a the matrix to translate * @param v the vec2 to scale the matrix by * @returns out **/ export declare function scale(out: Mat2dArray, a: Mat2dArray, v: Vec2Array): Mat2dArray; /** * Translates the mat2d by the dimensions in the given vec2 * * @param out the receiving matrix * @param a the matrix to translate * @param v the vec2 to translate the matrix by * @returns out **/ export declare function translate(out: Mat2dArray, a: Mat2dArray, v: Vec2Array): Mat2dArray; /** * Returns Frobenius norm of a mat2d * * @param a the matrix to calculate Frobenius norm of * @returns Frobenius norm */ export declare function frob(a: Mat2dArray): number;