diff --git a/dist/3.x/mat3-impl.d.ts b/dist/3.x/mat3-impl.d.ts index b3d28b7..1f7eeee 100644 --- a/dist/3.x/mat3-impl.d.ts +++ b/dist/3.x/mat3-impl.d.ts @@ -30,8 +30,18 @@ export declare function getAPI(Ctor: Mat3Ctor< translate: (m: BaseArgType, v: BaseArgType, dst?: T_17 | undefined) => T_17; rotation: (angleInRadians: number, dst?: T_18 | undefined) => T_18; rotate: (m: BaseArgType, angleInRadians: number, dst?: T_19 | undefined) => T_19; - scaling: (v: BaseArgType, dst?: T_20 | undefined) => T_20; - scale: (m: BaseArgType, v: BaseArgType, dst?: T_21 | undefined) => T_21; - uniformScaling: (s: number, dst?: T_22 | undefined) => T_22; - uniformScale: (m: BaseArgType, s: number, dst?: T_23 | undefined) => T_23; + rotationX: (angleInRadians: number, dst?: T_20 | undefined) => T_20; + rotateX: (m: BaseArgType, angleInRadians: number, dst?: T_21 | undefined) => T_21; + rotationY: (angleInRadians: number, dst?: T_22 | undefined) => T_22; + rotateY: (m: BaseArgType, angleInRadians: number, dst?: T_23 | undefined) => T_23; + rotationZ: (angleInRadians: number, dst?: T_18 | undefined) => T_18; + rotateZ: (m: BaseArgType, angleInRadians: number, dst?: T_19 | undefined) => T_19; + scaling: (v: BaseArgType, dst?: T_24 | undefined) => T_24; + scale: (m: BaseArgType, v: BaseArgType, dst?: T_25 | undefined) => T_25; + uniformScaling: (s: number, dst?: T_26 | undefined) => T_26; + uniformScale: (m: BaseArgType, s: number, dst?: T_27 | undefined) => T_27; + scaling3D: (v: BaseArgType, dst?: T_28 | undefined) => T_28; + scale3D: (m: BaseArgType, v: BaseArgType, dst?: T_29 | undefined) => T_29; + uniformScaling3D: (s: number, dst?: T_30 | undefined) => T_30; + uniformScale3D: (m: BaseArgType, s: number, dst?: T_31 | undefined) => T_31; }; diff --git a/dist/3.x/wgpu-matrix.d.ts b/dist/3.x/wgpu-matrix.d.ts index 5e6bafe..4f2b74d 100644 --- a/dist/3.x/wgpu-matrix.d.ts +++ b/dist/3.x/wgpu-matrix.d.ts @@ -62,10 +62,20 @@ mat3: { translate: (m: BaseArgType, v: BaseArgType, dst?: T_16 | undefined) => T_16; rotation: (angleInRadians: number, dst?: T_17 | undefined) => T_17; rotate: (m: BaseArgType, angleInRadians: number, dst?: T_18 | undefined) => T_18; - scaling: (v: BaseArgType, dst?: T_19 | undefined) => T_19; - scale: (m: BaseArgType, v: BaseArgType, dst?: T_20 | undefined) => T_20; - uniformScaling: (s: number, dst?: T_21 | undefined) => T_21; - uniformScale: (m: BaseArgType, s: number, dst?: T_22 | undefined) => T_22; + rotationX: (angleInRadians: number, dst?: T_19 | undefined) => T_19; + rotateX: (m: BaseArgType, angleInRadians: number, dst?: T_20 | undefined) => T_20; + rotationY: (angleInRadians: number, dst?: T_21 | undefined) => T_21; + rotateY: (m: BaseArgType, angleInRadians: number, dst?: T_22 | undefined) => T_22; + rotationZ: (angleInRadians: number, dst?: T_17 | undefined) => T_17; + rotateZ: (m: BaseArgType, angleInRadians: number, dst?: T_18 | undefined) => T_18; + scaling: (v: BaseArgType, dst?: T_23 | undefined) => T_23; + scale: (m: BaseArgType, v: BaseArgType, dst?: T_24 | undefined) => T_24; + uniformScaling: (s: number, dst?: T_25 | undefined) => T_25; + uniformScale: (m: BaseArgType, s: number, dst?: T_26 | undefined) => T_26; + scaling3D: (v: BaseArgType, dst?: T_27 | undefined) => T_27; + scale3D: (m: BaseArgType, v: BaseArgType, dst?: T_28 | undefined) => T_28; + uniformScaling3D: (s: number, dst?: T_29 | undefined) => T_29; + uniformScale3D: (m: BaseArgType, s: number, dst?: T_30 | undefined) => T_30; }, /** * 4x4 Matrix functions that default to returning `Float32Array` @@ -357,10 +367,20 @@ export declare const mat3d: { translate: (m: BaseArgType, v: BaseArgType, dst?: T_16 | undefined) => T_16; rotation: (angleInRadians: number, dst?: T_17 | undefined) => T_17; rotate: (m: BaseArgType, angleInRadians: number, dst?: T_18 | undefined) => T_18; - scaling: (v: BaseArgType, dst?: T_19 | undefined) => T_19; - scale: (m: BaseArgType, v: BaseArgType, dst?: T_20 | undefined) => T_20; - uniformScaling: (s: number, dst?: T_21 | undefined) => T_21; - uniformScale: (m: BaseArgType, s: number, dst?: T_22 | undefined) => T_22; + rotationX: (angleInRadians: number, dst?: T_19 | undefined) => T_19; + rotateX: (m: BaseArgType, angleInRadians: number, dst?: T_20 | undefined) => T_20; + rotationY: (angleInRadians: number, dst?: T_21 | undefined) => T_21; + rotateY: (m: BaseArgType, angleInRadians: number, dst?: T_22 | undefined) => T_22; + rotationZ: (angleInRadians: number, dst?: T_17 | undefined) => T_17; + rotateZ: (m: BaseArgType, angleInRadians: number, dst?: T_18 | undefined) => T_18; + scaling: (v: BaseArgType, dst?: T_23 | undefined) => T_23; + scale: (m: BaseArgType, v: BaseArgType, dst?: T_24 | undefined) => T_24; + uniformScaling: (s: number, dst?: T_25 | undefined) => T_25; + uniformScale: (m: BaseArgType, s: number, dst?: T_26 | undefined) => T_26; + scaling3D: (v: BaseArgType, dst?: T_27 | undefined) => T_27; + scale3D: (m: BaseArgType, v: BaseArgType, dst?: T_28 | undefined) => T_28; + uniformScaling3D: (s: number, dst?: T_29 | undefined) => T_29; + uniformScale3D: (m: BaseArgType, s: number, dst?: T_30 | undefined) => T_30; }, mat4d: { create: (v0?: number | undefined, v1?: number | undefined, v2?: number | undefined, v3?: number | undefined, v4?: number | undefined, v5?: number | undefined, v6?: number | undefined, v7?: number | undefined, v8?: number | undefined, v9?: number | undefined, v10?: number | undefined, v11?: number | undefined, v12?: number | undefined, v13?: number | undefined, v14?: number | undefined, v15?: number | undefined) => Float64Array; set: (v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number, dst?: T | undefined) => T; @@ -627,10 +647,20 @@ export declare const mat3n: { translate: (m: BaseArgType, v: BaseArgType, dst?: T_16 | undefined) => T_16; rotation: (angleInRadians: number, dst?: T_17 | undefined) => T_17; rotate: (m: BaseArgType, angleInRadians: number, dst?: T_18 | undefined) => T_18; - scaling: (v: BaseArgType, dst?: T_19 | undefined) => T_19; - scale: (m: BaseArgType, v: BaseArgType, dst?: T_20 | undefined) => T_20; - uniformScaling: (s: number, dst?: T_21 | undefined) => T_21; - uniformScale: (m: BaseArgType, s: number, dst?: T_22 | undefined) => T_22; + rotationX: (angleInRadians: number, dst?: T_19 | undefined) => T_19; + rotateX: (m: BaseArgType, angleInRadians: number, dst?: T_20 | undefined) => T_20; + rotationY: (angleInRadians: number, dst?: T_21 | undefined) => T_21; + rotateY: (m: BaseArgType, angleInRadians: number, dst?: T_22 | undefined) => T_22; + rotationZ: (angleInRadians: number, dst?: T_17 | undefined) => T_17; + rotateZ: (m: BaseArgType, angleInRadians: number, dst?: T_18 | undefined) => T_18; + scaling: (v: BaseArgType, dst?: T_23 | undefined) => T_23; + scale: (m: BaseArgType, v: BaseArgType, dst?: T_24 | undefined) => T_24; + uniformScaling: (s: number, dst?: T_25 | undefined) => T_25; + uniformScale: (m: BaseArgType, s: number, dst?: T_26 | undefined) => T_26; + scaling3D: (v: BaseArgType, dst?: T_27 | undefined) => T_27; + scale3D: (m: BaseArgType, v: BaseArgType, dst?: T_28 | undefined) => T_28; + uniformScaling3D: (s: number, dst?: T_29 | undefined) => T_29; + uniformScale3D: (m: BaseArgType, s: number, dst?: T_30 | undefined) => T_30; }, mat4n: { create: (v0?: number | undefined, v1?: number | undefined, v2?: number | undefined, v3?: number | undefined, v4?: number | undefined, v5?: number | undefined, v6?: number | undefined, v7?: number | undefined, v8?: number | undefined, v9?: number | undefined, v10?: number | undefined, v11?: number | undefined, v12?: number | undefined, v13?: number | undefined, v14?: number | undefined, v15?: number | undefined) => number[]; set: (v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number, dst?: T | undefined) => T; diff --git a/dist/3.x/wgpu-matrix.js b/dist/3.x/wgpu-matrix.js index b05791c..6d847f3 100644 --- a/dist/3.x/wgpu-matrix.js +++ b/dist/3.x/wgpu-matrix.js @@ -1,4 +1,4 @@ -/* wgpu-matrix@3.1.0, license MIT */ +/* wgpu-matrix@3.2.0, license MIT */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : @@ -2319,9 +2319,129 @@ } return newDst; } + /** + * Creates a 3-by-3 matrix which rotates around the x-axis by the given angle. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotation matrix. + */ + function rotationX(angleInRadians, dst) { + const newDst = (dst ?? new Ctor(12)); + const c = Math.cos(angleInRadians); + const s = Math.sin(angleInRadians); + newDst[0] = 1; + newDst[1] = 0; + newDst[2] = 0; + newDst[4] = 0; + newDst[5] = c; + newDst[6] = s; + newDst[8] = 0; + newDst[9] = -s; + newDst[10] = c; + return newDst; + } + /** + * Rotates the given 3-by-3 matrix around the x-axis by the given + * angle. + * @param m - The matrix. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotated matrix. + */ + function rotateX(m, angleInRadians, dst) { + const newDst = (dst ?? new Ctor(12)); + const m10 = m[4]; + const m11 = m[5]; + const m12 = m[6]; + const m20 = m[8]; + const m21 = m[9]; + const m22 = m[10]; + const c = Math.cos(angleInRadians); + const s = Math.sin(angleInRadians); + newDst[4] = c * m10 + s * m20; + newDst[5] = c * m11 + s * m21; + newDst[6] = c * m12 + s * m22; + newDst[8] = c * m20 - s * m10; + newDst[9] = c * m21 - s * m11; + newDst[10] = c * m22 - s * m12; + if (m !== newDst) { + newDst[0] = m[0]; + newDst[1] = m[1]; + newDst[2] = m[2]; + } + return newDst; + } + /** + * Creates a 3-by-3 matrix which rotates around the y-axis by the given angle. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotation matrix. + */ + function rotationY(angleInRadians, dst) { + const newDst = (dst ?? new Ctor(12)); + const c = Math.cos(angleInRadians); + const s = Math.sin(angleInRadians); + newDst[0] = c; + newDst[1] = 0; + newDst[2] = -s; + newDst[4] = 0; + newDst[5] = 1; + newDst[6] = 0; + newDst[8] = s; + newDst[9] = 0; + newDst[10] = c; + return newDst; + } + /** + * Rotates the given 3-by-3 matrix around the y-axis by the given + * angle. + * @param m - The matrix. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotated matrix. + */ + function rotateY(m, angleInRadians, dst) { + const newDst = (dst ?? new Ctor(12)); + const m00 = m[0 * 4 + 0]; + const m01 = m[0 * 4 + 1]; + const m02 = m[0 * 4 + 2]; + const m20 = m[2 * 4 + 0]; + const m21 = m[2 * 4 + 1]; + const m22 = m[2 * 4 + 2]; + const c = Math.cos(angleInRadians); + const s = Math.sin(angleInRadians); + newDst[0] = c * m00 - s * m20; + newDst[1] = c * m01 - s * m21; + newDst[2] = c * m02 - s * m22; + newDst[8] = c * m20 + s * m00; + newDst[9] = c * m21 + s * m01; + newDst[10] = c * m22 + s * m02; + if (m !== newDst) { + newDst[4] = m[4]; + newDst[5] = m[5]; + newDst[6] = m[6]; + } + return newDst; + } + /** + * Creates a 3-by-3 matrix which rotates around the z-axis by the given angle. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotation matrix. + */ + const rotationZ = rotation; + /** + * Rotates the given 3-by-3 matrix around the z-axis by the given + * angle. + * @param m - The matrix. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotated matrix. + */ + const rotateZ = rotate; /** * Creates a 3-by-3 matrix which scales in each dimension by an amount given by - * the corresponding entry in the given vector; assumes the vector has three + * the corresponding entry in the given vector; assumes the vector has two * entries. * @param v - A vector of * 2 entries specifying the factor by which to scale in each dimension. @@ -2344,7 +2464,7 @@ /** * Scales the given 3-by-3 matrix in each dimension by an amount * given by the corresponding entry in the given vector; assumes the vector has - * three entries. + * two entries. * @param m - The matrix to be modified. * @param v - A vector of 2 entries specifying the * factor by which to scale in each dimension. @@ -2369,7 +2489,55 @@ return newDst; } /** - * Creates a 3-by-3 matrix which scales uniformly in each dimension + * Creates a 3-by-3 matrix which scales in each dimension by an amount given by + * the corresponding entry in the given vector; assumes the vector has three + * entries. + * @param v - A vector of + * 3 entries specifying the factor by which to scale in each dimension. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The scaling matrix. + */ + function scaling3D(v, dst) { + const newDst = (dst ?? new Ctor(12)); + newDst[0] = v[0]; + newDst[1] = 0; + newDst[2] = 0; + newDst[4] = 0; + newDst[5] = v[1]; + newDst[6] = 0; + newDst[8] = 0; + newDst[9] = 0; + newDst[10] = v[2]; + return newDst; + } + /** + * Scales the given 3-by-3 matrix in each dimension by an amount + * given by the corresponding entry in the given vector; assumes the vector has + * three entries. + * @param m - The matrix to be modified. + * @param v - A vector of 3 entries specifying the + * factor by which to scale in each dimension. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The scaled matrix. + */ + function scale3D(m, v, dst) { + const newDst = (dst ?? new Ctor(12)); + const v0 = v[0]; + const v1 = v[1]; + const v2 = v[2]; + newDst[0] = v0 * m[0 * 4 + 0]; + newDst[1] = v0 * m[0 * 4 + 1]; + newDst[2] = v0 * m[0 * 4 + 2]; + newDst[4] = v1 * m[1 * 4 + 0]; + newDst[5] = v1 * m[1 * 4 + 1]; + newDst[6] = v1 * m[1 * 4 + 2]; + newDst[8] = v2 * m[2 * 4 + 0]; + newDst[9] = v2 * m[2 * 4 + 1]; + newDst[10] = v2 * m[2 * 4 + 2]; + return newDst; + } + /** + * Creates a 3-by-3 matrix which scales uniformly in the X and Y dimensions * @param s - Amount to scale * @param dst - matrix to hold result. If not passed a new one is created. * @returns The scaling matrix. @@ -2388,7 +2556,7 @@ return newDst; } /** - * Scales the given 3-by-3 matrix in each dimension by an amount + * Scales the given 3-by-3 matrix in the X and Y dimension by an amount * given. * @param m - The matrix to be modified. * @param s - Amount to scale. @@ -2410,6 +2578,46 @@ } return newDst; } + /** + * Creates a 3-by-3 matrix which scales uniformly in each dimension + * @param s - Amount to scale + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The scaling matrix. + */ + function uniformScaling3D(s, dst) { + const newDst = (dst ?? new Ctor(12)); + newDst[0] = s; + newDst[1] = 0; + newDst[2] = 0; + newDst[4] = 0; + newDst[5] = s; + newDst[6] = 0; + newDst[8] = 0; + newDst[9] = 0; + newDst[10] = s; + return newDst; + } + /** + * Scales the given 3-by-3 matrix in each dimension by an amount + * given. + * @param m - The matrix to be modified. + * @param s - Amount to scale. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The scaled matrix. + */ + function uniformScale3D(m, s, dst) { + const newDst = (dst ?? new Ctor(12)); + newDst[0] = s * m[0 * 4 + 0]; + newDst[1] = s * m[0 * 4 + 1]; + newDst[2] = s * m[0 * 4 + 2]; + newDst[4] = s * m[1 * 4 + 0]; + newDst[5] = s * m[1 * 4 + 1]; + newDst[6] = s * m[1 * 4 + 2]; + newDst[8] = s * m[2 * 4 + 0]; + newDst[9] = s * m[2 * 4 + 1]; + newDst[10] = s * m[2 * 4 + 2]; + return newDst; + } return { clone, create, @@ -2437,10 +2645,20 @@ translate, rotation, rotate, + rotationX, + rotateX, + rotationY, + rotateY, + rotationZ, + rotateZ, scaling, scale, uniformScaling, uniformScale, + scaling3D, + scale3D, + uniformScaling3D, + uniformScale3D, }; } const cache$3 = new Map(); diff --git a/dist/3.x/wgpu-matrix.js.map b/dist/3.x/wgpu-matrix.js.map index 8d5f7ce..f80671b 100644 --- a/dist/3.x/wgpu-matrix.js.map +++ b/dist/3.x/wgpu-matrix.js.map @@ -1 +1 @@ -{"version":3,"file":"wgpu-matrix.js","sources":["../../../src/types.ts","../../../src/utils.ts","../../../src/vec2-impl.ts","../../../src/vec3-impl.ts","../../../src/mat3-impl.ts","../../../src/mat4-impl.ts","../../../src/quat-impl.ts","../../../src/vec4-impl.ts","../../../src/wgpu-matrix.ts"],"sourcesContent":["/**\n * The types you can pass to most functions that take an\n * array of numbers.\n */\nexport type BaseArgType = Float32Array | Float64Array | number[];\n\nfunction wrapConstructor any>(\n OriginalConstructor: T,\n modifier: (instance: InstanceType) => void\n): T {\n return class extends OriginalConstructor {\n constructor(...args: any[]) {\n super(...args);\n modifier(this as InstanceType);\n }\n } as T; // Type assertion is necessary here\n}\n\nexport const ZeroArray = wrapConstructor(Array, a => a.fill(0));\n\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nexport let EPSILON = 0.000001;\n\n/**\n * Set the value for EPSILON for various checks\n * @param v - Value to use for EPSILON.\n * @returns previous value of EPSILON;\n */\nexport function setEpsilon(v: number): number {\n const old = EPSILON;\n EPSILON = v;\n return old;\n}\n\n/**\n * Convert degrees to radians\n * @param degrees - Angle in degrees\n * @returns angle converted to radians\n */\nexport function degToRad(degrees: number): number {\n return degrees * Math.PI / 180;\n}\n\n/**\n * Convert radians to degrees\n * @param radians - Angle in radians\n * @returns angle converted to degrees\n */\nexport function radToDeg(radians: number): number {\n return radians * 180 / Math.PI;\n}\n\n/**\n * Lerps between a and b via t\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @returns a + (b - a) * t\n */\nexport function lerp(a: number, b: number, t: number): number {\n return a + (b - a) * t;\n}\n\n/**\n * Compute the opposite of lerp. Given a and b and a value between\n * a and b returns a value between 0 and 1. 0 if a, 1 if b.\n * Note: no clamping is done.\n * @param a - start value\n * @param b - end value\n * @param v - value between a and b\n * @returns (v - a) / (b - a)\n */\nexport function inverseLerp(a: number, b: number, v: number): number {\n const d = b - a;\n return (Math.abs(b - a) < EPSILON)\n ? a\n : (v - a) / d;\n}\n\n/**\n * Compute the euclidean modulo\n *\n * ```\n * // table for n / 3\n * -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 <- n\n * ------------------------------------\n * -2 -1 -0 -2 -1 0, 1, 2, 0, 1, 2 <- n % 3\n * 1 2 0 1 2 0, 1, 2, 0, 1, 2 <- euclideanModule(n, 3)\n * ```\n *\n * @param n - dividend\n * @param m - divisor\n * @returns the euclidean modulo of n / m\n */\nexport function euclideanModulo(n: number, m: number) {\n return ((n % m) + m) % m;\n}","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Mat3Arg } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { Vec2Arg, Vec2Type } from './vec2';\nimport { Vec3Arg } from './vec3';\nimport { BaseArgType } from './types';\n\nexport { Vec2Arg, Vec2Type };\n\ntype Vec2Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec3\n */\nfunction getAPIImpl(Ctor: Vec2Ctor) {\n\n/**\n * Creates a Vec2; may be called with x, y, z to set initial values.\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Vec2's specified type\n * it would be faster to use\n *\n * ```\n * const v = vec2.clone(someJSArray);\n * ```\n *\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\nfunction create(x = 0, y = 0) {\n const newDst = new Ctor(2);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n }\n }\n return newDst;\n}\n\n/**\n * Creates a Vec2; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec2\n * Also see {@link vec2.create} and {@link vec2.copy}\n *\n * @param x first value\n * @param y second value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec2Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec2Arg, b: Vec2Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n\n return newDst;\n}\n\n/**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\nfunction angle(a: Vec2Arg, b: Vec2Arg): number {\n const ax = a[0];\n const ay = a[1];\n const bx = b[0];\n const by = b[1];\n const mag1 = Math.sqrt(ax * ax + ay * ay);\n const mag2 = Math.sqrt(bx * bx + by * by);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec2Arg, b: Vec2Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec2Arg, b: Vec2Arg): boolean {\n return a[0] === b[0] && a[1] === b[1];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec2Arg, b: Vec2Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec2Arg, b: Vec2Arg, t: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec2Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec2Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\nfunction cross(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const z = a[0] * b[1] - a[1] * b[0];\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = z;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec2Arg, b: Vec2Arg): number {\n return a[0] * b[0] + a[1] * b[1];\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec2Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n return Math.sqrt(v0 * v0 + v1 * v1);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec2Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n return v0 * v0 + v1 * v1;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec2Arg, b: Vec2Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return Math.sqrt(dx * dx + dy * dy);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec2Arg, b: Vec2Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return dx * dx + dy * dy;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const len = Math.sqrt(v0 * v0 + v1 * v1);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n }\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec2.clone})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec2.copy})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Creates a random unit vector * scale\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\nfunction random(scale = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const angle = Math.random() * 2 * Math.PI;\n newDst[0] = Math.cos(angle) * scale;\n newDst[1] = Math.sin(angle) * scale;\n\n return newDst;\n}\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform Vec2 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec2Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const x = v[0];\n const y = v[1];\n\n newDst[0] = x * m[0] + y * m[4] + m[12];\n newDst[1] = x * m[1] + y * m[5] + m[13];\n\n return newDst;\n}\n\n/**\n * Transforms vec4 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat3(v: Vec2Arg, m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const x = v[0];\n const y = v[1];\n\n newDst[0] = m[0] * x + m[4] * y + m[8];\n newDst[1] = m[1] * x + m[5] * y + m[9];\n\n return newDst;\n}\n\n/**\n * Rotate a 2D vector\n *\n * @param a The vec2 point to rotate\n * @param b The origin of the rotation\n * @param rad The angle of rotation in radians\n * @returns the rotated vector\n */\nfunction rotate(a: Vec2Arg, b: Vec2Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n // Translate point to the origin\n const p0 = a[0] - b[0];\n const p1 = a[1] - b[1];\n const sinC = Math.sin(rad);\n const cosC = Math.cos(rad);\n\n //perform rotation and translate to correct position\n newDst[0] = p0 * cosC - p1 * sinC + b[0];\n newDst[1] = p0 * sinC + p1 * cosC + b[1];\n\n return newDst;\n}\n\n/**\n * Treat a 2D vector as a direction and set it's length\n *\n * @param a The vec2 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec2Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec2 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec2Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat3,\n rotate,\n setLength,\n truncate,\n midpoint,\n};\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Vec2Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Vec3Arg, Vec3Type } from './vec3';\nimport { Mat3Arg } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { QuatArg } from './quat';\nimport { BaseArgType } from './types';\n\nexport { Vec3Arg, Vec3Type };\n\ntype Vec3Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec3\n * */\nfunction getAPIImpl(Ctor: Vec3Ctor) {\n\n/**\n * Creates a vec3; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number) {\n const newDst = new Ctor(3);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a vec3; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec3\n * Also see {@link vec3.create} and {@link vec3.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec3Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec3Arg, b: Vec3Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n\n return newDst;\n}\n\n/**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\nfunction angle(a: Vec3Arg, b: Vec3Arg): number {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const mag1 = Math.sqrt(ax * ax + ay * ay + az * az);\n const mag2 = Math.sqrt(bx * bx + by * by + bz * bz);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec3Arg, b: Vec3Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec3Arg, b: Vec3Arg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec3Arg, b: Vec3Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec3Arg, b: Vec3Arg, t: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec3Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec3Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\nfunction cross(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const t1 = a[2] * b[0] - a[0] * b[2];\n const t2 = a[0] * b[1] - a[1] * b[0];\n newDst[0] = a[1] * b[2] - a[2] * b[1];\n newDst[1] = t1;\n newDst[2] = t2;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec3Arg, b: Vec3Arg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]);\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec3Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec3Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return v0 * v0 + v1 * v1 + v2 * v2;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec3Arg, b: Vec3Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return Math.sqrt(dx * dx + dy * dy + dz * dz);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec3Arg, b: Vec3Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return dx * dx + dy * dy + dz * dz;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec3.clone})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec3.copy})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Creates a random vector\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\nfunction random(scale = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const angle = Math.random() * 2 * Math.PI;\n const z = Math.random() * 2 - 1;\n const zScale = Math.sqrt(1 - z * z) * scale;\n newDst[0] = Math.cos(angle) * zScale;\n newDst[1] = Math.sin(angle) * zScale;\n newDst[2] = z * scale;\n\n return newDst;\n}\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform vec3 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec3Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1;\n\n newDst[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n newDst[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n newDst[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n\n return newDst;\n}\n\n/**\n * Transform vec3 by upper 3x3 matrix inside 4x4 matrix.\n * @param v - The direction.\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns The transformed vector.\n */\nfunction transformMat4Upper3x3(v: Vec3Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[0] = v0 * m[0 * 4 + 0] + v1 * m[1 * 4 + 0] + v2 * m[2 * 4 + 0];\n newDst[1] = v0 * m[0 * 4 + 1] + v1 * m[1 * 4 + 1] + v2 * m[2 * 4 + 1];\n newDst[2] = v0 * m[0 * 4 + 2] + v1 * m[1 * 4 + 2] + v2 * m[2 * 4 + 2];\n\n return newDst;\n}\n\n/**\n * Transforms vec3 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat3(v: Vec3Arg, m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n\n newDst[0] = x * m[0] + y * m[4] + z * m[8];\n newDst[1] = x * m[1] + y * m[5] + z * m[9];\n newDst[2] = x * m[2] + y * m[6] + z * m[10];\n\n return newDst;\n}\n\n/**\n * Transforms vec3 by Quaternion\n * @param v - the vector to transform\n * @param q - the quaternion to transform by\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed\n */\nfunction transformQuat(v: Vec3Arg, q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n\n const uvX = qy * z - qz * y;\n const uvY = qz * x - qx * z;\n const uvZ = qx * y - qy * x;\n\n newDst[0] = x + uvX * w2 + (qy * uvZ - qz * uvY) * 2;\n newDst[1] = y + uvY * w2 + (qz * uvX - qx * uvZ) * 2;\n newDst[2] = z + uvZ * w2 + (qx * uvY - qy * uvX) * 2;\n\n return newDst;\n}\n\n/**\n * Returns the translation component of a 4-by-4 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\nfunction getTranslation(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n}\n/**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat4Arg, axis: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n}\n/**\n * Returns the scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the x-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\nfunction rotateX(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n //Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n //perform rotation\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad);\n\n //translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the y-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\nfunction rotateY(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n // perform rotation\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad);\n\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the z-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns {vec3} out\n */\nfunction rotateZ(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n // perform rotation\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2];\n\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Treat a 3D vector as a direction and set it's length\n *\n * @param a The vec3 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec3Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec3 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec3Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat4Upper3x3,\n transformMat3,\n transformQuat,\n getTranslation,\n getAxis,\n getScaling,\n rotateX,\n rotateY,\n rotateZ,\n setLength,\n truncate,\n midpoint,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Vec3Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nimport * as utils from './utils.js';\nimport { QuatArg } from './quat';\nimport { Mat3Arg, Mat3Type } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { Vec2Arg } from './vec2';\nimport { Vec3Arg } from './vec3';\nimport { getAPI as getVec2API } from './vec2-impl';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\n\nexport { Mat3Arg, Mat3Type };\n\ntype Mat3Ctor = new (n: number) => T;\n\n/**\n * Generates a typed API for Mat3\n * */\nfunction getAPIImpl(Ctor: Mat3Ctor) {\n const vec2 = getVec2API(Ctor);\n const vec3 = getVec3API(Ctor);\n\n/**\n * Create a Mat3 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat3's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat3.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @returns matrix created from values.\n */\nfunction create(\n v0?: number, v1?: number, v2?: number,\n v3?: number, v4?: number, v5?: number,\n v6?: number, v7?: number, v8?: number) {\n const newDst = new Ctor(12);\n // to make the array homogenous\n newDst[3] = 0;\n newDst[7] = 0;\n newDst[11] = 0;\n\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[4] = v3;\n if (v4 !== undefined) {\n newDst[5] = v4;\n if (v5 !== undefined) {\n newDst[6] = v5;\n if (v6 !== undefined) {\n newDst[8] = v6;\n if (v7 !== undefined) {\n newDst[9] = v7;\n if (v8 !== undefined) {\n newDst[10] = v8;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n\n return newDst;\n}\n\n/**\n * Sets the values of a Mat3\n * Also see {@link mat3.create} and {@link mat3.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 set from values.\n */\nfunction set(\n v0: number, v1: number, v2: number,\n v3: number, v4: number, v5: number,\n v6: number, v7: number, v8: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[0] = v0; newDst[1] = v1; newDst[ 2] = v2; newDst[ 3] = 0;\n newDst[4] = v3; newDst[5] = v4; newDst[ 6] = v5; newDst[ 7] = 0;\n newDst[8] = v6; newDst[9] = v7; newDst[10] = v8; newDst[11] = 0;\n\n return newDst;\n}\n\n/**\n * Creates a Mat3 from the upper left 3x3 part of a Mat4\n * @param m4 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from m4\n */\nfunction fromMat4(m4: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n newDst[0] = m4[0]; newDst[1] = m4[1]; newDst[ 2] = m4[ 2]; newDst[ 3] = 0;\n newDst[4] = m4[4]; newDst[5] = m4[5]; newDst[ 6] = m4[ 6]; newDst[ 7] = 0;\n newDst[8] = m4[8]; newDst[9] = m4[9]; newDst[10] = m4[10]; newDst[11] = 0;\n return newDst;\n}\n\n/**\n * Creates a Mat3 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from q\n */\nfunction fromQuat(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3];\n const x2 = x + x; const y2 = y + y; const z2 = z + z;\n\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n newDst[ 0] = 1 - yy - zz; newDst[ 1] = yx + wz; newDst[ 2] = zx - wy; newDst[ 3] = 0;\n newDst[ 4] = yx - wz; newDst[ 5] = 1 - xx - zz; newDst[ 6] = zy + wx; newDst[ 7] = 0;\n newDst[ 8] = zx + wy; newDst[ 9] = zy - wx; newDst[10] = 1 - xx - yy; newDst[11] = 0;\n\n return newDst;\n}\n\n/**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\nfunction negate(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = -m[ 0]; newDst[ 1] = -m[ 1]; newDst[ 2] = -m[ 2];\n newDst[ 4] = -m[ 4]; newDst[ 5] = -m[ 5]; newDst[ 6] = -m[ 6];\n newDst[ 8] = -m[ 8]; newDst[ 9] = -m[ 9]; newDst[10] = -m[10];\n\n return newDst;\n}\n\n/**\n * Copies a matrix. (same as {@link mat3.clone})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nfunction copy(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = m[ 0]; newDst[ 1] = m[ 1]; newDst[ 2] = m[ 2];\n newDst[ 4] = m[ 4]; newDst[ 5] = m[ 5]; newDst[ 6] = m[ 6];\n newDst[ 8] = m[ 8]; newDst[ 9] = m[ 9]; newDst[10] = m[10];\n\n return newDst;\n}\n\n/**\n * Copies a matrix (same as {@link mat3.copy})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nconst clone = copy;\n\n/**\n * Check if 2 matrices are approximately equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are approximately equal\n */\nfunction equalsApproximately(a: Mat3Arg, b: Mat3Arg): boolean {\n return Math.abs(a[ 0] - b[ 0]) < utils.EPSILON &&\n Math.abs(a[ 1] - b[ 1]) < utils.EPSILON &&\n Math.abs(a[ 2] - b[ 2]) < utils.EPSILON &&\n Math.abs(a[ 4] - b[ 4]) < utils.EPSILON &&\n Math.abs(a[ 5] - b[ 5]) < utils.EPSILON &&\n Math.abs(a[ 6] - b[ 6]) < utils.EPSILON &&\n Math.abs(a[ 8] - b[ 8]) < utils.EPSILON &&\n Math.abs(a[ 9] - b[ 9]) < utils.EPSILON &&\n Math.abs(a[10] - b[10]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 matrices are exactly equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are exactly equal\n */\nfunction equals(a: Mat3Arg, b: Mat3Arg): boolean {\n return a[ 0] === b[ 0] &&\n a[ 1] === b[ 1] &&\n a[ 2] === b[ 2] &&\n a[ 4] === b[ 4] &&\n a[ 5] === b[ 5] &&\n a[ 6] === b[ 6] &&\n a[ 8] === b[ 8] &&\n a[ 9] === b[ 9] &&\n a[10] === b[10];\n}\n\n/**\n * Creates a 3-by-3 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 3-by-3 identity matrix.\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\nfunction transpose(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n if (newDst === m) {\n let t: number;\n\n // 0 1 2\n // 4 5 6\n // 8 9 10\n\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n\n return newDst;\n }\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n newDst[ 0] = m00; newDst[ 1] = m10; newDst[ 2] = m20;\n newDst[ 4] = m01; newDst[ 5] = m11; newDst[ 6] = m21;\n newDst[ 8] = m02; newDst[ 9] = m12; newDst[10] = m22;\n\n return newDst;\n}\n\n/**\n * Computes the inverse of a 3-by-3 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nfunction inverse(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n const b01 = m22 * m11 - m12 * m21;\n const b11 = -m22 * m10 + m12 * m20;\n const b21 = m21 * m10 - m11 * m20;\n\n const invDet = 1 / (m00 * b01 + m01 * b11 + m02 * b21);\n\n newDst[ 0] = b01 * invDet;\n newDst[ 1] = (-m22 * m01 + m02 * m21) * invDet;\n newDst[ 2] = ( m12 * m01 - m02 * m11) * invDet;\n newDst[ 4] = b11 * invDet;\n newDst[ 5] = ( m22 * m00 - m02 * m20) * invDet;\n newDst[ 6] = (-m12 * m00 + m02 * m10) * invDet;\n newDst[ 8] = b21 * invDet;\n newDst[ 9] = (-m21 * m00 + m01 * m20) * invDet;\n newDst[10] = ( m11 * m00 - m01 * m10) * invDet;\n\n return newDst;\n}\n\n/**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\nfunction determinant(m: Mat3Arg): number {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n return m00 * (m11 * m22 - m21 * m12) -\n m10 * (m01 * m22 - m21 * m02) +\n m20 * (m01 * m12 - m11 * m02);\n}\n\n/**\n * Computes the inverse of a 3-by-3 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nconst invert = inverse;\n\n/**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nfunction multiply(a: Mat3Arg, b: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[ 4 + 0];\n const a11 = a[ 4 + 1];\n const a12 = a[ 4 + 2];\n const a20 = a[ 8 + 0];\n const a21 = a[ 8 + 1];\n const a22 = a[ 8 + 2];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b10 = b[ 4 + 0];\n const b11 = b[ 4 + 1];\n const b12 = b[ 4 + 2];\n const b20 = b[ 8 + 0];\n const b21 = b[ 8 + 1];\n const b22 = b[ 8 + 2];\n\n newDst[ 0] = a00 * b00 + a10 * b01 + a20 * b02;\n newDst[ 1] = a01 * b00 + a11 * b01 + a21 * b02;\n newDst[ 2] = a02 * b00 + a12 * b01 + a22 * b02;\n newDst[ 4] = a00 * b10 + a10 * b11 + a20 * b12;\n newDst[ 5] = a01 * b10 + a11 * b11 + a21 * b12;\n newDst[ 6] = a02 * b10 + a12 * b11 + a22 * b12;\n newDst[ 8] = a00 * b20 + a10 * b21 + a20 * b22;\n newDst[ 9] = a01 * b20 + a11 * b21 + a21 * b22;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22;\n\n return newDst;\n}\n\n/**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nconst mul = multiply;\n\n/**\n * Sets the translation component of a 3-by-3 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\nfunction setTranslation(a: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? identity()) as T;\n if (a !== newDst) {\n newDst[ 0] = a[ 0];\n newDst[ 1] = a[ 1];\n newDst[ 2] = a[ 2];\n newDst[ 4] = a[ 4];\n newDst[ 5] = a[ 5];\n newDst[ 6] = a[ 6];\n }\n newDst[ 8] = v[0];\n newDst[ 9] = v[1];\n newDst[10] = 1;\n return newDst;\n}\n\n/**\n * Returns the translation component of a 3-by-3 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\nfunction getTranslation(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec2.create()) as T;\n newDst[0] = m[8];\n newDst[1] = m[9];\n return newDst;\n}\n\n/**\n * Returns an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y,\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat3Arg, axis: number, dst?: T) {\n const newDst = (dst ?? vec2.create()) as T;\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n return newDst;\n}\n\n/**\n * Sets an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\nfunction setAxis(m: Mat3Arg, v: Vec2Arg, axis: number, dst?: T) {\n const newDst = (dst === m ? m : copy(m, dst)) as T;\n\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n return newDst;\n}\n\n/**\n * Returns the \"2d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec2.create());\n\n const xx = m[0];\n const xy = m[1];\n const yx = m[4];\n const yy = m[5];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy);\n newDst[1] = Math.sqrt(yx * yx + yy * yy);\n\n return newDst;\n}\n\n\n/**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction get3DScaling(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec3.create());\n\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which translates by the given vector v.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\nfunction translation(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = v[0]; newDst[ 9] = v[1]; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Translates the given 3-by-3 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\nfunction translate(m: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 0] = m00;\n newDst[ 1] = m01;\n newDst[ 2] = m02;\n newDst[ 4] = m10;\n newDst[ 5] = m11;\n newDst[ 6] = m12;\n }\n\n newDst[ 8] = m00 * v0 + m10 * v1 + m20;\n newDst[ 9] = m01 * v0 + m11 * v1 + m21;\n newDst[10] = m02 * v0 + m12 * v1 + m22;\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotation(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = s; newDst[ 2] = 0;\n newDst[ 4] = -s; newDst[ 5] = c; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix by the given angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotate(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 + s * m10;\n newDst[ 1] = c * m01 + s * m11;\n newDst[ 2] = c * m02 + s * m12;\n\n newDst[ 4] = c * m10 - s * m00;\n newDst[ 5] = c * m11 - s * m01;\n newDst[ 6] = c * m12 - s * m02;\n\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * 2 entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of 2 entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale(m: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales uniformly in each dimension\n * @param s - Amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given.\n * @param m - The matrix to be modified.\n * @param s - Amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale(m: Mat3Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\nreturn {\n clone,\n create,\n set,\n fromMat4,\n fromQuat,\n negate,\n copy,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n invert,\n determinant,\n mul,\n multiply,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n get3DScaling,\n translation,\n translate,\n rotation,\n rotate,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Mat3Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","import { Mat4Arg, Mat4Type } from './mat4';\nimport { Mat3Arg } from './mat3';\nimport { QuatArg } from './quat';\nimport { Vec3Arg } from './vec3';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\nimport * as utils from './utils';\n\nexport { Mat4Arg, Mat4Type };\n\ntype Mat4Ctor = new (n: number) => T;\n\n/**\n * Generates a typed API for Mat4\n * */\nfunction getAPIImpl(Ctor: Mat4Ctor) {\n const vec3 = getVec3API(Ctor);\n\n/**\n * 4x4 Matrix math math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new matrix. In other words you can do this\n *\n * const mat = mat4.translation([1, 2, 3]); // Creates a new translation matrix\n *\n * or\n *\n * const mat = mat4.create();\n * mat4.translation([1, 2, 3], mat); // Puts translation matrix in mat.\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always save to pass any matrix as the destination. So for example\n *\n * const mat = mat4.identity();\n * const trans = mat4.translation([1, 2, 3]);\n * mat4.multiply(mat, trans, mat); // Multiplies mat * trans and puts result in mat.\n *\n */\n\n\n/**\n * Create a Mat4 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat4's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat4.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @returns created from values.\n */\nfunction create(\n v0?: number, v1?: number, v2?: number, v3?: number,\n v4?: number, v5?: number, v6?: number, v7?: number,\n v8?: number, v9?: number, v10?: number, v11?: number,\n v12?: number, v13?: number, v14?: number, v15?: number) {\n const newDst = new Ctor(16);\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[3] = v3;\n if (v4 !== undefined) {\n newDst[4] = v4;\n if (v5 !== undefined) {\n newDst[5] = v5;\n if (v6 !== undefined) {\n newDst[6] = v6;\n if (v7 !== undefined) {\n newDst[7] = v7;\n if (v8 !== undefined) {\n newDst[8] = v8;\n if (v9 !== undefined) {\n newDst[9] = v9;\n if (v10 !== undefined) {\n newDst[10] = v10;\n if (v11 !== undefined) {\n newDst[11] = v11;\n if (v12 !== undefined) {\n newDst[12] = v12;\n if (v13 !== undefined) {\n newDst[13] = v13;\n if (v14 !== undefined) {\n newDst[14] = v14;\n if (v15 !== undefined) {\n newDst[15] = v15;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Sets the values of a Mat4\n * Also see {@link mat4.create} and {@link mat4.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 created from values.\n */\nfunction set(\n v0: number, v1: number, v2: number, v3: number,\n v4: number, v5: number, v6: number, v7: number,\n v8: number, v9: number, v10: number, v11: number,\n v12: number, v13: number, v14: number, v15: number,\n dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = v0; newDst[ 1] = v1; newDst[ 2] = v2; newDst[ 3] = v3;\n newDst[ 4] = v4; newDst[ 5] = v5; newDst[ 6] = v6; newDst[ 7] = v7;\n newDst[ 8] = v8; newDst[ 9] = v9; newDst[10] = v10; newDst[11] = v11;\n newDst[12] = v12; newDst[13] = v13; newDst[14] = v14; newDst[15] = v15;\n\n return newDst;\n}\n\n/**\n * Creates a Mat4 from a Mat3\n * @param m3 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from m3\n */\nfunction fromMat3(m3: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = m3[0]; newDst[ 1] = m3[1]; newDst[ 2] = m3[ 2]; newDst[ 3] = 0;\n newDst[ 4] = m3[4]; newDst[ 5] = m3[5]; newDst[ 6] = m3[ 6]; newDst[ 7] = 0;\n newDst[ 8] = m3[8]; newDst[ 9] = m3[9]; newDst[10] = m3[10]; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a Mat4 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from q\n */\nfunction fromQuat(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3];\n const x2 = x + x; const y2 = y + y; const z2 = z + z;\n\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n newDst[ 0] = 1 - yy - zz; newDst[ 1] = yx + wz; newDst[ 2] = zx - wy; newDst[ 3] = 0;\n newDst[ 4] = yx - wz; newDst[ 5] = 1 - xx - zz; newDst[ 6] = zy + wx; newDst[ 7] = 0;\n newDst[ 8] = zx + wy; newDst[ 9] = zy - wx; newDst[10] = 1 - xx - yy; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\nfunction negate(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = -m[ 0]; newDst[ 1] = -m[ 1]; newDst[ 2] = -m[ 2]; newDst[ 3] = -m[ 3];\n newDst[ 4] = -m[ 4]; newDst[ 5] = -m[ 5]; newDst[ 6] = -m[ 6]; newDst[ 7] = -m[ 7];\n newDst[ 8] = -m[ 8]; newDst[ 9] = -m[ 9]; newDst[10] = -m[10]; newDst[11] = -m[11];\n newDst[12] = -m[12]; newDst[13] = -m[13]; newDst[14] = -m[14]; newDst[15] = -m[15];\n\n return newDst;\n}\n\n/**\n * Copies a matrix. (same as {@link mat4.clone})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nfunction copy(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = m[ 0]; newDst[ 1] = m[ 1]; newDst[ 2] = m[ 2]; newDst[ 3] = m[ 3];\n newDst[ 4] = m[ 4]; newDst[ 5] = m[ 5]; newDst[ 6] = m[ 6]; newDst[ 7] = m[ 7];\n newDst[ 8] = m[ 8]; newDst[ 9] = m[ 9]; newDst[10] = m[10]; newDst[11] = m[11];\n newDst[12] = m[12]; newDst[13] = m[13]; newDst[14] = m[14]; newDst[15] = m[15];\n\n return newDst;\n}\n\n/**\n * Copies a matrix (same as {@link mat4.copy})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nconst clone = copy;\n\n/**\n * Check if 2 matrices are approximately equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are approximately equal\n */\nfunction equalsApproximately(a: Mat4Arg, b: Mat4Arg): boolean {\n return Math.abs(a[ 0] - b[ 0]) < utils.EPSILON &&\n Math.abs(a[ 1] - b[ 1]) < utils.EPSILON &&\n Math.abs(a[ 2] - b[ 2]) < utils.EPSILON &&\n Math.abs(a[ 3] - b[ 3]) < utils.EPSILON &&\n Math.abs(a[ 4] - b[ 4]) < utils.EPSILON &&\n Math.abs(a[ 5] - b[ 5]) < utils.EPSILON &&\n Math.abs(a[ 6] - b[ 6]) < utils.EPSILON &&\n Math.abs(a[ 7] - b[ 7]) < utils.EPSILON &&\n Math.abs(a[ 8] - b[ 8]) < utils.EPSILON &&\n Math.abs(a[ 9] - b[ 9]) < utils.EPSILON &&\n Math.abs(a[10] - b[10]) < utils.EPSILON &&\n Math.abs(a[11] - b[11]) < utils.EPSILON &&\n Math.abs(a[12] - b[12]) < utils.EPSILON &&\n Math.abs(a[13] - b[13]) < utils.EPSILON &&\n Math.abs(a[14] - b[14]) < utils.EPSILON &&\n Math.abs(a[15] - b[15]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 matrices are exactly equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are exactly equal\n */\nfunction equals(a: Mat4Arg, b: Mat4Arg): boolean {\n return a[ 0] === b[ 0] &&\n a[ 1] === b[ 1] &&\n a[ 2] === b[ 2] &&\n a[ 3] === b[ 3] &&\n a[ 4] === b[ 4] &&\n a[ 5] === b[ 5] &&\n a[ 6] === b[ 6] &&\n a[ 7] === b[ 7] &&\n a[ 8] === b[ 8] &&\n a[ 9] === b[ 9] &&\n a[10] === b[10] &&\n a[11] === b[11] &&\n a[12] === b[12] &&\n a[13] === b[13] &&\n a[14] === b[14] &&\n a[15] === b[15];\n}\n\n/**\n * Creates a 4-by-4 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 4-by-4 identity matrix.\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\nfunction transpose(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n if (newDst === m) {\n let t;\n\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n\n t = m[3];\n m[3] = m[12];\n m[12] = t;\n\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n\n t = m[7];\n m[7] = m[13];\n m[13] = t;\n\n t = m[11];\n m[11] = m[14];\n m[14] = t;\n return newDst;\n }\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n newDst[ 0] = m00; newDst[ 1] = m10; newDst[ 2] = m20; newDst[ 3] = m30;\n newDst[ 4] = m01; newDst[ 5] = m11; newDst[ 6] = m21; newDst[ 7] = m31;\n newDst[ 8] = m02; newDst[ 9] = m12; newDst[10] = m22; newDst[11] = m32;\n newDst[12] = m03; newDst[13] = m13; newDst[14] = m23; newDst[15] = m33;\n\n return newDst;\n}\n\n/**\n * Computes the inverse of a 4-by-4 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nfunction inverse(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n const tmp12 = m20 * m31;\n const tmp13 = m30 * m21;\n const tmp14 = m10 * m31;\n const tmp15 = m30 * m11;\n const tmp16 = m10 * m21;\n const tmp17 = m20 * m11;\n const tmp18 = m00 * m31;\n const tmp19 = m30 * m01;\n const tmp20 = m00 * m21;\n const tmp21 = m20 * m01;\n const tmp22 = m00 * m11;\n const tmp23 = m10 * m01;\n\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n\n const d = 1 / (m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3);\n\n newDst[ 0] = d * t0;\n newDst[ 1] = d * t1;\n newDst[ 2] = d * t2;\n newDst[ 3] = d * t3;\n newDst[ 4] = d * ((tmp1 * m10 + tmp2 * m20 + tmp5 * m30) -\n (tmp0 * m10 + tmp3 * m20 + tmp4 * m30));\n newDst[ 5] = d * ((tmp0 * m00 + tmp7 * m20 + tmp8 * m30) -\n (tmp1 * m00 + tmp6 * m20 + tmp9 * m30));\n newDst[ 6] = d * ((tmp3 * m00 + tmp6 * m10 + tmp11 * m30) -\n (tmp2 * m00 + tmp7 * m10 + tmp10 * m30));\n newDst[ 7] = d * ((tmp4 * m00 + tmp9 * m10 + tmp10 * m20) -\n (tmp5 * m00 + tmp8 * m10 + tmp11 * m20));\n newDst[ 8] = d * ((tmp12 * m13 + tmp15 * m23 + tmp16 * m33) -\n (tmp13 * m13 + tmp14 * m23 + tmp17 * m33));\n newDst[ 9] = d * ((tmp13 * m03 + tmp18 * m23 + tmp21 * m33) -\n (tmp12 * m03 + tmp19 * m23 + tmp20 * m33));\n newDst[10] = d * ((tmp14 * m03 + tmp19 * m13 + tmp22 * m33) -\n (tmp15 * m03 + tmp18 * m13 + tmp23 * m33));\n newDst[11] = d * ((tmp17 * m03 + tmp20 * m13 + tmp23 * m23) -\n (tmp16 * m03 + tmp21 * m13 + tmp22 * m23));\n newDst[12] = d * ((tmp14 * m22 + tmp17 * m32 + tmp13 * m12) -\n (tmp16 * m32 + tmp12 * m12 + tmp15 * m22));\n newDst[13] = d * ((tmp20 * m32 + tmp12 * m02 + tmp19 * m22) -\n (tmp18 * m22 + tmp21 * m32 + tmp13 * m02));\n newDst[14] = d * ((tmp18 * m12 + tmp23 * m32 + tmp15 * m02) -\n (tmp22 * m32 + tmp14 * m02 + tmp19 * m12));\n newDst[15] = d * ((tmp22 * m22 + tmp16 * m02 + tmp21 * m12) -\n (tmp20 * m12 + tmp23 * m22 + tmp17 * m02));\n\n return newDst;\n}\n\n/**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\nfunction determinant(m: Mat4Arg): number {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n\n return m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3;\n}\n\n/**\n * Computes the inverse of a 4-by-4 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nconst invert = inverse;\n\n/**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nfunction multiply(a: Mat4Arg, b: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[ 4 + 0];\n const a11 = a[ 4 + 1];\n const a12 = a[ 4 + 2];\n const a13 = a[ 4 + 3];\n const a20 = a[ 8 + 0];\n const a21 = a[ 8 + 1];\n const a22 = a[ 8 + 2];\n const a23 = a[ 8 + 3];\n const a30 = a[12 + 0];\n const a31 = a[12 + 1];\n const a32 = a[12 + 2];\n const a33 = a[12 + 3];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b03 = b[3];\n const b10 = b[ 4 + 0];\n const b11 = b[ 4 + 1];\n const b12 = b[ 4 + 2];\n const b13 = b[ 4 + 3];\n const b20 = b[ 8 + 0];\n const b21 = b[ 8 + 1];\n const b22 = b[ 8 + 2];\n const b23 = b[ 8 + 3];\n const b30 = b[12 + 0];\n const b31 = b[12 + 1];\n const b32 = b[12 + 2];\n const b33 = b[12 + 3];\n\n newDst[ 0] = a00 * b00 + a10 * b01 + a20 * b02 + a30 * b03;\n newDst[ 1] = a01 * b00 + a11 * b01 + a21 * b02 + a31 * b03;\n newDst[ 2] = a02 * b00 + a12 * b01 + a22 * b02 + a32 * b03;\n newDst[ 3] = a03 * b00 + a13 * b01 + a23 * b02 + a33 * b03;\n newDst[ 4] = a00 * b10 + a10 * b11 + a20 * b12 + a30 * b13;\n newDst[ 5] = a01 * b10 + a11 * b11 + a21 * b12 + a31 * b13;\n newDst[ 6] = a02 * b10 + a12 * b11 + a22 * b12 + a32 * b13;\n newDst[ 7] = a03 * b10 + a13 * b11 + a23 * b12 + a33 * b13;\n newDst[ 8] = a00 * b20 + a10 * b21 + a20 * b22 + a30 * b23;\n newDst[ 9] = a01 * b20 + a11 * b21 + a21 * b22 + a31 * b23;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22 + a32 * b23;\n newDst[11] = a03 * b20 + a13 * b21 + a23 * b22 + a33 * b23;\n newDst[12] = a00 * b30 + a10 * b31 + a20 * b32 + a30 * b33;\n newDst[13] = a01 * b30 + a11 * b31 + a21 * b32 + a31 * b33;\n newDst[14] = a02 * b30 + a12 * b31 + a22 * b32 + a32 * b33;\n newDst[15] = a03 * b30 + a13 * b31 + a23 * b32 + a33 * b33;\n\n return newDst;\n}\n\n/**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nconst mul = multiply;\n\n/**\n * Sets the translation component of a 4-by-4 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\nfunction setTranslation(a: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? identity()) as T;\n if (a !== newDst) {\n newDst[ 0] = a[ 0];\n newDst[ 1] = a[ 1];\n newDst[ 2] = a[ 2];\n newDst[ 3] = a[ 3];\n newDst[ 4] = a[ 4];\n newDst[ 5] = a[ 5];\n newDst[ 6] = a[ 6];\n newDst[ 7] = a[ 7];\n newDst[ 8] = a[ 8];\n newDst[ 9] = a[ 9];\n newDst[10] = a[10];\n newDst[11] = a[11];\n }\n newDst[12] = v[0];\n newDst[13] = v[1];\n newDst[14] = v[2];\n newDst[15] = 1;\n return newDst;\n}\n\n///**\n// * Returns the translation component of a 4-by-4 matrix as a vector with 3\n// * entries.\n// * @param m - The matrix.\n// * @param dst - vector to hold result. If not passed a new one is created.\n// * @returns The translation component of m.\n// */\nfunction getTranslation(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? vec3.create()) as T;\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n}\n\n/**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat4Arg, axis: number, dst?: T) {\n const newDst = (dst ?? vec3.create());\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n}\n\n/**\n * Sets an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\nfunction setAxis(m: Mat4Arg, v: Vec3Arg, axis: number, dst: T) {\n const newDst = (dst === m) ? dst : copy(m, dst);\n\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n newDst[off + 2] = v[2];\n return newDst;\n}\n\n/**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? vec3.create()) as T;\n\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 0 to 1 in the z dimension.\n *\n * Note: If you pass `Infinity` for zFar then it will produce a projection matrix\n * returns -Infinity for Z when transforming coordinates with Z <= 0 and +Infinity for Z\n * otherwise.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */\nfunction perspective(fieldOfViewYInRadians: number, aspect: number, zNear: number, zFar: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const f = Math.tan(Math.PI * 0.5 - 0.5 * fieldOfViewYInRadians);\n\n newDst[0] = f / aspect;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n newDst[4] = 0;\n newDst[5] = f;\n newDst[6] = 0;\n newDst[7] = 0;\n\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[11] = -1;\n\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (Number.isFinite(zFar)) {\n const rangeInv = 1 / (zNear - zFar);\n newDst[10] = zFar * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n } else {\n newDst[10] = -1;\n newDst[14] = -zNear;\n }\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 1 (at -zNear) to 0 (at -zFar) in the z dimension.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane. (default = Infinity)\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */function perspectiveReverseZ(fieldOfViewYInRadians: number, aspect: number, zNear: number, zFar = Infinity, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const f = 1 / Math.tan(fieldOfViewYInRadians * 0.5);\n\n newDst[ 0] = f / aspect;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n\n newDst[ 4] = 0;\n newDst[ 5] = f;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n\n newDst[ 8] = 0;\n newDst[ 9] = 0;\n newDst[11] = -1;\n\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (zFar === Infinity) {\n newDst[10] = 0;\n newDst[14] = zNear;\n } else {\n const rangeInv = 1 / (zFar - zNear);\n newDst[10] = zNear * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n }\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 orthogonal transformation matrix that transforms from\n * the given the left, right, bottom, and top dimensions to -1 +1 in x, and y\n * and 0 to +1 in z.\n * @param left - Left side of the near clipping plane viewport.\n * @param right - Right side of the near clipping plane viewport.\n * @param bottom - Bottom of the near clipping plane viewport.\n * @param top - Top of the near clipping plane viewport.\n * @param near - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param far - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The orthographic projection matrix.\n */\nfunction ortho(left: number, right: number, bottom: number, top: number, near: number, far: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[0] = 2 / (right - left);\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n newDst[4] = 0;\n newDst[5] = 2 / (top - bottom);\n newDst[6] = 0;\n newDst[7] = 0;\n\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[10] = 1 / (near - far);\n newDst[11] = 0;\n\n newDst[12] = (right + left) / (left - right);\n newDst[13] = (top + bottom) / (bottom - top);\n newDst[14] = near / (near - far);\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 0 to 1 in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\nfunction frustum(left: number, right: number, bottom: number, top: number, near: number, far: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const dx = (right - left);\n const dy = (top - bottom);\n const dz = (near - far);\n\n newDst[ 0] = 2 * near / dx;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n newDst[ 4] = 0;\n newDst[ 5] = 2 * near / dy;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n newDst[ 8] = (left + right) / dx;\n newDst[ 9] = (top + bottom) / dy;\n newDst[10] = far / dz;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = near * far / dz;\n newDst[15] = 0;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 1 (-near) to 0 (-far) in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\nfunction frustumReverseZ(left: number, right: number, bottom: number, top: number, near: number, far = Infinity, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const dx = (right - left);\n const dy = (top - bottom);\n\n newDst[ 0] = 2 * near / dx;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n newDst[ 4] = 0;\n newDst[ 5] = 2 * near / dy;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n newDst[ 8] = (left + right) / dx;\n newDst[ 9] = (top + bottom) / dy;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (far === Infinity) {\n newDst[10] = 0;\n newDst[14] = near;\n } else {\n const rangeInv = 1 / (far - near);\n newDst[10] = near * rangeInv;\n newDst[14] = far * near * rangeInv;\n }\n\n return newDst;\n}\n\nconst xAxis = vec3.create();\nconst yAxis = vec3.create();\nconst zAxis = vec3.create();\n\n/**\n * Computes a 4-by-4 aim transformation.\n *\n * This is a matrix which positions an object aiming down positive Z.\n * toward the target.\n *\n * Note: this is **NOT** the inverse of lookAt as lookAt looks at negative Z.\n *\n * @param position - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\nfunction aim(position: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(target, position, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = xAxis[1]; newDst[ 2] = xAxis[2]; newDst[ 3] = 0;\n newDst[ 4] = yAxis[0]; newDst[ 5] = yAxis[1]; newDst[ 6] = yAxis[2]; newDst[ 7] = 0;\n newDst[ 8] = zAxis[0]; newDst[ 9] = zAxis[1]; newDst[10] = zAxis[2]; newDst[11] = 0;\n newDst[12] = position[0]; newDst[13] = position[1]; newDst[14] = position[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 camera aim transformation.\n *\n * This is a matrix which positions an object aiming down negative Z.\n * toward the target.\n *\n * Note: this is the inverse of `lookAt`\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\nfunction cameraAim(eye: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = xAxis[1]; newDst[ 2] = xAxis[2]; newDst[ 3] = 0;\n newDst[ 4] = yAxis[0]; newDst[ 5] = yAxis[1]; newDst[ 6] = yAxis[2]; newDst[ 7] = 0;\n newDst[ 8] = zAxis[0]; newDst[ 9] = zAxis[1]; newDst[10] = zAxis[2]; newDst[11] = 0;\n newDst[12] = eye[0]; newDst[13] = eye[1]; newDst[14] = eye[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 view transformation.\n *\n * This is a view matrix which transforms all other objects\n * to be in the space of the view defined by the parameters.\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The look-at matrix.\n */\nfunction lookAt(eye: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = yAxis[0]; newDst[ 2] = zAxis[0]; newDst[ 3] = 0;\n newDst[ 4] = xAxis[1]; newDst[ 5] = yAxis[1]; newDst[ 6] = zAxis[1]; newDst[ 7] = 0;\n newDst[ 8] = xAxis[2]; newDst[ 9] = yAxis[2]; newDst[10] = zAxis[2]; newDst[11] = 0;\n\n newDst[12] = -(xAxis[0] * eye[0] + xAxis[1] * eye[1] + xAxis[2] * eye[2]);\n newDst[13] = -(yAxis[0] * eye[0] + yAxis[1] * eye[1] + yAxis[2] * eye[2]);\n newDst[14] = -(zAxis[0] * eye[0] + zAxis[1] * eye[1] + zAxis[2] * eye[2]);\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which translates by the given vector v.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\nfunction translation(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = v[0]; newDst[13] = v[1]; newDst[14] = v[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Translates the given 4-by-4 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\nfunction translate(m: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n if (m !== newDst) {\n newDst[ 0] = m00;\n newDst[ 1] = m01;\n newDst[ 2] = m02;\n newDst[ 3] = m03;\n newDst[ 4] = m10;\n newDst[ 5] = m11;\n newDst[ 6] = m12;\n newDst[ 7] = m13;\n newDst[ 8] = m20;\n newDst[ 9] = m21;\n newDst[10] = m22;\n newDst[11] = m23;\n }\n\n newDst[12] = m00 * v0 + m10 * v1 + m20 * v2 + m30;\n newDst[13] = m01 * v0 + m11 * v1 + m21 * v2 + m31;\n newDst[14] = m02 * v0 + m12 * v1 + m22 * v2 + m32;\n newDst[15] = m03 * v0 + m13 * v1 + m23 * v2 + m33;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the x-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationX(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = c; newDst[ 6] = s; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = -s; newDst[10] = c; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the x-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateX(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[4] = c * m10 + s * m20;\n newDst[5] = c * m11 + s * m21;\n newDst[6] = c * m12 + s * m22;\n newDst[7] = c * m13 + s * m23;\n newDst[8] = c * m20 - s * m10;\n newDst[9] = c * m21 - s * m11;\n newDst[10] = c * m22 - s * m12;\n newDst[11] = c * m23 - s * m13;\n\n if (m !== newDst) {\n newDst[ 0] = m[ 0];\n newDst[ 1] = m[ 1];\n newDst[ 2] = m[ 2];\n newDst[ 3] = m[ 3];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the y-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationY(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = 0; newDst[ 2] = -s; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = s; newDst[ 9] = 0; newDst[10] = c; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the y-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateY(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 - s * m20;\n newDst[ 1] = c * m01 - s * m21;\n newDst[ 2] = c * m02 - s * m22;\n newDst[ 3] = c * m03 - s * m23;\n newDst[ 8] = c * m20 + s * m00;\n newDst[ 9] = c * m21 + s * m01;\n newDst[10] = c * m22 + s * m02;\n newDst[11] = c * m23 + s * m03;\n\n if (m !== newDst) {\n newDst[ 4] = m[ 4];\n newDst[ 5] = m[ 5];\n newDst[ 6] = m[ 6];\n newDst[ 7] = m[ 7];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the z-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationZ(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = s; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = -s; newDst[ 5] = c; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the z-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateZ(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 + s * m10;\n newDst[ 1] = c * m01 + s * m11;\n newDst[ 2] = c * m02 + s * m12;\n newDst[ 3] = c * m03 + s * m13;\n newDst[ 4] = c * m10 - s * m00;\n newDst[ 5] = c * m11 - s * m01;\n newDst[ 6] = c * m12 - s * m02;\n newDst[ 7] = c * m13 - s * m03;\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n newDst[11] = m[11];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\nfunction axisRotation(axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n\n newDst[ 0] = xx + (1 - xx) * c;\n newDst[ 1] = x * y * oneMinusCosine + z * s;\n newDst[ 2] = x * z * oneMinusCosine - y * s;\n newDst[ 3] = 0;\n newDst[ 4] = x * y * oneMinusCosine - z * s;\n newDst[ 5] = yy + (1 - yy) * c;\n newDst[ 6] = y * z * oneMinusCosine + x * s;\n newDst[ 7] = 0;\n newDst[ 8] = x * z * oneMinusCosine + y * s;\n newDst[ 9] = y * z * oneMinusCosine - x * s;\n newDst[10] = zz + (1 - zz) * c;\n newDst[11] = 0;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = 0;\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle. (same as axisRotation)\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\nconst rotation = axisRotation;\n\n/**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle.\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction axisRotate(m: Mat4Arg, axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n\n const r00 = xx + (1 - xx) * c;\n const r01 = x * y * oneMinusCosine + z * s;\n const r02 = x * z * oneMinusCosine - y * s;\n const r10 = x * y * oneMinusCosine - z * s;\n const r11 = yy + (1 - yy) * c;\n const r12 = y * z * oneMinusCosine + x * s;\n const r20 = x * z * oneMinusCosine + y * s;\n const r21 = y * z * oneMinusCosine - x * s;\n const r22 = zz + (1 - zz) * c;\n\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n\n newDst[ 0] = r00 * m00 + r01 * m10 + r02 * m20;\n newDst[ 1] = r00 * m01 + r01 * m11 + r02 * m21;\n newDst[ 2] = r00 * m02 + r01 * m12 + r02 * m22;\n newDst[ 3] = r00 * m03 + r01 * m13 + r02 * m23;\n newDst[ 4] = r10 * m00 + r11 * m10 + r12 * m20;\n newDst[ 5] = r10 * m01 + r11 * m11 + r12 * m21;\n newDst[ 6] = r10 * m02 + r11 * m12 + r12 * m22;\n newDst[ 7] = r10 * m03 + r11 * m13 + r12 * m23;\n newDst[ 8] = r20 * m00 + r21 * m10 + r22 * m20;\n newDst[ 9] = r20 * m01 + r21 * m11 + r22 * m21;\n newDst[10] = r20 * m02 + r21 * m12 + r22 * m22;\n newDst[11] = r20 * m03 + r21 * m13 + r22 * m23;\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle. (same as rotate)\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nconst rotate = axisRotate;\n\n/**\n * Creates a 4-by-4 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * three entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = v[2]; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 4-by-4 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of three entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale(m: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n newDst[ 3] = v0 * m[0 * 4 + 3];\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n newDst[ 7] = v1 * m[1 * 4 + 3];\n newDst[ 8] = v2 * m[2 * 4 + 0];\n newDst[ 9] = v2 * m[2 * 4 + 1];\n newDst[10] = v2 * m[2 * 4 + 2];\n newDst[11] = v2 * m[2 * 4 + 3];\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which scales a uniform amount in each dimension.\n * @param s - the amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = s; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 4-by-4 matrix in each dimension by a uniform scale.\n * @param m - The matrix to be modified.\n * @param s - The amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale(m: Mat4Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n newDst[ 3] = s * m[0 * 4 + 3];\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n newDst[ 7] = s * m[1 * 4 + 3];\n newDst[ 8] = s * m[2 * 4 + 0];\n newDst[ 9] = s * m[2 * 4 + 1];\n newDst[10] = s * m[2 * 4 + 2];\n newDst[11] = s * m[2 * 4 + 3];\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\nreturn {\n create,\n set,\n fromMat3,\n fromQuat,\n negate,\n copy,\n clone,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n determinant,\n invert,\n multiply,\n mul,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n perspective,\n perspectiveReverseZ,\n ortho,\n frustum,\n frustumReverseZ,\n aim,\n cameraAim,\n lookAt,\n translation,\n translate,\n rotationX,\n rotateX,\n rotationY,\n rotateY,\n rotationZ,\n rotateZ,\n axisRotation,\n rotation,\n axisRotate,\n rotate,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n};\n\n}\n\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Mat4Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { QuatArg, QuatType } from './quat';\nimport { Mat3Arg } from './mat3.js';\nimport { Mat4Arg } from './mat4.js';\nimport { Vec3Arg } from './vec3.js';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\n\nexport { QuatArg, QuatType };\n\ntype QuatCtor = new (n: number) => T;\n\nexport type RotationOrder = 'xyz' | 'xzy' | 'yxz' | 'yzx' | 'zxy' | 'zyx';\n\n/**\n * Generates am typed API for Qud\n * */\nfunction getAPIImpl(Ctor: QuatCtor) {\n const vec3 = getVec3API(Ctor);\n\n/**\n * Creates a quat4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number, w?: number) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a Quat; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Quat\n * Also see {@link quat.create} and {@link quat.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, w: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n\n return newDst;\n}\n\n/**\n * Sets a quaternion from the given angle and axis,\n * then returns it.\n *\n * @param axis - the axis to rotate around\n * @param angleInRadians - the angle\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The quaternion that represents the given axis and angle\n **/\nfunction fromAxisAngle(axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n const s = Math.sin(halfAngle);\n\n newDst[0] = s * axis[0];\n newDst[1] = s * axis[1];\n newDst[2] = s * axis[2];\n newDst[3] = Math.cos(halfAngle);\n\n return newDst;\n}\n\n/**\n * Gets the rotation axis and angle\n * @param q - quaternion to compute from\n * @param dst - Vec3 to hold result. If not passed in a new one is created.\n * @return angle and axis\n */\nfunction toAxisAngle(q: QuatArg, dst?: T): { angle: number, axis: T } {\n const newDst = (dst ?? vec3.create(3)) as T;\n\n const angle = Math.acos(q[3]) * 2;\n const s = Math.sin(angle * 0.5);\n if (s > utils.EPSILON) {\n newDst[0] = q[0] / s;\n newDst[1] = q[1] / s;\n newDst[2] = q[2] / s;\n } else {\n newDst[0] = 1;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n\n return { angle, axis: newDst };\n}\n\n/**\n * Returns the angle in degrees between two rotations a and b.\n * @param a - quaternion a\n * @param b - quaternion b\n * @return angle in radians between the two quaternions\n */\nfunction angle(a: QuatArg, b: QuatArg) {\n const d = dot(a, b);\n return Math.acos(2 * d * d - 1);\n}\n\n/**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction multiply(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const bw = b[3];\n\n newDst[0] = ax * bw + aw * bx + ay * bz - az * by;\n newDst[1] = ay * bw + aw * by + az * bx - ax * bz;\n newDst[2] = az * bw + aw * bz + ax * by - ay * bx;\n newDst[3] = aw * bw - ax * bx - ay * by - az * bz;\n\n return newDst;\n}\n\n/**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nconst mul = multiply;\n\n/**\n * Rotates the given quaternion around the X axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateX(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const bx = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw + qw * bx;\n newDst[1] = qy * bw + qz * bx;\n newDst[2] = qz * bw - qy * bx;\n newDst[3] = qw * bw - qx * bx;\n\n return newDst;\n}\n\n/**\n * Rotates the given quaternion around the Y axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateY(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const by = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw - qz * by;\n newDst[1] = qy * bw + qw * by;\n newDst[2] = qz * bw + qx * by;\n newDst[3] = qw * bw - qy * by;\n\n return newDst;\n}\n\n/**\n * Rotates the given quaternion around the Z axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateZ(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const bz = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw + qy * bz;\n newDst[1] = qy * bw - qx * bz;\n newDst[2] = qz * bw + qw * bz;\n newDst[3] = qw * bw - qz * bz;\n\n return newDst;\n}\n\n/**\n * Spherically linear interpolate between two quaternions\n *\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction slerp(a: QuatArg, b: QuatArg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n\n let bx = b[0];\n let by = b[1];\n let bz = b[2];\n let bw = b[3];\n\n let cosOmega = ax * bx + ay * by + az * bz + aw * bw;\n\n if (cosOmega < 0) {\n cosOmega = -cosOmega;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n\n let scale0;\n let scale1;\n\n if (1.0 - cosOmega > utils.EPSILON) {\n const omega = Math.acos(cosOmega);\n const sinOmega = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinOmega;\n scale1 = Math.sin(t * omega) / sinOmega;\n } else {\n scale0 = 1.0 - t;\n scale1 = t;\n }\n\n newDst[0] = scale0 * ax + scale1 * bx;\n newDst[1] = scale0 * ay + scale1 * by;\n newDst[2] = scale0 * az + scale1 * bz;\n newDst[3] = scale0 * aw + scale1 * bw;\n\n return newDst;\n}\n\n/**\n * Compute the inverse of a quaternion\n *\n * @param q - quaternion to compute the inverse of\n * @returns A quaternion that is the result of a * b\n */\nfunction inverse(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const a0 = q[0];\n const a1 = q[1];\n const a2 = q[2];\n const a3 = q[3];\n\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n\n newDst[0] = -a0 * invDot;\n newDst[1] = -a1 * invDot;\n newDst[2] = -a2 * invDot;\n newDst[3] = a3 * invDot;\n\n return newDst;\n}\n\n/**\n * Compute the conjugate of a quaternion\n * For quaternions with a magnitude of 1 (a unit quaternion)\n * this returns the same as the inverse but is faster to calculate.\n *\n * @param q - quaternion to compute the conjugate of.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The conjugate of q\n */\nfunction conjugate(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = -q[0];\n newDst[1] = -q[1];\n newDst[2] = -q[2];\n newDst[3] = q[3];\n\n return newDst;\n}\n\n/**\n * Creates a quaternion from the given rotation matrix.\n *\n * The created quaternion is not normalized.\n *\n * @param m - rotation matrix\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\nfunction fromMat(m: Mat3Arg | Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n /*\n 0 1 2\n 3 4 5\n 6 7 8\n\n 0 1 2\n 4 5 6\n 8 9 10\n */\n\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n const trace = m[0] + m[5] + m[10];\n\n if (trace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n const root = Math.sqrt(trace + 1); // 2w\n newDst[3] = 0.5 * root;\n const invRoot = 0.5 / root; // 1/(4w)\n\n newDst[0] = (m[6] - m[9]) * invRoot;\n newDst[1] = (m[8] - m[2]) * invRoot;\n newDst[2] = (m[1] - m[4]) * invRoot;\n } else {\n // |w| <= 1/2\n let i = 0;\n\n if (m[5] > m[0]) {\n i = 1;\n }\n if (m[10] > m[i * 4 + i]) {\n i = 2;\n }\n\n const j = (i + 1) % 3;\n const k = (i + 2) % 3;\n\n const root = Math.sqrt(m[i * 4 + i] - m[j * 4 + j] - m[k * 4 + k] + 1.0);\n newDst[i] = 0.5 * root;\n\n const invRoot = 0.5 / root;\n\n newDst[3] = (m[j * 4 + k] - m[k * 4 + j]) * invRoot;\n newDst[j] = (m[j * 4 + i] + m[i * 4 + j]) * invRoot;\n newDst[k] = (m[k * 4 + i] + m[i * 4 + k]) * invRoot;\n }\n\n return newDst;\n}\n\n/**\n * Creates a quaternion from the given euler angle x, y, z using the provided intrinsic order for the conversion.\n *\n * @param xAngleInRadians - angle to rotate around X axis in radians.\n * @param yAngleInRadians - angle to rotate around Y axis in radians.\n * @param zAngleInRadians - angle to rotate around Z axis in radians.\n * @param order - order to apply euler angles\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion representing the same rotation as the euler angles applied in the given order\n */\nfunction fromEuler(\n xAngleInRadians: number,\n yAngleInRadians: number,\n zAngleInRadians: number,\n order: RotationOrder,\n dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const xHalfAngle = xAngleInRadians * 0.5;\n const yHalfAngle = yAngleInRadians * 0.5;\n const zHalfAngle = zAngleInRadians * 0.5;\n\n const sx = Math.sin(xHalfAngle);\n const cx = Math.cos(xHalfAngle);\n const sy = Math.sin(yHalfAngle);\n const cy = Math.cos(yHalfAngle);\n const sz = Math.sin(zHalfAngle);\n const cz = Math.cos(zHalfAngle);\n\n switch (order) {\n case 'xyz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'xzy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n case 'yxz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n case 'yzx':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'zxy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'zyx':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n default:\n throw new Error(`Unknown rotation order: ${order}`);\n }\n\n return newDst;\n}\n\n/**\n * Copies a quaternion. (same as {@link quat.clone})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is a copy of q\n */\nfunction copy(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = q[0];\n newDst[1] = q[1];\n newDst[2] = q[2];\n newDst[3] = q[3];\n\n return newDst;\n}\n\n/**\n * Clones a quaternion. (same as {@link quat.copy})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A copy of q.\n */\nconst clone = copy;\n\n/**\n * Adds two quaternions; assumes a and b have the same dimension.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the sum of a and b.\n */\nfunction add(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\nfunction subtract(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Multiplies a quaternion by a scalar.\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nfunction mulScalar(v: QuatArg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a quaternion by a scalar. (same as mulScalar)\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nfunction divScalar(v: QuatArg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two quaternions\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns dot product\n */\nfunction dot(a: QuatArg, b: QuatArg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n}\n\n/**\n * Performs linear interpolation on two quaternions.\n * Given quaternions a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param t - Interpolation coefficient.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: QuatArg, b: QuatArg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Computes the length of quaternion\n * @param v - quaternion.\n * @returns length of quaternion.\n */\nfunction length(v: QuatArg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n}\n\n/**\n * Computes the length of quaternion (same as length)\n * @param v - quaternion.\n * @returns length of quaternion.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of quaternion\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\nfunction lengthSq(v: QuatArg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n}\n\n/**\n * Computes the square of the length of quaternion (same as lengthSq)\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\nconst lenSq = lengthSq;\n\n/**\n * Divides a quaternion by its Euclidean length and returns the quotient.\n * @param v - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The normalized quaternion.\n */\nfunction normalize(v: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n }\n\n return newDst;\n}\n\n/**\n * Check if 2 quaternions are approximately equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are approximately equal\n */\nfunction equalsApproximately(a: QuatArg, b: QuatArg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON &&\n Math.abs(a[3] - b[3]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 quaternions are exactly equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are exactly equal\n */\nfunction equals(a: QuatArg, b: QuatArg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Creates an identity quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns an identity quaternion\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n\n return newDst;\n}\n\nconst tempVec3 = vec3.create();\nconst xUnitVec3 = vec3.create();\nconst yUnitVec3 = vec3.create();\n\n/**\n * Computes a quaternion to represent the shortest rotation from one vector to another.\n *\n * @param aUnit - the start vector\n * @param bUnit - the end vector\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\nfunction rotationTo(aUnit: Vec3Arg, bUnit: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const dot = vec3.dot(aUnit, bUnit);\n if (dot < -0.999999) {\n vec3.cross(xUnitVec3, aUnit, tempVec3);\n if (vec3.len(tempVec3) < 0.000001) {\n vec3.cross(yUnitVec3, aUnit, tempVec3);\n }\n\n vec3.normalize(tempVec3, tempVec3);\n fromAxisAngle(tempVec3, Math.PI, newDst);\n\n return newDst;\n } else if (dot > 0.999999) {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n\n return newDst;\n } else {\n vec3.cross(aUnit, bUnit, tempVec3);\n\n newDst[0] = tempVec3[0];\n newDst[1] = tempVec3[1];\n newDst[2] = tempVec3[2];\n newDst[3] = 1 + dot;\n\n return normalize(newDst, newDst);\n }\n}\n\nconst tempQuat1 = new Ctor(4);\nconst tempQuat2 = new Ctor(4);\n\n/**\n * Performs a spherical linear interpolation with two control points\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param c - the third quaternion\n * @param d - the fourth quaternion\n * @param t - Interpolation coefficient 0 to 1\n * @returns result\n */\nfunction sqlerp(\n a: QuatArg,\n b: QuatArg,\n c: QuatArg,\n d: QuatArg,\n t: number,\n dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n slerp(a, d, t, tempQuat1);\n slerp(b, c, t, tempQuat2);\n slerp(tempQuat1, tempQuat2, 2 * t * (1 - t), newDst);\n\n return newDst;\n}\n\nreturn {\n create,\n fromValues,\n set,\n fromAxisAngle,\n toAxisAngle,\n angle,\n multiply,\n mul,\n rotateX,\n rotateY,\n rotateZ,\n slerp,\n inverse,\n conjugate,\n fromMat,\n fromEuler,\n copy,\n clone,\n add,\n subtract,\n sub,\n mulScalar,\n scale,\n divScalar,\n dot,\n lerp,\n length,\n len,\n lengthSq,\n lenSq,\n normalize,\n equalsApproximately,\n equals,\n identity,\n rotationTo,\n sqlerp,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\n/**\n *\n * Quat4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Quat4`. In other words you can do this\n *\n * const v = quat4.cross(v1, v2); // Creates a new Quat4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = quat4.create();\n * quat4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * quat4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nexport function getAPI(Ctor: QuatCtor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Vec4Arg, Vec4Type } from './vec4';\nimport { Mat4Arg } from './mat4';\nimport { BaseArgType } from './types';\n\nexport { Vec4Arg, Vec4Type };\n\ntype Vec4Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec4\n * */\nfunction getAPIImpl(Ctor: Vec4Ctor) {\n\n/**\n * Creates a vec4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number, w?: number) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a vec4; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec4\n * Also see {@link vec4.create} and {@link vec4.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, w: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n newDst[3] = Math.ceil(v[3]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n newDst[3] = Math.floor(v[3]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n newDst[3] = Math.round(v[3]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec4Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n newDst[3] = Math.min(max, Math.max(min, v[3]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec4Arg, b: Vec4Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n newDst[3] = a[3] + b[3] * scale;\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec4Arg, b: Vec4Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON &&\n Math.abs(a[3] - b[3]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec4Arg, b: Vec4Arg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec4Arg, b: Vec4Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec4Arg, b: Vec4Arg, t: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n newDst[3] = a[3] + t[3] * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n newDst[3] = Math.max(a[3], b[3]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n newDst[3] = Math.min(a[3], b[3]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec4Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec4Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n newDst[3] = 1 / v[3];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the dot product of two vectors\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec4Arg, b: Vec4Arg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec4Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec4Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec4Arg, b: Vec4Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec4Arg, b: Vec4Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return dx * dx + dy * dy + dz * dz + dw * dw;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n }\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n newDst[3] = -v[3];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec4.clone})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n newDst[3] = v[3];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec4.copy})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n newDst[3] = a[3] * b[3];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n newDst[3] = a[3] / b[3];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform vec4 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec4 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec4Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = v[3];\n\n newDst[0] = m[0] * x + m[4] * y + m[ 8] * z + m[12] * w;\n newDst[1] = m[1] * x + m[5] * y + m[ 9] * z + m[13] * w;\n newDst[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n newDst[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n\n return newDst;\n}\n\n\n/**\n * Treat a 4D vector as a direction and set it's length\n *\n * @param a The vec4 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec4Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec4 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec4Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n zero,\n transformMat4,\n setLength,\n truncate,\n midpoint,\n};\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\n/**\n *\n * Vec4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Vec4`. In other words you can do this\n *\n * const v = vec4.cross(v1, v2); // Creates a new Vec4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = vec4.create();\n * vec4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * vec4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nexport function getAPI(Ctor: Vec4Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n\n","/**\n * Some docs\n * @namespace wgpu-matrix\n */\nimport {BaseArgType, ZeroArray} from './types';\nimport {Mat3Arg, Mat3Type, getAPI as getMat3API} from './mat3-impl';\nimport {Mat4Arg, Mat4Type, getAPI as getMat4API} from './mat4-impl';\nimport {QuatArg, QuatType, getAPI as getQuatAPI, RotationOrder} from './quat-impl';\nimport {Vec2Arg, Vec2Type, getAPI as getVec2API} from './vec2-impl';\nimport {Vec3Arg, Vec3Type, getAPI as getVec3API} from './vec3-impl';\nimport {Vec4Arg, Vec4Type, getAPI as getVec4API} from './vec4-impl';\nimport * as utils from './utils';\n\nexport {\n RotationOrder,\n utils,\n\n BaseArgType,\n\n Mat3Arg,\n Mat4Arg,\n QuatArg,\n Vec2Arg,\n Vec3Arg,\n Vec4Arg,\n\n Mat3Type,\n Mat4Type,\n QuatType,\n Vec2Type,\n Vec3Type,\n Vec4Type,\n};\n\nexport type BaseCtor = new (n: number) => T;\n\nexport type Mat3 = Mat3Type;\nexport type Mat4 = Mat4Type;\nexport type Quat = QuatType;\nexport type Vec2 = Vec2Type;\nexport type Vec3 = Vec3Type;\nexport type Vec4 = Vec4Type;\n\nexport type Mat3d = Mat3Type;\nexport type Mat4d = Mat4Type;\nexport type Quatd = QuatType;\nexport type Vec2d = Vec2Type;\nexport type Vec3d = Vec3Type;\nexport type Vec4d = Vec4Type;\n\nexport type Mat3n = Mat3Type;\nexport type Mat4n = Mat4Type;\nexport type Quatn = QuatType;\nexport type Vec2n = Vec2Type;\nexport type Vec3n = Vec3Type;\nexport type Vec4n = Vec4Type;\n\n/**\n * Generate wgpu-matrix API for type\n */\nfunction wgpuMatrixAPI<\n Mat3 extends BaseArgType,\n Mat4 extends BaseArgType,\n Quat extends BaseArgType,\n Vec2 extends BaseArgType,\n Vec3 extends BaseArgType,\n Vec4 extends BaseArgType,\n>(\n Mat3Ctor: BaseCtor,\n Mat4Ctor: BaseCtor,\n QuatCtor: BaseCtor,\n Vec2Ctor: BaseCtor,\n Vec3Ctor: BaseCtor,\n Vec4Ctor: BaseCtor,\n) {\n return {\n /** @namespace mat3 */\n mat3: getMat3API(Mat3Ctor),\n /** @namespace mat4 */\n mat4: getMat4API(Mat4Ctor),\n /** @namespace quat */\n quat: getQuatAPI(QuatCtor),\n /** @namespace vec2 */\n vec2: getVec2API(Vec2Ctor),\n /** @namespace vec3 */\n vec3: getVec3API(Vec3Ctor),\n /** @namespace vec4 */\n vec4: getVec4API(Vec4Ctor),\n };\n}\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat3,\n /**\n * 4x4 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat4,\n /**\n * Quaternion functions that default to returning `Float32Array`\n * @namespace\n */\n quat,\n /**\n * Vec2 functions that default to returning `Float32Array`\n * @namespace\n */\n vec2,\n /**\n * Vec3 functions that default to returning `Float32Array`\n * @namespace\n */\n vec3,\n /**\n * Vec3 functions that default to returning `Float32Array`\n * @namespace\n */\n vec4,\n} = wgpuMatrixAPI<\n Mat3, Mat4, Quat, Vec2, Vec3, Vec4>(\n Float32Array, Float32Array, Float32Array, Float32Array, Float32Array, Float32Array);\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat3: mat3d,\n /**\n * 4x4 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat4: mat4d,\n /**\n * Quaternion functions that default to returning `Float64Array`\n * @namespace\n */\n quat: quatd,\n /**\n * Vec2 functions that default to returning `Float64Array`\n * @namespace\n */\n vec2: vec2d,\n /**\n * Vec3 functions that default to returning `Float64Array`\n * @namespace\n */\n vec3: vec3d,\n /**\n * Vec3 functions that default to returning `Float64Array`\n * @namespace\n */\n vec4: vec4d,\n} = wgpuMatrixAPI<\n Mat3d, Mat4d, Quatd, Vec2d, Vec3d, Vec4d>(\n Float64Array, Float64Array, Float64Array, Float64Array, Float64Array, Float64Array);\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat3: mat3n,\n /**\n * 4x4 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat4: mat4n,\n /**\n * Quaternion functions that default to returning `number[]`\n * @namespace\n */\n quat: quatn,\n /**\n * Vec2 functions that default to returning `number[]`\n * @namespace\n */\n vec2: vec2n,\n /**\n * Vec3 functions that default to returning `number[]`\n * @namespace\n */\n vec3: vec3n,\n /**\n * Vec3 functions that default to returning `number[]`\n * @namespace\n */\n vec4: vec4n,\n} = wgpuMatrixAPI<\n Mat3n, Mat4n, Quatn, Vec2n, Vec3n, Vec4n>(\n ZeroArray, Array, Array, Array, Array, Array);\n"],"names":["getAPIImpl","utils.EPSILON","cache","getAPI","getVec2API","getVec3API","getMat3API","getMat4API","getQuatAPI","getVec4API"],"mappings":";;;;;;;IAMA,SAAS,eAAe,CACtB,mBAAsB,EACtB,QAA6C,EAAA;QAE7C,OAAO,cAAc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EAAEI,MAAU,CAAO,QAAQ,CAAC;SACjC,CAAC;IACJ,CAAC;AAEY,UAAA;IACX;;;IAGG;IACH,IAAI;IACJ;;;IAGG;IACH,IAAI;IACJ;;;IAGG;IACH,IAAI;IACJ;;;IAGG;IACH,IAAI;IACJ;;;IAGG;IACH,IAAI;IACJ;;;IAGG;IACH,IAAI,GACL,GAAG,aAAa,CAEb,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE;AAE3E,UAAA;IACX;;;IAGG;IACH,IAAI,EAAE,KAAK;IACX;;;IAGG;IACH,IAAI,EAAE,KAAK;IACX;;;IAGG;IACH,IAAI,EAAE,KAAK;IACX;;;IAGG;IACH,IAAI,EAAE,KAAK;IACX;;;IAGG;IACH,IAAI,EAAE,KAAK;IACX;;;IAGG;IACH,IAAI,EAAE,KAAK,GACZ,GAAG,aAAa,CAEb,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE;AAE3E,UAAA;IACX;;;IAGG;IACH,IAAI,EAAE,KAAK;IACX;;;IAGG;IACH,IAAI,EAAE,KAAK;IACX;;;IAGG;IACH,IAAI,EAAE,KAAK;IACX;;;IAGG;IACH,IAAI,EAAE,KAAK;IACX;;;IAGG;IACH,IAAI,EAAE,KAAK;IACX;;;IAGG;IACH,IAAI,EAAE,KAAK,GACZ,GAAG,aAAa,CAEb,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"wgpu-matrix.js","sources":["../../../src/types.ts","../../../src/utils.ts","../../../src/vec2-impl.ts","../../../src/vec3-impl.ts","../../../src/mat3-impl.ts","../../../src/mat4-impl.ts","../../../src/quat-impl.ts","../../../src/vec4-impl.ts","../../../src/wgpu-matrix.ts"],"sourcesContent":["/**\n * The types you can pass to most functions that take an\n * array of numbers.\n */\nexport type BaseArgType = Float32Array | Float64Array | number[];\n\nfunction wrapConstructor any>(\n OriginalConstructor: T,\n modifier: (instance: InstanceType) => void\n): T {\n return class extends OriginalConstructor {\n constructor(...args: any[]) {\n super(...args);\n modifier(this as InstanceType);\n }\n } as T; // Type assertion is necessary here\n}\n\nexport const ZeroArray = wrapConstructor(Array, a => a.fill(0));\n\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nexport let EPSILON = 0.000001;\n\n/**\n * Set the value for EPSILON for various checks\n * @param v - Value to use for EPSILON.\n * @returns previous value of EPSILON;\n */\nexport function setEpsilon(v: number): number {\n const old = EPSILON;\n EPSILON = v;\n return old;\n}\n\n/**\n * Convert degrees to radians\n * @param degrees - Angle in degrees\n * @returns angle converted to radians\n */\nexport function degToRad(degrees: number): number {\n return degrees * Math.PI / 180;\n}\n\n/**\n * Convert radians to degrees\n * @param radians - Angle in radians\n * @returns angle converted to degrees\n */\nexport function radToDeg(radians: number): number {\n return radians * 180 / Math.PI;\n}\n\n/**\n * Lerps between a and b via t\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @returns a + (b - a) * t\n */\nexport function lerp(a: number, b: number, t: number): number {\n return a + (b - a) * t;\n}\n\n/**\n * Compute the opposite of lerp. Given a and b and a value between\n * a and b returns a value between 0 and 1. 0 if a, 1 if b.\n * Note: no clamping is done.\n * @param a - start value\n * @param b - end value\n * @param v - value between a and b\n * @returns (v - a) / (b - a)\n */\nexport function inverseLerp(a: number, b: number, v: number): number {\n const d = b - a;\n return (Math.abs(b - a) < EPSILON)\n ? a\n : (v - a) / d;\n}\n\n/**\n * Compute the euclidean modulo\n *\n * ```\n * // table for n / 3\n * -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 <- n\n * ------------------------------------\n * -2 -1 -0 -2 -1 0, 1, 2, 0, 1, 2 <- n % 3\n * 1 2 0 1 2 0, 1, 2, 0, 1, 2 <- euclideanModule(n, 3)\n * ```\n *\n * @param n - dividend\n * @param m - divisor\n * @returns the euclidean modulo of n / m\n */\nexport function euclideanModulo(n: number, m: number) {\n return ((n % m) + m) % m;\n}","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Mat3Arg } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { Vec2Arg, Vec2Type } from './vec2';\nimport { Vec3Arg } from './vec3';\nimport { BaseArgType } from './types';\n\nexport { Vec2Arg, Vec2Type };\n\ntype Vec2Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec3\n */\nfunction getAPIImpl(Ctor: Vec2Ctor) {\n\n/**\n * Creates a Vec2; may be called with x, y, z to set initial values.\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Vec2's specified type\n * it would be faster to use\n *\n * ```\n * const v = vec2.clone(someJSArray);\n * ```\n *\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\nfunction create(x = 0, y = 0) {\n const newDst = new Ctor(2);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n }\n }\n return newDst;\n}\n\n/**\n * Creates a Vec2; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec2\n * Also see {@link vec2.create} and {@link vec2.copy}\n *\n * @param x first value\n * @param y second value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec2Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec2Arg, b: Vec2Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n\n return newDst;\n}\n\n/**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\nfunction angle(a: Vec2Arg, b: Vec2Arg): number {\n const ax = a[0];\n const ay = a[1];\n const bx = b[0];\n const by = b[1];\n const mag1 = Math.sqrt(ax * ax + ay * ay);\n const mag2 = Math.sqrt(bx * bx + by * by);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec2Arg, b: Vec2Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec2Arg, b: Vec2Arg): boolean {\n return a[0] === b[0] && a[1] === b[1];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec2Arg, b: Vec2Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec2Arg, b: Vec2Arg, t: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec2Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec2Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\nfunction cross(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const z = a[0] * b[1] - a[1] * b[0];\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = z;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec2Arg, b: Vec2Arg): number {\n return a[0] * b[0] + a[1] * b[1];\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec2Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n return Math.sqrt(v0 * v0 + v1 * v1);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec2Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n return v0 * v0 + v1 * v1;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec2Arg, b: Vec2Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return Math.sqrt(dx * dx + dy * dy);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec2Arg, b: Vec2Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return dx * dx + dy * dy;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const len = Math.sqrt(v0 * v0 + v1 * v1);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n }\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec2.clone})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec2.copy})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Creates a random unit vector * scale\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\nfunction random(scale = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const angle = Math.random() * 2 * Math.PI;\n newDst[0] = Math.cos(angle) * scale;\n newDst[1] = Math.sin(angle) * scale;\n\n return newDst;\n}\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform Vec2 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec2Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const x = v[0];\n const y = v[1];\n\n newDst[0] = x * m[0] + y * m[4] + m[12];\n newDst[1] = x * m[1] + y * m[5] + m[13];\n\n return newDst;\n}\n\n/**\n * Transforms vec4 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat3(v: Vec2Arg, m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const x = v[0];\n const y = v[1];\n\n newDst[0] = m[0] * x + m[4] * y + m[8];\n newDst[1] = m[1] * x + m[5] * y + m[9];\n\n return newDst;\n}\n\n/**\n * Rotate a 2D vector\n *\n * @param a The vec2 point to rotate\n * @param b The origin of the rotation\n * @param rad The angle of rotation in radians\n * @returns the rotated vector\n */\nfunction rotate(a: Vec2Arg, b: Vec2Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n // Translate point to the origin\n const p0 = a[0] - b[0];\n const p1 = a[1] - b[1];\n const sinC = Math.sin(rad);\n const cosC = Math.cos(rad);\n\n //perform rotation and translate to correct position\n newDst[0] = p0 * cosC - p1 * sinC + b[0];\n newDst[1] = p0 * sinC + p1 * cosC + b[1];\n\n return newDst;\n}\n\n/**\n * Treat a 2D vector as a direction and set it's length\n *\n * @param a The vec2 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec2Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec2 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec2Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat3,\n rotate,\n setLength,\n truncate,\n midpoint,\n};\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Vec2Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Vec3Arg, Vec3Type } from './vec3';\nimport { Mat3Arg } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { QuatArg } from './quat';\nimport { BaseArgType } from './types';\n\nexport { Vec3Arg, Vec3Type };\n\ntype Vec3Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec3\n * */\nfunction getAPIImpl(Ctor: Vec3Ctor) {\n\n/**\n * Creates a vec3; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number) {\n const newDst = new Ctor(3);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a vec3; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec3\n * Also see {@link vec3.create} and {@link vec3.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec3Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec3Arg, b: Vec3Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n\n return newDst;\n}\n\n/**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\nfunction angle(a: Vec3Arg, b: Vec3Arg): number {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const mag1 = Math.sqrt(ax * ax + ay * ay + az * az);\n const mag2 = Math.sqrt(bx * bx + by * by + bz * bz);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec3Arg, b: Vec3Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec3Arg, b: Vec3Arg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec3Arg, b: Vec3Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec3Arg, b: Vec3Arg, t: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec3Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec3Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\nfunction cross(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const t1 = a[2] * b[0] - a[0] * b[2];\n const t2 = a[0] * b[1] - a[1] * b[0];\n newDst[0] = a[1] * b[2] - a[2] * b[1];\n newDst[1] = t1;\n newDst[2] = t2;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec3Arg, b: Vec3Arg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]);\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec3Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec3Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return v0 * v0 + v1 * v1 + v2 * v2;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec3Arg, b: Vec3Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return Math.sqrt(dx * dx + dy * dy + dz * dz);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec3Arg, b: Vec3Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return dx * dx + dy * dy + dz * dz;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec3.clone})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec3.copy})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Creates a random vector\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\nfunction random(scale = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const angle = Math.random() * 2 * Math.PI;\n const z = Math.random() * 2 - 1;\n const zScale = Math.sqrt(1 - z * z) * scale;\n newDst[0] = Math.cos(angle) * zScale;\n newDst[1] = Math.sin(angle) * zScale;\n newDst[2] = z * scale;\n\n return newDst;\n}\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform vec3 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec3Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1;\n\n newDst[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n newDst[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n newDst[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n\n return newDst;\n}\n\n/**\n * Transform vec3 by upper 3x3 matrix inside 4x4 matrix.\n * @param v - The direction.\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns The transformed vector.\n */\nfunction transformMat4Upper3x3(v: Vec3Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[0] = v0 * m[0 * 4 + 0] + v1 * m[1 * 4 + 0] + v2 * m[2 * 4 + 0];\n newDst[1] = v0 * m[0 * 4 + 1] + v1 * m[1 * 4 + 1] + v2 * m[2 * 4 + 1];\n newDst[2] = v0 * m[0 * 4 + 2] + v1 * m[1 * 4 + 2] + v2 * m[2 * 4 + 2];\n\n return newDst;\n}\n\n/**\n * Transforms vec3 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat3(v: Vec3Arg, m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n\n newDst[0] = x * m[0] + y * m[4] + z * m[8];\n newDst[1] = x * m[1] + y * m[5] + z * m[9];\n newDst[2] = x * m[2] + y * m[6] + z * m[10];\n\n return newDst;\n}\n\n/**\n * Transforms vec3 by Quaternion\n * @param v - the vector to transform\n * @param q - the quaternion to transform by\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed\n */\nfunction transformQuat(v: Vec3Arg, q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n\n const uvX = qy * z - qz * y;\n const uvY = qz * x - qx * z;\n const uvZ = qx * y - qy * x;\n\n newDst[0] = x + uvX * w2 + (qy * uvZ - qz * uvY) * 2;\n newDst[1] = y + uvY * w2 + (qz * uvX - qx * uvZ) * 2;\n newDst[2] = z + uvZ * w2 + (qx * uvY - qy * uvX) * 2;\n\n return newDst;\n}\n\n/**\n * Returns the translation component of a 4-by-4 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\nfunction getTranslation(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n}\n/**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat4Arg, axis: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n}\n/**\n * Returns the scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the x-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\nfunction rotateX(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n //Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n //perform rotation\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad);\n\n //translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the y-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\nfunction rotateY(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n // perform rotation\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad);\n\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the z-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns {vec3} out\n */\nfunction rotateZ(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n // perform rotation\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2];\n\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Treat a 3D vector as a direction and set it's length\n *\n * @param a The vec3 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec3Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec3 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec3Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat4Upper3x3,\n transformMat3,\n transformQuat,\n getTranslation,\n getAxis,\n getScaling,\n rotateX,\n rotateY,\n rotateZ,\n setLength,\n truncate,\n midpoint,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Vec3Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nimport * as utils from './utils.js';\nimport { QuatArg } from './quat';\nimport { Mat3Arg, Mat3Type } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { Vec2Arg } from './vec2';\nimport { Vec3Arg } from './vec3';\nimport { getAPI as getVec2API } from './vec2-impl';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\n\nexport { Mat3Arg, Mat3Type };\n\ntype Mat3Ctor = new (n: number) => T;\n\n/**\n * Generates a typed API for Mat3\n * */\nfunction getAPIImpl(Ctor: Mat3Ctor) {\n const vec2 = getVec2API(Ctor);\n const vec3 = getVec3API(Ctor);\n\n/**\n * Create a Mat3 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat3's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat3.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @returns matrix created from values.\n */\nfunction create(\n v0?: number, v1?: number, v2?: number,\n v3?: number, v4?: number, v5?: number,\n v6?: number, v7?: number, v8?: number) {\n const newDst = new Ctor(12);\n // to make the array homogenous\n newDst[3] = 0;\n newDst[7] = 0;\n newDst[11] = 0;\n\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[4] = v3;\n if (v4 !== undefined) {\n newDst[5] = v4;\n if (v5 !== undefined) {\n newDst[6] = v5;\n if (v6 !== undefined) {\n newDst[8] = v6;\n if (v7 !== undefined) {\n newDst[9] = v7;\n if (v8 !== undefined) {\n newDst[10] = v8;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n\n return newDst;\n}\n\n/**\n * Sets the values of a Mat3\n * Also see {@link mat3.create} and {@link mat3.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 set from values.\n */\nfunction set(\n v0: number, v1: number, v2: number,\n v3: number, v4: number, v5: number,\n v6: number, v7: number, v8: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[0] = v0; newDst[1] = v1; newDst[ 2] = v2; newDst[ 3] = 0;\n newDst[4] = v3; newDst[5] = v4; newDst[ 6] = v5; newDst[ 7] = 0;\n newDst[8] = v6; newDst[9] = v7; newDst[10] = v8; newDst[11] = 0;\n\n return newDst;\n}\n\n/**\n * Creates a Mat3 from the upper left 3x3 part of a Mat4\n * @param m4 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from m4\n */\nfunction fromMat4(m4: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n newDst[0] = m4[0]; newDst[1] = m4[1]; newDst[ 2] = m4[ 2]; newDst[ 3] = 0;\n newDst[4] = m4[4]; newDst[5] = m4[5]; newDst[ 6] = m4[ 6]; newDst[ 7] = 0;\n newDst[8] = m4[8]; newDst[9] = m4[9]; newDst[10] = m4[10]; newDst[11] = 0;\n return newDst;\n}\n\n/**\n * Creates a Mat3 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from q\n */\nfunction fromQuat(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3];\n const x2 = x + x; const y2 = y + y; const z2 = z + z;\n\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n newDst[ 0] = 1 - yy - zz; newDst[ 1] = yx + wz; newDst[ 2] = zx - wy; newDst[ 3] = 0;\n newDst[ 4] = yx - wz; newDst[ 5] = 1 - xx - zz; newDst[ 6] = zy + wx; newDst[ 7] = 0;\n newDst[ 8] = zx + wy; newDst[ 9] = zy - wx; newDst[10] = 1 - xx - yy; newDst[11] = 0;\n\n return newDst;\n}\n\n/**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\nfunction negate(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = -m[ 0]; newDst[ 1] = -m[ 1]; newDst[ 2] = -m[ 2];\n newDst[ 4] = -m[ 4]; newDst[ 5] = -m[ 5]; newDst[ 6] = -m[ 6];\n newDst[ 8] = -m[ 8]; newDst[ 9] = -m[ 9]; newDst[10] = -m[10];\n\n return newDst;\n}\n\n/**\n * Copies a matrix. (same as {@link mat3.clone})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nfunction copy(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = m[ 0]; newDst[ 1] = m[ 1]; newDst[ 2] = m[ 2];\n newDst[ 4] = m[ 4]; newDst[ 5] = m[ 5]; newDst[ 6] = m[ 6];\n newDst[ 8] = m[ 8]; newDst[ 9] = m[ 9]; newDst[10] = m[10];\n\n return newDst;\n}\n\n/**\n * Copies a matrix (same as {@link mat3.copy})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nconst clone = copy;\n\n/**\n * Check if 2 matrices are approximately equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are approximately equal\n */\nfunction equalsApproximately(a: Mat3Arg, b: Mat3Arg): boolean {\n return Math.abs(a[ 0] - b[ 0]) < utils.EPSILON &&\n Math.abs(a[ 1] - b[ 1]) < utils.EPSILON &&\n Math.abs(a[ 2] - b[ 2]) < utils.EPSILON &&\n Math.abs(a[ 4] - b[ 4]) < utils.EPSILON &&\n Math.abs(a[ 5] - b[ 5]) < utils.EPSILON &&\n Math.abs(a[ 6] - b[ 6]) < utils.EPSILON &&\n Math.abs(a[ 8] - b[ 8]) < utils.EPSILON &&\n Math.abs(a[ 9] - b[ 9]) < utils.EPSILON &&\n Math.abs(a[10] - b[10]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 matrices are exactly equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are exactly equal\n */\nfunction equals(a: Mat3Arg, b: Mat3Arg): boolean {\n return a[ 0] === b[ 0] &&\n a[ 1] === b[ 1] &&\n a[ 2] === b[ 2] &&\n a[ 4] === b[ 4] &&\n a[ 5] === b[ 5] &&\n a[ 6] === b[ 6] &&\n a[ 8] === b[ 8] &&\n a[ 9] === b[ 9] &&\n a[10] === b[10];\n}\n\n/**\n * Creates a 3-by-3 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 3-by-3 identity matrix.\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\nfunction transpose(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n if (newDst === m) {\n let t: number;\n\n // 0 1 2\n // 4 5 6\n // 8 9 10\n\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n\n return newDst;\n }\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n newDst[ 0] = m00; newDst[ 1] = m10; newDst[ 2] = m20;\n newDst[ 4] = m01; newDst[ 5] = m11; newDst[ 6] = m21;\n newDst[ 8] = m02; newDst[ 9] = m12; newDst[10] = m22;\n\n return newDst;\n}\n\n/**\n * Computes the inverse of a 3-by-3 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nfunction inverse(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n const b01 = m22 * m11 - m12 * m21;\n const b11 = -m22 * m10 + m12 * m20;\n const b21 = m21 * m10 - m11 * m20;\n\n const invDet = 1 / (m00 * b01 + m01 * b11 + m02 * b21);\n\n newDst[ 0] = b01 * invDet;\n newDst[ 1] = (-m22 * m01 + m02 * m21) * invDet;\n newDst[ 2] = ( m12 * m01 - m02 * m11) * invDet;\n newDst[ 4] = b11 * invDet;\n newDst[ 5] = ( m22 * m00 - m02 * m20) * invDet;\n newDst[ 6] = (-m12 * m00 + m02 * m10) * invDet;\n newDst[ 8] = b21 * invDet;\n newDst[ 9] = (-m21 * m00 + m01 * m20) * invDet;\n newDst[10] = ( m11 * m00 - m01 * m10) * invDet;\n\n return newDst;\n}\n\n/**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\nfunction determinant(m: Mat3Arg): number {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n return m00 * (m11 * m22 - m21 * m12) -\n m10 * (m01 * m22 - m21 * m02) +\n m20 * (m01 * m12 - m11 * m02);\n}\n\n/**\n * Computes the inverse of a 3-by-3 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nconst invert = inverse;\n\n/**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nfunction multiply(a: Mat3Arg, b: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[ 4 + 0];\n const a11 = a[ 4 + 1];\n const a12 = a[ 4 + 2];\n const a20 = a[ 8 + 0];\n const a21 = a[ 8 + 1];\n const a22 = a[ 8 + 2];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b10 = b[ 4 + 0];\n const b11 = b[ 4 + 1];\n const b12 = b[ 4 + 2];\n const b20 = b[ 8 + 0];\n const b21 = b[ 8 + 1];\n const b22 = b[ 8 + 2];\n\n newDst[ 0] = a00 * b00 + a10 * b01 + a20 * b02;\n newDst[ 1] = a01 * b00 + a11 * b01 + a21 * b02;\n newDst[ 2] = a02 * b00 + a12 * b01 + a22 * b02;\n newDst[ 4] = a00 * b10 + a10 * b11 + a20 * b12;\n newDst[ 5] = a01 * b10 + a11 * b11 + a21 * b12;\n newDst[ 6] = a02 * b10 + a12 * b11 + a22 * b12;\n newDst[ 8] = a00 * b20 + a10 * b21 + a20 * b22;\n newDst[ 9] = a01 * b20 + a11 * b21 + a21 * b22;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22;\n\n return newDst;\n}\n\n/**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nconst mul = multiply;\n\n/**\n * Sets the translation component of a 3-by-3 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\nfunction setTranslation(a: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? identity()) as T;\n if (a !== newDst) {\n newDst[ 0] = a[ 0];\n newDst[ 1] = a[ 1];\n newDst[ 2] = a[ 2];\n newDst[ 4] = a[ 4];\n newDst[ 5] = a[ 5];\n newDst[ 6] = a[ 6];\n }\n newDst[ 8] = v[0];\n newDst[ 9] = v[1];\n newDst[10] = 1;\n return newDst;\n}\n\n/**\n * Returns the translation component of a 3-by-3 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\nfunction getTranslation(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec2.create()) as T;\n newDst[0] = m[8];\n newDst[1] = m[9];\n return newDst;\n}\n\n/**\n * Returns an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y,\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat3Arg, axis: number, dst?: T) {\n const newDst = (dst ?? vec2.create()) as T;\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n return newDst;\n}\n\n/**\n * Sets an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\nfunction setAxis(m: Mat3Arg, v: Vec2Arg, axis: number, dst?: T) {\n const newDst = (dst === m ? m : copy(m, dst)) as T;\n\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n return newDst;\n}\n\n/**\n * Returns the \"2d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec2.create());\n\n const xx = m[0];\n const xy = m[1];\n const yx = m[4];\n const yy = m[5];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy);\n newDst[1] = Math.sqrt(yx * yx + yy * yy);\n\n return newDst;\n}\n\n\n/**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction get3DScaling(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec3.create());\n\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which translates by the given vector v.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\nfunction translation(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = v[0]; newDst[ 9] = v[1]; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Translates the given 3-by-3 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\nfunction translate(m: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 0] = m00;\n newDst[ 1] = m01;\n newDst[ 2] = m02;\n newDst[ 4] = m10;\n newDst[ 5] = m11;\n newDst[ 6] = m12;\n }\n\n newDst[ 8] = m00 * v0 + m10 * v1 + m20;\n newDst[ 9] = m01 * v0 + m11 * v1 + m21;\n newDst[10] = m02 * v0 + m12 * v1 + m22;\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotation(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = s; newDst[ 2] = 0;\n newDst[ 4] = -s; newDst[ 5] = c; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix by the given angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotate(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 + s * m10;\n newDst[ 1] = c * m01 + s * m11;\n newDst[ 2] = c * m02 + s * m12;\n\n newDst[ 4] = c * m10 - s * m00;\n newDst[ 5] = c * m11 - s * m01;\n newDst[ 6] = c * m12 - s * m02;\n\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the x-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationX(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = c; newDst[ 6] = s;\n newDst[ 8] = 0; newDst[ 9] = -s; newDst[10] = c;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix around the x-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateX(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[4] = c * m10 + s * m20;\n newDst[5] = c * m11 + s * m21;\n newDst[6] = c * m12 + s * m22;\n newDst[8] = c * m20 - s * m10;\n newDst[9] = c * m21 - s * m11;\n newDst[10] = c * m22 - s * m12;\n\n if (m !== newDst) {\n newDst[ 0] = m[ 0];\n newDst[ 1] = m[ 1];\n newDst[ 2] = m[ 2];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the y-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationY(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = 0; newDst[ 2] = -s;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = s; newDst[ 9] = 0; newDst[10] = c;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix around the y-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateY(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 - s * m20;\n newDst[ 1] = c * m01 - s * m21;\n newDst[ 2] = c * m02 - s * m22;\n newDst[ 8] = c * m20 + s * m00;\n newDst[ 9] = c * m21 + s * m01;\n newDst[10] = c * m22 + s * m02;\n\n if (m !== newDst) {\n newDst[ 4] = m[ 4];\n newDst[ 5] = m[ 5];\n newDst[ 6] = m[ 6];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the z-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nconst rotationZ = rotation;\n\n/**\n * Rotates the given 3-by-3 matrix around the z-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nconst rotateZ = rotate;\n\n/**\n * Creates a 3-by-3 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has two\n * entries.\n * @param v - A vector of\n * 2 entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * two entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of 2 entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale(m: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * 3 entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling3D(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = v[2];\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of 3 entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale3D(m: Mat3Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n\n newDst[ 8] = v2 * m[2 * 4 + 0];\n newDst[ 9] = v2 * m[2 * 4 + 1];\n newDst[10] = v2 * m[2 * 4 + 2];\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales uniformly in the X and Y dimensions\n * @param s - Amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in the X and Y dimension by an amount\n * given.\n * @param m - The matrix to be modified.\n * @param s - Amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale(m: Mat3Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales uniformly in each dimension\n * @param s - Amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling3D(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = s;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given.\n * @param m - The matrix to be modified.\n * @param s - Amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale3D(m: Mat3Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n\n newDst[ 8] = s * m[2 * 4 + 0];\n newDst[ 9] = s * m[2 * 4 + 1];\n newDst[10] = s * m[2 * 4 + 2];\n\n return newDst;\n}\n\nreturn {\n clone,\n create,\n set,\n fromMat4,\n fromQuat,\n negate,\n copy,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n invert,\n determinant,\n mul,\n multiply,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n get3DScaling,\n translation,\n translate,\n rotation,\n rotate,\n rotationX,\n rotateX,\n rotationY,\n rotateY,\n rotationZ,\n rotateZ,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n scaling3D,\n scale3D,\n uniformScaling3D,\n uniformScale3D,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Mat3Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","import { Mat4Arg, Mat4Type } from './mat4';\nimport { Mat3Arg } from './mat3';\nimport { QuatArg } from './quat';\nimport { Vec3Arg } from './vec3';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\nimport * as utils from './utils';\n\nexport { Mat4Arg, Mat4Type };\n\ntype Mat4Ctor = new (n: number) => T;\n\n/**\n * Generates a typed API for Mat4\n * */\nfunction getAPIImpl(Ctor: Mat4Ctor) {\n const vec3 = getVec3API(Ctor);\n\n/**\n * 4x4 Matrix math math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new matrix. In other words you can do this\n *\n * const mat = mat4.translation([1, 2, 3]); // Creates a new translation matrix\n *\n * or\n *\n * const mat = mat4.create();\n * mat4.translation([1, 2, 3], mat); // Puts translation matrix in mat.\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always save to pass any matrix as the destination. So for example\n *\n * const mat = mat4.identity();\n * const trans = mat4.translation([1, 2, 3]);\n * mat4.multiply(mat, trans, mat); // Multiplies mat * trans and puts result in mat.\n *\n */\n\n\n/**\n * Create a Mat4 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat4's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat4.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @returns created from values.\n */\nfunction create(\n v0?: number, v1?: number, v2?: number, v3?: number,\n v4?: number, v5?: number, v6?: number, v7?: number,\n v8?: number, v9?: number, v10?: number, v11?: number,\n v12?: number, v13?: number, v14?: number, v15?: number) {\n const newDst = new Ctor(16);\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[3] = v3;\n if (v4 !== undefined) {\n newDst[4] = v4;\n if (v5 !== undefined) {\n newDst[5] = v5;\n if (v6 !== undefined) {\n newDst[6] = v6;\n if (v7 !== undefined) {\n newDst[7] = v7;\n if (v8 !== undefined) {\n newDst[8] = v8;\n if (v9 !== undefined) {\n newDst[9] = v9;\n if (v10 !== undefined) {\n newDst[10] = v10;\n if (v11 !== undefined) {\n newDst[11] = v11;\n if (v12 !== undefined) {\n newDst[12] = v12;\n if (v13 !== undefined) {\n newDst[13] = v13;\n if (v14 !== undefined) {\n newDst[14] = v14;\n if (v15 !== undefined) {\n newDst[15] = v15;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Sets the values of a Mat4\n * Also see {@link mat4.create} and {@link mat4.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 created from values.\n */\nfunction set(\n v0: number, v1: number, v2: number, v3: number,\n v4: number, v5: number, v6: number, v7: number,\n v8: number, v9: number, v10: number, v11: number,\n v12: number, v13: number, v14: number, v15: number,\n dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = v0; newDst[ 1] = v1; newDst[ 2] = v2; newDst[ 3] = v3;\n newDst[ 4] = v4; newDst[ 5] = v5; newDst[ 6] = v6; newDst[ 7] = v7;\n newDst[ 8] = v8; newDst[ 9] = v9; newDst[10] = v10; newDst[11] = v11;\n newDst[12] = v12; newDst[13] = v13; newDst[14] = v14; newDst[15] = v15;\n\n return newDst;\n}\n\n/**\n * Creates a Mat4 from a Mat3\n * @param m3 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from m3\n */\nfunction fromMat3(m3: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = m3[0]; newDst[ 1] = m3[1]; newDst[ 2] = m3[ 2]; newDst[ 3] = 0;\n newDst[ 4] = m3[4]; newDst[ 5] = m3[5]; newDst[ 6] = m3[ 6]; newDst[ 7] = 0;\n newDst[ 8] = m3[8]; newDst[ 9] = m3[9]; newDst[10] = m3[10]; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a Mat4 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from q\n */\nfunction fromQuat(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3];\n const x2 = x + x; const y2 = y + y; const z2 = z + z;\n\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n newDst[ 0] = 1 - yy - zz; newDst[ 1] = yx + wz; newDst[ 2] = zx - wy; newDst[ 3] = 0;\n newDst[ 4] = yx - wz; newDst[ 5] = 1 - xx - zz; newDst[ 6] = zy + wx; newDst[ 7] = 0;\n newDst[ 8] = zx + wy; newDst[ 9] = zy - wx; newDst[10] = 1 - xx - yy; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\nfunction negate(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = -m[ 0]; newDst[ 1] = -m[ 1]; newDst[ 2] = -m[ 2]; newDst[ 3] = -m[ 3];\n newDst[ 4] = -m[ 4]; newDst[ 5] = -m[ 5]; newDst[ 6] = -m[ 6]; newDst[ 7] = -m[ 7];\n newDst[ 8] = -m[ 8]; newDst[ 9] = -m[ 9]; newDst[10] = -m[10]; newDst[11] = -m[11];\n newDst[12] = -m[12]; newDst[13] = -m[13]; newDst[14] = -m[14]; newDst[15] = -m[15];\n\n return newDst;\n}\n\n/**\n * Copies a matrix. (same as {@link mat4.clone})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nfunction copy(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = m[ 0]; newDst[ 1] = m[ 1]; newDst[ 2] = m[ 2]; newDst[ 3] = m[ 3];\n newDst[ 4] = m[ 4]; newDst[ 5] = m[ 5]; newDst[ 6] = m[ 6]; newDst[ 7] = m[ 7];\n newDst[ 8] = m[ 8]; newDst[ 9] = m[ 9]; newDst[10] = m[10]; newDst[11] = m[11];\n newDst[12] = m[12]; newDst[13] = m[13]; newDst[14] = m[14]; newDst[15] = m[15];\n\n return newDst;\n}\n\n/**\n * Copies a matrix (same as {@link mat4.copy})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nconst clone = copy;\n\n/**\n * Check if 2 matrices are approximately equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are approximately equal\n */\nfunction equalsApproximately(a: Mat4Arg, b: Mat4Arg): boolean {\n return Math.abs(a[ 0] - b[ 0]) < utils.EPSILON &&\n Math.abs(a[ 1] - b[ 1]) < utils.EPSILON &&\n Math.abs(a[ 2] - b[ 2]) < utils.EPSILON &&\n Math.abs(a[ 3] - b[ 3]) < utils.EPSILON &&\n Math.abs(a[ 4] - b[ 4]) < utils.EPSILON &&\n Math.abs(a[ 5] - b[ 5]) < utils.EPSILON &&\n Math.abs(a[ 6] - b[ 6]) < utils.EPSILON &&\n Math.abs(a[ 7] - b[ 7]) < utils.EPSILON &&\n Math.abs(a[ 8] - b[ 8]) < utils.EPSILON &&\n Math.abs(a[ 9] - b[ 9]) < utils.EPSILON &&\n Math.abs(a[10] - b[10]) < utils.EPSILON &&\n Math.abs(a[11] - b[11]) < utils.EPSILON &&\n Math.abs(a[12] - b[12]) < utils.EPSILON &&\n Math.abs(a[13] - b[13]) < utils.EPSILON &&\n Math.abs(a[14] - b[14]) < utils.EPSILON &&\n Math.abs(a[15] - b[15]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 matrices are exactly equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are exactly equal\n */\nfunction equals(a: Mat4Arg, b: Mat4Arg): boolean {\n return a[ 0] === b[ 0] &&\n a[ 1] === b[ 1] &&\n a[ 2] === b[ 2] &&\n a[ 3] === b[ 3] &&\n a[ 4] === b[ 4] &&\n a[ 5] === b[ 5] &&\n a[ 6] === b[ 6] &&\n a[ 7] === b[ 7] &&\n a[ 8] === b[ 8] &&\n a[ 9] === b[ 9] &&\n a[10] === b[10] &&\n a[11] === b[11] &&\n a[12] === b[12] &&\n a[13] === b[13] &&\n a[14] === b[14] &&\n a[15] === b[15];\n}\n\n/**\n * Creates a 4-by-4 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 4-by-4 identity matrix.\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\nfunction transpose(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n if (newDst === m) {\n let t;\n\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n\n t = m[3];\n m[3] = m[12];\n m[12] = t;\n\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n\n t = m[7];\n m[7] = m[13];\n m[13] = t;\n\n t = m[11];\n m[11] = m[14];\n m[14] = t;\n return newDst;\n }\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n newDst[ 0] = m00; newDst[ 1] = m10; newDst[ 2] = m20; newDst[ 3] = m30;\n newDst[ 4] = m01; newDst[ 5] = m11; newDst[ 6] = m21; newDst[ 7] = m31;\n newDst[ 8] = m02; newDst[ 9] = m12; newDst[10] = m22; newDst[11] = m32;\n newDst[12] = m03; newDst[13] = m13; newDst[14] = m23; newDst[15] = m33;\n\n return newDst;\n}\n\n/**\n * Computes the inverse of a 4-by-4 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nfunction inverse(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n const tmp12 = m20 * m31;\n const tmp13 = m30 * m21;\n const tmp14 = m10 * m31;\n const tmp15 = m30 * m11;\n const tmp16 = m10 * m21;\n const tmp17 = m20 * m11;\n const tmp18 = m00 * m31;\n const tmp19 = m30 * m01;\n const tmp20 = m00 * m21;\n const tmp21 = m20 * m01;\n const tmp22 = m00 * m11;\n const tmp23 = m10 * m01;\n\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n\n const d = 1 / (m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3);\n\n newDst[ 0] = d * t0;\n newDst[ 1] = d * t1;\n newDst[ 2] = d * t2;\n newDst[ 3] = d * t3;\n newDst[ 4] = d * ((tmp1 * m10 + tmp2 * m20 + tmp5 * m30) -\n (tmp0 * m10 + tmp3 * m20 + tmp4 * m30));\n newDst[ 5] = d * ((tmp0 * m00 + tmp7 * m20 + tmp8 * m30) -\n (tmp1 * m00 + tmp6 * m20 + tmp9 * m30));\n newDst[ 6] = d * ((tmp3 * m00 + tmp6 * m10 + tmp11 * m30) -\n (tmp2 * m00 + tmp7 * m10 + tmp10 * m30));\n newDst[ 7] = d * ((tmp4 * m00 + tmp9 * m10 + tmp10 * m20) -\n (tmp5 * m00 + tmp8 * m10 + tmp11 * m20));\n newDst[ 8] = d * ((tmp12 * m13 + tmp15 * m23 + tmp16 * m33) -\n (tmp13 * m13 + tmp14 * m23 + tmp17 * m33));\n newDst[ 9] = d * ((tmp13 * m03 + tmp18 * m23 + tmp21 * m33) -\n (tmp12 * m03 + tmp19 * m23 + tmp20 * m33));\n newDst[10] = d * ((tmp14 * m03 + tmp19 * m13 + tmp22 * m33) -\n (tmp15 * m03 + tmp18 * m13 + tmp23 * m33));\n newDst[11] = d * ((tmp17 * m03 + tmp20 * m13 + tmp23 * m23) -\n (tmp16 * m03 + tmp21 * m13 + tmp22 * m23));\n newDst[12] = d * ((tmp14 * m22 + tmp17 * m32 + tmp13 * m12) -\n (tmp16 * m32 + tmp12 * m12 + tmp15 * m22));\n newDst[13] = d * ((tmp20 * m32 + tmp12 * m02 + tmp19 * m22) -\n (tmp18 * m22 + tmp21 * m32 + tmp13 * m02));\n newDst[14] = d * ((tmp18 * m12 + tmp23 * m32 + tmp15 * m02) -\n (tmp22 * m32 + tmp14 * m02 + tmp19 * m12));\n newDst[15] = d * ((tmp22 * m22 + tmp16 * m02 + tmp21 * m12) -\n (tmp20 * m12 + tmp23 * m22 + tmp17 * m02));\n\n return newDst;\n}\n\n/**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\nfunction determinant(m: Mat4Arg): number {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n\n return m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3;\n}\n\n/**\n * Computes the inverse of a 4-by-4 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nconst invert = inverse;\n\n/**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nfunction multiply(a: Mat4Arg, b: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[ 4 + 0];\n const a11 = a[ 4 + 1];\n const a12 = a[ 4 + 2];\n const a13 = a[ 4 + 3];\n const a20 = a[ 8 + 0];\n const a21 = a[ 8 + 1];\n const a22 = a[ 8 + 2];\n const a23 = a[ 8 + 3];\n const a30 = a[12 + 0];\n const a31 = a[12 + 1];\n const a32 = a[12 + 2];\n const a33 = a[12 + 3];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b03 = b[3];\n const b10 = b[ 4 + 0];\n const b11 = b[ 4 + 1];\n const b12 = b[ 4 + 2];\n const b13 = b[ 4 + 3];\n const b20 = b[ 8 + 0];\n const b21 = b[ 8 + 1];\n const b22 = b[ 8 + 2];\n const b23 = b[ 8 + 3];\n const b30 = b[12 + 0];\n const b31 = b[12 + 1];\n const b32 = b[12 + 2];\n const b33 = b[12 + 3];\n\n newDst[ 0] = a00 * b00 + a10 * b01 + a20 * b02 + a30 * b03;\n newDst[ 1] = a01 * b00 + a11 * b01 + a21 * b02 + a31 * b03;\n newDst[ 2] = a02 * b00 + a12 * b01 + a22 * b02 + a32 * b03;\n newDst[ 3] = a03 * b00 + a13 * b01 + a23 * b02 + a33 * b03;\n newDst[ 4] = a00 * b10 + a10 * b11 + a20 * b12 + a30 * b13;\n newDst[ 5] = a01 * b10 + a11 * b11 + a21 * b12 + a31 * b13;\n newDst[ 6] = a02 * b10 + a12 * b11 + a22 * b12 + a32 * b13;\n newDst[ 7] = a03 * b10 + a13 * b11 + a23 * b12 + a33 * b13;\n newDst[ 8] = a00 * b20 + a10 * b21 + a20 * b22 + a30 * b23;\n newDst[ 9] = a01 * b20 + a11 * b21 + a21 * b22 + a31 * b23;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22 + a32 * b23;\n newDst[11] = a03 * b20 + a13 * b21 + a23 * b22 + a33 * b23;\n newDst[12] = a00 * b30 + a10 * b31 + a20 * b32 + a30 * b33;\n newDst[13] = a01 * b30 + a11 * b31 + a21 * b32 + a31 * b33;\n newDst[14] = a02 * b30 + a12 * b31 + a22 * b32 + a32 * b33;\n newDst[15] = a03 * b30 + a13 * b31 + a23 * b32 + a33 * b33;\n\n return newDst;\n}\n\n/**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nconst mul = multiply;\n\n/**\n * Sets the translation component of a 4-by-4 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\nfunction setTranslation(a: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? identity()) as T;\n if (a !== newDst) {\n newDst[ 0] = a[ 0];\n newDst[ 1] = a[ 1];\n newDst[ 2] = a[ 2];\n newDst[ 3] = a[ 3];\n newDst[ 4] = a[ 4];\n newDst[ 5] = a[ 5];\n newDst[ 6] = a[ 6];\n newDst[ 7] = a[ 7];\n newDst[ 8] = a[ 8];\n newDst[ 9] = a[ 9];\n newDst[10] = a[10];\n newDst[11] = a[11];\n }\n newDst[12] = v[0];\n newDst[13] = v[1];\n newDst[14] = v[2];\n newDst[15] = 1;\n return newDst;\n}\n\n///**\n// * Returns the translation component of a 4-by-4 matrix as a vector with 3\n// * entries.\n// * @param m - The matrix.\n// * @param dst - vector to hold result. If not passed a new one is created.\n// * @returns The translation component of m.\n// */\nfunction getTranslation(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? vec3.create()) as T;\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n}\n\n/**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat4Arg, axis: number, dst?: T) {\n const newDst = (dst ?? vec3.create());\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n}\n\n/**\n * Sets an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\nfunction setAxis(m: Mat4Arg, v: Vec3Arg, axis: number, dst: T) {\n const newDst = (dst === m) ? dst : copy(m, dst);\n\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n newDst[off + 2] = v[2];\n return newDst;\n}\n\n/**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? vec3.create()) as T;\n\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 0 to 1 in the z dimension.\n *\n * Note: If you pass `Infinity` for zFar then it will produce a projection matrix\n * returns -Infinity for Z when transforming coordinates with Z <= 0 and +Infinity for Z\n * otherwise.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */\nfunction perspective(fieldOfViewYInRadians: number, aspect: number, zNear: number, zFar: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const f = Math.tan(Math.PI * 0.5 - 0.5 * fieldOfViewYInRadians);\n\n newDst[0] = f / aspect;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n newDst[4] = 0;\n newDst[5] = f;\n newDst[6] = 0;\n newDst[7] = 0;\n\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[11] = -1;\n\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (Number.isFinite(zFar)) {\n const rangeInv = 1 / (zNear - zFar);\n newDst[10] = zFar * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n } else {\n newDst[10] = -1;\n newDst[14] = -zNear;\n }\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 1 (at -zNear) to 0 (at -zFar) in the z dimension.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane. (default = Infinity)\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */function perspectiveReverseZ(fieldOfViewYInRadians: number, aspect: number, zNear: number, zFar = Infinity, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const f = 1 / Math.tan(fieldOfViewYInRadians * 0.5);\n\n newDst[ 0] = f / aspect;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n\n newDst[ 4] = 0;\n newDst[ 5] = f;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n\n newDst[ 8] = 0;\n newDst[ 9] = 0;\n newDst[11] = -1;\n\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (zFar === Infinity) {\n newDst[10] = 0;\n newDst[14] = zNear;\n } else {\n const rangeInv = 1 / (zFar - zNear);\n newDst[10] = zNear * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n }\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 orthogonal transformation matrix that transforms from\n * the given the left, right, bottom, and top dimensions to -1 +1 in x, and y\n * and 0 to +1 in z.\n * @param left - Left side of the near clipping plane viewport.\n * @param right - Right side of the near clipping plane viewport.\n * @param bottom - Bottom of the near clipping plane viewport.\n * @param top - Top of the near clipping plane viewport.\n * @param near - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param far - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The orthographic projection matrix.\n */\nfunction ortho(left: number, right: number, bottom: number, top: number, near: number, far: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[0] = 2 / (right - left);\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n newDst[4] = 0;\n newDst[5] = 2 / (top - bottom);\n newDst[6] = 0;\n newDst[7] = 0;\n\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[10] = 1 / (near - far);\n newDst[11] = 0;\n\n newDst[12] = (right + left) / (left - right);\n newDst[13] = (top + bottom) / (bottom - top);\n newDst[14] = near / (near - far);\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 0 to 1 in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\nfunction frustum(left: number, right: number, bottom: number, top: number, near: number, far: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const dx = (right - left);\n const dy = (top - bottom);\n const dz = (near - far);\n\n newDst[ 0] = 2 * near / dx;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n newDst[ 4] = 0;\n newDst[ 5] = 2 * near / dy;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n newDst[ 8] = (left + right) / dx;\n newDst[ 9] = (top + bottom) / dy;\n newDst[10] = far / dz;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = near * far / dz;\n newDst[15] = 0;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 1 (-near) to 0 (-far) in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\nfunction frustumReverseZ(left: number, right: number, bottom: number, top: number, near: number, far = Infinity, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const dx = (right - left);\n const dy = (top - bottom);\n\n newDst[ 0] = 2 * near / dx;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n newDst[ 4] = 0;\n newDst[ 5] = 2 * near / dy;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n newDst[ 8] = (left + right) / dx;\n newDst[ 9] = (top + bottom) / dy;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (far === Infinity) {\n newDst[10] = 0;\n newDst[14] = near;\n } else {\n const rangeInv = 1 / (far - near);\n newDst[10] = near * rangeInv;\n newDst[14] = far * near * rangeInv;\n }\n\n return newDst;\n}\n\nconst xAxis = vec3.create();\nconst yAxis = vec3.create();\nconst zAxis = vec3.create();\n\n/**\n * Computes a 4-by-4 aim transformation.\n *\n * This is a matrix which positions an object aiming down positive Z.\n * toward the target.\n *\n * Note: this is **NOT** the inverse of lookAt as lookAt looks at negative Z.\n *\n * @param position - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\nfunction aim(position: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(target, position, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = xAxis[1]; newDst[ 2] = xAxis[2]; newDst[ 3] = 0;\n newDst[ 4] = yAxis[0]; newDst[ 5] = yAxis[1]; newDst[ 6] = yAxis[2]; newDst[ 7] = 0;\n newDst[ 8] = zAxis[0]; newDst[ 9] = zAxis[1]; newDst[10] = zAxis[2]; newDst[11] = 0;\n newDst[12] = position[0]; newDst[13] = position[1]; newDst[14] = position[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 camera aim transformation.\n *\n * This is a matrix which positions an object aiming down negative Z.\n * toward the target.\n *\n * Note: this is the inverse of `lookAt`\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\nfunction cameraAim(eye: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = xAxis[1]; newDst[ 2] = xAxis[2]; newDst[ 3] = 0;\n newDst[ 4] = yAxis[0]; newDst[ 5] = yAxis[1]; newDst[ 6] = yAxis[2]; newDst[ 7] = 0;\n newDst[ 8] = zAxis[0]; newDst[ 9] = zAxis[1]; newDst[10] = zAxis[2]; newDst[11] = 0;\n newDst[12] = eye[0]; newDst[13] = eye[1]; newDst[14] = eye[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 view transformation.\n *\n * This is a view matrix which transforms all other objects\n * to be in the space of the view defined by the parameters.\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The look-at matrix.\n */\nfunction lookAt(eye: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = yAxis[0]; newDst[ 2] = zAxis[0]; newDst[ 3] = 0;\n newDst[ 4] = xAxis[1]; newDst[ 5] = yAxis[1]; newDst[ 6] = zAxis[1]; newDst[ 7] = 0;\n newDst[ 8] = xAxis[2]; newDst[ 9] = yAxis[2]; newDst[10] = zAxis[2]; newDst[11] = 0;\n\n newDst[12] = -(xAxis[0] * eye[0] + xAxis[1] * eye[1] + xAxis[2] * eye[2]);\n newDst[13] = -(yAxis[0] * eye[0] + yAxis[1] * eye[1] + yAxis[2] * eye[2]);\n newDst[14] = -(zAxis[0] * eye[0] + zAxis[1] * eye[1] + zAxis[2] * eye[2]);\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which translates by the given vector v.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\nfunction translation(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = v[0]; newDst[13] = v[1]; newDst[14] = v[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Translates the given 4-by-4 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\nfunction translate(m: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n if (m !== newDst) {\n newDst[ 0] = m00;\n newDst[ 1] = m01;\n newDst[ 2] = m02;\n newDst[ 3] = m03;\n newDst[ 4] = m10;\n newDst[ 5] = m11;\n newDst[ 6] = m12;\n newDst[ 7] = m13;\n newDst[ 8] = m20;\n newDst[ 9] = m21;\n newDst[10] = m22;\n newDst[11] = m23;\n }\n\n newDst[12] = m00 * v0 + m10 * v1 + m20 * v2 + m30;\n newDst[13] = m01 * v0 + m11 * v1 + m21 * v2 + m31;\n newDst[14] = m02 * v0 + m12 * v1 + m22 * v2 + m32;\n newDst[15] = m03 * v0 + m13 * v1 + m23 * v2 + m33;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the x-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationX(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = c; newDst[ 6] = s; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = -s; newDst[10] = c; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the x-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateX(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[4] = c * m10 + s * m20;\n newDst[5] = c * m11 + s * m21;\n newDst[6] = c * m12 + s * m22;\n newDst[7] = c * m13 + s * m23;\n newDst[8] = c * m20 - s * m10;\n newDst[9] = c * m21 - s * m11;\n newDst[10] = c * m22 - s * m12;\n newDst[11] = c * m23 - s * m13;\n\n if (m !== newDst) {\n newDst[ 0] = m[ 0];\n newDst[ 1] = m[ 1];\n newDst[ 2] = m[ 2];\n newDst[ 3] = m[ 3];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the y-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationY(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = 0; newDst[ 2] = -s; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = s; newDst[ 9] = 0; newDst[10] = c; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the y-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateY(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 - s * m20;\n newDst[ 1] = c * m01 - s * m21;\n newDst[ 2] = c * m02 - s * m22;\n newDst[ 3] = c * m03 - s * m23;\n newDst[ 8] = c * m20 + s * m00;\n newDst[ 9] = c * m21 + s * m01;\n newDst[10] = c * m22 + s * m02;\n newDst[11] = c * m23 + s * m03;\n\n if (m !== newDst) {\n newDst[ 4] = m[ 4];\n newDst[ 5] = m[ 5];\n newDst[ 6] = m[ 6];\n newDst[ 7] = m[ 7];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the z-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationZ(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = s; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = -s; newDst[ 5] = c; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the z-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateZ(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 + s * m10;\n newDst[ 1] = c * m01 + s * m11;\n newDst[ 2] = c * m02 + s * m12;\n newDst[ 3] = c * m03 + s * m13;\n newDst[ 4] = c * m10 - s * m00;\n newDst[ 5] = c * m11 - s * m01;\n newDst[ 6] = c * m12 - s * m02;\n newDst[ 7] = c * m13 - s * m03;\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n newDst[11] = m[11];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\nfunction axisRotation(axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n\n newDst[ 0] = xx + (1 - xx) * c;\n newDst[ 1] = x * y * oneMinusCosine + z * s;\n newDst[ 2] = x * z * oneMinusCosine - y * s;\n newDst[ 3] = 0;\n newDst[ 4] = x * y * oneMinusCosine - z * s;\n newDst[ 5] = yy + (1 - yy) * c;\n newDst[ 6] = y * z * oneMinusCosine + x * s;\n newDst[ 7] = 0;\n newDst[ 8] = x * z * oneMinusCosine + y * s;\n newDst[ 9] = y * z * oneMinusCosine - x * s;\n newDst[10] = zz + (1 - zz) * c;\n newDst[11] = 0;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = 0;\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle. (same as axisRotation)\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\nconst rotation = axisRotation;\n\n/**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle.\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction axisRotate(m: Mat4Arg, axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n\n const r00 = xx + (1 - xx) * c;\n const r01 = x * y * oneMinusCosine + z * s;\n const r02 = x * z * oneMinusCosine - y * s;\n const r10 = x * y * oneMinusCosine - z * s;\n const r11 = yy + (1 - yy) * c;\n const r12 = y * z * oneMinusCosine + x * s;\n const r20 = x * z * oneMinusCosine + y * s;\n const r21 = y * z * oneMinusCosine - x * s;\n const r22 = zz + (1 - zz) * c;\n\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n\n newDst[ 0] = r00 * m00 + r01 * m10 + r02 * m20;\n newDst[ 1] = r00 * m01 + r01 * m11 + r02 * m21;\n newDst[ 2] = r00 * m02 + r01 * m12 + r02 * m22;\n newDst[ 3] = r00 * m03 + r01 * m13 + r02 * m23;\n newDst[ 4] = r10 * m00 + r11 * m10 + r12 * m20;\n newDst[ 5] = r10 * m01 + r11 * m11 + r12 * m21;\n newDst[ 6] = r10 * m02 + r11 * m12 + r12 * m22;\n newDst[ 7] = r10 * m03 + r11 * m13 + r12 * m23;\n newDst[ 8] = r20 * m00 + r21 * m10 + r22 * m20;\n newDst[ 9] = r20 * m01 + r21 * m11 + r22 * m21;\n newDst[10] = r20 * m02 + r21 * m12 + r22 * m22;\n newDst[11] = r20 * m03 + r21 * m13 + r22 * m23;\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle. (same as rotate)\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nconst rotate = axisRotate;\n\n/**\n * Creates a 4-by-4 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * three entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = v[2]; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 4-by-4 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of three entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale(m: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n newDst[ 3] = v0 * m[0 * 4 + 3];\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n newDst[ 7] = v1 * m[1 * 4 + 3];\n newDst[ 8] = v2 * m[2 * 4 + 0];\n newDst[ 9] = v2 * m[2 * 4 + 1];\n newDst[10] = v2 * m[2 * 4 + 2];\n newDst[11] = v2 * m[2 * 4 + 3];\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which scales a uniform amount in each dimension.\n * @param s - the amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = s; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 4-by-4 matrix in each dimension by a uniform scale.\n * @param m - The matrix to be modified.\n * @param s - The amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale(m: Mat4Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n newDst[ 3] = s * m[0 * 4 + 3];\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n newDst[ 7] = s * m[1 * 4 + 3];\n newDst[ 8] = s * m[2 * 4 + 0];\n newDst[ 9] = s * m[2 * 4 + 1];\n newDst[10] = s * m[2 * 4 + 2];\n newDst[11] = s * m[2 * 4 + 3];\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\nreturn {\n create,\n set,\n fromMat3,\n fromQuat,\n negate,\n copy,\n clone,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n determinant,\n invert,\n multiply,\n mul,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n perspective,\n perspectiveReverseZ,\n ortho,\n frustum,\n frustumReverseZ,\n aim,\n cameraAim,\n lookAt,\n translation,\n translate,\n rotationX,\n rotateX,\n rotationY,\n rotateY,\n rotationZ,\n rotateZ,\n axisRotation,\n rotation,\n axisRotate,\n rotate,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n};\n\n}\n\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Mat4Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { QuatArg, QuatType } from './quat';\nimport { Mat3Arg } from './mat3.js';\nimport { Mat4Arg } from './mat4.js';\nimport { Vec3Arg } from './vec3.js';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\n\nexport { QuatArg, QuatType };\n\ntype QuatCtor = new (n: number) => T;\n\nexport type RotationOrder = 'xyz' | 'xzy' | 'yxz' | 'yzx' | 'zxy' | 'zyx';\n\n/**\n * Generates am typed API for Qud\n * */\nfunction getAPIImpl(Ctor: QuatCtor) {\n const vec3 = getVec3API(Ctor);\n\n/**\n * Creates a quat4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number, w?: number) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a Quat; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Quat\n * Also see {@link quat.create} and {@link quat.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, w: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n\n return newDst;\n}\n\n/**\n * Sets a quaternion from the given angle and axis,\n * then returns it.\n *\n * @param axis - the axis to rotate around\n * @param angleInRadians - the angle\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The quaternion that represents the given axis and angle\n **/\nfunction fromAxisAngle(axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n const s = Math.sin(halfAngle);\n\n newDst[0] = s * axis[0];\n newDst[1] = s * axis[1];\n newDst[2] = s * axis[2];\n newDst[3] = Math.cos(halfAngle);\n\n return newDst;\n}\n\n/**\n * Gets the rotation axis and angle\n * @param q - quaternion to compute from\n * @param dst - Vec3 to hold result. If not passed in a new one is created.\n * @return angle and axis\n */\nfunction toAxisAngle(q: QuatArg, dst?: T): { angle: number, axis: T } {\n const newDst = (dst ?? vec3.create(3)) as T;\n\n const angle = Math.acos(q[3]) * 2;\n const s = Math.sin(angle * 0.5);\n if (s > utils.EPSILON) {\n newDst[0] = q[0] / s;\n newDst[1] = q[1] / s;\n newDst[2] = q[2] / s;\n } else {\n newDst[0] = 1;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n\n return { angle, axis: newDst };\n}\n\n/**\n * Returns the angle in degrees between two rotations a and b.\n * @param a - quaternion a\n * @param b - quaternion b\n * @return angle in radians between the two quaternions\n */\nfunction angle(a: QuatArg, b: QuatArg) {\n const d = dot(a, b);\n return Math.acos(2 * d * d - 1);\n}\n\n/**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction multiply(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const bw = b[3];\n\n newDst[0] = ax * bw + aw * bx + ay * bz - az * by;\n newDst[1] = ay * bw + aw * by + az * bx - ax * bz;\n newDst[2] = az * bw + aw * bz + ax * by - ay * bx;\n newDst[3] = aw * bw - ax * bx - ay * by - az * bz;\n\n return newDst;\n}\n\n/**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nconst mul = multiply;\n\n/**\n * Rotates the given quaternion around the X axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateX(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const bx = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw + qw * bx;\n newDst[1] = qy * bw + qz * bx;\n newDst[2] = qz * bw - qy * bx;\n newDst[3] = qw * bw - qx * bx;\n\n return newDst;\n}\n\n/**\n * Rotates the given quaternion around the Y axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateY(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const by = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw - qz * by;\n newDst[1] = qy * bw + qw * by;\n newDst[2] = qz * bw + qx * by;\n newDst[3] = qw * bw - qy * by;\n\n return newDst;\n}\n\n/**\n * Rotates the given quaternion around the Z axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateZ(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const bz = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw + qy * bz;\n newDst[1] = qy * bw - qx * bz;\n newDst[2] = qz * bw + qw * bz;\n newDst[3] = qw * bw - qz * bz;\n\n return newDst;\n}\n\n/**\n * Spherically linear interpolate between two quaternions\n *\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction slerp(a: QuatArg, b: QuatArg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n\n let bx = b[0];\n let by = b[1];\n let bz = b[2];\n let bw = b[3];\n\n let cosOmega = ax * bx + ay * by + az * bz + aw * bw;\n\n if (cosOmega < 0) {\n cosOmega = -cosOmega;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n\n let scale0;\n let scale1;\n\n if (1.0 - cosOmega > utils.EPSILON) {\n const omega = Math.acos(cosOmega);\n const sinOmega = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinOmega;\n scale1 = Math.sin(t * omega) / sinOmega;\n } else {\n scale0 = 1.0 - t;\n scale1 = t;\n }\n\n newDst[0] = scale0 * ax + scale1 * bx;\n newDst[1] = scale0 * ay + scale1 * by;\n newDst[2] = scale0 * az + scale1 * bz;\n newDst[3] = scale0 * aw + scale1 * bw;\n\n return newDst;\n}\n\n/**\n * Compute the inverse of a quaternion\n *\n * @param q - quaternion to compute the inverse of\n * @returns A quaternion that is the result of a * b\n */\nfunction inverse(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const a0 = q[0];\n const a1 = q[1];\n const a2 = q[2];\n const a3 = q[3];\n\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n\n newDst[0] = -a0 * invDot;\n newDst[1] = -a1 * invDot;\n newDst[2] = -a2 * invDot;\n newDst[3] = a3 * invDot;\n\n return newDst;\n}\n\n/**\n * Compute the conjugate of a quaternion\n * For quaternions with a magnitude of 1 (a unit quaternion)\n * this returns the same as the inverse but is faster to calculate.\n *\n * @param q - quaternion to compute the conjugate of.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The conjugate of q\n */\nfunction conjugate(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = -q[0];\n newDst[1] = -q[1];\n newDst[2] = -q[2];\n newDst[3] = q[3];\n\n return newDst;\n}\n\n/**\n * Creates a quaternion from the given rotation matrix.\n *\n * The created quaternion is not normalized.\n *\n * @param m - rotation matrix\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\nfunction fromMat(m: Mat3Arg | Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n /*\n 0 1 2\n 3 4 5\n 6 7 8\n\n 0 1 2\n 4 5 6\n 8 9 10\n */\n\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n const trace = m[0] + m[5] + m[10];\n\n if (trace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n const root = Math.sqrt(trace + 1); // 2w\n newDst[3] = 0.5 * root;\n const invRoot = 0.5 / root; // 1/(4w)\n\n newDst[0] = (m[6] - m[9]) * invRoot;\n newDst[1] = (m[8] - m[2]) * invRoot;\n newDst[2] = (m[1] - m[4]) * invRoot;\n } else {\n // |w| <= 1/2\n let i = 0;\n\n if (m[5] > m[0]) {\n i = 1;\n }\n if (m[10] > m[i * 4 + i]) {\n i = 2;\n }\n\n const j = (i + 1) % 3;\n const k = (i + 2) % 3;\n\n const root = Math.sqrt(m[i * 4 + i] - m[j * 4 + j] - m[k * 4 + k] + 1.0);\n newDst[i] = 0.5 * root;\n\n const invRoot = 0.5 / root;\n\n newDst[3] = (m[j * 4 + k] - m[k * 4 + j]) * invRoot;\n newDst[j] = (m[j * 4 + i] + m[i * 4 + j]) * invRoot;\n newDst[k] = (m[k * 4 + i] + m[i * 4 + k]) * invRoot;\n }\n\n return newDst;\n}\n\n/**\n * Creates a quaternion from the given euler angle x, y, z using the provided intrinsic order for the conversion.\n *\n * @param xAngleInRadians - angle to rotate around X axis in radians.\n * @param yAngleInRadians - angle to rotate around Y axis in radians.\n * @param zAngleInRadians - angle to rotate around Z axis in radians.\n * @param order - order to apply euler angles\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion representing the same rotation as the euler angles applied in the given order\n */\nfunction fromEuler(\n xAngleInRadians: number,\n yAngleInRadians: number,\n zAngleInRadians: number,\n order: RotationOrder,\n dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const xHalfAngle = xAngleInRadians * 0.5;\n const yHalfAngle = yAngleInRadians * 0.5;\n const zHalfAngle = zAngleInRadians * 0.5;\n\n const sx = Math.sin(xHalfAngle);\n const cx = Math.cos(xHalfAngle);\n const sy = Math.sin(yHalfAngle);\n const cy = Math.cos(yHalfAngle);\n const sz = Math.sin(zHalfAngle);\n const cz = Math.cos(zHalfAngle);\n\n switch (order) {\n case 'xyz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'xzy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n case 'yxz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n case 'yzx':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'zxy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'zyx':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n default:\n throw new Error(`Unknown rotation order: ${order}`);\n }\n\n return newDst;\n}\n\n/**\n * Copies a quaternion. (same as {@link quat.clone})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is a copy of q\n */\nfunction copy(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = q[0];\n newDst[1] = q[1];\n newDst[2] = q[2];\n newDst[3] = q[3];\n\n return newDst;\n}\n\n/**\n * Clones a quaternion. (same as {@link quat.copy})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A copy of q.\n */\nconst clone = copy;\n\n/**\n * Adds two quaternions; assumes a and b have the same dimension.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the sum of a and b.\n */\nfunction add(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\nfunction subtract(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Multiplies a quaternion by a scalar.\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nfunction mulScalar(v: QuatArg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a quaternion by a scalar. (same as mulScalar)\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nfunction divScalar(v: QuatArg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two quaternions\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns dot product\n */\nfunction dot(a: QuatArg, b: QuatArg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n}\n\n/**\n * Performs linear interpolation on two quaternions.\n * Given quaternions a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param t - Interpolation coefficient.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: QuatArg, b: QuatArg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Computes the length of quaternion\n * @param v - quaternion.\n * @returns length of quaternion.\n */\nfunction length(v: QuatArg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n}\n\n/**\n * Computes the length of quaternion (same as length)\n * @param v - quaternion.\n * @returns length of quaternion.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of quaternion\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\nfunction lengthSq(v: QuatArg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n}\n\n/**\n * Computes the square of the length of quaternion (same as lengthSq)\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\nconst lenSq = lengthSq;\n\n/**\n * Divides a quaternion by its Euclidean length and returns the quotient.\n * @param v - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The normalized quaternion.\n */\nfunction normalize(v: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n }\n\n return newDst;\n}\n\n/**\n * Check if 2 quaternions are approximately equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are approximately equal\n */\nfunction equalsApproximately(a: QuatArg, b: QuatArg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON &&\n Math.abs(a[3] - b[3]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 quaternions are exactly equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are exactly equal\n */\nfunction equals(a: QuatArg, b: QuatArg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Creates an identity quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns an identity quaternion\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n\n return newDst;\n}\n\nconst tempVec3 = vec3.create();\nconst xUnitVec3 = vec3.create();\nconst yUnitVec3 = vec3.create();\n\n/**\n * Computes a quaternion to represent the shortest rotation from one vector to another.\n *\n * @param aUnit - the start vector\n * @param bUnit - the end vector\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\nfunction rotationTo(aUnit: Vec3Arg, bUnit: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const dot = vec3.dot(aUnit, bUnit);\n if (dot < -0.999999) {\n vec3.cross(xUnitVec3, aUnit, tempVec3);\n if (vec3.len(tempVec3) < 0.000001) {\n vec3.cross(yUnitVec3, aUnit, tempVec3);\n }\n\n vec3.normalize(tempVec3, tempVec3);\n fromAxisAngle(tempVec3, Math.PI, newDst);\n\n return newDst;\n } else if (dot > 0.999999) {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n\n return newDst;\n } else {\n vec3.cross(aUnit, bUnit, tempVec3);\n\n newDst[0] = tempVec3[0];\n newDst[1] = tempVec3[1];\n newDst[2] = tempVec3[2];\n newDst[3] = 1 + dot;\n\n return normalize(newDst, newDst);\n }\n}\n\nconst tempQuat1 = new Ctor(4);\nconst tempQuat2 = new Ctor(4);\n\n/**\n * Performs a spherical linear interpolation with two control points\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param c - the third quaternion\n * @param d - the fourth quaternion\n * @param t - Interpolation coefficient 0 to 1\n * @returns result\n */\nfunction sqlerp(\n a: QuatArg,\n b: QuatArg,\n c: QuatArg,\n d: QuatArg,\n t: number,\n dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n slerp(a, d, t, tempQuat1);\n slerp(b, c, t, tempQuat2);\n slerp(tempQuat1, tempQuat2, 2 * t * (1 - t), newDst);\n\n return newDst;\n}\n\nreturn {\n create,\n fromValues,\n set,\n fromAxisAngle,\n toAxisAngle,\n angle,\n multiply,\n mul,\n rotateX,\n rotateY,\n rotateZ,\n slerp,\n inverse,\n conjugate,\n fromMat,\n fromEuler,\n copy,\n clone,\n add,\n subtract,\n sub,\n mulScalar,\n scale,\n divScalar,\n dot,\n lerp,\n length,\n len,\n lengthSq,\n lenSq,\n normalize,\n equalsApproximately,\n equals,\n identity,\n rotationTo,\n sqlerp,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\n/**\n *\n * Quat4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Quat4`. In other words you can do this\n *\n * const v = quat4.cross(v1, v2); // Creates a new Quat4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = quat4.create();\n * quat4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * quat4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nexport function getAPI(Ctor: QuatCtor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Vec4Arg, Vec4Type } from './vec4';\nimport { Mat4Arg } from './mat4';\nimport { BaseArgType } from './types';\n\nexport { Vec4Arg, Vec4Type };\n\ntype Vec4Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec4\n * */\nfunction getAPIImpl(Ctor: Vec4Ctor) {\n\n/**\n * Creates a vec4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number, w?: number) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a vec4; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec4\n * Also see {@link vec4.create} and {@link vec4.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, w: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n newDst[3] = Math.ceil(v[3]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n newDst[3] = Math.floor(v[3]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n newDst[3] = Math.round(v[3]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec4Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n newDst[3] = Math.min(max, Math.max(min, v[3]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec4Arg, b: Vec4Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n newDst[3] = a[3] + b[3] * scale;\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec4Arg, b: Vec4Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON &&\n Math.abs(a[3] - b[3]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec4Arg, b: Vec4Arg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec4Arg, b: Vec4Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec4Arg, b: Vec4Arg, t: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n newDst[3] = a[3] + t[3] * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n newDst[3] = Math.max(a[3], b[3]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n newDst[3] = Math.min(a[3], b[3]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec4Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec4Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n newDst[3] = 1 / v[3];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the dot product of two vectors\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec4Arg, b: Vec4Arg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec4Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec4Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec4Arg, b: Vec4Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec4Arg, b: Vec4Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return dx * dx + dy * dy + dz * dz + dw * dw;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n }\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n newDst[3] = -v[3];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec4.clone})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n newDst[3] = v[3];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec4.copy})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n newDst[3] = a[3] * b[3];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n newDst[3] = a[3] / b[3];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform vec4 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec4 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec4Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = v[3];\n\n newDst[0] = m[0] * x + m[4] * y + m[ 8] * z + m[12] * w;\n newDst[1] = m[1] * x + m[5] * y + m[ 9] * z + m[13] * w;\n newDst[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n newDst[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n\n return newDst;\n}\n\n\n/**\n * Treat a 4D vector as a direction and set it's length\n *\n * @param a The vec4 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec4Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec4 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec4Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n zero,\n transformMat4,\n setLength,\n truncate,\n midpoint,\n};\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\n/**\n *\n * Vec4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Vec4`. In other words you can do this\n *\n * const v = vec4.cross(v1, v2); // Creates a new Vec4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = vec4.create();\n * vec4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * vec4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nexport function getAPI(Ctor: Vec4Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n\n","/**\n * Some docs\n * @namespace wgpu-matrix\n */\nimport {BaseArgType, ZeroArray} from './types';\nimport {Mat3Arg, Mat3Type, getAPI as getMat3API} from './mat3-impl';\nimport {Mat4Arg, Mat4Type, getAPI as getMat4API} from './mat4-impl';\nimport {QuatArg, QuatType, getAPI as getQuatAPI, RotationOrder} from './quat-impl';\nimport {Vec2Arg, Vec2Type, getAPI as getVec2API} from './vec2-impl';\nimport {Vec3Arg, Vec3Type, getAPI as getVec3API} from './vec3-impl';\nimport {Vec4Arg, Vec4Type, getAPI as getVec4API} from './vec4-impl';\nimport * as utils from './utils';\n\nexport {\n RotationOrder,\n utils,\n\n BaseArgType,\n\n Mat3Arg,\n Mat4Arg,\n QuatArg,\n Vec2Arg,\n Vec3Arg,\n Vec4Arg,\n\n Mat3Type,\n Mat4Type,\n QuatType,\n Vec2Type,\n Vec3Type,\n Vec4Type,\n};\n\nexport type BaseCtor = new (n: number) => T;\n\nexport type Mat3 = Mat3Type;\nexport type Mat4 = Mat4Type;\nexport type Quat = QuatType;\nexport type Vec2 = Vec2Type;\nexport type Vec3 = Vec3Type;\nexport type Vec4 = Vec4Type;\n\nexport type Mat3d = Mat3Type;\nexport type Mat4d = Mat4Type;\nexport type Quatd = QuatType;\nexport type Vec2d = Vec2Type;\nexport type Vec3d = Vec3Type;\nexport type Vec4d = Vec4Type;\n\nexport type Mat3n = Mat3Type;\nexport type Mat4n = Mat4Type;\nexport type Quatn = QuatType;\nexport type Vec2n = Vec2Type;\nexport type Vec3n = Vec3Type;\nexport type Vec4n = Vec4Type;\n\n/**\n * Generate wgpu-matrix API for type\n */\nfunction wgpuMatrixAPI<\n Mat3 extends BaseArgType,\n Mat4 extends BaseArgType,\n Quat extends BaseArgType,\n Vec2 extends BaseArgType,\n Vec3 extends BaseArgType,\n Vec4 extends BaseArgType,\n>(\n Mat3Ctor: BaseCtor,\n Mat4Ctor: BaseCtor,\n QuatCtor: BaseCtor,\n Vec2Ctor: BaseCtor,\n Vec3Ctor: BaseCtor,\n Vec4Ctor: BaseCtor,\n) {\n return {\n /** @namespace mat3 */\n mat3: getMat3API(Mat3Ctor),\n /** @namespace mat4 */\n mat4: getMat4API(Mat4Ctor),\n /** @namespace quat */\n quat: getQuatAPI(QuatCtor),\n /** @namespace vec2 */\n vec2: getVec2API(Vec2Ctor),\n /** @namespace vec3 */\n vec3: getVec3API(Vec3Ctor),\n /** @namespace vec4 */\n vec4: getVec4API(Vec4Ctor),\n };\n}\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat3,\n /**\n * 4x4 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat4,\n /**\n * Quaternion functions that default to returning `Float32Array`\n * @namespace\n */\n quat,\n /**\n * Vec2 functions that default to returning `Float32Array`\n * @namespace\n */\n vec2,\n /**\n * Vec3 functions that default to returning `Float32Array`\n * @namespace\n */\n vec3,\n /**\n * Vec3 functions that default to returning `Float32Array`\n * @namespace\n */\n vec4,\n} = wgpuMatrixAPI<\n Mat3, Mat4, Quat, Vec2, Vec3, Vec4>(\n Float32Array, Float32Array, Float32Array, Float32Array, Float32Array, Float32Array);\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat3: mat3d,\n /**\n * 4x4 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat4: mat4d,\n /**\n * Quaternion functions that default to returning `Float64Array`\n * @namespace\n */\n quat: quatd,\n /**\n * Vec2 functions that default to returning `Float64Array`\n * @namespace\n */\n vec2: vec2d,\n /**\n * Vec3 functions that default to returning `Float64Array`\n * @namespace\n */\n vec3: vec3d,\n /**\n * Vec3 functions that default to returning `Float64Array`\n * @namespace\n */\n vec4: vec4d,\n} = wgpuMatrixAPI<\n Mat3d, Mat4d, Quatd, Vec2d, Vec3d, Vec4d>(\n Float64Array, Float64Array, Float64Array, Float64Array, Float64Array, Float64Array);\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat3: mat3n,\n /**\n * 4x4 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat4: mat4n,\n /**\n * Quaternion functions that default to returning `number[]`\n * @namespace\n */\n quat: quatn,\n /**\n * Vec2 functions that default to returning `number[]`\n * @namespace\n */\n vec2: vec2n,\n /**\n * Vec3 functions that default to returning `number[]`\n * @namespace\n */\n vec3: vec3n,\n /**\n * Vec3 functions that default to returning `number[]`\n * @namespace\n */\n vec4: vec4n,\n} = wgpuMatrixAPI<\n Mat3n, Mat4n, Quatn, Vec2n, Vec3n, Vec4n>(\n ZeroArray, Array, Array, Array, Array, Array);\n"],"names":["getAPIImpl","utils.EPSILON","cache","getAPI","getVec2API","getVec3API","getMat3API","getMat4API","getQuatAPI","getVec4API"],"mappings":";;;;;;;IAMA,SAAS,eAAe,CACtB,mBAAsB,EACtB,QAA6C,EAAA;QAE7C,OAAO,cAAc,mBAAmB,CAAA;IACtC,QAAA,WAAA,CAAY,GAAG,IAAW,EAAA;IACxB,YAAA,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;gBACf,QAAQ,CAAC,IAAuB,CAAC,CAAC;aACnC;IACG,KAAA,CAAC;IACT,CAAC;IAEM,MAAM,SAAS,GAAG,eAAe,EAAC,KAAa,GAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;;IClBvE;;;;;;;;;;;;;;;;;;;;IAoBG;IAEI,IAAI,OAAO,GAAG,QAAQ,CAAC;IAE9B;;;;IAIG;IACG,SAAU,UAAU,CAAC,CAAS,EAAA;QAClC,MAAM,GAAG,GAAG,OAAO,CAAC;QACpB,OAAO,GAAG,CAAC,CAAC;IACZ,IAAA,OAAO,GAAG,CAAC;IACb,CAAC;IAED;;;;IAIG;IACG,SAAU,QAAQ,CAAC,OAAe,EAAA;IACtC,IAAA,OAAO,OAAO,GAAG,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC;IACjC,CAAC;IAED;;;;IAIG;IACG,SAAU,QAAQ,CAAC,OAAe,EAAA;IACtC,IAAA,OAAO,OAAO,GAAG,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC;IACjC,CAAC;IAED;;;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Y,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE;AAE3E,UAAA;IACX;;;IAGG;IACH,IAAI,EAAE,KAAK;IACX;;;IAGG;IACH,IAAI,EAAE,KAAK;IACX;;;IAGG;IACH,IAAI,EAAE,KAAK;IACX;;;IAGG;IACH,IAAI,EAAE,KAAK;IACX;;;IAGG;IACH,IAAI,EAAE,KAAK;IACX;;;IAGG;IACH,IAAI,EAAE,KAAK,GACZ,GAAG,aAAa,CAEb,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/3.x/wgpu-matrix.min.js b/dist/3.x/wgpu-matrix.min.js index 46565a0..8335b69 100644 --- a/dist/3.x/wgpu-matrix.min.js +++ b/dist/3.x/wgpu-matrix.min.js @@ -1,2 +1,2 @@ -!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n="undefined"!=typeof globalThis?globalThis:n||self).wgpuMatrix={})}(this,(function(n){"use strict";const t=(e=Array,r=n=>n.fill(0),class extends e{constructor(...n){super(...n),r(this)}});var e,r;let o=1e-6;var c={__proto__:null,get EPSILON(){return o},degToRad:function(n){return n*Math.PI/180},euclideanModulo:function(n,t){return(n%t+t)%t},inverseLerp:function(n,t,e){const r=t-n;return Math.abs(t-n)1e-5?(r[0]=o/u,r[1]=c/u):(r[0]=0,r[1]=0),r}function l(t,e){const r=e??new n(2);return r[0]=t[0],r[1]=t[1],r}function w(t,e,r){const o=r??new n(2);return o[0]=t[0]*e[0],o[1]=t[1]*e[1],o}function m(t,e,r){const o=r??new n(2);return o[0]=t[0]/e[0],o[1]=t[1]/e[1],o}function d(t,e,r){const o=r??new n(2);return M(t,o),c(o,e,o)}return{create:t,fromValues:t,set:function(t,e,r){const o=r??new n(2);return o[0]=t,o[1]=e,o},ceil:function(t,e){const r=e??new n(2);return r[0]=Math.ceil(t[0]),r[1]=Math.ceil(t[1]),r},floor:function(t,e){const r=e??new n(2);return r[0]=Math.floor(t[0]),r[1]=Math.floor(t[1]),r},round:function(t,e){const r=e??new n(2);return r[0]=Math.round(t[0]),r[1]=Math.round(t[1]),r},clamp:function(t,e=0,r=1,o){const c=o??new n(2);return c[0]=Math.min(r,Math.max(e,t[0])),c[1]=Math.min(r,Math.max(e,t[1])),c},add:function(t,e,r){const o=r??new n(2);return o[0]=t[0]+e[0],o[1]=t[1]+e[1],o},addScaled:function(t,e,r,o){const c=o??new n(2);return c[0]=t[0]+e[0]*r,c[1]=t[1]+e[1]*r,c},angle:function(n,t){const e=n[0],r=n[1],o=t[0],c=t[1],u=Math.sqrt(e*e+r*r)*Math.sqrt(o*o+c*c),s=u&&a(n,t)/u;return Math.acos(s)},subtract:e,sub:e,equalsApproximately:function(n,t){return Math.abs(n[0]-t[0])e?d(t,e,o):l(t,o)},midpoint:function(t,e,o){return r(t,e,.5,o??new n(2))}}}(n),u.set(n,t)),t}const s=new Map;function i(n){let t=s.get(n);return t||(t=function(n){function t(t,e,r){const o=new n(3);return void 0!==t&&(o[0]=t,void 0!==e&&(o[1]=e,void 0!==r&&(o[2]=r))),o}function e(t,e,r){const o=r??new n(3);return o[0]=t[0]-e[0],o[1]=t[1]-e[1],o[2]=t[2]-e[2],o}function r(t,e,r,o){const c=o??new n(3);return c[0]=t[0]+r*(e[0]-t[0]),c[1]=t[1]+r*(e[1]-t[1]),c[2]=t[2]+r*(e[2]-t[2]),c}function c(t,e,r){const o=r??new n(3);return o[0]=t[0]*e,o[1]=t[1]*e,o[2]=t[2]*e,o}function u(t,e){const r=e??new n(3);return r[0]=1/t[0],r[1]=1/t[1],r[2]=1/t[2],r}function a(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function s(n){const t=n[0],e=n[1],r=n[2];return Math.sqrt(t*t+e*e+r*r)}function i(n){const t=n[0],e=n[1],r=n[2];return t*t+e*e+r*r}function f(n,t){const e=n[0]-t[0],r=n[1]-t[1],o=n[2]-t[2];return Math.sqrt(e*e+r*r+o*o)}function h(n,t){const e=n[0]-t[0],r=n[1]-t[1],o=n[2]-t[2];return e*e+r*r+o*o}function M(t,e){const r=e??new n(3),o=t[0],c=t[1],u=t[2],a=Math.sqrt(o*o+c*c+u*u);return a>1e-5?(r[0]=o/a,r[1]=c/a,r[2]=u/a):(r[0]=0,r[1]=0,r[2]=0),r}function l(t,e){const r=e??new n(3);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r}function w(t,e,r){const o=r??new n(3);return o[0]=t[0]*e[0],o[1]=t[1]*e[1],o[2]=t[2]*e[2],o}function m(t,e,r){const o=r??new n(3);return o[0]=t[0]/e[0],o[1]=t[1]/e[1],o[2]=t[2]/e[2],o}function d(t,e,r){const o=r??new n(3);return M(t,o),c(o,e,o)}return{create:t,fromValues:t,set:function(t,e,r,o){const c=o??new n(3);return c[0]=t,c[1]=e,c[2]=r,c},ceil:function(t,e){const r=e??new n(3);return r[0]=Math.ceil(t[0]),r[1]=Math.ceil(t[1]),r[2]=Math.ceil(t[2]),r},floor:function(t,e){const r=e??new n(3);return r[0]=Math.floor(t[0]),r[1]=Math.floor(t[1]),r[2]=Math.floor(t[2]),r},round:function(t,e){const r=e??new n(3);return r[0]=Math.round(t[0]),r[1]=Math.round(t[1]),r[2]=Math.round(t[2]),r},clamp:function(t,e=0,r=1,o){const c=o??new n(3);return c[0]=Math.min(r,Math.max(e,t[0])),c[1]=Math.min(r,Math.max(e,t[1])),c[2]=Math.min(r,Math.max(e,t[2])),c},add:function(t,e,r){const o=r??new n(3);return o[0]=t[0]+e[0],o[1]=t[1]+e[1],o[2]=t[2]+e[2],o},addScaled:function(t,e,r,o){const c=o??new n(3);return c[0]=t[0]+e[0]*r,c[1]=t[1]+e[1]*r,c[2]=t[2]+e[2]*r,c},angle:function(n,t){const e=n[0],r=n[1],o=n[2],c=t[0],u=t[1],s=t[2],i=Math.sqrt(e*e+r*r+o*o)*Math.sqrt(c*c+u*u+s*s),f=i&&a(n,t)/i;return Math.acos(f)},subtract:e,sub:e,equalsApproximately:function(n,t){return Math.abs(n[0]-t[0])e?d(t,e,o):l(t,o)},midpoint:function(t,e,o){return r(t,e,.5,o??new n(3))}}}(n),s.set(n,t)),t}const f=new Map;function h(n){let t=f.get(n);return t||(t=function(n){const t=a(n),e=i(n);function r(t,e){const r=e??new n(12);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[8]=t[8],r[9]=t[9],r[10]=t[10],r}function c(t){const e=t??new n(12);return e[0]=1,e[1]=0,e[2]=0,e[4]=0,e[5]=1,e[6]=0,e[8]=0,e[9]=0,e[10]=1,e}function u(t,e){const r=e??new n(12),o=t[0],c=t[1],u=t[2],a=t[4],s=t[5],i=t[6],f=t[8],h=t[9],M=t[10],l=M*s-i*h,w=-M*a+i*f,m=h*a-s*f,d=1/(o*l+c*w+u*m);return r[0]=l*d,r[1]=(-M*c+u*h)*d,r[2]=(i*c-u*s)*d,r[4]=w*d,r[5]=(M*o-u*f)*d,r[6]=(-i*o+u*a)*d,r[8]=m*d,r[9]=(-h*o+c*f)*d,r[10]=(s*o-c*a)*d,r}function s(t,e,r){const o=r??new n(12),c=t[0],u=t[1],a=t[2],s=t[4],i=t[5],f=t[6],h=t[8],M=t[9],l=t[10],w=e[0],m=e[1],d=e[2],v=e[4],p=e[5],q=e[6],b=e[8],g=e[9],x=e[10];return o[0]=c*w+s*m+h*d,o[1]=u*w+i*m+M*d,o[2]=a*w+f*m+l*d,o[4]=c*v+s*p+h*q,o[5]=u*v+i*p+M*q,o[6]=a*v+f*p+l*q,o[8]=c*b+s*g+h*x,o[9]=u*b+i*g+M*x,o[10]=a*b+f*g+l*x,o}return{clone:r,create:function(t,e,r,o,c,u,a,s,i){const f=new n(12);return f[3]=0,f[7]=0,f[11]=0,void 0!==t&&(f[0]=t,void 0!==e&&(f[1]=e,void 0!==r&&(f[2]=r,void 0!==o&&(f[4]=o,void 0!==c&&(f[5]=c,void 0!==u&&(f[6]=u,void 0!==a&&(f[8]=a,void 0!==s&&(f[9]=s,void 0!==i&&(f[10]=i))))))))),f},set:function(t,e,r,o,c,u,a,s,i,f){const h=f??new n(12);return h[0]=t,h[1]=e,h[2]=r,h[3]=0,h[4]=o,h[5]=c,h[6]=u,h[7]=0,h[8]=a,h[9]=s,h[10]=i,h[11]=0,h},fromMat4:function(t,e){const r=e??new n(12);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=0,r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=0,r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=0,r},fromQuat:function(t,e){const r=e??new n(12),o=t[0],c=t[1],u=t[2],a=t[3],s=o+o,i=c+c,f=u+u,h=o*s,M=c*s,l=c*i,w=u*s,m=u*i,d=u*f,v=a*s,p=a*i,q=a*f;return r[0]=1-l-d,r[1]=M+q,r[2]=w-p,r[3]=0,r[4]=M-q,r[5]=1-h-d,r[6]=m+v,r[7]=0,r[8]=w+p,r[9]=m-v,r[10]=1-h-l,r[11]=0,r},negate:function(t,e){const r=e??new n(12);return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[4]=-t[4],r[5]=-t[5],r[6]=-t[6],r[8]=-t[8],r[9]=-t[9],r[10]=-t[10],r},copy:r,equalsApproximately:function(n,t){return Math.abs(n[0]-t[0])o){const n=Math.acos(v),t=Math.sin(n);h=Math.sin((1-r)*n)/t,M=Math.sin(r*n)/t}else h=1-r,M=r;return u[0]=h*a+M*l,u[1]=h*s+M*w,u[2]=h*i+M*m,u[3]=h*f+M*d,u}function f(t,e){const r=e??new n(4);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r}const h=f;function M(t,e,r){const o=r??new n(4);return o[0]=t[0]-e[0],o[1]=t[1]-e[1],o[2]=t[2]-e[2],o[3]=t[3]-e[3],o}const l=M;function w(t,e,r){const o=r??new n(4);return o[0]=t[0]*e,o[1]=t[1]*e,o[2]=t[2]*e,o[3]=t[3]*e,o}const m=w;function d(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3]}function v(n){const t=n[0],e=n[1],r=n[2],o=n[3];return Math.sqrt(t*t+e*e+r*r+o*o)}const p=v;function q(n){const t=n[0],e=n[1],r=n[2],o=n[3];return t*t+e*e+r*r+o*o}const b=q;function g(t,e){const r=e??new n(4),o=t[0],c=t[1],u=t[2],a=t[3],s=Math.sqrt(o*o+c*c+u*u+a*a);return s>1e-5?(r[0]=o/s,r[1]=c/s,r[2]=u/s,r[3]=a/s):(r[0]=0,r[1]=0,r[2]=0,r[3]=1),r}const x=t.create(),y=t.create(),A=t.create(),S=new n(4),z=new n(4);return{create:e,fromValues:r,set:function(t,e,r,o,c){const u=c??new n(4);return u[0]=t,u[1]=e,u[2]=r,u[3]=o,u},fromAxisAngle:c,toAxisAngle:function(n,e){const r=e??t.create(3),c=2*Math.acos(n[3]),u=Math.sin(.5*c);return u>o?(r[0]=n[0]/u,r[1]=n[1]/u,r[2]=n[2]/u):(r[0]=1,r[1]=0,r[2]=0),{angle:c,axis:r}},angle:function(n,t){const e=d(n,t);return Math.acos(2*e*e-1)},multiply:u,mul:a,rotateX:function(t,e,r){const o=r??new n(4),c=.5*e,u=t[0],a=t[1],s=t[2],i=t[3],f=Math.sin(c),h=Math.cos(c);return o[0]=u*h+i*f,o[1]=a*h+s*f,o[2]=s*h-a*f,o[3]=i*h-u*f,o},rotateY:function(t,e,r){const o=r??new n(4),c=.5*e,u=t[0],a=t[1],s=t[2],i=t[3],f=Math.sin(c),h=Math.cos(c);return o[0]=u*h-s*f,o[1]=a*h+i*f,o[2]=s*h+u*f,o[3]=i*h-a*f,o},rotateZ:function(t,e,r){const o=r??new n(4),c=.5*e,u=t[0],a=t[1],s=t[2],i=t[3],f=Math.sin(c),h=Math.cos(c);return o[0]=u*h+a*f,o[1]=a*h-u*f,o[2]=s*h+i*f,o[3]=i*h-s*f,o},slerp:s,inverse:function(t,e){const r=e??new n(4),o=t[0],c=t[1],u=t[2],a=t[3],s=o*o+c*c+u*u+a*a,i=s?1/s:0;return r[0]=-o*i,r[1]=-c*i,r[2]=-u*i,r[3]=a*i,r},conjugate:function(t,e){const r=e??new n(4);return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[3]=t[3],r},fromMat:function(t,e){const r=e??new n(4),o=t[0]+t[5]+t[10];if(o>0){const n=Math.sqrt(o+1);r[3]=.5*n;const e=.5/n;r[0]=(t[6]-t[9])*e,r[1]=(t[8]-t[2])*e,r[2]=(t[1]-t[4])*e}else{let n=0;t[5]>t[0]&&(n=1),t[10]>t[4*n+n]&&(n=2);const e=(n+1)%3,o=(n+2)%3,c=Math.sqrt(t[4*n+n]-t[4*e+e]-t[4*o+o]+1);r[n]=.5*c;const u=.5/c;r[3]=(t[4*e+o]-t[4*o+e])*u,r[e]=(t[4*e+n]+t[4*n+e])*u,r[o]=(t[4*o+n]+t[4*n+o])*u}return r},fromEuler:function(t,e,r,o,c){const u=c??new n(4),a=.5*t,s=.5*e,i=.5*r,f=Math.sin(a),h=Math.cos(a),M=Math.sin(s),l=Math.cos(s),w=Math.sin(i),m=Math.cos(i);switch(o){case"xyz":u[0]=f*l*m+h*M*w,u[1]=h*M*m-f*l*w,u[2]=h*l*w+f*M*m,u[3]=h*l*m-f*M*w;break;case"xzy":u[0]=f*l*m-h*M*w,u[1]=h*M*m-f*l*w,u[2]=h*l*w+f*M*m,u[3]=h*l*m+f*M*w;break;case"yxz":u[0]=f*l*m+h*M*w,u[1]=h*M*m-f*l*w,u[2]=h*l*w-f*M*m,u[3]=h*l*m+f*M*w;break;case"yzx":u[0]=f*l*m+h*M*w,u[1]=h*M*m+f*l*w,u[2]=h*l*w-f*M*m,u[3]=h*l*m-f*M*w;break;case"zxy":u[0]=f*l*m-h*M*w,u[1]=h*M*m+f*l*w,u[2]=h*l*w+f*M*m,u[3]=h*l*m-f*M*w;break;case"zyx":u[0]=f*l*m-h*M*w,u[1]=h*M*m+f*l*w,u[2]=h*l*w-f*M*m,u[3]=h*l*m+f*M*w;break;default:throw new Error(`Unknown rotation order: ${o}`)}return u},copy:f,clone:h,add:function(t,e,r){const o=r??new n(4);return o[0]=t[0]+e[0],o[1]=t[1]+e[1],o[2]=t[2]+e[2],o[3]=t[3]+e[3],o},subtract:M,sub:l,mulScalar:w,scale:m,divScalar:function(t,e,r){const o=r??new n(4);return o[0]=t[0]/e,o[1]=t[1]/e,o[2]=t[2]/e,o[3]=t[3]/e,o},dot:d,lerp:function(t,e,r,o){const c=o??new n(4);return c[0]=t[0]+r*(e[0]-t[0]),c[1]=t[1]+r*(e[1]-t[1]),c[2]=t[2]+r*(e[2]-t[2]),c[3]=t[3]+r*(e[3]-t[3]),c},length:v,len:p,lengthSq:q,lenSq:b,normalize:g,equalsApproximately:function(n,t){return Math.abs(n[0]-t[0]).999999?(u[0]=0,u[1]=0,u[2]=0,u[3]=1,u):(t.cross(e,r,x),u[0]=x[0],u[1]=x[1],u[2]=x[2],u[3]=1+a,g(u,u))},sqlerp:function(t,e,r,o,c,u){const a=u??new n(4);return s(t,o,c,S),s(e,r,c,z),s(S,z,2*c*(1-c),a),a}}}(n),w.set(n,t)),t}const d=new Map;function v(n){let t=d.get(n);return t||(t=function(n){function t(t,e,r,o){const c=new n(4);return void 0!==t&&(c[0]=t,void 0!==e&&(c[1]=e,void 0!==r&&(c[2]=r,void 0!==o&&(c[3]=o)))),c}function e(t,e,r){const o=r??new n(4);return o[0]=t[0]-e[0],o[1]=t[1]-e[1],o[2]=t[2]-e[2],o[3]=t[3]-e[3],o}function r(t,e,r,o){const c=o??new n(4);return c[0]=t[0]+r*(e[0]-t[0]),c[1]=t[1]+r*(e[1]-t[1]),c[2]=t[2]+r*(e[2]-t[2]),c[3]=t[3]+r*(e[3]-t[3]),c}function c(t,e,r){const o=r??new n(4);return o[0]=t[0]*e,o[1]=t[1]*e,o[2]=t[2]*e,o[3]=t[3]*e,o}function u(t,e){const r=e??new n(4);return r[0]=1/t[0],r[1]=1/t[1],r[2]=1/t[2],r[3]=1/t[3],r}function a(n){const t=n[0],e=n[1],r=n[2],o=n[3];return Math.sqrt(t*t+e*e+r*r+o*o)}function s(n){const t=n[0],e=n[1],r=n[2],o=n[3];return t*t+e*e+r*r+o*o}function i(n,t){const e=n[0]-t[0],r=n[1]-t[1],o=n[2]-t[2],c=n[3]-t[3];return Math.sqrt(e*e+r*r+o*o+c*c)}function f(n,t){const e=n[0]-t[0],r=n[1]-t[1],o=n[2]-t[2],c=n[3]-t[3];return e*e+r*r+o*o+c*c}function h(t,e){const r=e??new n(4),o=t[0],c=t[1],u=t[2],a=t[3],s=Math.sqrt(o*o+c*c+u*u+a*a);return s>1e-5?(r[0]=o/s,r[1]=c/s,r[2]=u/s,r[3]=a/s):(r[0]=0,r[1]=0,r[2]=0,r[3]=0),r}function M(t,e){const r=e??new n(4);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r}function l(t,e,r){const o=r??new n(4);return o[0]=t[0]*e[0],o[1]=t[1]*e[1],o[2]=t[2]*e[2],o[3]=t[3]*e[3],o}function w(t,e,r){const o=r??new n(4);return o[0]=t[0]/e[0],o[1]=t[1]/e[1],o[2]=t[2]/e[2],o[3]=t[3]/e[3],o}function m(t,e,r){const o=r??new n(4);return h(t,o),c(o,e,o)}return{create:t,fromValues:t,set:function(t,e,r,o,c){const u=c??new n(4);return u[0]=t,u[1]=e,u[2]=r,u[3]=o,u},ceil:function(t,e){const r=e??new n(4);return r[0]=Math.ceil(t[0]),r[1]=Math.ceil(t[1]),r[2]=Math.ceil(t[2]),r[3]=Math.ceil(t[3]),r},floor:function(t,e){const r=e??new n(4);return r[0]=Math.floor(t[0]),r[1]=Math.floor(t[1]),r[2]=Math.floor(t[2]),r[3]=Math.floor(t[3]),r},round:function(t,e){const r=e??new n(4);return r[0]=Math.round(t[0]),r[1]=Math.round(t[1]),r[2]=Math.round(t[2]),r[3]=Math.round(t[3]),r},clamp:function(t,e=0,r=1,o){const c=o??new n(4);return c[0]=Math.min(r,Math.max(e,t[0])),c[1]=Math.min(r,Math.max(e,t[1])),c[2]=Math.min(r,Math.max(e,t[2])),c[3]=Math.min(r,Math.max(e,t[3])),c},add:function(t,e,r){const o=r??new n(4);return o[0]=t[0]+e[0],o[1]=t[1]+e[1],o[2]=t[2]+e[2],o[3]=t[3]+e[3],o},addScaled:function(t,e,r,o){const c=o??new n(4);return c[0]=t[0]+e[0]*r,c[1]=t[1]+e[1]*r,c[2]=t[2]+e[2]*r,c[3]=t[3]+e[3]*r,c},subtract:e,sub:e,equalsApproximately:function(n,t){return Math.abs(n[0]-t[0])e?m(t,e,o):M(t,o)},midpoint:function(t,e,o){return r(t,e,.5,o??new n(4))}}}(n),d.set(n,t)),t}function p(n,t,e,r,o,c){return{mat3:h(n),mat4:l(t),quat:m(e),vec2:a(r),vec3:i(o),vec4:v(c)}}const{mat3:q,mat4:b,quat:g,vec2:x,vec3:y,vec4:A}=p(Float32Array,Float32Array,Float32Array,Float32Array,Float32Array,Float32Array),{mat3:S,mat4:z,quat:F,vec2:T,vec3:k,vec4:I}=p(Float64Array,Float64Array,Float64Array,Float64Array,Float64Array,Float64Array),{mat3:P,mat4:V,quat:Z,vec2:L,vec3:R,vec4:E}=p(t,Array,Array,Array,Array,Array);n.mat3=q,n.mat3d=S,n.mat3n=P,n.mat4=b,n.mat4d=z,n.mat4n=V,n.quat=g,n.quatd=F,n.quatn=Z,n.utils=c,n.vec2=x,n.vec2d=T,n.vec2n=L,n.vec3=y,n.vec3d=k,n.vec3n=R,n.vec4=A,n.vec4d=I,n.vec4n=E})); +!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n="undefined"!=typeof globalThis?globalThis:n||self).wgpuMatrix={})}(this,(function(n){"use strict";const t=(e=Array,r=n=>n.fill(0),class extends e{constructor(...n){super(...n),r(this)}});var e,r;let o=1e-6;var c={__proto__:null,get EPSILON(){return o},degToRad:function(n){return n*Math.PI/180},euclideanModulo:function(n,t){return(n%t+t)%t},inverseLerp:function(n,t,e){const r=t-n;return Math.abs(t-n)1e-5?(r[0]=o/u,r[1]=c/u):(r[0]=0,r[1]=0),r}function l(t,e){const r=e??new n(2);return r[0]=t[0],r[1]=t[1],r}function w(t,e,r){const o=r??new n(2);return o[0]=t[0]*e[0],o[1]=t[1]*e[1],o}function m(t,e,r){const o=r??new n(2);return o[0]=t[0]/e[0],o[1]=t[1]/e[1],o}function d(t,e,r){const o=r??new n(2);return M(t,o),c(o,e,o)}return{create:t,fromValues:t,set:function(t,e,r){const o=r??new n(2);return o[0]=t,o[1]=e,o},ceil:function(t,e){const r=e??new n(2);return r[0]=Math.ceil(t[0]),r[1]=Math.ceil(t[1]),r},floor:function(t,e){const r=e??new n(2);return r[0]=Math.floor(t[0]),r[1]=Math.floor(t[1]),r},round:function(t,e){const r=e??new n(2);return r[0]=Math.round(t[0]),r[1]=Math.round(t[1]),r},clamp:function(t,e=0,r=1,o){const c=o??new n(2);return c[0]=Math.min(r,Math.max(e,t[0])),c[1]=Math.min(r,Math.max(e,t[1])),c},add:function(t,e,r){const o=r??new n(2);return o[0]=t[0]+e[0],o[1]=t[1]+e[1],o},addScaled:function(t,e,r,o){const c=o??new n(2);return c[0]=t[0]+e[0]*r,c[1]=t[1]+e[1]*r,c},angle:function(n,t){const e=n[0],r=n[1],o=t[0],c=t[1],u=Math.sqrt(e*e+r*r)*Math.sqrt(o*o+c*c),s=u&&a(n,t)/u;return Math.acos(s)},subtract:e,sub:e,equalsApproximately:function(n,t){return Math.abs(n[0]-t[0])e?d(t,e,o):l(t,o)},midpoint:function(t,e,o){return r(t,e,.5,o??new n(2))}}}(n),u.set(n,t)),t}const s=new Map;function i(n){let t=s.get(n);return t||(t=function(n){function t(t,e,r){const o=new n(3);return void 0!==t&&(o[0]=t,void 0!==e&&(o[1]=e,void 0!==r&&(o[2]=r))),o}function e(t,e,r){const o=r??new n(3);return o[0]=t[0]-e[0],o[1]=t[1]-e[1],o[2]=t[2]-e[2],o}function r(t,e,r,o){const c=o??new n(3);return c[0]=t[0]+r*(e[0]-t[0]),c[1]=t[1]+r*(e[1]-t[1]),c[2]=t[2]+r*(e[2]-t[2]),c}function c(t,e,r){const o=r??new n(3);return o[0]=t[0]*e,o[1]=t[1]*e,o[2]=t[2]*e,o}function u(t,e){const r=e??new n(3);return r[0]=1/t[0],r[1]=1/t[1],r[2]=1/t[2],r}function a(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function s(n){const t=n[0],e=n[1],r=n[2];return Math.sqrt(t*t+e*e+r*r)}function i(n){const t=n[0],e=n[1],r=n[2];return t*t+e*e+r*r}function f(n,t){const e=n[0]-t[0],r=n[1]-t[1],o=n[2]-t[2];return Math.sqrt(e*e+r*r+o*o)}function h(n,t){const e=n[0]-t[0],r=n[1]-t[1],o=n[2]-t[2];return e*e+r*r+o*o}function M(t,e){const r=e??new n(3),o=t[0],c=t[1],u=t[2],a=Math.sqrt(o*o+c*c+u*u);return a>1e-5?(r[0]=o/a,r[1]=c/a,r[2]=u/a):(r[0]=0,r[1]=0,r[2]=0),r}function l(t,e){const r=e??new n(3);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r}function w(t,e,r){const o=r??new n(3);return o[0]=t[0]*e[0],o[1]=t[1]*e[1],o[2]=t[2]*e[2],o}function m(t,e,r){const o=r??new n(3);return o[0]=t[0]/e[0],o[1]=t[1]/e[1],o[2]=t[2]/e[2],o}function d(t,e,r){const o=r??new n(3);return M(t,o),c(o,e,o)}return{create:t,fromValues:t,set:function(t,e,r,o){const c=o??new n(3);return c[0]=t,c[1]=e,c[2]=r,c},ceil:function(t,e){const r=e??new n(3);return r[0]=Math.ceil(t[0]),r[1]=Math.ceil(t[1]),r[2]=Math.ceil(t[2]),r},floor:function(t,e){const r=e??new n(3);return r[0]=Math.floor(t[0]),r[1]=Math.floor(t[1]),r[2]=Math.floor(t[2]),r},round:function(t,e){const r=e??new n(3);return r[0]=Math.round(t[0]),r[1]=Math.round(t[1]),r[2]=Math.round(t[2]),r},clamp:function(t,e=0,r=1,o){const c=o??new n(3);return c[0]=Math.min(r,Math.max(e,t[0])),c[1]=Math.min(r,Math.max(e,t[1])),c[2]=Math.min(r,Math.max(e,t[2])),c},add:function(t,e,r){const o=r??new n(3);return o[0]=t[0]+e[0],o[1]=t[1]+e[1],o[2]=t[2]+e[2],o},addScaled:function(t,e,r,o){const c=o??new n(3);return c[0]=t[0]+e[0]*r,c[1]=t[1]+e[1]*r,c[2]=t[2]+e[2]*r,c},angle:function(n,t){const e=n[0],r=n[1],o=n[2],c=t[0],u=t[1],s=t[2],i=Math.sqrt(e*e+r*r+o*o)*Math.sqrt(c*c+u*u+s*s),f=i&&a(n,t)/i;return Math.acos(f)},subtract:e,sub:e,equalsApproximately:function(n,t){return Math.abs(n[0]-t[0])e?d(t,e,o):l(t,o)},midpoint:function(t,e,o){return r(t,e,.5,o??new n(3))}}}(n),s.set(n,t)),t}const f=new Map;function h(n){let t=f.get(n);return t||(t=function(n){const t=a(n),e=i(n);function r(t,e){const r=e??new n(12);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[8]=t[8],r[9]=t[9],r[10]=t[10],r}function c(t){const e=t??new n(12);return e[0]=1,e[1]=0,e[2]=0,e[4]=0,e[5]=1,e[6]=0,e[8]=0,e[9]=0,e[10]=1,e}function u(t,e){const r=e??new n(12),o=t[0],c=t[1],u=t[2],a=t[4],s=t[5],i=t[6],f=t[8],h=t[9],M=t[10],l=M*s-i*h,w=-M*a+i*f,m=h*a-s*f,d=1/(o*l+c*w+u*m);return r[0]=l*d,r[1]=(-M*c+u*h)*d,r[2]=(i*c-u*s)*d,r[4]=w*d,r[5]=(M*o-u*f)*d,r[6]=(-i*o+u*a)*d,r[8]=m*d,r[9]=(-h*o+c*f)*d,r[10]=(s*o-c*a)*d,r}function s(t,e,r){const o=r??new n(12),c=t[0],u=t[1],a=t[2],s=t[4],i=t[5],f=t[6],h=t[8],M=t[9],l=t[10],w=e[0],m=e[1],d=e[2],v=e[4],p=e[5],q=e[6],b=e[8],g=e[9],x=e[10];return o[0]=c*w+s*m+h*d,o[1]=u*w+i*m+M*d,o[2]=a*w+f*m+l*d,o[4]=c*v+s*p+h*q,o[5]=u*v+i*p+M*q,o[6]=a*v+f*p+l*q,o[8]=c*b+s*g+h*x,o[9]=u*b+i*g+M*x,o[10]=a*b+f*g+l*x,o}function f(t,e){const r=e??new n(12),o=Math.cos(t),c=Math.sin(t);return r[0]=o,r[1]=c,r[2]=0,r[4]=-c,r[5]=o,r[6]=0,r[8]=0,r[9]=0,r[10]=1,r}function h(t,e,r){const o=r??new n(12),c=t[0],u=t[1],a=t[2],s=t[4],i=t[5],f=t[6],h=Math.cos(e),M=Math.sin(e);return o[0]=h*c+M*s,o[1]=h*u+M*i,o[2]=h*a+M*f,o[4]=h*s-M*c,o[5]=h*i-M*u,o[6]=h*f-M*a,t!==o&&(o[8]=t[8],o[9]=t[9],o[10]=t[10]),o}return{clone:r,create:function(t,e,r,o,c,u,a,s,i){const f=new n(12);return f[3]=0,f[7]=0,f[11]=0,void 0!==t&&(f[0]=t,void 0!==e&&(f[1]=e,void 0!==r&&(f[2]=r,void 0!==o&&(f[4]=o,void 0!==c&&(f[5]=c,void 0!==u&&(f[6]=u,void 0!==a&&(f[8]=a,void 0!==s&&(f[9]=s,void 0!==i&&(f[10]=i))))))))),f},set:function(t,e,r,o,c,u,a,s,i,f){const h=f??new n(12);return h[0]=t,h[1]=e,h[2]=r,h[3]=0,h[4]=o,h[5]=c,h[6]=u,h[7]=0,h[8]=a,h[9]=s,h[10]=i,h[11]=0,h},fromMat4:function(t,e){const r=e??new n(12);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=0,r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=0,r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=0,r},fromQuat:function(t,e){const r=e??new n(12),o=t[0],c=t[1],u=t[2],a=t[3],s=o+o,i=c+c,f=u+u,h=o*s,M=c*s,l=c*i,w=u*s,m=u*i,d=u*f,v=a*s,p=a*i,q=a*f;return r[0]=1-l-d,r[1]=M+q,r[2]=w-p,r[3]=0,r[4]=M-q,r[5]=1-h-d,r[6]=m+v,r[7]=0,r[8]=w+p,r[9]=m-v,r[10]=1-h-l,r[11]=0,r},negate:function(t,e){const r=e??new n(12);return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[4]=-t[4],r[5]=-t[5],r[6]=-t[6],r[8]=-t[8],r[9]=-t[9],r[10]=-t[10],r},copy:r,equalsApproximately:function(n,t){return Math.abs(n[0]-t[0])o){const n=Math.acos(v),t=Math.sin(n);h=Math.sin((1-r)*n)/t,M=Math.sin(r*n)/t}else h=1-r,M=r;return u[0]=h*a+M*l,u[1]=h*s+M*w,u[2]=h*i+M*m,u[3]=h*f+M*d,u}function f(t,e){const r=e??new n(4);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r}const h=f;function M(t,e,r){const o=r??new n(4);return o[0]=t[0]-e[0],o[1]=t[1]-e[1],o[2]=t[2]-e[2],o[3]=t[3]-e[3],o}const l=M;function w(t,e,r){const o=r??new n(4);return o[0]=t[0]*e,o[1]=t[1]*e,o[2]=t[2]*e,o[3]=t[3]*e,o}const m=w;function d(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3]}function v(n){const t=n[0],e=n[1],r=n[2],o=n[3];return Math.sqrt(t*t+e*e+r*r+o*o)}const p=v;function q(n){const t=n[0],e=n[1],r=n[2],o=n[3];return t*t+e*e+r*r+o*o}const b=q;function g(t,e){const r=e??new n(4),o=t[0],c=t[1],u=t[2],a=t[3],s=Math.sqrt(o*o+c*c+u*u+a*a);return s>1e-5?(r[0]=o/s,r[1]=c/s,r[2]=u/s,r[3]=a/s):(r[0]=0,r[1]=0,r[2]=0,r[3]=1),r}const x=t.create(),y=t.create(),S=t.create(),A=new n(4),z=new n(4);return{create:e,fromValues:r,set:function(t,e,r,o,c){const u=c??new n(4);return u[0]=t,u[1]=e,u[2]=r,u[3]=o,u},fromAxisAngle:c,toAxisAngle:function(n,e){const r=e??t.create(3),c=2*Math.acos(n[3]),u=Math.sin(.5*c);return u>o?(r[0]=n[0]/u,r[1]=n[1]/u,r[2]=n[2]/u):(r[0]=1,r[1]=0,r[2]=0),{angle:c,axis:r}},angle:function(n,t){const e=d(n,t);return Math.acos(2*e*e-1)},multiply:u,mul:a,rotateX:function(t,e,r){const o=r??new n(4),c=.5*e,u=t[0],a=t[1],s=t[2],i=t[3],f=Math.sin(c),h=Math.cos(c);return o[0]=u*h+i*f,o[1]=a*h+s*f,o[2]=s*h-a*f,o[3]=i*h-u*f,o},rotateY:function(t,e,r){const o=r??new n(4),c=.5*e,u=t[0],a=t[1],s=t[2],i=t[3],f=Math.sin(c),h=Math.cos(c);return o[0]=u*h-s*f,o[1]=a*h+i*f,o[2]=s*h+u*f,o[3]=i*h-a*f,o},rotateZ:function(t,e,r){const o=r??new n(4),c=.5*e,u=t[0],a=t[1],s=t[2],i=t[3],f=Math.sin(c),h=Math.cos(c);return o[0]=u*h+a*f,o[1]=a*h-u*f,o[2]=s*h+i*f,o[3]=i*h-s*f,o},slerp:s,inverse:function(t,e){const r=e??new n(4),o=t[0],c=t[1],u=t[2],a=t[3],s=o*o+c*c+u*u+a*a,i=s?1/s:0;return r[0]=-o*i,r[1]=-c*i,r[2]=-u*i,r[3]=a*i,r},conjugate:function(t,e){const r=e??new n(4);return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[3]=t[3],r},fromMat:function(t,e){const r=e??new n(4),o=t[0]+t[5]+t[10];if(o>0){const n=Math.sqrt(o+1);r[3]=.5*n;const e=.5/n;r[0]=(t[6]-t[9])*e,r[1]=(t[8]-t[2])*e,r[2]=(t[1]-t[4])*e}else{let n=0;t[5]>t[0]&&(n=1),t[10]>t[4*n+n]&&(n=2);const e=(n+1)%3,o=(n+2)%3,c=Math.sqrt(t[4*n+n]-t[4*e+e]-t[4*o+o]+1);r[n]=.5*c;const u=.5/c;r[3]=(t[4*e+o]-t[4*o+e])*u,r[e]=(t[4*e+n]+t[4*n+e])*u,r[o]=(t[4*o+n]+t[4*n+o])*u}return r},fromEuler:function(t,e,r,o,c){const u=c??new n(4),a=.5*t,s=.5*e,i=.5*r,f=Math.sin(a),h=Math.cos(a),M=Math.sin(s),l=Math.cos(s),w=Math.sin(i),m=Math.cos(i);switch(o){case"xyz":u[0]=f*l*m+h*M*w,u[1]=h*M*m-f*l*w,u[2]=h*l*w+f*M*m,u[3]=h*l*m-f*M*w;break;case"xzy":u[0]=f*l*m-h*M*w,u[1]=h*M*m-f*l*w,u[2]=h*l*w+f*M*m,u[3]=h*l*m+f*M*w;break;case"yxz":u[0]=f*l*m+h*M*w,u[1]=h*M*m-f*l*w,u[2]=h*l*w-f*M*m,u[3]=h*l*m+f*M*w;break;case"yzx":u[0]=f*l*m+h*M*w,u[1]=h*M*m+f*l*w,u[2]=h*l*w-f*M*m,u[3]=h*l*m-f*M*w;break;case"zxy":u[0]=f*l*m-h*M*w,u[1]=h*M*m+f*l*w,u[2]=h*l*w+f*M*m,u[3]=h*l*m-f*M*w;break;case"zyx":u[0]=f*l*m-h*M*w,u[1]=h*M*m+f*l*w,u[2]=h*l*w-f*M*m,u[3]=h*l*m+f*M*w;break;default:throw new Error(`Unknown rotation order: ${o}`)}return u},copy:f,clone:h,add:function(t,e,r){const o=r??new n(4);return o[0]=t[0]+e[0],o[1]=t[1]+e[1],o[2]=t[2]+e[2],o[3]=t[3]+e[3],o},subtract:M,sub:l,mulScalar:w,scale:m,divScalar:function(t,e,r){const o=r??new n(4);return o[0]=t[0]/e,o[1]=t[1]/e,o[2]=t[2]/e,o[3]=t[3]/e,o},dot:d,lerp:function(t,e,r,o){const c=o??new n(4);return c[0]=t[0]+r*(e[0]-t[0]),c[1]=t[1]+r*(e[1]-t[1]),c[2]=t[2]+r*(e[2]-t[2]),c[3]=t[3]+r*(e[3]-t[3]),c},length:v,len:p,lengthSq:q,lenSq:b,normalize:g,equalsApproximately:function(n,t){return Math.abs(n[0]-t[0]).999999?(u[0]=0,u[1]=0,u[2]=0,u[3]=1,u):(t.cross(e,r,x),u[0]=x[0],u[1]=x[1],u[2]=x[2],u[3]=1+a,g(u,u))},sqlerp:function(t,e,r,o,c,u){const a=u??new n(4);return s(t,o,c,A),s(e,r,c,z),s(A,z,2*c*(1-c),a),a}}}(n),w.set(n,t)),t}const d=new Map;function v(n){let t=d.get(n);return t||(t=function(n){function t(t,e,r,o){const c=new n(4);return void 0!==t&&(c[0]=t,void 0!==e&&(c[1]=e,void 0!==r&&(c[2]=r,void 0!==o&&(c[3]=o)))),c}function e(t,e,r){const o=r??new n(4);return o[0]=t[0]-e[0],o[1]=t[1]-e[1],o[2]=t[2]-e[2],o[3]=t[3]-e[3],o}function r(t,e,r,o){const c=o??new n(4);return c[0]=t[0]+r*(e[0]-t[0]),c[1]=t[1]+r*(e[1]-t[1]),c[2]=t[2]+r*(e[2]-t[2]),c[3]=t[3]+r*(e[3]-t[3]),c}function c(t,e,r){const o=r??new n(4);return o[0]=t[0]*e,o[1]=t[1]*e,o[2]=t[2]*e,o[3]=t[3]*e,o}function u(t,e){const r=e??new n(4);return r[0]=1/t[0],r[1]=1/t[1],r[2]=1/t[2],r[3]=1/t[3],r}function a(n){const t=n[0],e=n[1],r=n[2],o=n[3];return Math.sqrt(t*t+e*e+r*r+o*o)}function s(n){const t=n[0],e=n[1],r=n[2],o=n[3];return t*t+e*e+r*r+o*o}function i(n,t){const e=n[0]-t[0],r=n[1]-t[1],o=n[2]-t[2],c=n[3]-t[3];return Math.sqrt(e*e+r*r+o*o+c*c)}function f(n,t){const e=n[0]-t[0],r=n[1]-t[1],o=n[2]-t[2],c=n[3]-t[3];return e*e+r*r+o*o+c*c}function h(t,e){const r=e??new n(4),o=t[0],c=t[1],u=t[2],a=t[3],s=Math.sqrt(o*o+c*c+u*u+a*a);return s>1e-5?(r[0]=o/s,r[1]=c/s,r[2]=u/s,r[3]=a/s):(r[0]=0,r[1]=0,r[2]=0,r[3]=0),r}function M(t,e){const r=e??new n(4);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r}function l(t,e,r){const o=r??new n(4);return o[0]=t[0]*e[0],o[1]=t[1]*e[1],o[2]=t[2]*e[2],o[3]=t[3]*e[3],o}function w(t,e,r){const o=r??new n(4);return o[0]=t[0]/e[0],o[1]=t[1]/e[1],o[2]=t[2]/e[2],o[3]=t[3]/e[3],o}function m(t,e,r){const o=r??new n(4);return h(t,o),c(o,e,o)}return{create:t,fromValues:t,set:function(t,e,r,o,c){const u=c??new n(4);return u[0]=t,u[1]=e,u[2]=r,u[3]=o,u},ceil:function(t,e){const r=e??new n(4);return r[0]=Math.ceil(t[0]),r[1]=Math.ceil(t[1]),r[2]=Math.ceil(t[2]),r[3]=Math.ceil(t[3]),r},floor:function(t,e){const r=e??new n(4);return r[0]=Math.floor(t[0]),r[1]=Math.floor(t[1]),r[2]=Math.floor(t[2]),r[3]=Math.floor(t[3]),r},round:function(t,e){const r=e??new n(4);return r[0]=Math.round(t[0]),r[1]=Math.round(t[1]),r[2]=Math.round(t[2]),r[3]=Math.round(t[3]),r},clamp:function(t,e=0,r=1,o){const c=o??new n(4);return c[0]=Math.min(r,Math.max(e,t[0])),c[1]=Math.min(r,Math.max(e,t[1])),c[2]=Math.min(r,Math.max(e,t[2])),c[3]=Math.min(r,Math.max(e,t[3])),c},add:function(t,e,r){const o=r??new n(4);return o[0]=t[0]+e[0],o[1]=t[1]+e[1],o[2]=t[2]+e[2],o[3]=t[3]+e[3],o},addScaled:function(t,e,r,o){const c=o??new n(4);return c[0]=t[0]+e[0]*r,c[1]=t[1]+e[1]*r,c[2]=t[2]+e[2]*r,c[3]=t[3]+e[3]*r,c},subtract:e,sub:e,equalsApproximately:function(n,t){return Math.abs(n[0]-t[0])e?m(t,e,o):M(t,o)},midpoint:function(t,e,o){return r(t,e,.5,o??new n(4))}}}(n),d.set(n,t)),t}function p(n,t,e,r,o,c){return{mat3:h(n),mat4:l(t),quat:m(e),vec2:a(r),vec3:i(o),vec4:v(c)}}const{mat3:q,mat4:b,quat:g,vec2:x,vec3:y,vec4:S}=p(Float32Array,Float32Array,Float32Array,Float32Array,Float32Array,Float32Array),{mat3:A,mat4:z,quat:F,vec2:T,vec3:k,vec4:Z}=p(Float64Array,Float64Array,Float64Array,Float64Array,Float64Array,Float64Array),{mat3:I,mat4:P,quat:V,vec2:D,vec3:X,vec4:Y}=p(t,Array,Array,Array,Array,Array);n.mat3=q,n.mat3d=A,n.mat3n=I,n.mat4=b,n.mat4d=z,n.mat4n=P,n.quat=g,n.quatd=F,n.quatn=V,n.utils=c,n.vec2=x,n.vec2d=T,n.vec2n=D,n.vec3=y,n.vec3d=k,n.vec3n=X,n.vec4=S,n.vec4d=Z,n.vec4n=Y})); //# sourceMappingURL=wgpu-matrix.min.js.map diff --git a/dist/3.x/wgpu-matrix.min.js.map b/dist/3.x/wgpu-matrix.min.js.map index be7da57..047e293 100644 --- a/dist/3.x/wgpu-matrix.min.js.map +++ b/dist/3.x/wgpu-matrix.min.js.map @@ -1 +1 @@ -{"version":3,"file":"wgpu-matrix.min.js","sources":["../../../src/types.ts","../../../src/utils.ts","../../../src/vec2-impl.ts","../../../src/vec3-impl.ts","../../../src/mat3-impl.ts","../../../src/mat4-impl.ts","../../../src/quat-impl.ts","../../../src/vec4-impl.ts","../../../src/wgpu-matrix.ts"],"sourcesContent":["/**\n * The types you can pass to most functions that take an\n * array of numbers.\n */\nexport type BaseArgType = Float32Array | Float64Array | number[];\n\nfunction wrapConstructor any>(\n OriginalConstructor: T,\n modifier: (instance: InstanceType) => void\n): T {\n return class extends OriginalConstructor {\n constructor(...args: any[]) {\n super(...args);\n modifier(this as InstanceType);\n }\n } as T; // Type assertion is necessary here\n}\n\nexport const ZeroArray = wrapConstructor(Array, a => a.fill(0));\n\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nexport let EPSILON = 0.000001;\n\n/**\n * Set the value for EPSILON for various checks\n * @param v - Value to use for EPSILON.\n * @returns previous value of EPSILON;\n */\nexport function setEpsilon(v: number): number {\n const old = EPSILON;\n EPSILON = v;\n return old;\n}\n\n/**\n * Convert degrees to radians\n * @param degrees - Angle in degrees\n * @returns angle converted to radians\n */\nexport function degToRad(degrees: number): number {\n return degrees * Math.PI / 180;\n}\n\n/**\n * Convert radians to degrees\n * @param radians - Angle in radians\n * @returns angle converted to degrees\n */\nexport function radToDeg(radians: number): number {\n return radians * 180 / Math.PI;\n}\n\n/**\n * Lerps between a and b via t\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @returns a + (b - a) * t\n */\nexport function lerp(a: number, b: number, t: number): number {\n return a + (b - a) * t;\n}\n\n/**\n * Compute the opposite of lerp. Given a and b and a value between\n * a and b returns a value between 0 and 1. 0 if a, 1 if b.\n * Note: no clamping is done.\n * @param a - start value\n * @param b - end value\n * @param v - value between a and b\n * @returns (v - a) / (b - a)\n */\nexport function inverseLerp(a: number, b: number, v: number): number {\n const d = b - a;\n return (Math.abs(b - a) < EPSILON)\n ? a\n : (v - a) / d;\n}\n\n/**\n * Compute the euclidean modulo\n *\n * ```\n * // table for n / 3\n * -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 <- n\n * ------------------------------------\n * -2 -1 -0 -2 -1 0, 1, 2, 0, 1, 2 <- n % 3\n * 1 2 0 1 2 0, 1, 2, 0, 1, 2 <- euclideanModule(n, 3)\n * ```\n *\n * @param n - dividend\n * @param m - divisor\n * @returns the euclidean modulo of n / m\n */\nexport function euclideanModulo(n: number, m: number) {\n return ((n % m) + m) % m;\n}","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Mat3Arg } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { Vec2Arg, Vec2Type } from './vec2';\nimport { Vec3Arg } from './vec3';\nimport { BaseArgType } from './types';\n\nexport { Vec2Arg, Vec2Type };\n\ntype Vec2Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec3\n */\nfunction getAPIImpl(Ctor: Vec2Ctor) {\n\n/**\n * Creates a Vec2; may be called with x, y, z to set initial values.\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Vec2's specified type\n * it would be faster to use\n *\n * ```\n * const v = vec2.clone(someJSArray);\n * ```\n *\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\nfunction create(x = 0, y = 0) {\n const newDst = new Ctor(2);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n }\n }\n return newDst;\n}\n\n/**\n * Creates a Vec2; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec2\n * Also see {@link vec2.create} and {@link vec2.copy}\n *\n * @param x first value\n * @param y second value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec2Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec2Arg, b: Vec2Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n\n return newDst;\n}\n\n/**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\nfunction angle(a: Vec2Arg, b: Vec2Arg): number {\n const ax = a[0];\n const ay = a[1];\n const bx = b[0];\n const by = b[1];\n const mag1 = Math.sqrt(ax * ax + ay * ay);\n const mag2 = Math.sqrt(bx * bx + by * by);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec2Arg, b: Vec2Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec2Arg, b: Vec2Arg): boolean {\n return a[0] === b[0] && a[1] === b[1];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec2Arg, b: Vec2Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec2Arg, b: Vec2Arg, t: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec2Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec2Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\nfunction cross(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const z = a[0] * b[1] - a[1] * b[0];\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = z;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec2Arg, b: Vec2Arg): number {\n return a[0] * b[0] + a[1] * b[1];\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec2Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n return Math.sqrt(v0 * v0 + v1 * v1);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec2Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n return v0 * v0 + v1 * v1;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec2Arg, b: Vec2Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return Math.sqrt(dx * dx + dy * dy);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec2Arg, b: Vec2Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return dx * dx + dy * dy;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const len = Math.sqrt(v0 * v0 + v1 * v1);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n }\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec2.clone})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec2.copy})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Creates a random unit vector * scale\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\nfunction random(scale = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const angle = Math.random() * 2 * Math.PI;\n newDst[0] = Math.cos(angle) * scale;\n newDst[1] = Math.sin(angle) * scale;\n\n return newDst;\n}\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform Vec2 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec2Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const x = v[0];\n const y = v[1];\n\n newDst[0] = x * m[0] + y * m[4] + m[12];\n newDst[1] = x * m[1] + y * m[5] + m[13];\n\n return newDst;\n}\n\n/**\n * Transforms vec4 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat3(v: Vec2Arg, m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const x = v[0];\n const y = v[1];\n\n newDst[0] = m[0] * x + m[4] * y + m[8];\n newDst[1] = m[1] * x + m[5] * y + m[9];\n\n return newDst;\n}\n\n/**\n * Rotate a 2D vector\n *\n * @param a The vec2 point to rotate\n * @param b The origin of the rotation\n * @param rad The angle of rotation in radians\n * @returns the rotated vector\n */\nfunction rotate(a: Vec2Arg, b: Vec2Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n // Translate point to the origin\n const p0 = a[0] - b[0];\n const p1 = a[1] - b[1];\n const sinC = Math.sin(rad);\n const cosC = Math.cos(rad);\n\n //perform rotation and translate to correct position\n newDst[0] = p0 * cosC - p1 * sinC + b[0];\n newDst[1] = p0 * sinC + p1 * cosC + b[1];\n\n return newDst;\n}\n\n/**\n * Treat a 2D vector as a direction and set it's length\n *\n * @param a The vec2 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec2Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec2 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec2Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat3,\n rotate,\n setLength,\n truncate,\n midpoint,\n};\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Vec2Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Vec3Arg, Vec3Type } from './vec3';\nimport { Mat3Arg } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { QuatArg } from './quat';\nimport { BaseArgType } from './types';\n\nexport { Vec3Arg, Vec3Type };\n\ntype Vec3Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec3\n * */\nfunction getAPIImpl(Ctor: Vec3Ctor) {\n\n/**\n * Creates a vec3; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number) {\n const newDst = new Ctor(3);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a vec3; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec3\n * Also see {@link vec3.create} and {@link vec3.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec3Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec3Arg, b: Vec3Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n\n return newDst;\n}\n\n/**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\nfunction angle(a: Vec3Arg, b: Vec3Arg): number {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const mag1 = Math.sqrt(ax * ax + ay * ay + az * az);\n const mag2 = Math.sqrt(bx * bx + by * by + bz * bz);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec3Arg, b: Vec3Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec3Arg, b: Vec3Arg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec3Arg, b: Vec3Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec3Arg, b: Vec3Arg, t: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec3Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec3Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\nfunction cross(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const t1 = a[2] * b[0] - a[0] * b[2];\n const t2 = a[0] * b[1] - a[1] * b[0];\n newDst[0] = a[1] * b[2] - a[2] * b[1];\n newDst[1] = t1;\n newDst[2] = t2;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec3Arg, b: Vec3Arg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]);\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec3Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec3Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return v0 * v0 + v1 * v1 + v2 * v2;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec3Arg, b: Vec3Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return Math.sqrt(dx * dx + dy * dy + dz * dz);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec3Arg, b: Vec3Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return dx * dx + dy * dy + dz * dz;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec3.clone})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec3.copy})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Creates a random vector\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\nfunction random(scale = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const angle = Math.random() * 2 * Math.PI;\n const z = Math.random() * 2 - 1;\n const zScale = Math.sqrt(1 - z * z) * scale;\n newDst[0] = Math.cos(angle) * zScale;\n newDst[1] = Math.sin(angle) * zScale;\n newDst[2] = z * scale;\n\n return newDst;\n}\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform vec3 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec3Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1;\n\n newDst[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n newDst[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n newDst[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n\n return newDst;\n}\n\n/**\n * Transform vec3 by upper 3x3 matrix inside 4x4 matrix.\n * @param v - The direction.\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns The transformed vector.\n */\nfunction transformMat4Upper3x3(v: Vec3Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[0] = v0 * m[0 * 4 + 0] + v1 * m[1 * 4 + 0] + v2 * m[2 * 4 + 0];\n newDst[1] = v0 * m[0 * 4 + 1] + v1 * m[1 * 4 + 1] + v2 * m[2 * 4 + 1];\n newDst[2] = v0 * m[0 * 4 + 2] + v1 * m[1 * 4 + 2] + v2 * m[2 * 4 + 2];\n\n return newDst;\n}\n\n/**\n * Transforms vec3 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat3(v: Vec3Arg, m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n\n newDst[0] = x * m[0] + y * m[4] + z * m[8];\n newDst[1] = x * m[1] + y * m[5] + z * m[9];\n newDst[2] = x * m[2] + y * m[6] + z * m[10];\n\n return newDst;\n}\n\n/**\n * Transforms vec3 by Quaternion\n * @param v - the vector to transform\n * @param q - the quaternion to transform by\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed\n */\nfunction transformQuat(v: Vec3Arg, q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n\n const uvX = qy * z - qz * y;\n const uvY = qz * x - qx * z;\n const uvZ = qx * y - qy * x;\n\n newDst[0] = x + uvX * w2 + (qy * uvZ - qz * uvY) * 2;\n newDst[1] = y + uvY * w2 + (qz * uvX - qx * uvZ) * 2;\n newDst[2] = z + uvZ * w2 + (qx * uvY - qy * uvX) * 2;\n\n return newDst;\n}\n\n/**\n * Returns the translation component of a 4-by-4 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\nfunction getTranslation(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n}\n/**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat4Arg, axis: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n}\n/**\n * Returns the scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the x-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\nfunction rotateX(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n //Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n //perform rotation\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad);\n\n //translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the y-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\nfunction rotateY(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n // perform rotation\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad);\n\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the z-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns {vec3} out\n */\nfunction rotateZ(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n // perform rotation\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2];\n\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Treat a 3D vector as a direction and set it's length\n *\n * @param a The vec3 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec3Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec3 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec3Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat4Upper3x3,\n transformMat3,\n transformQuat,\n getTranslation,\n getAxis,\n getScaling,\n rotateX,\n rotateY,\n rotateZ,\n setLength,\n truncate,\n midpoint,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Vec3Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nimport * as utils from './utils.js';\nimport { QuatArg } from './quat';\nimport { Mat3Arg, Mat3Type } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { Vec2Arg } from './vec2';\nimport { Vec3Arg } from './vec3';\nimport { getAPI as getVec2API } from './vec2-impl';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\n\nexport { Mat3Arg, Mat3Type };\n\ntype Mat3Ctor = new (n: number) => T;\n\n/**\n * Generates a typed API for Mat3\n * */\nfunction getAPIImpl(Ctor: Mat3Ctor) {\n const vec2 = getVec2API(Ctor);\n const vec3 = getVec3API(Ctor);\n\n/**\n * Create a Mat3 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat3's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat3.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @returns matrix created from values.\n */\nfunction create(\n v0?: number, v1?: number, v2?: number,\n v3?: number, v4?: number, v5?: number,\n v6?: number, v7?: number, v8?: number) {\n const newDst = new Ctor(12);\n // to make the array homogenous\n newDst[3] = 0;\n newDst[7] = 0;\n newDst[11] = 0;\n\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[4] = v3;\n if (v4 !== undefined) {\n newDst[5] = v4;\n if (v5 !== undefined) {\n newDst[6] = v5;\n if (v6 !== undefined) {\n newDst[8] = v6;\n if (v7 !== undefined) {\n newDst[9] = v7;\n if (v8 !== undefined) {\n newDst[10] = v8;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n\n return newDst;\n}\n\n/**\n * Sets the values of a Mat3\n * Also see {@link mat3.create} and {@link mat3.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 set from values.\n */\nfunction set(\n v0: number, v1: number, v2: number,\n v3: number, v4: number, v5: number,\n v6: number, v7: number, v8: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[0] = v0; newDst[1] = v1; newDst[ 2] = v2; newDst[ 3] = 0;\n newDst[4] = v3; newDst[5] = v4; newDst[ 6] = v5; newDst[ 7] = 0;\n newDst[8] = v6; newDst[9] = v7; newDst[10] = v8; newDst[11] = 0;\n\n return newDst;\n}\n\n/**\n * Creates a Mat3 from the upper left 3x3 part of a Mat4\n * @param m4 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from m4\n */\nfunction fromMat4(m4: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n newDst[0] = m4[0]; newDst[1] = m4[1]; newDst[ 2] = m4[ 2]; newDst[ 3] = 0;\n newDst[4] = m4[4]; newDst[5] = m4[5]; newDst[ 6] = m4[ 6]; newDst[ 7] = 0;\n newDst[8] = m4[8]; newDst[9] = m4[9]; newDst[10] = m4[10]; newDst[11] = 0;\n return newDst;\n}\n\n/**\n * Creates a Mat3 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from q\n */\nfunction fromQuat(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3];\n const x2 = x + x; const y2 = y + y; const z2 = z + z;\n\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n newDst[ 0] = 1 - yy - zz; newDst[ 1] = yx + wz; newDst[ 2] = zx - wy; newDst[ 3] = 0;\n newDst[ 4] = yx - wz; newDst[ 5] = 1 - xx - zz; newDst[ 6] = zy + wx; newDst[ 7] = 0;\n newDst[ 8] = zx + wy; newDst[ 9] = zy - wx; newDst[10] = 1 - xx - yy; newDst[11] = 0;\n\n return newDst;\n}\n\n/**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\nfunction negate(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = -m[ 0]; newDst[ 1] = -m[ 1]; newDst[ 2] = -m[ 2];\n newDst[ 4] = -m[ 4]; newDst[ 5] = -m[ 5]; newDst[ 6] = -m[ 6];\n newDst[ 8] = -m[ 8]; newDst[ 9] = -m[ 9]; newDst[10] = -m[10];\n\n return newDst;\n}\n\n/**\n * Copies a matrix. (same as {@link mat3.clone})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nfunction copy(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = m[ 0]; newDst[ 1] = m[ 1]; newDst[ 2] = m[ 2];\n newDst[ 4] = m[ 4]; newDst[ 5] = m[ 5]; newDst[ 6] = m[ 6];\n newDst[ 8] = m[ 8]; newDst[ 9] = m[ 9]; newDst[10] = m[10];\n\n return newDst;\n}\n\n/**\n * Copies a matrix (same as {@link mat3.copy})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nconst clone = copy;\n\n/**\n * Check if 2 matrices are approximately equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are approximately equal\n */\nfunction equalsApproximately(a: Mat3Arg, b: Mat3Arg): boolean {\n return Math.abs(a[ 0] - b[ 0]) < utils.EPSILON &&\n Math.abs(a[ 1] - b[ 1]) < utils.EPSILON &&\n Math.abs(a[ 2] - b[ 2]) < utils.EPSILON &&\n Math.abs(a[ 4] - b[ 4]) < utils.EPSILON &&\n Math.abs(a[ 5] - b[ 5]) < utils.EPSILON &&\n Math.abs(a[ 6] - b[ 6]) < utils.EPSILON &&\n Math.abs(a[ 8] - b[ 8]) < utils.EPSILON &&\n Math.abs(a[ 9] - b[ 9]) < utils.EPSILON &&\n Math.abs(a[10] - b[10]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 matrices are exactly equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are exactly equal\n */\nfunction equals(a: Mat3Arg, b: Mat3Arg): boolean {\n return a[ 0] === b[ 0] &&\n a[ 1] === b[ 1] &&\n a[ 2] === b[ 2] &&\n a[ 4] === b[ 4] &&\n a[ 5] === b[ 5] &&\n a[ 6] === b[ 6] &&\n a[ 8] === b[ 8] &&\n a[ 9] === b[ 9] &&\n a[10] === b[10];\n}\n\n/**\n * Creates a 3-by-3 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 3-by-3 identity matrix.\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\nfunction transpose(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n if (newDst === m) {\n let t: number;\n\n // 0 1 2\n // 4 5 6\n // 8 9 10\n\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n\n return newDst;\n }\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n newDst[ 0] = m00; newDst[ 1] = m10; newDst[ 2] = m20;\n newDst[ 4] = m01; newDst[ 5] = m11; newDst[ 6] = m21;\n newDst[ 8] = m02; newDst[ 9] = m12; newDst[10] = m22;\n\n return newDst;\n}\n\n/**\n * Computes the inverse of a 3-by-3 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nfunction inverse(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n const b01 = m22 * m11 - m12 * m21;\n const b11 = -m22 * m10 + m12 * m20;\n const b21 = m21 * m10 - m11 * m20;\n\n const invDet = 1 / (m00 * b01 + m01 * b11 + m02 * b21);\n\n newDst[ 0] = b01 * invDet;\n newDst[ 1] = (-m22 * m01 + m02 * m21) * invDet;\n newDst[ 2] = ( m12 * m01 - m02 * m11) * invDet;\n newDst[ 4] = b11 * invDet;\n newDst[ 5] = ( m22 * m00 - m02 * m20) * invDet;\n newDst[ 6] = (-m12 * m00 + m02 * m10) * invDet;\n newDst[ 8] = b21 * invDet;\n newDst[ 9] = (-m21 * m00 + m01 * m20) * invDet;\n newDst[10] = ( m11 * m00 - m01 * m10) * invDet;\n\n return newDst;\n}\n\n/**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\nfunction determinant(m: Mat3Arg): number {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n return m00 * (m11 * m22 - m21 * m12) -\n m10 * (m01 * m22 - m21 * m02) +\n m20 * (m01 * m12 - m11 * m02);\n}\n\n/**\n * Computes the inverse of a 3-by-3 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nconst invert = inverse;\n\n/**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nfunction multiply(a: Mat3Arg, b: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[ 4 + 0];\n const a11 = a[ 4 + 1];\n const a12 = a[ 4 + 2];\n const a20 = a[ 8 + 0];\n const a21 = a[ 8 + 1];\n const a22 = a[ 8 + 2];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b10 = b[ 4 + 0];\n const b11 = b[ 4 + 1];\n const b12 = b[ 4 + 2];\n const b20 = b[ 8 + 0];\n const b21 = b[ 8 + 1];\n const b22 = b[ 8 + 2];\n\n newDst[ 0] = a00 * b00 + a10 * b01 + a20 * b02;\n newDst[ 1] = a01 * b00 + a11 * b01 + a21 * b02;\n newDst[ 2] = a02 * b00 + a12 * b01 + a22 * b02;\n newDst[ 4] = a00 * b10 + a10 * b11 + a20 * b12;\n newDst[ 5] = a01 * b10 + a11 * b11 + a21 * b12;\n newDst[ 6] = a02 * b10 + a12 * b11 + a22 * b12;\n newDst[ 8] = a00 * b20 + a10 * b21 + a20 * b22;\n newDst[ 9] = a01 * b20 + a11 * b21 + a21 * b22;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22;\n\n return newDst;\n}\n\n/**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nconst mul = multiply;\n\n/**\n * Sets the translation component of a 3-by-3 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\nfunction setTranslation(a: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? identity()) as T;\n if (a !== newDst) {\n newDst[ 0] = a[ 0];\n newDst[ 1] = a[ 1];\n newDst[ 2] = a[ 2];\n newDst[ 4] = a[ 4];\n newDst[ 5] = a[ 5];\n newDst[ 6] = a[ 6];\n }\n newDst[ 8] = v[0];\n newDst[ 9] = v[1];\n newDst[10] = 1;\n return newDst;\n}\n\n/**\n * Returns the translation component of a 3-by-3 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\nfunction getTranslation(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec2.create()) as T;\n newDst[0] = m[8];\n newDst[1] = m[9];\n return newDst;\n}\n\n/**\n * Returns an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y,\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat3Arg, axis: number, dst?: T) {\n const newDst = (dst ?? vec2.create()) as T;\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n return newDst;\n}\n\n/**\n * Sets an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\nfunction setAxis(m: Mat3Arg, v: Vec2Arg, axis: number, dst?: T) {\n const newDst = (dst === m ? m : copy(m, dst)) as T;\n\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n return newDst;\n}\n\n/**\n * Returns the \"2d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec2.create());\n\n const xx = m[0];\n const xy = m[1];\n const yx = m[4];\n const yy = m[5];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy);\n newDst[1] = Math.sqrt(yx * yx + yy * yy);\n\n return newDst;\n}\n\n\n/**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction get3DScaling(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec3.create());\n\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which translates by the given vector v.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\nfunction translation(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = v[0]; newDst[ 9] = v[1]; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Translates the given 3-by-3 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\nfunction translate(m: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 0] = m00;\n newDst[ 1] = m01;\n newDst[ 2] = m02;\n newDst[ 4] = m10;\n newDst[ 5] = m11;\n newDst[ 6] = m12;\n }\n\n newDst[ 8] = m00 * v0 + m10 * v1 + m20;\n newDst[ 9] = m01 * v0 + m11 * v1 + m21;\n newDst[10] = m02 * v0 + m12 * v1 + m22;\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotation(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = s; newDst[ 2] = 0;\n newDst[ 4] = -s; newDst[ 5] = c; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix by the given angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotate(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 + s * m10;\n newDst[ 1] = c * m01 + s * m11;\n newDst[ 2] = c * m02 + s * m12;\n\n newDst[ 4] = c * m10 - s * m00;\n newDst[ 5] = c * m11 - s * m01;\n newDst[ 6] = c * m12 - s * m02;\n\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * 2 entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of 2 entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale(m: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales uniformly in each dimension\n * @param s - Amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given.\n * @param m - The matrix to be modified.\n * @param s - Amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale(m: Mat3Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\nreturn {\n clone,\n create,\n set,\n fromMat4,\n fromQuat,\n negate,\n copy,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n invert,\n determinant,\n mul,\n multiply,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n get3DScaling,\n translation,\n translate,\n rotation,\n rotate,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Mat3Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","import { Mat4Arg, Mat4Type } from './mat4';\nimport { Mat3Arg } from './mat3';\nimport { QuatArg } from './quat';\nimport { Vec3Arg } from './vec3';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\nimport * as utils from './utils';\n\nexport { Mat4Arg, Mat4Type };\n\ntype Mat4Ctor = new (n: number) => T;\n\n/**\n * Generates a typed API for Mat4\n * */\nfunction getAPIImpl(Ctor: Mat4Ctor) {\n const vec3 = getVec3API(Ctor);\n\n/**\n * 4x4 Matrix math math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new matrix. In other words you can do this\n *\n * const mat = mat4.translation([1, 2, 3]); // Creates a new translation matrix\n *\n * or\n *\n * const mat = mat4.create();\n * mat4.translation([1, 2, 3], mat); // Puts translation matrix in mat.\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always save to pass any matrix as the destination. So for example\n *\n * const mat = mat4.identity();\n * const trans = mat4.translation([1, 2, 3]);\n * mat4.multiply(mat, trans, mat); // Multiplies mat * trans and puts result in mat.\n *\n */\n\n\n/**\n * Create a Mat4 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat4's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat4.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @returns created from values.\n */\nfunction create(\n v0?: number, v1?: number, v2?: number, v3?: number,\n v4?: number, v5?: number, v6?: number, v7?: number,\n v8?: number, v9?: number, v10?: number, v11?: number,\n v12?: number, v13?: number, v14?: number, v15?: number) {\n const newDst = new Ctor(16);\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[3] = v3;\n if (v4 !== undefined) {\n newDst[4] = v4;\n if (v5 !== undefined) {\n newDst[5] = v5;\n if (v6 !== undefined) {\n newDst[6] = v6;\n if (v7 !== undefined) {\n newDst[7] = v7;\n if (v8 !== undefined) {\n newDst[8] = v8;\n if (v9 !== undefined) {\n newDst[9] = v9;\n if (v10 !== undefined) {\n newDst[10] = v10;\n if (v11 !== undefined) {\n newDst[11] = v11;\n if (v12 !== undefined) {\n newDst[12] = v12;\n if (v13 !== undefined) {\n newDst[13] = v13;\n if (v14 !== undefined) {\n newDst[14] = v14;\n if (v15 !== undefined) {\n newDst[15] = v15;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Sets the values of a Mat4\n * Also see {@link mat4.create} and {@link mat4.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 created from values.\n */\nfunction set(\n v0: number, v1: number, v2: number, v3: number,\n v4: number, v5: number, v6: number, v7: number,\n v8: number, v9: number, v10: number, v11: number,\n v12: number, v13: number, v14: number, v15: number,\n dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = v0; newDst[ 1] = v1; newDst[ 2] = v2; newDst[ 3] = v3;\n newDst[ 4] = v4; newDst[ 5] = v5; newDst[ 6] = v6; newDst[ 7] = v7;\n newDst[ 8] = v8; newDst[ 9] = v9; newDst[10] = v10; newDst[11] = v11;\n newDst[12] = v12; newDst[13] = v13; newDst[14] = v14; newDst[15] = v15;\n\n return newDst;\n}\n\n/**\n * Creates a Mat4 from a Mat3\n * @param m3 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from m3\n */\nfunction fromMat3(m3: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = m3[0]; newDst[ 1] = m3[1]; newDst[ 2] = m3[ 2]; newDst[ 3] = 0;\n newDst[ 4] = m3[4]; newDst[ 5] = m3[5]; newDst[ 6] = m3[ 6]; newDst[ 7] = 0;\n newDst[ 8] = m3[8]; newDst[ 9] = m3[9]; newDst[10] = m3[10]; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a Mat4 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from q\n */\nfunction fromQuat(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3];\n const x2 = x + x; const y2 = y + y; const z2 = z + z;\n\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n newDst[ 0] = 1 - yy - zz; newDst[ 1] = yx + wz; newDst[ 2] = zx - wy; newDst[ 3] = 0;\n newDst[ 4] = yx - wz; newDst[ 5] = 1 - xx - zz; newDst[ 6] = zy + wx; newDst[ 7] = 0;\n newDst[ 8] = zx + wy; newDst[ 9] = zy - wx; newDst[10] = 1 - xx - yy; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\nfunction negate(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = -m[ 0]; newDst[ 1] = -m[ 1]; newDst[ 2] = -m[ 2]; newDst[ 3] = -m[ 3];\n newDst[ 4] = -m[ 4]; newDst[ 5] = -m[ 5]; newDst[ 6] = -m[ 6]; newDst[ 7] = -m[ 7];\n newDst[ 8] = -m[ 8]; newDst[ 9] = -m[ 9]; newDst[10] = -m[10]; newDst[11] = -m[11];\n newDst[12] = -m[12]; newDst[13] = -m[13]; newDst[14] = -m[14]; newDst[15] = -m[15];\n\n return newDst;\n}\n\n/**\n * Copies a matrix. (same as {@link mat4.clone})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nfunction copy(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = m[ 0]; newDst[ 1] = m[ 1]; newDst[ 2] = m[ 2]; newDst[ 3] = m[ 3];\n newDst[ 4] = m[ 4]; newDst[ 5] = m[ 5]; newDst[ 6] = m[ 6]; newDst[ 7] = m[ 7];\n newDst[ 8] = m[ 8]; newDst[ 9] = m[ 9]; newDst[10] = m[10]; newDst[11] = m[11];\n newDst[12] = m[12]; newDst[13] = m[13]; newDst[14] = m[14]; newDst[15] = m[15];\n\n return newDst;\n}\n\n/**\n * Copies a matrix (same as {@link mat4.copy})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nconst clone = copy;\n\n/**\n * Check if 2 matrices are approximately equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are approximately equal\n */\nfunction equalsApproximately(a: Mat4Arg, b: Mat4Arg): boolean {\n return Math.abs(a[ 0] - b[ 0]) < utils.EPSILON &&\n Math.abs(a[ 1] - b[ 1]) < utils.EPSILON &&\n Math.abs(a[ 2] - b[ 2]) < utils.EPSILON &&\n Math.abs(a[ 3] - b[ 3]) < utils.EPSILON &&\n Math.abs(a[ 4] - b[ 4]) < utils.EPSILON &&\n Math.abs(a[ 5] - b[ 5]) < utils.EPSILON &&\n Math.abs(a[ 6] - b[ 6]) < utils.EPSILON &&\n Math.abs(a[ 7] - b[ 7]) < utils.EPSILON &&\n Math.abs(a[ 8] - b[ 8]) < utils.EPSILON &&\n Math.abs(a[ 9] - b[ 9]) < utils.EPSILON &&\n Math.abs(a[10] - b[10]) < utils.EPSILON &&\n Math.abs(a[11] - b[11]) < utils.EPSILON &&\n Math.abs(a[12] - b[12]) < utils.EPSILON &&\n Math.abs(a[13] - b[13]) < utils.EPSILON &&\n Math.abs(a[14] - b[14]) < utils.EPSILON &&\n Math.abs(a[15] - b[15]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 matrices are exactly equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are exactly equal\n */\nfunction equals(a: Mat4Arg, b: Mat4Arg): boolean {\n return a[ 0] === b[ 0] &&\n a[ 1] === b[ 1] &&\n a[ 2] === b[ 2] &&\n a[ 3] === b[ 3] &&\n a[ 4] === b[ 4] &&\n a[ 5] === b[ 5] &&\n a[ 6] === b[ 6] &&\n a[ 7] === b[ 7] &&\n a[ 8] === b[ 8] &&\n a[ 9] === b[ 9] &&\n a[10] === b[10] &&\n a[11] === b[11] &&\n a[12] === b[12] &&\n a[13] === b[13] &&\n a[14] === b[14] &&\n a[15] === b[15];\n}\n\n/**\n * Creates a 4-by-4 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 4-by-4 identity matrix.\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\nfunction transpose(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n if (newDst === m) {\n let t;\n\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n\n t = m[3];\n m[3] = m[12];\n m[12] = t;\n\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n\n t = m[7];\n m[7] = m[13];\n m[13] = t;\n\n t = m[11];\n m[11] = m[14];\n m[14] = t;\n return newDst;\n }\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n newDst[ 0] = m00; newDst[ 1] = m10; newDst[ 2] = m20; newDst[ 3] = m30;\n newDst[ 4] = m01; newDst[ 5] = m11; newDst[ 6] = m21; newDst[ 7] = m31;\n newDst[ 8] = m02; newDst[ 9] = m12; newDst[10] = m22; newDst[11] = m32;\n newDst[12] = m03; newDst[13] = m13; newDst[14] = m23; newDst[15] = m33;\n\n return newDst;\n}\n\n/**\n * Computes the inverse of a 4-by-4 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nfunction inverse(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n const tmp12 = m20 * m31;\n const tmp13 = m30 * m21;\n const tmp14 = m10 * m31;\n const tmp15 = m30 * m11;\n const tmp16 = m10 * m21;\n const tmp17 = m20 * m11;\n const tmp18 = m00 * m31;\n const tmp19 = m30 * m01;\n const tmp20 = m00 * m21;\n const tmp21 = m20 * m01;\n const tmp22 = m00 * m11;\n const tmp23 = m10 * m01;\n\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n\n const d = 1 / (m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3);\n\n newDst[ 0] = d * t0;\n newDst[ 1] = d * t1;\n newDst[ 2] = d * t2;\n newDst[ 3] = d * t3;\n newDst[ 4] = d * ((tmp1 * m10 + tmp2 * m20 + tmp5 * m30) -\n (tmp0 * m10 + tmp3 * m20 + tmp4 * m30));\n newDst[ 5] = d * ((tmp0 * m00 + tmp7 * m20 + tmp8 * m30) -\n (tmp1 * m00 + tmp6 * m20 + tmp9 * m30));\n newDst[ 6] = d * ((tmp3 * m00 + tmp6 * m10 + tmp11 * m30) -\n (tmp2 * m00 + tmp7 * m10 + tmp10 * m30));\n newDst[ 7] = d * ((tmp4 * m00 + tmp9 * m10 + tmp10 * m20) -\n (tmp5 * m00 + tmp8 * m10 + tmp11 * m20));\n newDst[ 8] = d * ((tmp12 * m13 + tmp15 * m23 + tmp16 * m33) -\n (tmp13 * m13 + tmp14 * m23 + tmp17 * m33));\n newDst[ 9] = d * ((tmp13 * m03 + tmp18 * m23 + tmp21 * m33) -\n (tmp12 * m03 + tmp19 * m23 + tmp20 * m33));\n newDst[10] = d * ((tmp14 * m03 + tmp19 * m13 + tmp22 * m33) -\n (tmp15 * m03 + tmp18 * m13 + tmp23 * m33));\n newDst[11] = d * ((tmp17 * m03 + tmp20 * m13 + tmp23 * m23) -\n (tmp16 * m03 + tmp21 * m13 + tmp22 * m23));\n newDst[12] = d * ((tmp14 * m22 + tmp17 * m32 + tmp13 * m12) -\n (tmp16 * m32 + tmp12 * m12 + tmp15 * m22));\n newDst[13] = d * ((tmp20 * m32 + tmp12 * m02 + tmp19 * m22) -\n (tmp18 * m22 + tmp21 * m32 + tmp13 * m02));\n newDst[14] = d * ((tmp18 * m12 + tmp23 * m32 + tmp15 * m02) -\n (tmp22 * m32 + tmp14 * m02 + tmp19 * m12));\n newDst[15] = d * ((tmp22 * m22 + tmp16 * m02 + tmp21 * m12) -\n (tmp20 * m12 + tmp23 * m22 + tmp17 * m02));\n\n return newDst;\n}\n\n/**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\nfunction determinant(m: Mat4Arg): number {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n\n return m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3;\n}\n\n/**\n * Computes the inverse of a 4-by-4 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nconst invert = inverse;\n\n/**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nfunction multiply(a: Mat4Arg, b: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[ 4 + 0];\n const a11 = a[ 4 + 1];\n const a12 = a[ 4 + 2];\n const a13 = a[ 4 + 3];\n const a20 = a[ 8 + 0];\n const a21 = a[ 8 + 1];\n const a22 = a[ 8 + 2];\n const a23 = a[ 8 + 3];\n const a30 = a[12 + 0];\n const a31 = a[12 + 1];\n const a32 = a[12 + 2];\n const a33 = a[12 + 3];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b03 = b[3];\n const b10 = b[ 4 + 0];\n const b11 = b[ 4 + 1];\n const b12 = b[ 4 + 2];\n const b13 = b[ 4 + 3];\n const b20 = b[ 8 + 0];\n const b21 = b[ 8 + 1];\n const b22 = b[ 8 + 2];\n const b23 = b[ 8 + 3];\n const b30 = b[12 + 0];\n const b31 = b[12 + 1];\n const b32 = b[12 + 2];\n const b33 = b[12 + 3];\n\n newDst[ 0] = a00 * b00 + a10 * b01 + a20 * b02 + a30 * b03;\n newDst[ 1] = a01 * b00 + a11 * b01 + a21 * b02 + a31 * b03;\n newDst[ 2] = a02 * b00 + a12 * b01 + a22 * b02 + a32 * b03;\n newDst[ 3] = a03 * b00 + a13 * b01 + a23 * b02 + a33 * b03;\n newDst[ 4] = a00 * b10 + a10 * b11 + a20 * b12 + a30 * b13;\n newDst[ 5] = a01 * b10 + a11 * b11 + a21 * b12 + a31 * b13;\n newDst[ 6] = a02 * b10 + a12 * b11 + a22 * b12 + a32 * b13;\n newDst[ 7] = a03 * b10 + a13 * b11 + a23 * b12 + a33 * b13;\n newDst[ 8] = a00 * b20 + a10 * b21 + a20 * b22 + a30 * b23;\n newDst[ 9] = a01 * b20 + a11 * b21 + a21 * b22 + a31 * b23;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22 + a32 * b23;\n newDst[11] = a03 * b20 + a13 * b21 + a23 * b22 + a33 * b23;\n newDst[12] = a00 * b30 + a10 * b31 + a20 * b32 + a30 * b33;\n newDst[13] = a01 * b30 + a11 * b31 + a21 * b32 + a31 * b33;\n newDst[14] = a02 * b30 + a12 * b31 + a22 * b32 + a32 * b33;\n newDst[15] = a03 * b30 + a13 * b31 + a23 * b32 + a33 * b33;\n\n return newDst;\n}\n\n/**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nconst mul = multiply;\n\n/**\n * Sets the translation component of a 4-by-4 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\nfunction setTranslation(a: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? identity()) as T;\n if (a !== newDst) {\n newDst[ 0] = a[ 0];\n newDst[ 1] = a[ 1];\n newDst[ 2] = a[ 2];\n newDst[ 3] = a[ 3];\n newDst[ 4] = a[ 4];\n newDst[ 5] = a[ 5];\n newDst[ 6] = a[ 6];\n newDst[ 7] = a[ 7];\n newDst[ 8] = a[ 8];\n newDst[ 9] = a[ 9];\n newDst[10] = a[10];\n newDst[11] = a[11];\n }\n newDst[12] = v[0];\n newDst[13] = v[1];\n newDst[14] = v[2];\n newDst[15] = 1;\n return newDst;\n}\n\n///**\n// * Returns the translation component of a 4-by-4 matrix as a vector with 3\n// * entries.\n// * @param m - The matrix.\n// * @param dst - vector to hold result. If not passed a new one is created.\n// * @returns The translation component of m.\n// */\nfunction getTranslation(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? vec3.create()) as T;\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n}\n\n/**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat4Arg, axis: number, dst?: T) {\n const newDst = (dst ?? vec3.create());\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n}\n\n/**\n * Sets an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\nfunction setAxis(m: Mat4Arg, v: Vec3Arg, axis: number, dst: T) {\n const newDst = (dst === m) ? dst : copy(m, dst);\n\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n newDst[off + 2] = v[2];\n return newDst;\n}\n\n/**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? vec3.create()) as T;\n\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 0 to 1 in the z dimension.\n *\n * Note: If you pass `Infinity` for zFar then it will produce a projection matrix\n * returns -Infinity for Z when transforming coordinates with Z <= 0 and +Infinity for Z\n * otherwise.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */\nfunction perspective(fieldOfViewYInRadians: number, aspect: number, zNear: number, zFar: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const f = Math.tan(Math.PI * 0.5 - 0.5 * fieldOfViewYInRadians);\n\n newDst[0] = f / aspect;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n newDst[4] = 0;\n newDst[5] = f;\n newDst[6] = 0;\n newDst[7] = 0;\n\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[11] = -1;\n\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (Number.isFinite(zFar)) {\n const rangeInv = 1 / (zNear - zFar);\n newDst[10] = zFar * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n } else {\n newDst[10] = -1;\n newDst[14] = -zNear;\n }\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 1 (at -zNear) to 0 (at -zFar) in the z dimension.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane. (default = Infinity)\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */function perspectiveReverseZ(fieldOfViewYInRadians: number, aspect: number, zNear: number, zFar = Infinity, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const f = 1 / Math.tan(fieldOfViewYInRadians * 0.5);\n\n newDst[ 0] = f / aspect;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n\n newDst[ 4] = 0;\n newDst[ 5] = f;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n\n newDst[ 8] = 0;\n newDst[ 9] = 0;\n newDst[11] = -1;\n\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (zFar === Infinity) {\n newDst[10] = 0;\n newDst[14] = zNear;\n } else {\n const rangeInv = 1 / (zFar - zNear);\n newDst[10] = zNear * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n }\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 orthogonal transformation matrix that transforms from\n * the given the left, right, bottom, and top dimensions to -1 +1 in x, and y\n * and 0 to +1 in z.\n * @param left - Left side of the near clipping plane viewport.\n * @param right - Right side of the near clipping plane viewport.\n * @param bottom - Bottom of the near clipping plane viewport.\n * @param top - Top of the near clipping plane viewport.\n * @param near - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param far - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The orthographic projection matrix.\n */\nfunction ortho(left: number, right: number, bottom: number, top: number, near: number, far: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[0] = 2 / (right - left);\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n newDst[4] = 0;\n newDst[5] = 2 / (top - bottom);\n newDst[6] = 0;\n newDst[7] = 0;\n\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[10] = 1 / (near - far);\n newDst[11] = 0;\n\n newDst[12] = (right + left) / (left - right);\n newDst[13] = (top + bottom) / (bottom - top);\n newDst[14] = near / (near - far);\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 0 to 1 in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\nfunction frustum(left: number, right: number, bottom: number, top: number, near: number, far: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const dx = (right - left);\n const dy = (top - bottom);\n const dz = (near - far);\n\n newDst[ 0] = 2 * near / dx;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n newDst[ 4] = 0;\n newDst[ 5] = 2 * near / dy;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n newDst[ 8] = (left + right) / dx;\n newDst[ 9] = (top + bottom) / dy;\n newDst[10] = far / dz;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = near * far / dz;\n newDst[15] = 0;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 1 (-near) to 0 (-far) in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\nfunction frustumReverseZ(left: number, right: number, bottom: number, top: number, near: number, far = Infinity, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const dx = (right - left);\n const dy = (top - bottom);\n\n newDst[ 0] = 2 * near / dx;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n newDst[ 4] = 0;\n newDst[ 5] = 2 * near / dy;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n newDst[ 8] = (left + right) / dx;\n newDst[ 9] = (top + bottom) / dy;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (far === Infinity) {\n newDst[10] = 0;\n newDst[14] = near;\n } else {\n const rangeInv = 1 / (far - near);\n newDst[10] = near * rangeInv;\n newDst[14] = far * near * rangeInv;\n }\n\n return newDst;\n}\n\nconst xAxis = vec3.create();\nconst yAxis = vec3.create();\nconst zAxis = vec3.create();\n\n/**\n * Computes a 4-by-4 aim transformation.\n *\n * This is a matrix which positions an object aiming down positive Z.\n * toward the target.\n *\n * Note: this is **NOT** the inverse of lookAt as lookAt looks at negative Z.\n *\n * @param position - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\nfunction aim(position: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(target, position, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = xAxis[1]; newDst[ 2] = xAxis[2]; newDst[ 3] = 0;\n newDst[ 4] = yAxis[0]; newDst[ 5] = yAxis[1]; newDst[ 6] = yAxis[2]; newDst[ 7] = 0;\n newDst[ 8] = zAxis[0]; newDst[ 9] = zAxis[1]; newDst[10] = zAxis[2]; newDst[11] = 0;\n newDst[12] = position[0]; newDst[13] = position[1]; newDst[14] = position[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 camera aim transformation.\n *\n * This is a matrix which positions an object aiming down negative Z.\n * toward the target.\n *\n * Note: this is the inverse of `lookAt`\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\nfunction cameraAim(eye: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = xAxis[1]; newDst[ 2] = xAxis[2]; newDst[ 3] = 0;\n newDst[ 4] = yAxis[0]; newDst[ 5] = yAxis[1]; newDst[ 6] = yAxis[2]; newDst[ 7] = 0;\n newDst[ 8] = zAxis[0]; newDst[ 9] = zAxis[1]; newDst[10] = zAxis[2]; newDst[11] = 0;\n newDst[12] = eye[0]; newDst[13] = eye[1]; newDst[14] = eye[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 view transformation.\n *\n * This is a view matrix which transforms all other objects\n * to be in the space of the view defined by the parameters.\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The look-at matrix.\n */\nfunction lookAt(eye: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = yAxis[0]; newDst[ 2] = zAxis[0]; newDst[ 3] = 0;\n newDst[ 4] = xAxis[1]; newDst[ 5] = yAxis[1]; newDst[ 6] = zAxis[1]; newDst[ 7] = 0;\n newDst[ 8] = xAxis[2]; newDst[ 9] = yAxis[2]; newDst[10] = zAxis[2]; newDst[11] = 0;\n\n newDst[12] = -(xAxis[0] * eye[0] + xAxis[1] * eye[1] + xAxis[2] * eye[2]);\n newDst[13] = -(yAxis[0] * eye[0] + yAxis[1] * eye[1] + yAxis[2] * eye[2]);\n newDst[14] = -(zAxis[0] * eye[0] + zAxis[1] * eye[1] + zAxis[2] * eye[2]);\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which translates by the given vector v.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\nfunction translation(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = v[0]; newDst[13] = v[1]; newDst[14] = v[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Translates the given 4-by-4 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\nfunction translate(m: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n if (m !== newDst) {\n newDst[ 0] = m00;\n newDst[ 1] = m01;\n newDst[ 2] = m02;\n newDst[ 3] = m03;\n newDst[ 4] = m10;\n newDst[ 5] = m11;\n newDst[ 6] = m12;\n newDst[ 7] = m13;\n newDst[ 8] = m20;\n newDst[ 9] = m21;\n newDst[10] = m22;\n newDst[11] = m23;\n }\n\n newDst[12] = m00 * v0 + m10 * v1 + m20 * v2 + m30;\n newDst[13] = m01 * v0 + m11 * v1 + m21 * v2 + m31;\n newDst[14] = m02 * v0 + m12 * v1 + m22 * v2 + m32;\n newDst[15] = m03 * v0 + m13 * v1 + m23 * v2 + m33;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the x-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationX(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = c; newDst[ 6] = s; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = -s; newDst[10] = c; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the x-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateX(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[4] = c * m10 + s * m20;\n newDst[5] = c * m11 + s * m21;\n newDst[6] = c * m12 + s * m22;\n newDst[7] = c * m13 + s * m23;\n newDst[8] = c * m20 - s * m10;\n newDst[9] = c * m21 - s * m11;\n newDst[10] = c * m22 - s * m12;\n newDst[11] = c * m23 - s * m13;\n\n if (m !== newDst) {\n newDst[ 0] = m[ 0];\n newDst[ 1] = m[ 1];\n newDst[ 2] = m[ 2];\n newDst[ 3] = m[ 3];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the y-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationY(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = 0; newDst[ 2] = -s; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = s; newDst[ 9] = 0; newDst[10] = c; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the y-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateY(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 - s * m20;\n newDst[ 1] = c * m01 - s * m21;\n newDst[ 2] = c * m02 - s * m22;\n newDst[ 3] = c * m03 - s * m23;\n newDst[ 8] = c * m20 + s * m00;\n newDst[ 9] = c * m21 + s * m01;\n newDst[10] = c * m22 + s * m02;\n newDst[11] = c * m23 + s * m03;\n\n if (m !== newDst) {\n newDst[ 4] = m[ 4];\n newDst[ 5] = m[ 5];\n newDst[ 6] = m[ 6];\n newDst[ 7] = m[ 7];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the z-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationZ(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = s; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = -s; newDst[ 5] = c; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the z-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateZ(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 + s * m10;\n newDst[ 1] = c * m01 + s * m11;\n newDst[ 2] = c * m02 + s * m12;\n newDst[ 3] = c * m03 + s * m13;\n newDst[ 4] = c * m10 - s * m00;\n newDst[ 5] = c * m11 - s * m01;\n newDst[ 6] = c * m12 - s * m02;\n newDst[ 7] = c * m13 - s * m03;\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n newDst[11] = m[11];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\nfunction axisRotation(axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n\n newDst[ 0] = xx + (1 - xx) * c;\n newDst[ 1] = x * y * oneMinusCosine + z * s;\n newDst[ 2] = x * z * oneMinusCosine - y * s;\n newDst[ 3] = 0;\n newDst[ 4] = x * y * oneMinusCosine - z * s;\n newDst[ 5] = yy + (1 - yy) * c;\n newDst[ 6] = y * z * oneMinusCosine + x * s;\n newDst[ 7] = 0;\n newDst[ 8] = x * z * oneMinusCosine + y * s;\n newDst[ 9] = y * z * oneMinusCosine - x * s;\n newDst[10] = zz + (1 - zz) * c;\n newDst[11] = 0;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = 0;\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle. (same as axisRotation)\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\nconst rotation = axisRotation;\n\n/**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle.\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction axisRotate(m: Mat4Arg, axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n\n const r00 = xx + (1 - xx) * c;\n const r01 = x * y * oneMinusCosine + z * s;\n const r02 = x * z * oneMinusCosine - y * s;\n const r10 = x * y * oneMinusCosine - z * s;\n const r11 = yy + (1 - yy) * c;\n const r12 = y * z * oneMinusCosine + x * s;\n const r20 = x * z * oneMinusCosine + y * s;\n const r21 = y * z * oneMinusCosine - x * s;\n const r22 = zz + (1 - zz) * c;\n\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n\n newDst[ 0] = r00 * m00 + r01 * m10 + r02 * m20;\n newDst[ 1] = r00 * m01 + r01 * m11 + r02 * m21;\n newDst[ 2] = r00 * m02 + r01 * m12 + r02 * m22;\n newDst[ 3] = r00 * m03 + r01 * m13 + r02 * m23;\n newDst[ 4] = r10 * m00 + r11 * m10 + r12 * m20;\n newDst[ 5] = r10 * m01 + r11 * m11 + r12 * m21;\n newDst[ 6] = r10 * m02 + r11 * m12 + r12 * m22;\n newDst[ 7] = r10 * m03 + r11 * m13 + r12 * m23;\n newDst[ 8] = r20 * m00 + r21 * m10 + r22 * m20;\n newDst[ 9] = r20 * m01 + r21 * m11 + r22 * m21;\n newDst[10] = r20 * m02 + r21 * m12 + r22 * m22;\n newDst[11] = r20 * m03 + r21 * m13 + r22 * m23;\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle. (same as rotate)\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nconst rotate = axisRotate;\n\n/**\n * Creates a 4-by-4 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * three entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = v[2]; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 4-by-4 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of three entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale(m: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n newDst[ 3] = v0 * m[0 * 4 + 3];\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n newDst[ 7] = v1 * m[1 * 4 + 3];\n newDst[ 8] = v2 * m[2 * 4 + 0];\n newDst[ 9] = v2 * m[2 * 4 + 1];\n newDst[10] = v2 * m[2 * 4 + 2];\n newDst[11] = v2 * m[2 * 4 + 3];\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which scales a uniform amount in each dimension.\n * @param s - the amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = s; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 4-by-4 matrix in each dimension by a uniform scale.\n * @param m - The matrix to be modified.\n * @param s - The amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale(m: Mat4Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n newDst[ 3] = s * m[0 * 4 + 3];\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n newDst[ 7] = s * m[1 * 4 + 3];\n newDst[ 8] = s * m[2 * 4 + 0];\n newDst[ 9] = s * m[2 * 4 + 1];\n newDst[10] = s * m[2 * 4 + 2];\n newDst[11] = s * m[2 * 4 + 3];\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\nreturn {\n create,\n set,\n fromMat3,\n fromQuat,\n negate,\n copy,\n clone,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n determinant,\n invert,\n multiply,\n mul,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n perspective,\n perspectiveReverseZ,\n ortho,\n frustum,\n frustumReverseZ,\n aim,\n cameraAim,\n lookAt,\n translation,\n translate,\n rotationX,\n rotateX,\n rotationY,\n rotateY,\n rotationZ,\n rotateZ,\n axisRotation,\n rotation,\n axisRotate,\n rotate,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n};\n\n}\n\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Mat4Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { QuatArg, QuatType } from './quat';\nimport { Mat3Arg } from './mat3.js';\nimport { Mat4Arg } from './mat4.js';\nimport { Vec3Arg } from './vec3.js';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\n\nexport { QuatArg, QuatType };\n\ntype QuatCtor = new (n: number) => T;\n\nexport type RotationOrder = 'xyz' | 'xzy' | 'yxz' | 'yzx' | 'zxy' | 'zyx';\n\n/**\n * Generates am typed API for Qud\n * */\nfunction getAPIImpl(Ctor: QuatCtor) {\n const vec3 = getVec3API(Ctor);\n\n/**\n * Creates a quat4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number, w?: number) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a Quat; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Quat\n * Also see {@link quat.create} and {@link quat.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, w: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n\n return newDst;\n}\n\n/**\n * Sets a quaternion from the given angle and axis,\n * then returns it.\n *\n * @param axis - the axis to rotate around\n * @param angleInRadians - the angle\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The quaternion that represents the given axis and angle\n **/\nfunction fromAxisAngle(axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n const s = Math.sin(halfAngle);\n\n newDst[0] = s * axis[0];\n newDst[1] = s * axis[1];\n newDst[2] = s * axis[2];\n newDst[3] = Math.cos(halfAngle);\n\n return newDst;\n}\n\n/**\n * Gets the rotation axis and angle\n * @param q - quaternion to compute from\n * @param dst - Vec3 to hold result. If not passed in a new one is created.\n * @return angle and axis\n */\nfunction toAxisAngle(q: QuatArg, dst?: T): { angle: number, axis: T } {\n const newDst = (dst ?? vec3.create(3)) as T;\n\n const angle = Math.acos(q[3]) * 2;\n const s = Math.sin(angle * 0.5);\n if (s > utils.EPSILON) {\n newDst[0] = q[0] / s;\n newDst[1] = q[1] / s;\n newDst[2] = q[2] / s;\n } else {\n newDst[0] = 1;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n\n return { angle, axis: newDst };\n}\n\n/**\n * Returns the angle in degrees between two rotations a and b.\n * @param a - quaternion a\n * @param b - quaternion b\n * @return angle in radians between the two quaternions\n */\nfunction angle(a: QuatArg, b: QuatArg) {\n const d = dot(a, b);\n return Math.acos(2 * d * d - 1);\n}\n\n/**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction multiply(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const bw = b[3];\n\n newDst[0] = ax * bw + aw * bx + ay * bz - az * by;\n newDst[1] = ay * bw + aw * by + az * bx - ax * bz;\n newDst[2] = az * bw + aw * bz + ax * by - ay * bx;\n newDst[3] = aw * bw - ax * bx - ay * by - az * bz;\n\n return newDst;\n}\n\n/**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nconst mul = multiply;\n\n/**\n * Rotates the given quaternion around the X axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateX(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const bx = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw + qw * bx;\n newDst[1] = qy * bw + qz * bx;\n newDst[2] = qz * bw - qy * bx;\n newDst[3] = qw * bw - qx * bx;\n\n return newDst;\n}\n\n/**\n * Rotates the given quaternion around the Y axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateY(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const by = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw - qz * by;\n newDst[1] = qy * bw + qw * by;\n newDst[2] = qz * bw + qx * by;\n newDst[3] = qw * bw - qy * by;\n\n return newDst;\n}\n\n/**\n * Rotates the given quaternion around the Z axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateZ(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const bz = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw + qy * bz;\n newDst[1] = qy * bw - qx * bz;\n newDst[2] = qz * bw + qw * bz;\n newDst[3] = qw * bw - qz * bz;\n\n return newDst;\n}\n\n/**\n * Spherically linear interpolate between two quaternions\n *\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction slerp(a: QuatArg, b: QuatArg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n\n let bx = b[0];\n let by = b[1];\n let bz = b[2];\n let bw = b[3];\n\n let cosOmega = ax * bx + ay * by + az * bz + aw * bw;\n\n if (cosOmega < 0) {\n cosOmega = -cosOmega;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n\n let scale0;\n let scale1;\n\n if (1.0 - cosOmega > utils.EPSILON) {\n const omega = Math.acos(cosOmega);\n const sinOmega = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinOmega;\n scale1 = Math.sin(t * omega) / sinOmega;\n } else {\n scale0 = 1.0 - t;\n scale1 = t;\n }\n\n newDst[0] = scale0 * ax + scale1 * bx;\n newDst[1] = scale0 * ay + scale1 * by;\n newDst[2] = scale0 * az + scale1 * bz;\n newDst[3] = scale0 * aw + scale1 * bw;\n\n return newDst;\n}\n\n/**\n * Compute the inverse of a quaternion\n *\n * @param q - quaternion to compute the inverse of\n * @returns A quaternion that is the result of a * b\n */\nfunction inverse(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const a0 = q[0];\n const a1 = q[1];\n const a2 = q[2];\n const a3 = q[3];\n\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n\n newDst[0] = -a0 * invDot;\n newDst[1] = -a1 * invDot;\n newDst[2] = -a2 * invDot;\n newDst[3] = a3 * invDot;\n\n return newDst;\n}\n\n/**\n * Compute the conjugate of a quaternion\n * For quaternions with a magnitude of 1 (a unit quaternion)\n * this returns the same as the inverse but is faster to calculate.\n *\n * @param q - quaternion to compute the conjugate of.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The conjugate of q\n */\nfunction conjugate(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = -q[0];\n newDst[1] = -q[1];\n newDst[2] = -q[2];\n newDst[3] = q[3];\n\n return newDst;\n}\n\n/**\n * Creates a quaternion from the given rotation matrix.\n *\n * The created quaternion is not normalized.\n *\n * @param m - rotation matrix\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\nfunction fromMat(m: Mat3Arg | Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n /*\n 0 1 2\n 3 4 5\n 6 7 8\n\n 0 1 2\n 4 5 6\n 8 9 10\n */\n\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n const trace = m[0] + m[5] + m[10];\n\n if (trace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n const root = Math.sqrt(trace + 1); // 2w\n newDst[3] = 0.5 * root;\n const invRoot = 0.5 / root; // 1/(4w)\n\n newDst[0] = (m[6] - m[9]) * invRoot;\n newDst[1] = (m[8] - m[2]) * invRoot;\n newDst[2] = (m[1] - m[4]) * invRoot;\n } else {\n // |w| <= 1/2\n let i = 0;\n\n if (m[5] > m[0]) {\n i = 1;\n }\n if (m[10] > m[i * 4 + i]) {\n i = 2;\n }\n\n const j = (i + 1) % 3;\n const k = (i + 2) % 3;\n\n const root = Math.sqrt(m[i * 4 + i] - m[j * 4 + j] - m[k * 4 + k] + 1.0);\n newDst[i] = 0.5 * root;\n\n const invRoot = 0.5 / root;\n\n newDst[3] = (m[j * 4 + k] - m[k * 4 + j]) * invRoot;\n newDst[j] = (m[j * 4 + i] + m[i * 4 + j]) * invRoot;\n newDst[k] = (m[k * 4 + i] + m[i * 4 + k]) * invRoot;\n }\n\n return newDst;\n}\n\n/**\n * Creates a quaternion from the given euler angle x, y, z using the provided intrinsic order for the conversion.\n *\n * @param xAngleInRadians - angle to rotate around X axis in radians.\n * @param yAngleInRadians - angle to rotate around Y axis in radians.\n * @param zAngleInRadians - angle to rotate around Z axis in radians.\n * @param order - order to apply euler angles\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion representing the same rotation as the euler angles applied in the given order\n */\nfunction fromEuler(\n xAngleInRadians: number,\n yAngleInRadians: number,\n zAngleInRadians: number,\n order: RotationOrder,\n dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const xHalfAngle = xAngleInRadians * 0.5;\n const yHalfAngle = yAngleInRadians * 0.5;\n const zHalfAngle = zAngleInRadians * 0.5;\n\n const sx = Math.sin(xHalfAngle);\n const cx = Math.cos(xHalfAngle);\n const sy = Math.sin(yHalfAngle);\n const cy = Math.cos(yHalfAngle);\n const sz = Math.sin(zHalfAngle);\n const cz = Math.cos(zHalfAngle);\n\n switch (order) {\n case 'xyz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'xzy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n case 'yxz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n case 'yzx':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'zxy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'zyx':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n default:\n throw new Error(`Unknown rotation order: ${order}`);\n }\n\n return newDst;\n}\n\n/**\n * Copies a quaternion. (same as {@link quat.clone})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is a copy of q\n */\nfunction copy(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = q[0];\n newDst[1] = q[1];\n newDst[2] = q[2];\n newDst[3] = q[3];\n\n return newDst;\n}\n\n/**\n * Clones a quaternion. (same as {@link quat.copy})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A copy of q.\n */\nconst clone = copy;\n\n/**\n * Adds two quaternions; assumes a and b have the same dimension.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the sum of a and b.\n */\nfunction add(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\nfunction subtract(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Multiplies a quaternion by a scalar.\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nfunction mulScalar(v: QuatArg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a quaternion by a scalar. (same as mulScalar)\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nfunction divScalar(v: QuatArg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two quaternions\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns dot product\n */\nfunction dot(a: QuatArg, b: QuatArg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n}\n\n/**\n * Performs linear interpolation on two quaternions.\n * Given quaternions a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param t - Interpolation coefficient.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: QuatArg, b: QuatArg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Computes the length of quaternion\n * @param v - quaternion.\n * @returns length of quaternion.\n */\nfunction length(v: QuatArg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n}\n\n/**\n * Computes the length of quaternion (same as length)\n * @param v - quaternion.\n * @returns length of quaternion.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of quaternion\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\nfunction lengthSq(v: QuatArg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n}\n\n/**\n * Computes the square of the length of quaternion (same as lengthSq)\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\nconst lenSq = lengthSq;\n\n/**\n * Divides a quaternion by its Euclidean length and returns the quotient.\n * @param v - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The normalized quaternion.\n */\nfunction normalize(v: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n }\n\n return newDst;\n}\n\n/**\n * Check if 2 quaternions are approximately equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are approximately equal\n */\nfunction equalsApproximately(a: QuatArg, b: QuatArg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON &&\n Math.abs(a[3] - b[3]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 quaternions are exactly equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are exactly equal\n */\nfunction equals(a: QuatArg, b: QuatArg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Creates an identity quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns an identity quaternion\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n\n return newDst;\n}\n\nconst tempVec3 = vec3.create();\nconst xUnitVec3 = vec3.create();\nconst yUnitVec3 = vec3.create();\n\n/**\n * Computes a quaternion to represent the shortest rotation from one vector to another.\n *\n * @param aUnit - the start vector\n * @param bUnit - the end vector\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\nfunction rotationTo(aUnit: Vec3Arg, bUnit: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const dot = vec3.dot(aUnit, bUnit);\n if (dot < -0.999999) {\n vec3.cross(xUnitVec3, aUnit, tempVec3);\n if (vec3.len(tempVec3) < 0.000001) {\n vec3.cross(yUnitVec3, aUnit, tempVec3);\n }\n\n vec3.normalize(tempVec3, tempVec3);\n fromAxisAngle(tempVec3, Math.PI, newDst);\n\n return newDst;\n } else if (dot > 0.999999) {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n\n return newDst;\n } else {\n vec3.cross(aUnit, bUnit, tempVec3);\n\n newDst[0] = tempVec3[0];\n newDst[1] = tempVec3[1];\n newDst[2] = tempVec3[2];\n newDst[3] = 1 + dot;\n\n return normalize(newDst, newDst);\n }\n}\n\nconst tempQuat1 = new Ctor(4);\nconst tempQuat2 = new Ctor(4);\n\n/**\n * Performs a spherical linear interpolation with two control points\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param c - the third quaternion\n * @param d - the fourth quaternion\n * @param t - Interpolation coefficient 0 to 1\n * @returns result\n */\nfunction sqlerp(\n a: QuatArg,\n b: QuatArg,\n c: QuatArg,\n d: QuatArg,\n t: number,\n dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n slerp(a, d, t, tempQuat1);\n slerp(b, c, t, tempQuat2);\n slerp(tempQuat1, tempQuat2, 2 * t * (1 - t), newDst);\n\n return newDst;\n}\n\nreturn {\n create,\n fromValues,\n set,\n fromAxisAngle,\n toAxisAngle,\n angle,\n multiply,\n mul,\n rotateX,\n rotateY,\n rotateZ,\n slerp,\n inverse,\n conjugate,\n fromMat,\n fromEuler,\n copy,\n clone,\n add,\n subtract,\n sub,\n mulScalar,\n scale,\n divScalar,\n dot,\n lerp,\n length,\n len,\n lengthSq,\n lenSq,\n normalize,\n equalsApproximately,\n equals,\n identity,\n rotationTo,\n sqlerp,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\n/**\n *\n * Quat4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Quat4`. In other words you can do this\n *\n * const v = quat4.cross(v1, v2); // Creates a new Quat4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = quat4.create();\n * quat4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * quat4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nexport function getAPI(Ctor: QuatCtor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Vec4Arg, Vec4Type } from './vec4';\nimport { Mat4Arg } from './mat4';\nimport { BaseArgType } from './types';\n\nexport { Vec4Arg, Vec4Type };\n\ntype Vec4Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec4\n * */\nfunction getAPIImpl(Ctor: Vec4Ctor) {\n\n/**\n * Creates a vec4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number, w?: number) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a vec4; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec4\n * Also see {@link vec4.create} and {@link vec4.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, w: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n newDst[3] = Math.ceil(v[3]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n newDst[3] = Math.floor(v[3]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n newDst[3] = Math.round(v[3]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec4Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n newDst[3] = Math.min(max, Math.max(min, v[3]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec4Arg, b: Vec4Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n newDst[3] = a[3] + b[3] * scale;\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec4Arg, b: Vec4Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON &&\n Math.abs(a[3] - b[3]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec4Arg, b: Vec4Arg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec4Arg, b: Vec4Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec4Arg, b: Vec4Arg, t: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n newDst[3] = a[3] + t[3] * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n newDst[3] = Math.max(a[3], b[3]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n newDst[3] = Math.min(a[3], b[3]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec4Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec4Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n newDst[3] = 1 / v[3];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the dot product of two vectors\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec4Arg, b: Vec4Arg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec4Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec4Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec4Arg, b: Vec4Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec4Arg, b: Vec4Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return dx * dx + dy * dy + dz * dz + dw * dw;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n }\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n newDst[3] = -v[3];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec4.clone})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n newDst[3] = v[3];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec4.copy})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n newDst[3] = a[3] * b[3];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n newDst[3] = a[3] / b[3];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform vec4 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec4 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec4Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = v[3];\n\n newDst[0] = m[0] * x + m[4] * y + m[ 8] * z + m[12] * w;\n newDst[1] = m[1] * x + m[5] * y + m[ 9] * z + m[13] * w;\n newDst[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n newDst[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n\n return newDst;\n}\n\n\n/**\n * Treat a 4D vector as a direction and set it's length\n *\n * @param a The vec4 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec4Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec4 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec4Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n zero,\n transformMat4,\n setLength,\n truncate,\n midpoint,\n};\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\n/**\n *\n * Vec4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Vec4`. In other words you can do this\n *\n * const v = vec4.cross(v1, v2); // Creates a new Vec4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = vec4.create();\n * vec4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * vec4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nexport function getAPI(Ctor: Vec4Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n\n","/**\n * Some docs\n * @namespace wgpu-matrix\n */\nimport {BaseArgType, ZeroArray} from './types';\nimport {Mat3Arg, Mat3Type, getAPI as getMat3API} from './mat3-impl';\nimport {Mat4Arg, Mat4Type, getAPI as getMat4API} from './mat4-impl';\nimport {QuatArg, QuatType, getAPI as getQuatAPI, RotationOrder} from './quat-impl';\nimport {Vec2Arg, Vec2Type, getAPI as getVec2API} from './vec2-impl';\nimport {Vec3Arg, Vec3Type, getAPI as getVec3API} from './vec3-impl';\nimport {Vec4Arg, Vec4Type, getAPI as getVec4API} from './vec4-impl';\nimport * as utils from './utils';\n\nexport {\n RotationOrder,\n utils,\n\n BaseArgType,\n\n Mat3Arg,\n Mat4Arg,\n QuatArg,\n Vec2Arg,\n Vec3Arg,\n Vec4Arg,\n\n Mat3Type,\n Mat4Type,\n QuatType,\n Vec2Type,\n Vec3Type,\n Vec4Type,\n};\n\nexport type BaseCtor = new (n: number) => T;\n\nexport type Mat3 = Mat3Type;\nexport type Mat4 = Mat4Type;\nexport type Quat = QuatType;\nexport type Vec2 = Vec2Type;\nexport type Vec3 = Vec3Type;\nexport type Vec4 = Vec4Type;\n\nexport type Mat3d = Mat3Type;\nexport type Mat4d = Mat4Type;\nexport type Quatd = QuatType;\nexport type Vec2d = Vec2Type;\nexport type Vec3d = Vec3Type;\nexport type Vec4d = Vec4Type;\n\nexport type Mat3n = Mat3Type;\nexport type Mat4n = Mat4Type;\nexport type Quatn = QuatType;\nexport type Vec2n = Vec2Type;\nexport type Vec3n = Vec3Type;\nexport type Vec4n = Vec4Type;\n\n/**\n * Generate wgpu-matrix API for type\n */\nfunction wgpuMatrixAPI<\n Mat3 extends BaseArgType,\n Mat4 extends BaseArgType,\n Quat extends BaseArgType,\n Vec2 extends BaseArgType,\n Vec3 extends BaseArgType,\n Vec4 extends BaseArgType,\n>(\n Mat3Ctor: BaseCtor,\n Mat4Ctor: BaseCtor,\n QuatCtor: BaseCtor,\n Vec2Ctor: BaseCtor,\n Vec3Ctor: BaseCtor,\n Vec4Ctor: BaseCtor,\n) {\n return {\n /** @namespace mat3 */\n mat3: getMat3API(Mat3Ctor),\n /** @namespace mat4 */\n mat4: getMat4API(Mat4Ctor),\n /** @namespace quat */\n quat: getQuatAPI(QuatCtor),\n /** @namespace vec2 */\n vec2: getVec2API(Vec2Ctor),\n /** @namespace vec3 */\n vec3: getVec3API(Vec3Ctor),\n /** @namespace vec4 */\n vec4: getVec4API(Vec4Ctor),\n };\n}\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat3,\n /**\n * 4x4 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat4,\n /**\n * Quaternion functions that default to returning `Float32Array`\n * @namespace\n */\n quat,\n /**\n * Vec2 functions that default to returning `Float32Array`\n * @namespace\n */\n vec2,\n /**\n * Vec3 functions that default to returning `Float32Array`\n * @namespace\n */\n vec3,\n /**\n * Vec3 functions that default to returning `Float32Array`\n * @namespace\n */\n vec4,\n} = wgpuMatrixAPI<\n Mat3, Mat4, Quat, Vec2, Vec3, Vec4>(\n Float32Array, Float32Array, Float32Array, Float32Array, Float32Array, Float32Array);\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat3: mat3d,\n /**\n * 4x4 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat4: mat4d,\n /**\n * Quaternion functions that default to returning `Float64Array`\n * @namespace\n */\n quat: quatd,\n /**\n * Vec2 functions that default to returning `Float64Array`\n * @namespace\n */\n vec2: vec2d,\n /**\n * Vec3 functions that default to returning `Float64Array`\n * @namespace\n */\n vec3: vec3d,\n /**\n * Vec3 functions that default to returning `Float64Array`\n * @namespace\n */\n vec4: vec4d,\n} = wgpuMatrixAPI<\n Mat3d, Mat4d, Quatd, Vec2d, Vec3d, Vec4d>(\n Float64Array, Float64Array, Float64Array, Float64Array, Float64Array, Float64Array);\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat3: mat3n,\n /**\n * 4x4 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat4: mat4n,\n /**\n * Quaternion functions that default to returning `number[]`\n * @namespace\n */\n quat: quatn,\n /**\n * Vec2 functions that default to returning `number[]`\n * @namespace\n */\n vec2: vec2n,\n /**\n * Vec3 functions that default to returning `number[]`\n * @namespace\n */\n vec3: vec3n,\n /**\n * Vec3 functions that default to returning `number[]`\n * @namespace\n */\n vec4: vec4n,\n} = wgpuMatrixAPI<\n Mat3n, Mat4n, Quatn, Vec2n, Vec3n, Vec4n>(\n ZeroArray, Array, Array, Array, Array, Array);\n"],"names":["ZeroArray","OriginalConstructor","modifier","a","fill","constructor","args","super","this","EPSILON","degrees","Math","PI","n","m","b","v","d","abs","t","radians","old","cache","Map","getAPI","Ctor","api","get","create","x","y","newDst","undefined","subtract","dst","lerp","mulScalar","k","inverse","dot","length","v0","v1","sqrt","lengthSq","distance","dx","dy","distanceSq","normalize","len","copy","multiply","divide","setLength","fromValues","set","ceil","floor","round","clamp","min","max","add","addScaled","scale","angle","ax","ay","bx","by","mag","cosine","acos","sub","equalsApproximately","utils.EPSILON","equals","lerpV","divScalar","invert","cross","z","lenSq","dist","distSq","negate","clone","mul","div","random","cos","sin","zero","transformMat4","transformMat3","rotate","rad","p0","p1","sinC","cosC","truncate","maxLen","midpoint","getAPIImpl","v2","dz","az","bz","t1","t2","zScale","w","transformMat4Upper3x3","transformQuat","q","qx","qy","qz","w2","uvX","uvY","uvZ","getTranslation","getAxis","axis","off","getScaling","xx","xy","xz","yx","yy","yz","zx","zy","zz","rotateX","p","r","rotateY","rotateZ","vec2","getVec2API","vec3","getVec3API","identity","m00","m01","m02","m10","m11","m12","m20","m21","m22","b01","b11","b21","invDet","a00","a01","a02","a10","a11","a12","a20","a21","a22","b00","b02","b10","b12","b20","b22","v3","v4","v5","v6","v7","v8","fromMat4","m4","fromQuat","x2","y2","z2","wx","wy","wz","transpose","determinant","setTranslation","setAxis","get3DScaling","translation","translate","rotation","angleInRadians","c","s","scaling","uniformScaling","uniformScale","m03","m13","m23","m30","m31","m32","m33","tmp0","tmp1","tmp2","tmp3","tmp4","tmp5","tmp6","tmp7","tmp8","tmp9","tmp10","tmp11","tmp12","tmp13","tmp14","tmp15","tmp16","tmp17","tmp18","tmp19","tmp20","tmp21","tmp22","tmp23","t0","t3","a03","a13","a23","a30","a31","a32","a33","b03","b13","b23","b30","b31","b32","b33","xAxis","yAxis","zAxis","axisRotation","oneMinusCosine","axisRotate","r00","r01","r02","r10","r11","r12","r20","r21","r22","v9","v10","v11","v12","v13","v14","v15","fromMat3","m3","perspective","fieldOfViewYInRadians","aspect","zNear","zFar","f","tan","Number","isFinite","rangeInv","perspectiveReverseZ","Infinity","ortho","left","right","bottom","top","near","far","frustum","frustumReverseZ","aim","position","target","up","cameraAim","eye","lookAt","rotationX","rotationY","rotationZ","fromAxisAngle","halfAngle","aw","bw","slerp","scale0","scale1","cosOmega","omega","sinOmega","tempVec3","xUnitVec3","yUnitVec3","tempQuat1","tempQuat2","toAxisAngle","qw","a0","a1","a2","a3","invDot","conjugate","fromMat","trace","root","invRoot","i","j","fromEuler","xAngleInRadians","yAngleInRadians","zAngleInRadians","order","xHalfAngle","yHalfAngle","zHalfAngle","sx","cx","sy","cy","sz","cz","Error","rotationTo","aUnit","bUnit","sqlerp","dw","wgpuMatrixAPI","Mat3Ctor","Mat4Ctor","QuatCtor","Vec2Ctor","Vec3Ctor","Vec4Ctor","mat3","getMat3API","mat4","getMat4API","quat","getQuatAPI","vec4","getVec4API","Float32Array","mat3d","mat4d","quatd","vec2d","vec3d","vec4d","Float64Array","mat3n","mat4n","quatn","vec2n","vec3n","vec4n","Array"],"mappings":"kPAkBO,MAAMA,GAXXC,EAWsC,MAVtCC,EAUsDC,GAAKA,EAAEC,KAAK,GAR3D,cAAcH,EACnB,WAAAI,IAAeC,GACbC,SAASD,GACTJ,EAASM,KACV,IARL,IACEP,EACAC,ECcK,IAAIO,EAAU,4DAkBf,SAAmBC,GACvB,OAAOA,EAAUC,KAAKC,GAAK,GAC7B,kBAqDgB,SAAgBC,EAAWC,GACzC,OAASD,EAAIC,EAAKA,GAAKA,CACzB,uBAxB4BX,EAAWY,EAAWC,GAChD,MAAMC,EAAIF,EAAIZ,EACd,OAAQQ,KAAKO,IAAIH,EAAIZ,GAAKM,EACrBN,GACCa,EAAIb,GAAKc,CACjB,gBAlBqBd,EAAWY,EAAWI,GACzC,OAAOhB,GAAKY,EAAIZ,GAAKgB,CACvB,WAbM,SAAmBC,GACvB,OAAiB,IAAVA,EAAgBT,KAAKC,EAC9B,aAtBM,SAAqBI,GACzB,MAAMK,EAAMZ,EAEZ,OADAA,EAAUO,EACHK,CACT,GCgwBA,MAAMC,EAAQ,IAAIC,IAEZ,SAAUC,EAAyCC,GACvD,IAAIC,EAAMJ,EAAMK,IAAIF,GAKpB,OAJKC,IACHA,EAnwBJ,SAA4DD,GAkB5D,SAASG,EAAOC,EAAI,EAAGC,EAAI,GACzB,MAAMC,EAAS,IAAIN,EAAK,GAOxB,YANUO,IAANH,IACFE,EAAO,GAAKF,OACFG,IAANF,IACFC,EAAO,GAAKD,IAGTC,CACR,CAoJD,SAASE,EAAsC9B,EAAYY,EAAYmB,GACrE,MAAMH,EAAUG,GAAO,IAAIT,EAAK,GAKhC,OAHAM,EAAO,GAAK5B,EAAE,GAAKY,EAAE,GACrBgB,EAAO,GAAK5B,EAAE,GAAKY,EAAE,GAEdgB,CACR,CA0CD,SAASI,EAAk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AA+CrG,EAAYY,EAAYmB,GAErE,OAAOC,EAAKhC,EAAGY,EAAG,GADFmB,GAAO,IAAIT,EAAK,GAEjC,EAgDD,CA+BUgF,CAAchF,GACpBH,EAAMkC,IAAI/B,EAAMC,IAEXA,CACT,CC3tBA,SAAS0U,EAQLC,EACAC,EACAC,EACAC,EACAC,EACAC,GAEF,MAAO,CAELC,KAAMC,EAAiBP,GAEvBQ,KAAMC,EAAiBR,GAEvBS,KAAMC,EAAiBT,GAEvBxN,KAAMC,EAAiBwN,GAEvBvN,KAAMC,EAAiBuN,GAEvBQ,KAAMC,EAAiBR,GAE3B,CAEa,MAAAC,KAKXA,EAAIE,KAKJA,EAAIE,KAKJA,EAAIhO,KAKJA,EAAIE,KAKJA,EAAIgO,KAKJA,GACEb,EAEAe,aAAcA,aAAcA,aAAcA,aAAcA,aAAcA,eAOxER,KAAMS,EAKNP,KAAMQ,EAKNN,KAAMO,EAKNvO,KAAMwO,EAKNtO,KAAMuO,EAKNP,KAAMQ,GACJrB,EAEAsB,aAAcA,aAAcA,aAAcA,aAAcA,aAAcA,eAOxEf,KAAMgB,EAKNd,KAAMe,EAKNb,KAAMc,EAKN9O,KAAM+O,EAKN7O,KAAM8O,EAKNd,KAAMe,GACJ5B,EAEApW,EAAWiY,MAAOA,MAAOA,MAAOA,MAAOA"} \ No newline at end of file +{"version":3,"file":"wgpu-matrix.min.js","sources":["../../../src/types.ts","../../../src/utils.ts","../../../src/vec2-impl.ts","../../../src/vec3-impl.ts","../../../src/mat3-impl.ts","../../../src/mat4-impl.ts","../../../src/quat-impl.ts","../../../src/vec4-impl.ts","../../../src/wgpu-matrix.ts"],"sourcesContent":["/**\n * The types you can pass to most functions that take an\n * array of numbers.\n */\nexport type BaseArgType = Float32Array | Float64Array | number[];\n\nfunction wrapConstructor any>(\n OriginalConstructor: T,\n modifier: (instance: InstanceType) => void\n): T {\n return class extends OriginalConstructor {\n constructor(...args: any[]) {\n super(...args);\n modifier(this as InstanceType);\n }\n } as T; // Type assertion is necessary here\n}\n\nexport const ZeroArray = wrapConstructor(Array, a => a.fill(0));\n\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nexport let EPSILON = 0.000001;\n\n/**\n * Set the value for EPSILON for various checks\n * @param v - Value to use for EPSILON.\n * @returns previous value of EPSILON;\n */\nexport function setEpsilon(v: number): number {\n const old = EPSILON;\n EPSILON = v;\n return old;\n}\n\n/**\n * Convert degrees to radians\n * @param degrees - Angle in degrees\n * @returns angle converted to radians\n */\nexport function degToRad(degrees: number): number {\n return degrees * Math.PI / 180;\n}\n\n/**\n * Convert radians to degrees\n * @param radians - Angle in radians\n * @returns angle converted to degrees\n */\nexport function radToDeg(radians: number): number {\n return radians * 180 / Math.PI;\n}\n\n/**\n * Lerps between a and b via t\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @returns a + (b - a) * t\n */\nexport function lerp(a: number, b: number, t: number): number {\n return a + (b - a) * t;\n}\n\n/**\n * Compute the opposite of lerp. Given a and b and a value between\n * a and b returns a value between 0 and 1. 0 if a, 1 if b.\n * Note: no clamping is done.\n * @param a - start value\n * @param b - end value\n * @param v - value between a and b\n * @returns (v - a) / (b - a)\n */\nexport function inverseLerp(a: number, b: number, v: number): number {\n const d = b - a;\n return (Math.abs(b - a) < EPSILON)\n ? a\n : (v - a) / d;\n}\n\n/**\n * Compute the euclidean modulo\n *\n * ```\n * // table for n / 3\n * -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 <- n\n * ------------------------------------\n * -2 -1 -0 -2 -1 0, 1, 2, 0, 1, 2 <- n % 3\n * 1 2 0 1 2 0, 1, 2, 0, 1, 2 <- euclideanModule(n, 3)\n * ```\n *\n * @param n - dividend\n * @param m - divisor\n * @returns the euclidean modulo of n / m\n */\nexport function euclideanModulo(n: number, m: number) {\n return ((n % m) + m) % m;\n}","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Mat3Arg } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { Vec2Arg, Vec2Type } from './vec2';\nimport { Vec3Arg } from './vec3';\nimport { BaseArgType } from './types';\n\nexport { Vec2Arg, Vec2Type };\n\ntype Vec2Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec3\n */\nfunction getAPIImpl(Ctor: Vec2Ctor) {\n\n/**\n * Creates a Vec2; may be called with x, y, z to set initial values.\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Vec2's specified type\n * it would be faster to use\n *\n * ```\n * const v = vec2.clone(someJSArray);\n * ```\n *\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\nfunction create(x = 0, y = 0) {\n const newDst = new Ctor(2);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n }\n }\n return newDst;\n}\n\n/**\n * Creates a Vec2; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec2\n * Also see {@link vec2.create} and {@link vec2.copy}\n *\n * @param x first value\n * @param y second value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec2Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec2Arg, b: Vec2Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n\n return newDst;\n}\n\n/**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\nfunction angle(a: Vec2Arg, b: Vec2Arg): number {\n const ax = a[0];\n const ay = a[1];\n const bx = b[0];\n const by = b[1];\n const mag1 = Math.sqrt(ax * ax + ay * ay);\n const mag2 = Math.sqrt(bx * bx + by * by);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec2Arg, b: Vec2Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec2Arg, b: Vec2Arg): boolean {\n return a[0] === b[0] && a[1] === b[1];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec2Arg, b: Vec2Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec2Arg, b: Vec2Arg, t: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec2Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec2Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\nfunction cross(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const z = a[0] * b[1] - a[1] * b[0];\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = z;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec2Arg, b: Vec2Arg): number {\n return a[0] * b[0] + a[1] * b[1];\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec2Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n return Math.sqrt(v0 * v0 + v1 * v1);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec2Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n return v0 * v0 + v1 * v1;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec2Arg, b: Vec2Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return Math.sqrt(dx * dx + dy * dy);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec2Arg, b: Vec2Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return dx * dx + dy * dy;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const len = Math.sqrt(v0 * v0 + v1 * v1);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n }\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec2.clone})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec2.copy})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Creates a random unit vector * scale\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\nfunction random(scale = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const angle = Math.random() * 2 * Math.PI;\n newDst[0] = Math.cos(angle) * scale;\n newDst[1] = Math.sin(angle) * scale;\n\n return newDst;\n}\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform Vec2 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec2Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const x = v[0];\n const y = v[1];\n\n newDst[0] = x * m[0] + y * m[4] + m[12];\n newDst[1] = x * m[1] + y * m[5] + m[13];\n\n return newDst;\n}\n\n/**\n * Transforms vec4 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat3(v: Vec2Arg, m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const x = v[0];\n const y = v[1];\n\n newDst[0] = m[0] * x + m[4] * y + m[8];\n newDst[1] = m[1] * x + m[5] * y + m[9];\n\n return newDst;\n}\n\n/**\n * Rotate a 2D vector\n *\n * @param a The vec2 point to rotate\n * @param b The origin of the rotation\n * @param rad The angle of rotation in radians\n * @returns the rotated vector\n */\nfunction rotate(a: Vec2Arg, b: Vec2Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n // Translate point to the origin\n const p0 = a[0] - b[0];\n const p1 = a[1] - b[1];\n const sinC = Math.sin(rad);\n const cosC = Math.cos(rad);\n\n //perform rotation and translate to correct position\n newDst[0] = p0 * cosC - p1 * sinC + b[0];\n newDst[1] = p0 * sinC + p1 * cosC + b[1];\n\n return newDst;\n}\n\n/**\n * Treat a 2D vector as a direction and set it's length\n *\n * @param a The vec2 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec2Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec2 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec2Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat3,\n rotate,\n setLength,\n truncate,\n midpoint,\n};\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Vec2Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Vec3Arg, Vec3Type } from './vec3';\nimport { Mat3Arg } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { QuatArg } from './quat';\nimport { BaseArgType } from './types';\n\nexport { Vec3Arg, Vec3Type };\n\ntype Vec3Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec3\n * */\nfunction getAPIImpl(Ctor: Vec3Ctor) {\n\n/**\n * Creates a vec3; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number) {\n const newDst = new Ctor(3);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a vec3; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec3\n * Also see {@link vec3.create} and {@link vec3.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec3Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec3Arg, b: Vec3Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n\n return newDst;\n}\n\n/**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\nfunction angle(a: Vec3Arg, b: Vec3Arg): number {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const mag1 = Math.sqrt(ax * ax + ay * ay + az * az);\n const mag2 = Math.sqrt(bx * bx + by * by + bz * bz);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec3Arg, b: Vec3Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec3Arg, b: Vec3Arg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec3Arg, b: Vec3Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec3Arg, b: Vec3Arg, t: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec3Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec3Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\nfunction cross(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const t1 = a[2] * b[0] - a[0] * b[2];\n const t2 = a[0] * b[1] - a[1] * b[0];\n newDst[0] = a[1] * b[2] - a[2] * b[1];\n newDst[1] = t1;\n newDst[2] = t2;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec3Arg, b: Vec3Arg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]);\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec3Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec3Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return v0 * v0 + v1 * v1 + v2 * v2;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec3Arg, b: Vec3Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return Math.sqrt(dx * dx + dy * dy + dz * dz);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec3Arg, b: Vec3Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return dx * dx + dy * dy + dz * dz;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec3.clone})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec3.copy})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Creates a random vector\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\nfunction random(scale = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const angle = Math.random() * 2 * Math.PI;\n const z = Math.random() * 2 - 1;\n const zScale = Math.sqrt(1 - z * z) * scale;\n newDst[0] = Math.cos(angle) * zScale;\n newDst[1] = Math.sin(angle) * zScale;\n newDst[2] = z * scale;\n\n return newDst;\n}\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform vec3 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec3Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1;\n\n newDst[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n newDst[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n newDst[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n\n return newDst;\n}\n\n/**\n * Transform vec3 by upper 3x3 matrix inside 4x4 matrix.\n * @param v - The direction.\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns The transformed vector.\n */\nfunction transformMat4Upper3x3(v: Vec3Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[0] = v0 * m[0 * 4 + 0] + v1 * m[1 * 4 + 0] + v2 * m[2 * 4 + 0];\n newDst[1] = v0 * m[0 * 4 + 1] + v1 * m[1 * 4 + 1] + v2 * m[2 * 4 + 1];\n newDst[2] = v0 * m[0 * 4 + 2] + v1 * m[1 * 4 + 2] + v2 * m[2 * 4 + 2];\n\n return newDst;\n}\n\n/**\n * Transforms vec3 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat3(v: Vec3Arg, m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n\n newDst[0] = x * m[0] + y * m[4] + z * m[8];\n newDst[1] = x * m[1] + y * m[5] + z * m[9];\n newDst[2] = x * m[2] + y * m[6] + z * m[10];\n\n return newDst;\n}\n\n/**\n * Transforms vec3 by Quaternion\n * @param v - the vector to transform\n * @param q - the quaternion to transform by\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed\n */\nfunction transformQuat(v: Vec3Arg, q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n\n const uvX = qy * z - qz * y;\n const uvY = qz * x - qx * z;\n const uvZ = qx * y - qy * x;\n\n newDst[0] = x + uvX * w2 + (qy * uvZ - qz * uvY) * 2;\n newDst[1] = y + uvY * w2 + (qz * uvX - qx * uvZ) * 2;\n newDst[2] = z + uvZ * w2 + (qx * uvY - qy * uvX) * 2;\n\n return newDst;\n}\n\n/**\n * Returns the translation component of a 4-by-4 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\nfunction getTranslation(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n}\n/**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat4Arg, axis: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n}\n/**\n * Returns the scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the x-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\nfunction rotateX(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n //Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n //perform rotation\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad);\n\n //translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the y-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\nfunction rotateY(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n // perform rotation\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad);\n\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the z-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns {vec3} out\n */\nfunction rotateZ(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n // perform rotation\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2];\n\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Treat a 3D vector as a direction and set it's length\n *\n * @param a The vec3 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec3Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec3 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec3Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat4Upper3x3,\n transformMat3,\n transformQuat,\n getTranslation,\n getAxis,\n getScaling,\n rotateX,\n rotateY,\n rotateZ,\n setLength,\n truncate,\n midpoint,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Vec3Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nimport * as utils from './utils.js';\nimport { QuatArg } from './quat';\nimport { Mat3Arg, Mat3Type } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { Vec2Arg } from './vec2';\nimport { Vec3Arg } from './vec3';\nimport { getAPI as getVec2API } from './vec2-impl';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\n\nexport { Mat3Arg, Mat3Type };\n\ntype Mat3Ctor = new (n: number) => T;\n\n/**\n * Generates a typed API for Mat3\n * */\nfunction getAPIImpl(Ctor: Mat3Ctor) {\n const vec2 = getVec2API(Ctor);\n const vec3 = getVec3API(Ctor);\n\n/**\n * Create a Mat3 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat3's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat3.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @returns matrix created from values.\n */\nfunction create(\n v0?: number, v1?: number, v2?: number,\n v3?: number, v4?: number, v5?: number,\n v6?: number, v7?: number, v8?: number) {\n const newDst = new Ctor(12);\n // to make the array homogenous\n newDst[3] = 0;\n newDst[7] = 0;\n newDst[11] = 0;\n\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[4] = v3;\n if (v4 !== undefined) {\n newDst[5] = v4;\n if (v5 !== undefined) {\n newDst[6] = v5;\n if (v6 !== undefined) {\n newDst[8] = v6;\n if (v7 !== undefined) {\n newDst[9] = v7;\n if (v8 !== undefined) {\n newDst[10] = v8;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n\n return newDst;\n}\n\n/**\n * Sets the values of a Mat3\n * Also see {@link mat3.create} and {@link mat3.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 set from values.\n */\nfunction set(\n v0: number, v1: number, v2: number,\n v3: number, v4: number, v5: number,\n v6: number, v7: number, v8: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[0] = v0; newDst[1] = v1; newDst[ 2] = v2; newDst[ 3] = 0;\n newDst[4] = v3; newDst[5] = v4; newDst[ 6] = v5; newDst[ 7] = 0;\n newDst[8] = v6; newDst[9] = v7; newDst[10] = v8; newDst[11] = 0;\n\n return newDst;\n}\n\n/**\n * Creates a Mat3 from the upper left 3x3 part of a Mat4\n * @param m4 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from m4\n */\nfunction fromMat4(m4: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n newDst[0] = m4[0]; newDst[1] = m4[1]; newDst[ 2] = m4[ 2]; newDst[ 3] = 0;\n newDst[4] = m4[4]; newDst[5] = m4[5]; newDst[ 6] = m4[ 6]; newDst[ 7] = 0;\n newDst[8] = m4[8]; newDst[9] = m4[9]; newDst[10] = m4[10]; newDst[11] = 0;\n return newDst;\n}\n\n/**\n * Creates a Mat3 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from q\n */\nfunction fromQuat(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3];\n const x2 = x + x; const y2 = y + y; const z2 = z + z;\n\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n newDst[ 0] = 1 - yy - zz; newDst[ 1] = yx + wz; newDst[ 2] = zx - wy; newDst[ 3] = 0;\n newDst[ 4] = yx - wz; newDst[ 5] = 1 - xx - zz; newDst[ 6] = zy + wx; newDst[ 7] = 0;\n newDst[ 8] = zx + wy; newDst[ 9] = zy - wx; newDst[10] = 1 - xx - yy; newDst[11] = 0;\n\n return newDst;\n}\n\n/**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\nfunction negate(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = -m[ 0]; newDst[ 1] = -m[ 1]; newDst[ 2] = -m[ 2];\n newDst[ 4] = -m[ 4]; newDst[ 5] = -m[ 5]; newDst[ 6] = -m[ 6];\n newDst[ 8] = -m[ 8]; newDst[ 9] = -m[ 9]; newDst[10] = -m[10];\n\n return newDst;\n}\n\n/**\n * Copies a matrix. (same as {@link mat3.clone})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nfunction copy(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = m[ 0]; newDst[ 1] = m[ 1]; newDst[ 2] = m[ 2];\n newDst[ 4] = m[ 4]; newDst[ 5] = m[ 5]; newDst[ 6] = m[ 6];\n newDst[ 8] = m[ 8]; newDst[ 9] = m[ 9]; newDst[10] = m[10];\n\n return newDst;\n}\n\n/**\n * Copies a matrix (same as {@link mat3.copy})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nconst clone = copy;\n\n/**\n * Check if 2 matrices are approximately equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are approximately equal\n */\nfunction equalsApproximately(a: Mat3Arg, b: Mat3Arg): boolean {\n return Math.abs(a[ 0] - b[ 0]) < utils.EPSILON &&\n Math.abs(a[ 1] - b[ 1]) < utils.EPSILON &&\n Math.abs(a[ 2] - b[ 2]) < utils.EPSILON &&\n Math.abs(a[ 4] - b[ 4]) < utils.EPSILON &&\n Math.abs(a[ 5] - b[ 5]) < utils.EPSILON &&\n Math.abs(a[ 6] - b[ 6]) < utils.EPSILON &&\n Math.abs(a[ 8] - b[ 8]) < utils.EPSILON &&\n Math.abs(a[ 9] - b[ 9]) < utils.EPSILON &&\n Math.abs(a[10] - b[10]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 matrices are exactly equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are exactly equal\n */\nfunction equals(a: Mat3Arg, b: Mat3Arg): boolean {\n return a[ 0] === b[ 0] &&\n a[ 1] === b[ 1] &&\n a[ 2] === b[ 2] &&\n a[ 4] === b[ 4] &&\n a[ 5] === b[ 5] &&\n a[ 6] === b[ 6] &&\n a[ 8] === b[ 8] &&\n a[ 9] === b[ 9] &&\n a[10] === b[10];\n}\n\n/**\n * Creates a 3-by-3 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 3-by-3 identity matrix.\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\nfunction transpose(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n if (newDst === m) {\n let t: number;\n\n // 0 1 2\n // 4 5 6\n // 8 9 10\n\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n\n return newDst;\n }\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n newDst[ 0] = m00; newDst[ 1] = m10; newDst[ 2] = m20;\n newDst[ 4] = m01; newDst[ 5] = m11; newDst[ 6] = m21;\n newDst[ 8] = m02; newDst[ 9] = m12; newDst[10] = m22;\n\n return newDst;\n}\n\n/**\n * Computes the inverse of a 3-by-3 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nfunction inverse(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n const b01 = m22 * m11 - m12 * m21;\n const b11 = -m22 * m10 + m12 * m20;\n const b21 = m21 * m10 - m11 * m20;\n\n const invDet = 1 / (m00 * b01 + m01 * b11 + m02 * b21);\n\n newDst[ 0] = b01 * invDet;\n newDst[ 1] = (-m22 * m01 + m02 * m21) * invDet;\n newDst[ 2] = ( m12 * m01 - m02 * m11) * invDet;\n newDst[ 4] = b11 * invDet;\n newDst[ 5] = ( m22 * m00 - m02 * m20) * invDet;\n newDst[ 6] = (-m12 * m00 + m02 * m10) * invDet;\n newDst[ 8] = b21 * invDet;\n newDst[ 9] = (-m21 * m00 + m01 * m20) * invDet;\n newDst[10] = ( m11 * m00 - m01 * m10) * invDet;\n\n return newDst;\n}\n\n/**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\nfunction determinant(m: Mat3Arg): number {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n return m00 * (m11 * m22 - m21 * m12) -\n m10 * (m01 * m22 - m21 * m02) +\n m20 * (m01 * m12 - m11 * m02);\n}\n\n/**\n * Computes the inverse of a 3-by-3 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nconst invert = inverse;\n\n/**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nfunction multiply(a: Mat3Arg, b: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[ 4 + 0];\n const a11 = a[ 4 + 1];\n const a12 = a[ 4 + 2];\n const a20 = a[ 8 + 0];\n const a21 = a[ 8 + 1];\n const a22 = a[ 8 + 2];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b10 = b[ 4 + 0];\n const b11 = b[ 4 + 1];\n const b12 = b[ 4 + 2];\n const b20 = b[ 8 + 0];\n const b21 = b[ 8 + 1];\n const b22 = b[ 8 + 2];\n\n newDst[ 0] = a00 * b00 + a10 * b01 + a20 * b02;\n newDst[ 1] = a01 * b00 + a11 * b01 + a21 * b02;\n newDst[ 2] = a02 * b00 + a12 * b01 + a22 * b02;\n newDst[ 4] = a00 * b10 + a10 * b11 + a20 * b12;\n newDst[ 5] = a01 * b10 + a11 * b11 + a21 * b12;\n newDst[ 6] = a02 * b10 + a12 * b11 + a22 * b12;\n newDst[ 8] = a00 * b20 + a10 * b21 + a20 * b22;\n newDst[ 9] = a01 * b20 + a11 * b21 + a21 * b22;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22;\n\n return newDst;\n}\n\n/**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nconst mul = multiply;\n\n/**\n * Sets the translation component of a 3-by-3 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\nfunction setTranslation(a: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? identity()) as T;\n if (a !== newDst) {\n newDst[ 0] = a[ 0];\n newDst[ 1] = a[ 1];\n newDst[ 2] = a[ 2];\n newDst[ 4] = a[ 4];\n newDst[ 5] = a[ 5];\n newDst[ 6] = a[ 6];\n }\n newDst[ 8] = v[0];\n newDst[ 9] = v[1];\n newDst[10] = 1;\n return newDst;\n}\n\n/**\n * Returns the translation component of a 3-by-3 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\nfunction getTranslation(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec2.create()) as T;\n newDst[0] = m[8];\n newDst[1] = m[9];\n return newDst;\n}\n\n/**\n * Returns an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y,\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat3Arg, axis: number, dst?: T) {\n const newDst = (dst ?? vec2.create()) as T;\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n return newDst;\n}\n\n/**\n * Sets an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\nfunction setAxis(m: Mat3Arg, v: Vec2Arg, axis: number, dst?: T) {\n const newDst = (dst === m ? m : copy(m, dst)) as T;\n\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n return newDst;\n}\n\n/**\n * Returns the \"2d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec2.create());\n\n const xx = m[0];\n const xy = m[1];\n const yx = m[4];\n const yy = m[5];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy);\n newDst[1] = Math.sqrt(yx * yx + yy * yy);\n\n return newDst;\n}\n\n\n/**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction get3DScaling(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec3.create());\n\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which translates by the given vector v.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\nfunction translation(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = v[0]; newDst[ 9] = v[1]; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Translates the given 3-by-3 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\nfunction translate(m: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 0] = m00;\n newDst[ 1] = m01;\n newDst[ 2] = m02;\n newDst[ 4] = m10;\n newDst[ 5] = m11;\n newDst[ 6] = m12;\n }\n\n newDst[ 8] = m00 * v0 + m10 * v1 + m20;\n newDst[ 9] = m01 * v0 + m11 * v1 + m21;\n newDst[10] = m02 * v0 + m12 * v1 + m22;\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotation(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = s; newDst[ 2] = 0;\n newDst[ 4] = -s; newDst[ 5] = c; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix by the given angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotate(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 + s * m10;\n newDst[ 1] = c * m01 + s * m11;\n newDst[ 2] = c * m02 + s * m12;\n\n newDst[ 4] = c * m10 - s * m00;\n newDst[ 5] = c * m11 - s * m01;\n newDst[ 6] = c * m12 - s * m02;\n\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the x-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationX(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = c; newDst[ 6] = s;\n newDst[ 8] = 0; newDst[ 9] = -s; newDst[10] = c;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix around the x-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateX(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[4] = c * m10 + s * m20;\n newDst[5] = c * m11 + s * m21;\n newDst[6] = c * m12 + s * m22;\n newDst[8] = c * m20 - s * m10;\n newDst[9] = c * m21 - s * m11;\n newDst[10] = c * m22 - s * m12;\n\n if (m !== newDst) {\n newDst[ 0] = m[ 0];\n newDst[ 1] = m[ 1];\n newDst[ 2] = m[ 2];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the y-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationY(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = 0; newDst[ 2] = -s;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = s; newDst[ 9] = 0; newDst[10] = c;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix around the y-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateY(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 - s * m20;\n newDst[ 1] = c * m01 - s * m21;\n newDst[ 2] = c * m02 - s * m22;\n newDst[ 8] = c * m20 + s * m00;\n newDst[ 9] = c * m21 + s * m01;\n newDst[10] = c * m22 + s * m02;\n\n if (m !== newDst) {\n newDst[ 4] = m[ 4];\n newDst[ 5] = m[ 5];\n newDst[ 6] = m[ 6];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the z-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nconst rotationZ = rotation;\n\n/**\n * Rotates the given 3-by-3 matrix around the z-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nconst rotateZ = rotate;\n\n/**\n * Creates a 3-by-3 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has two\n * entries.\n * @param v - A vector of\n * 2 entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * two entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of 2 entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale(m: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * 3 entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling3D(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = v[2];\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of 3 entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale3D(m: Mat3Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n\n newDst[ 8] = v2 * m[2 * 4 + 0];\n newDst[ 9] = v2 * m[2 * 4 + 1];\n newDst[10] = v2 * m[2 * 4 + 2];\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales uniformly in the X and Y dimensions\n * @param s - Amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in the X and Y dimension by an amount\n * given.\n * @param m - The matrix to be modified.\n * @param s - Amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale(m: Mat3Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales uniformly in each dimension\n * @param s - Amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling3D(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = s;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given.\n * @param m - The matrix to be modified.\n * @param s - Amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale3D(m: Mat3Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n\n newDst[ 8] = s * m[2 * 4 + 0];\n newDst[ 9] = s * m[2 * 4 + 1];\n newDst[10] = s * m[2 * 4 + 2];\n\n return newDst;\n}\n\nreturn {\n clone,\n create,\n set,\n fromMat4,\n fromQuat,\n negate,\n copy,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n invert,\n determinant,\n mul,\n multiply,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n get3DScaling,\n translation,\n translate,\n rotation,\n rotate,\n rotationX,\n rotateX,\n rotationY,\n rotateY,\n rotationZ,\n rotateZ,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n scaling3D,\n scale3D,\n uniformScaling3D,\n uniformScale3D,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Mat3Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","import { Mat4Arg, Mat4Type } from './mat4';\nimport { Mat3Arg } from './mat3';\nimport { QuatArg } from './quat';\nimport { Vec3Arg } from './vec3';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\nimport * as utils from './utils';\n\nexport { Mat4Arg, Mat4Type };\n\ntype Mat4Ctor = new (n: number) => T;\n\n/**\n * Generates a typed API for Mat4\n * */\nfunction getAPIImpl(Ctor: Mat4Ctor) {\n const vec3 = getVec3API(Ctor);\n\n/**\n * 4x4 Matrix math math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new matrix. In other words you can do this\n *\n * const mat = mat4.translation([1, 2, 3]); // Creates a new translation matrix\n *\n * or\n *\n * const mat = mat4.create();\n * mat4.translation([1, 2, 3], mat); // Puts translation matrix in mat.\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always save to pass any matrix as the destination. So for example\n *\n * const mat = mat4.identity();\n * const trans = mat4.translation([1, 2, 3]);\n * mat4.multiply(mat, trans, mat); // Multiplies mat * trans and puts result in mat.\n *\n */\n\n\n/**\n * Create a Mat4 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat4's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat4.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @returns created from values.\n */\nfunction create(\n v0?: number, v1?: number, v2?: number, v3?: number,\n v4?: number, v5?: number, v6?: number, v7?: number,\n v8?: number, v9?: number, v10?: number, v11?: number,\n v12?: number, v13?: number, v14?: number, v15?: number) {\n const newDst = new Ctor(16);\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[3] = v3;\n if (v4 !== undefined) {\n newDst[4] = v4;\n if (v5 !== undefined) {\n newDst[5] = v5;\n if (v6 !== undefined) {\n newDst[6] = v6;\n if (v7 !== undefined) {\n newDst[7] = v7;\n if (v8 !== undefined) {\n newDst[8] = v8;\n if (v9 !== undefined) {\n newDst[9] = v9;\n if (v10 !== undefined) {\n newDst[10] = v10;\n if (v11 !== undefined) {\n newDst[11] = v11;\n if (v12 !== undefined) {\n newDst[12] = v12;\n if (v13 !== undefined) {\n newDst[13] = v13;\n if (v14 !== undefined) {\n newDst[14] = v14;\n if (v15 !== undefined) {\n newDst[15] = v15;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Sets the values of a Mat4\n * Also see {@link mat4.create} and {@link mat4.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 created from values.\n */\nfunction set(\n v0: number, v1: number, v2: number, v3: number,\n v4: number, v5: number, v6: number, v7: number,\n v8: number, v9: number, v10: number, v11: number,\n v12: number, v13: number, v14: number, v15: number,\n dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = v0; newDst[ 1] = v1; newDst[ 2] = v2; newDst[ 3] = v3;\n newDst[ 4] = v4; newDst[ 5] = v5; newDst[ 6] = v6; newDst[ 7] = v7;\n newDst[ 8] = v8; newDst[ 9] = v9; newDst[10] = v10; newDst[11] = v11;\n newDst[12] = v12; newDst[13] = v13; newDst[14] = v14; newDst[15] = v15;\n\n return newDst;\n}\n\n/**\n * Creates a Mat4 from a Mat3\n * @param m3 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from m3\n */\nfunction fromMat3(m3: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = m3[0]; newDst[ 1] = m3[1]; newDst[ 2] = m3[ 2]; newDst[ 3] = 0;\n newDst[ 4] = m3[4]; newDst[ 5] = m3[5]; newDst[ 6] = m3[ 6]; newDst[ 7] = 0;\n newDst[ 8] = m3[8]; newDst[ 9] = m3[9]; newDst[10] = m3[10]; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a Mat4 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from q\n */\nfunction fromQuat(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3];\n const x2 = x + x; const y2 = y + y; const z2 = z + z;\n\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n newDst[ 0] = 1 - yy - zz; newDst[ 1] = yx + wz; newDst[ 2] = zx - wy; newDst[ 3] = 0;\n newDst[ 4] = yx - wz; newDst[ 5] = 1 - xx - zz; newDst[ 6] = zy + wx; newDst[ 7] = 0;\n newDst[ 8] = zx + wy; newDst[ 9] = zy - wx; newDst[10] = 1 - xx - yy; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\nfunction negate(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = -m[ 0]; newDst[ 1] = -m[ 1]; newDst[ 2] = -m[ 2]; newDst[ 3] = -m[ 3];\n newDst[ 4] = -m[ 4]; newDst[ 5] = -m[ 5]; newDst[ 6] = -m[ 6]; newDst[ 7] = -m[ 7];\n newDst[ 8] = -m[ 8]; newDst[ 9] = -m[ 9]; newDst[10] = -m[10]; newDst[11] = -m[11];\n newDst[12] = -m[12]; newDst[13] = -m[13]; newDst[14] = -m[14]; newDst[15] = -m[15];\n\n return newDst;\n}\n\n/**\n * Copies a matrix. (same as {@link mat4.clone})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nfunction copy(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = m[ 0]; newDst[ 1] = m[ 1]; newDst[ 2] = m[ 2]; newDst[ 3] = m[ 3];\n newDst[ 4] = m[ 4]; newDst[ 5] = m[ 5]; newDst[ 6] = m[ 6]; newDst[ 7] = m[ 7];\n newDst[ 8] = m[ 8]; newDst[ 9] = m[ 9]; newDst[10] = m[10]; newDst[11] = m[11];\n newDst[12] = m[12]; newDst[13] = m[13]; newDst[14] = m[14]; newDst[15] = m[15];\n\n return newDst;\n}\n\n/**\n * Copies a matrix (same as {@link mat4.copy})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nconst clone = copy;\n\n/**\n * Check if 2 matrices are approximately equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are approximately equal\n */\nfunction equalsApproximately(a: Mat4Arg, b: Mat4Arg): boolean {\n return Math.abs(a[ 0] - b[ 0]) < utils.EPSILON &&\n Math.abs(a[ 1] - b[ 1]) < utils.EPSILON &&\n Math.abs(a[ 2] - b[ 2]) < utils.EPSILON &&\n Math.abs(a[ 3] - b[ 3]) < utils.EPSILON &&\n Math.abs(a[ 4] - b[ 4]) < utils.EPSILON &&\n Math.abs(a[ 5] - b[ 5]) < utils.EPSILON &&\n Math.abs(a[ 6] - b[ 6]) < utils.EPSILON &&\n Math.abs(a[ 7] - b[ 7]) < utils.EPSILON &&\n Math.abs(a[ 8] - b[ 8]) < utils.EPSILON &&\n Math.abs(a[ 9] - b[ 9]) < utils.EPSILON &&\n Math.abs(a[10] - b[10]) < utils.EPSILON &&\n Math.abs(a[11] - b[11]) < utils.EPSILON &&\n Math.abs(a[12] - b[12]) < utils.EPSILON &&\n Math.abs(a[13] - b[13]) < utils.EPSILON &&\n Math.abs(a[14] - b[14]) < utils.EPSILON &&\n Math.abs(a[15] - b[15]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 matrices are exactly equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are exactly equal\n */\nfunction equals(a: Mat4Arg, b: Mat4Arg): boolean {\n return a[ 0] === b[ 0] &&\n a[ 1] === b[ 1] &&\n a[ 2] === b[ 2] &&\n a[ 3] === b[ 3] &&\n a[ 4] === b[ 4] &&\n a[ 5] === b[ 5] &&\n a[ 6] === b[ 6] &&\n a[ 7] === b[ 7] &&\n a[ 8] === b[ 8] &&\n a[ 9] === b[ 9] &&\n a[10] === b[10] &&\n a[11] === b[11] &&\n a[12] === b[12] &&\n a[13] === b[13] &&\n a[14] === b[14] &&\n a[15] === b[15];\n}\n\n/**\n * Creates a 4-by-4 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 4-by-4 identity matrix.\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\nfunction transpose(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n if (newDst === m) {\n let t;\n\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n\n t = m[3];\n m[3] = m[12];\n m[12] = t;\n\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n\n t = m[7];\n m[7] = m[13];\n m[13] = t;\n\n t = m[11];\n m[11] = m[14];\n m[14] = t;\n return newDst;\n }\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n newDst[ 0] = m00; newDst[ 1] = m10; newDst[ 2] = m20; newDst[ 3] = m30;\n newDst[ 4] = m01; newDst[ 5] = m11; newDst[ 6] = m21; newDst[ 7] = m31;\n newDst[ 8] = m02; newDst[ 9] = m12; newDst[10] = m22; newDst[11] = m32;\n newDst[12] = m03; newDst[13] = m13; newDst[14] = m23; newDst[15] = m33;\n\n return newDst;\n}\n\n/**\n * Computes the inverse of a 4-by-4 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nfunction inverse(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n const tmp12 = m20 * m31;\n const tmp13 = m30 * m21;\n const tmp14 = m10 * m31;\n const tmp15 = m30 * m11;\n const tmp16 = m10 * m21;\n const tmp17 = m20 * m11;\n const tmp18 = m00 * m31;\n const tmp19 = m30 * m01;\n const tmp20 = m00 * m21;\n const tmp21 = m20 * m01;\n const tmp22 = m00 * m11;\n const tmp23 = m10 * m01;\n\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n\n const d = 1 / (m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3);\n\n newDst[ 0] = d * t0;\n newDst[ 1] = d * t1;\n newDst[ 2] = d * t2;\n newDst[ 3] = d * t3;\n newDst[ 4] = d * ((tmp1 * m10 + tmp2 * m20 + tmp5 * m30) -\n (tmp0 * m10 + tmp3 * m20 + tmp4 * m30));\n newDst[ 5] = d * ((tmp0 * m00 + tmp7 * m20 + tmp8 * m30) -\n (tmp1 * m00 + tmp6 * m20 + tmp9 * m30));\n newDst[ 6] = d * ((tmp3 * m00 + tmp6 * m10 + tmp11 * m30) -\n (tmp2 * m00 + tmp7 * m10 + tmp10 * m30));\n newDst[ 7] = d * ((tmp4 * m00 + tmp9 * m10 + tmp10 * m20) -\n (tmp5 * m00 + tmp8 * m10 + tmp11 * m20));\n newDst[ 8] = d * ((tmp12 * m13 + tmp15 * m23 + tmp16 * m33) -\n (tmp13 * m13 + tmp14 * m23 + tmp17 * m33));\n newDst[ 9] = d * ((tmp13 * m03 + tmp18 * m23 + tmp21 * m33) -\n (tmp12 * m03 + tmp19 * m23 + tmp20 * m33));\n newDst[10] = d * ((tmp14 * m03 + tmp19 * m13 + tmp22 * m33) -\n (tmp15 * m03 + tmp18 * m13 + tmp23 * m33));\n newDst[11] = d * ((tmp17 * m03 + tmp20 * m13 + tmp23 * m23) -\n (tmp16 * m03 + tmp21 * m13 + tmp22 * m23));\n newDst[12] = d * ((tmp14 * m22 + tmp17 * m32 + tmp13 * m12) -\n (tmp16 * m32 + tmp12 * m12 + tmp15 * m22));\n newDst[13] = d * ((tmp20 * m32 + tmp12 * m02 + tmp19 * m22) -\n (tmp18 * m22 + tmp21 * m32 + tmp13 * m02));\n newDst[14] = d * ((tmp18 * m12 + tmp23 * m32 + tmp15 * m02) -\n (tmp22 * m32 + tmp14 * m02 + tmp19 * m12));\n newDst[15] = d * ((tmp22 * m22 + tmp16 * m02 + tmp21 * m12) -\n (tmp20 * m12 + tmp23 * m22 + tmp17 * m02));\n\n return newDst;\n}\n\n/**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\nfunction determinant(m: Mat4Arg): number {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n\n return m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3;\n}\n\n/**\n * Computes the inverse of a 4-by-4 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nconst invert = inverse;\n\n/**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nfunction multiply(a: Mat4Arg, b: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[ 4 + 0];\n const a11 = a[ 4 + 1];\n const a12 = a[ 4 + 2];\n const a13 = a[ 4 + 3];\n const a20 = a[ 8 + 0];\n const a21 = a[ 8 + 1];\n const a22 = a[ 8 + 2];\n const a23 = a[ 8 + 3];\n const a30 = a[12 + 0];\n const a31 = a[12 + 1];\n const a32 = a[12 + 2];\n const a33 = a[12 + 3];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b03 = b[3];\n const b10 = b[ 4 + 0];\n const b11 = b[ 4 + 1];\n const b12 = b[ 4 + 2];\n const b13 = b[ 4 + 3];\n const b20 = b[ 8 + 0];\n const b21 = b[ 8 + 1];\n const b22 = b[ 8 + 2];\n const b23 = b[ 8 + 3];\n const b30 = b[12 + 0];\n const b31 = b[12 + 1];\n const b32 = b[12 + 2];\n const b33 = b[12 + 3];\n\n newDst[ 0] = a00 * b00 + a10 * b01 + a20 * b02 + a30 * b03;\n newDst[ 1] = a01 * b00 + a11 * b01 + a21 * b02 + a31 * b03;\n newDst[ 2] = a02 * b00 + a12 * b01 + a22 * b02 + a32 * b03;\n newDst[ 3] = a03 * b00 + a13 * b01 + a23 * b02 + a33 * b03;\n newDst[ 4] = a00 * b10 + a10 * b11 + a20 * b12 + a30 * b13;\n newDst[ 5] = a01 * b10 + a11 * b11 + a21 * b12 + a31 * b13;\n newDst[ 6] = a02 * b10 + a12 * b11 + a22 * b12 + a32 * b13;\n newDst[ 7] = a03 * b10 + a13 * b11 + a23 * b12 + a33 * b13;\n newDst[ 8] = a00 * b20 + a10 * b21 + a20 * b22 + a30 * b23;\n newDst[ 9] = a01 * b20 + a11 * b21 + a21 * b22 + a31 * b23;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22 + a32 * b23;\n newDst[11] = a03 * b20 + a13 * b21 + a23 * b22 + a33 * b23;\n newDst[12] = a00 * b30 + a10 * b31 + a20 * b32 + a30 * b33;\n newDst[13] = a01 * b30 + a11 * b31 + a21 * b32 + a31 * b33;\n newDst[14] = a02 * b30 + a12 * b31 + a22 * b32 + a32 * b33;\n newDst[15] = a03 * b30 + a13 * b31 + a23 * b32 + a33 * b33;\n\n return newDst;\n}\n\n/**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nconst mul = multiply;\n\n/**\n * Sets the translation component of a 4-by-4 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\nfunction setTranslation(a: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? identity()) as T;\n if (a !== newDst) {\n newDst[ 0] = a[ 0];\n newDst[ 1] = a[ 1];\n newDst[ 2] = a[ 2];\n newDst[ 3] = a[ 3];\n newDst[ 4] = a[ 4];\n newDst[ 5] = a[ 5];\n newDst[ 6] = a[ 6];\n newDst[ 7] = a[ 7];\n newDst[ 8] = a[ 8];\n newDst[ 9] = a[ 9];\n newDst[10] = a[10];\n newDst[11] = a[11];\n }\n newDst[12] = v[0];\n newDst[13] = v[1];\n newDst[14] = v[2];\n newDst[15] = 1;\n return newDst;\n}\n\n///**\n// * Returns the translation component of a 4-by-4 matrix as a vector with 3\n// * entries.\n// * @param m - The matrix.\n// * @param dst - vector to hold result. If not passed a new one is created.\n// * @returns The translation component of m.\n// */\nfunction getTranslation(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? vec3.create()) as T;\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n}\n\n/**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat4Arg, axis: number, dst?: T) {\n const newDst = (dst ?? vec3.create());\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n}\n\n/**\n * Sets an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\nfunction setAxis(m: Mat4Arg, v: Vec3Arg, axis: number, dst: T) {\n const newDst = (dst === m) ? dst : copy(m, dst);\n\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n newDst[off + 2] = v[2];\n return newDst;\n}\n\n/**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? vec3.create()) as T;\n\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 0 to 1 in the z dimension.\n *\n * Note: If you pass `Infinity` for zFar then it will produce a projection matrix\n * returns -Infinity for Z when transforming coordinates with Z <= 0 and +Infinity for Z\n * otherwise.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */\nfunction perspective(fieldOfViewYInRadians: number, aspect: number, zNear: number, zFar: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const f = Math.tan(Math.PI * 0.5 - 0.5 * fieldOfViewYInRadians);\n\n newDst[0] = f / aspect;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n newDst[4] = 0;\n newDst[5] = f;\n newDst[6] = 0;\n newDst[7] = 0;\n\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[11] = -1;\n\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (Number.isFinite(zFar)) {\n const rangeInv = 1 / (zNear - zFar);\n newDst[10] = zFar * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n } else {\n newDst[10] = -1;\n newDst[14] = -zNear;\n }\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 1 (at -zNear) to 0 (at -zFar) in the z dimension.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane. (default = Infinity)\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */function perspectiveReverseZ(fieldOfViewYInRadians: number, aspect: number, zNear: number, zFar = Infinity, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const f = 1 / Math.tan(fieldOfViewYInRadians * 0.5);\n\n newDst[ 0] = f / aspect;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n\n newDst[ 4] = 0;\n newDst[ 5] = f;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n\n newDst[ 8] = 0;\n newDst[ 9] = 0;\n newDst[11] = -1;\n\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (zFar === Infinity) {\n newDst[10] = 0;\n newDst[14] = zNear;\n } else {\n const rangeInv = 1 / (zFar - zNear);\n newDst[10] = zNear * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n }\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 orthogonal transformation matrix that transforms from\n * the given the left, right, bottom, and top dimensions to -1 +1 in x, and y\n * and 0 to +1 in z.\n * @param left - Left side of the near clipping plane viewport.\n * @param right - Right side of the near clipping plane viewport.\n * @param bottom - Bottom of the near clipping plane viewport.\n * @param top - Top of the near clipping plane viewport.\n * @param near - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param far - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The orthographic projection matrix.\n */\nfunction ortho(left: number, right: number, bottom: number, top: number, near: number, far: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[0] = 2 / (right - left);\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n newDst[4] = 0;\n newDst[5] = 2 / (top - bottom);\n newDst[6] = 0;\n newDst[7] = 0;\n\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[10] = 1 / (near - far);\n newDst[11] = 0;\n\n newDst[12] = (right + left) / (left - right);\n newDst[13] = (top + bottom) / (bottom - top);\n newDst[14] = near / (near - far);\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 0 to 1 in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\nfunction frustum(left: number, right: number, bottom: number, top: number, near: number, far: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const dx = (right - left);\n const dy = (top - bottom);\n const dz = (near - far);\n\n newDst[ 0] = 2 * near / dx;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n newDst[ 4] = 0;\n newDst[ 5] = 2 * near / dy;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n newDst[ 8] = (left + right) / dx;\n newDst[ 9] = (top + bottom) / dy;\n newDst[10] = far / dz;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = near * far / dz;\n newDst[15] = 0;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 1 (-near) to 0 (-far) in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\nfunction frustumReverseZ(left: number, right: number, bottom: number, top: number, near: number, far = Infinity, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const dx = (right - left);\n const dy = (top - bottom);\n\n newDst[ 0] = 2 * near / dx;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n newDst[ 4] = 0;\n newDst[ 5] = 2 * near / dy;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n newDst[ 8] = (left + right) / dx;\n newDst[ 9] = (top + bottom) / dy;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (far === Infinity) {\n newDst[10] = 0;\n newDst[14] = near;\n } else {\n const rangeInv = 1 / (far - near);\n newDst[10] = near * rangeInv;\n newDst[14] = far * near * rangeInv;\n }\n\n return newDst;\n}\n\nconst xAxis = vec3.create();\nconst yAxis = vec3.create();\nconst zAxis = vec3.create();\n\n/**\n * Computes a 4-by-4 aim transformation.\n *\n * This is a matrix which positions an object aiming down positive Z.\n * toward the target.\n *\n * Note: this is **NOT** the inverse of lookAt as lookAt looks at negative Z.\n *\n * @param position - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\nfunction aim(position: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(target, position, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = xAxis[1]; newDst[ 2] = xAxis[2]; newDst[ 3] = 0;\n newDst[ 4] = yAxis[0]; newDst[ 5] = yAxis[1]; newDst[ 6] = yAxis[2]; newDst[ 7] = 0;\n newDst[ 8] = zAxis[0]; newDst[ 9] = zAxis[1]; newDst[10] = zAxis[2]; newDst[11] = 0;\n newDst[12] = position[0]; newDst[13] = position[1]; newDst[14] = position[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 camera aim transformation.\n *\n * This is a matrix which positions an object aiming down negative Z.\n * toward the target.\n *\n * Note: this is the inverse of `lookAt`\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\nfunction cameraAim(eye: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = xAxis[1]; newDst[ 2] = xAxis[2]; newDst[ 3] = 0;\n newDst[ 4] = yAxis[0]; newDst[ 5] = yAxis[1]; newDst[ 6] = yAxis[2]; newDst[ 7] = 0;\n newDst[ 8] = zAxis[0]; newDst[ 9] = zAxis[1]; newDst[10] = zAxis[2]; newDst[11] = 0;\n newDst[12] = eye[0]; newDst[13] = eye[1]; newDst[14] = eye[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 view transformation.\n *\n * This is a view matrix which transforms all other objects\n * to be in the space of the view defined by the parameters.\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The look-at matrix.\n */\nfunction lookAt(eye: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = yAxis[0]; newDst[ 2] = zAxis[0]; newDst[ 3] = 0;\n newDst[ 4] = xAxis[1]; newDst[ 5] = yAxis[1]; newDst[ 6] = zAxis[1]; newDst[ 7] = 0;\n newDst[ 8] = xAxis[2]; newDst[ 9] = yAxis[2]; newDst[10] = zAxis[2]; newDst[11] = 0;\n\n newDst[12] = -(xAxis[0] * eye[0] + xAxis[1] * eye[1] + xAxis[2] * eye[2]);\n newDst[13] = -(yAxis[0] * eye[0] + yAxis[1] * eye[1] + yAxis[2] * eye[2]);\n newDst[14] = -(zAxis[0] * eye[0] + zAxis[1] * eye[1] + zAxis[2] * eye[2]);\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which translates by the given vector v.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\nfunction translation(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = v[0]; newDst[13] = v[1]; newDst[14] = v[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Translates the given 4-by-4 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\nfunction translate(m: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n if (m !== newDst) {\n newDst[ 0] = m00;\n newDst[ 1] = m01;\n newDst[ 2] = m02;\n newDst[ 3] = m03;\n newDst[ 4] = m10;\n newDst[ 5] = m11;\n newDst[ 6] = m12;\n newDst[ 7] = m13;\n newDst[ 8] = m20;\n newDst[ 9] = m21;\n newDst[10] = m22;\n newDst[11] = m23;\n }\n\n newDst[12] = m00 * v0 + m10 * v1 + m20 * v2 + m30;\n newDst[13] = m01 * v0 + m11 * v1 + m21 * v2 + m31;\n newDst[14] = m02 * v0 + m12 * v1 + m22 * v2 + m32;\n newDst[15] = m03 * v0 + m13 * v1 + m23 * v2 + m33;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the x-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationX(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = c; newDst[ 6] = s; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = -s; newDst[10] = c; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the x-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateX(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[4] = c * m10 + s * m20;\n newDst[5] = c * m11 + s * m21;\n newDst[6] = c * m12 + s * m22;\n newDst[7] = c * m13 + s * m23;\n newDst[8] = c * m20 - s * m10;\n newDst[9] = c * m21 - s * m11;\n newDst[10] = c * m22 - s * m12;\n newDst[11] = c * m23 - s * m13;\n\n if (m !== newDst) {\n newDst[ 0] = m[ 0];\n newDst[ 1] = m[ 1];\n newDst[ 2] = m[ 2];\n newDst[ 3] = m[ 3];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the y-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationY(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = 0; newDst[ 2] = -s; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = s; newDst[ 9] = 0; newDst[10] = c; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the y-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateY(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 - s * m20;\n newDst[ 1] = c * m01 - s * m21;\n newDst[ 2] = c * m02 - s * m22;\n newDst[ 3] = c * m03 - s * m23;\n newDst[ 8] = c * m20 + s * m00;\n newDst[ 9] = c * m21 + s * m01;\n newDst[10] = c * m22 + s * m02;\n newDst[11] = c * m23 + s * m03;\n\n if (m !== newDst) {\n newDst[ 4] = m[ 4];\n newDst[ 5] = m[ 5];\n newDst[ 6] = m[ 6];\n newDst[ 7] = m[ 7];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the z-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationZ(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = s; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = -s; newDst[ 5] = c; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the z-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateZ(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 + s * m10;\n newDst[ 1] = c * m01 + s * m11;\n newDst[ 2] = c * m02 + s * m12;\n newDst[ 3] = c * m03 + s * m13;\n newDst[ 4] = c * m10 - s * m00;\n newDst[ 5] = c * m11 - s * m01;\n newDst[ 6] = c * m12 - s * m02;\n newDst[ 7] = c * m13 - s * m03;\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n newDst[11] = m[11];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\nfunction axisRotation(axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n\n newDst[ 0] = xx + (1 - xx) * c;\n newDst[ 1] = x * y * oneMinusCosine + z * s;\n newDst[ 2] = x * z * oneMinusCosine - y * s;\n newDst[ 3] = 0;\n newDst[ 4] = x * y * oneMinusCosine - z * s;\n newDst[ 5] = yy + (1 - yy) * c;\n newDst[ 6] = y * z * oneMinusCosine + x * s;\n newDst[ 7] = 0;\n newDst[ 8] = x * z * oneMinusCosine + y * s;\n newDst[ 9] = y * z * oneMinusCosine - x * s;\n newDst[10] = zz + (1 - zz) * c;\n newDst[11] = 0;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = 0;\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle. (same as axisRotation)\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\nconst rotation = axisRotation;\n\n/**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle.\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction axisRotate(m: Mat4Arg, axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n\n const r00 = xx + (1 - xx) * c;\n const r01 = x * y * oneMinusCosine + z * s;\n const r02 = x * z * oneMinusCosine - y * s;\n const r10 = x * y * oneMinusCosine - z * s;\n const r11 = yy + (1 - yy) * c;\n const r12 = y * z * oneMinusCosine + x * s;\n const r20 = x * z * oneMinusCosine + y * s;\n const r21 = y * z * oneMinusCosine - x * s;\n const r22 = zz + (1 - zz) * c;\n\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n\n newDst[ 0] = r00 * m00 + r01 * m10 + r02 * m20;\n newDst[ 1] = r00 * m01 + r01 * m11 + r02 * m21;\n newDst[ 2] = r00 * m02 + r01 * m12 + r02 * m22;\n newDst[ 3] = r00 * m03 + r01 * m13 + r02 * m23;\n newDst[ 4] = r10 * m00 + r11 * m10 + r12 * m20;\n newDst[ 5] = r10 * m01 + r11 * m11 + r12 * m21;\n newDst[ 6] = r10 * m02 + r11 * m12 + r12 * m22;\n newDst[ 7] = r10 * m03 + r11 * m13 + r12 * m23;\n newDst[ 8] = r20 * m00 + r21 * m10 + r22 * m20;\n newDst[ 9] = r20 * m01 + r21 * m11 + r22 * m21;\n newDst[10] = r20 * m02 + r21 * m12 + r22 * m22;\n newDst[11] = r20 * m03 + r21 * m13 + r22 * m23;\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle. (same as rotate)\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nconst rotate = axisRotate;\n\n/**\n * Creates a 4-by-4 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * three entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = v[2]; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 4-by-4 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of three entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale(m: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n newDst[ 3] = v0 * m[0 * 4 + 3];\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n newDst[ 7] = v1 * m[1 * 4 + 3];\n newDst[ 8] = v2 * m[2 * 4 + 0];\n newDst[ 9] = v2 * m[2 * 4 + 1];\n newDst[10] = v2 * m[2 * 4 + 2];\n newDst[11] = v2 * m[2 * 4 + 3];\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which scales a uniform amount in each dimension.\n * @param s - the amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = s; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 4-by-4 matrix in each dimension by a uniform scale.\n * @param m - The matrix to be modified.\n * @param s - The amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale(m: Mat4Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n newDst[ 3] = s * m[0 * 4 + 3];\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n newDst[ 7] = s * m[1 * 4 + 3];\n newDst[ 8] = s * m[2 * 4 + 0];\n newDst[ 9] = s * m[2 * 4 + 1];\n newDst[10] = s * m[2 * 4 + 2];\n newDst[11] = s * m[2 * 4 + 3];\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\nreturn {\n create,\n set,\n fromMat3,\n fromQuat,\n negate,\n copy,\n clone,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n determinant,\n invert,\n multiply,\n mul,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n perspective,\n perspectiveReverseZ,\n ortho,\n frustum,\n frustumReverseZ,\n aim,\n cameraAim,\n lookAt,\n translation,\n translate,\n rotationX,\n rotateX,\n rotationY,\n rotateY,\n rotationZ,\n rotateZ,\n axisRotation,\n rotation,\n axisRotate,\n rotate,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n};\n\n}\n\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Mat4Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { QuatArg, QuatType } from './quat';\nimport { Mat3Arg } from './mat3.js';\nimport { Mat4Arg } from './mat4.js';\nimport { Vec3Arg } from './vec3.js';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\n\nexport { QuatArg, QuatType };\n\ntype QuatCtor = new (n: number) => T;\n\nexport type RotationOrder = 'xyz' | 'xzy' | 'yxz' | 'yzx' | 'zxy' | 'zyx';\n\n/**\n * Generates am typed API for Qud\n * */\nfunction getAPIImpl(Ctor: QuatCtor) {\n const vec3 = getVec3API(Ctor);\n\n/**\n * Creates a quat4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number, w?: number) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a Quat; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Quat\n * Also see {@link quat.create} and {@link quat.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, w: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n\n return newDst;\n}\n\n/**\n * Sets a quaternion from the given angle and axis,\n * then returns it.\n *\n * @param axis - the axis to rotate around\n * @param angleInRadians - the angle\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The quaternion that represents the given axis and angle\n **/\nfunction fromAxisAngle(axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n const s = Math.sin(halfAngle);\n\n newDst[0] = s * axis[0];\n newDst[1] = s * axis[1];\n newDst[2] = s * axis[2];\n newDst[3] = Math.cos(halfAngle);\n\n return newDst;\n}\n\n/**\n * Gets the rotation axis and angle\n * @param q - quaternion to compute from\n * @param dst - Vec3 to hold result. If not passed in a new one is created.\n * @return angle and axis\n */\nfunction toAxisAngle(q: QuatArg, dst?: T): { angle: number, axis: T } {\n const newDst = (dst ?? vec3.create(3)) as T;\n\n const angle = Math.acos(q[3]) * 2;\n const s = Math.sin(angle * 0.5);\n if (s > utils.EPSILON) {\n newDst[0] = q[0] / s;\n newDst[1] = q[1] / s;\n newDst[2] = q[2] / s;\n } else {\n newDst[0] = 1;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n\n return { angle, axis: newDst };\n}\n\n/**\n * Returns the angle in degrees between two rotations a and b.\n * @param a - quaternion a\n * @param b - quaternion b\n * @return angle in radians between the two quaternions\n */\nfunction angle(a: QuatArg, b: QuatArg) {\n const d = dot(a, b);\n return Math.acos(2 * d * d - 1);\n}\n\n/**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction multiply(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const bw = b[3];\n\n newDst[0] = ax * bw + aw * bx + ay * bz - az * by;\n newDst[1] = ay * bw + aw * by + az * bx - ax * bz;\n newDst[2] = az * bw + aw * bz + ax * by - ay * bx;\n newDst[3] = aw * bw - ax * bx - ay * by - az * bz;\n\n return newDst;\n}\n\n/**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nconst mul = multiply;\n\n/**\n * Rotates the given quaternion around the X axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateX(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const bx = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw + qw * bx;\n newDst[1] = qy * bw + qz * bx;\n newDst[2] = qz * bw - qy * bx;\n newDst[3] = qw * bw - qx * bx;\n\n return newDst;\n}\n\n/**\n * Rotates the given quaternion around the Y axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateY(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const by = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw - qz * by;\n newDst[1] = qy * bw + qw * by;\n newDst[2] = qz * bw + qx * by;\n newDst[3] = qw * bw - qy * by;\n\n return newDst;\n}\n\n/**\n * Rotates the given quaternion around the Z axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateZ(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const bz = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw + qy * bz;\n newDst[1] = qy * bw - qx * bz;\n newDst[2] = qz * bw + qw * bz;\n newDst[3] = qw * bw - qz * bz;\n\n return newDst;\n}\n\n/**\n * Spherically linear interpolate between two quaternions\n *\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction slerp(a: QuatArg, b: QuatArg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n\n let bx = b[0];\n let by = b[1];\n let bz = b[2];\n let bw = b[3];\n\n let cosOmega = ax * bx + ay * by + az * bz + aw * bw;\n\n if (cosOmega < 0) {\n cosOmega = -cosOmega;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n\n let scale0;\n let scale1;\n\n if (1.0 - cosOmega > utils.EPSILON) {\n const omega = Math.acos(cosOmega);\n const sinOmega = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinOmega;\n scale1 = Math.sin(t * omega) / sinOmega;\n } else {\n scale0 = 1.0 - t;\n scale1 = t;\n }\n\n newDst[0] = scale0 * ax + scale1 * bx;\n newDst[1] = scale0 * ay + scale1 * by;\n newDst[2] = scale0 * az + scale1 * bz;\n newDst[3] = scale0 * aw + scale1 * bw;\n\n return newDst;\n}\n\n/**\n * Compute the inverse of a quaternion\n *\n * @param q - quaternion to compute the inverse of\n * @returns A quaternion that is the result of a * b\n */\nfunction inverse(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const a0 = q[0];\n const a1 = q[1];\n const a2 = q[2];\n const a3 = q[3];\n\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n\n newDst[0] = -a0 * invDot;\n newDst[1] = -a1 * invDot;\n newDst[2] = -a2 * invDot;\n newDst[3] = a3 * invDot;\n\n return newDst;\n}\n\n/**\n * Compute the conjugate of a quaternion\n * For quaternions with a magnitude of 1 (a unit quaternion)\n * this returns the same as the inverse but is faster to calculate.\n *\n * @param q - quaternion to compute the conjugate of.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The conjugate of q\n */\nfunction conjugate(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = -q[0];\n newDst[1] = -q[1];\n newDst[2] = -q[2];\n newDst[3] = q[3];\n\n return newDst;\n}\n\n/**\n * Creates a quaternion from the given rotation matrix.\n *\n * The created quaternion is not normalized.\n *\n * @param m - rotation matrix\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\nfunction fromMat(m: Mat3Arg | Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n /*\n 0 1 2\n 3 4 5\n 6 7 8\n\n 0 1 2\n 4 5 6\n 8 9 10\n */\n\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n const trace = m[0] + m[5] + m[10];\n\n if (trace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n const root = Math.sqrt(trace + 1); // 2w\n newDst[3] = 0.5 * root;\n const invRoot = 0.5 / root; // 1/(4w)\n\n newDst[0] = (m[6] - m[9]) * invRoot;\n newDst[1] = (m[8] - m[2]) * invRoot;\n newDst[2] = (m[1] - m[4]) * invRoot;\n } else {\n // |w| <= 1/2\n let i = 0;\n\n if (m[5] > m[0]) {\n i = 1;\n }\n if (m[10] > m[i * 4 + i]) {\n i = 2;\n }\n\n const j = (i + 1) % 3;\n const k = (i + 2) % 3;\n\n const root = Math.sqrt(m[i * 4 + i] - m[j * 4 + j] - m[k * 4 + k] + 1.0);\n newDst[i] = 0.5 * root;\n\n const invRoot = 0.5 / root;\n\n newDst[3] = (m[j * 4 + k] - m[k * 4 + j]) * invRoot;\n newDst[j] = (m[j * 4 + i] + m[i * 4 + j]) * invRoot;\n newDst[k] = (m[k * 4 + i] + m[i * 4 + k]) * invRoot;\n }\n\n return newDst;\n}\n\n/**\n * Creates a quaternion from the given euler angle x, y, z using the provided intrinsic order for the conversion.\n *\n * @param xAngleInRadians - angle to rotate around X axis in radians.\n * @param yAngleInRadians - angle to rotate around Y axis in radians.\n * @param zAngleInRadians - angle to rotate around Z axis in radians.\n * @param order - order to apply euler angles\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion representing the same rotation as the euler angles applied in the given order\n */\nfunction fromEuler(\n xAngleInRadians: number,\n yAngleInRadians: number,\n zAngleInRadians: number,\n order: RotationOrder,\n dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const xHalfAngle = xAngleInRadians * 0.5;\n const yHalfAngle = yAngleInRadians * 0.5;\n const zHalfAngle = zAngleInRadians * 0.5;\n\n const sx = Math.sin(xHalfAngle);\n const cx = Math.cos(xHalfAngle);\n const sy = Math.sin(yHalfAngle);\n const cy = Math.cos(yHalfAngle);\n const sz = Math.sin(zHalfAngle);\n const cz = Math.cos(zHalfAngle);\n\n switch (order) {\n case 'xyz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'xzy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n case 'yxz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n case 'yzx':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'zxy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'zyx':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n default:\n throw new Error(`Unknown rotation order: ${order}`);\n }\n\n return newDst;\n}\n\n/**\n * Copies a quaternion. (same as {@link quat.clone})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is a copy of q\n */\nfunction copy(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = q[0];\n newDst[1] = q[1];\n newDst[2] = q[2];\n newDst[3] = q[3];\n\n return newDst;\n}\n\n/**\n * Clones a quaternion. (same as {@link quat.copy})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A copy of q.\n */\nconst clone = copy;\n\n/**\n * Adds two quaternions; assumes a and b have the same dimension.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the sum of a and b.\n */\nfunction add(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\nfunction subtract(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Multiplies a quaternion by a scalar.\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nfunction mulScalar(v: QuatArg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a quaternion by a scalar. (same as mulScalar)\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nfunction divScalar(v: QuatArg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two quaternions\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns dot product\n */\nfunction dot(a: QuatArg, b: QuatArg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n}\n\n/**\n * Performs linear interpolation on two quaternions.\n * Given quaternions a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param t - Interpolation coefficient.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: QuatArg, b: QuatArg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Computes the length of quaternion\n * @param v - quaternion.\n * @returns length of quaternion.\n */\nfunction length(v: QuatArg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n}\n\n/**\n * Computes the length of quaternion (same as length)\n * @param v - quaternion.\n * @returns length of quaternion.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of quaternion\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\nfunction lengthSq(v: QuatArg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n}\n\n/**\n * Computes the square of the length of quaternion (same as lengthSq)\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\nconst lenSq = lengthSq;\n\n/**\n * Divides a quaternion by its Euclidean length and returns the quotient.\n * @param v - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The normalized quaternion.\n */\nfunction normalize(v: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n }\n\n return newDst;\n}\n\n/**\n * Check if 2 quaternions are approximately equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are approximately equal\n */\nfunction equalsApproximately(a: QuatArg, b: QuatArg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON &&\n Math.abs(a[3] - b[3]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 quaternions are exactly equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are exactly equal\n */\nfunction equals(a: QuatArg, b: QuatArg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Creates an identity quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns an identity quaternion\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n\n return newDst;\n}\n\nconst tempVec3 = vec3.create();\nconst xUnitVec3 = vec3.create();\nconst yUnitVec3 = vec3.create();\n\n/**\n * Computes a quaternion to represent the shortest rotation from one vector to another.\n *\n * @param aUnit - the start vector\n * @param bUnit - the end vector\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\nfunction rotationTo(aUnit: Vec3Arg, bUnit: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const dot = vec3.dot(aUnit, bUnit);\n if (dot < -0.999999) {\n vec3.cross(xUnitVec3, aUnit, tempVec3);\n if (vec3.len(tempVec3) < 0.000001) {\n vec3.cross(yUnitVec3, aUnit, tempVec3);\n }\n\n vec3.normalize(tempVec3, tempVec3);\n fromAxisAngle(tempVec3, Math.PI, newDst);\n\n return newDst;\n } else if (dot > 0.999999) {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n\n return newDst;\n } else {\n vec3.cross(aUnit, bUnit, tempVec3);\n\n newDst[0] = tempVec3[0];\n newDst[1] = tempVec3[1];\n newDst[2] = tempVec3[2];\n newDst[3] = 1 + dot;\n\n return normalize(newDst, newDst);\n }\n}\n\nconst tempQuat1 = new Ctor(4);\nconst tempQuat2 = new Ctor(4);\n\n/**\n * Performs a spherical linear interpolation with two control points\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param c - the third quaternion\n * @param d - the fourth quaternion\n * @param t - Interpolation coefficient 0 to 1\n * @returns result\n */\nfunction sqlerp(\n a: QuatArg,\n b: QuatArg,\n c: QuatArg,\n d: QuatArg,\n t: number,\n dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n slerp(a, d, t, tempQuat1);\n slerp(b, c, t, tempQuat2);\n slerp(tempQuat1, tempQuat2, 2 * t * (1 - t), newDst);\n\n return newDst;\n}\n\nreturn {\n create,\n fromValues,\n set,\n fromAxisAngle,\n toAxisAngle,\n angle,\n multiply,\n mul,\n rotateX,\n rotateY,\n rotateZ,\n slerp,\n inverse,\n conjugate,\n fromMat,\n fromEuler,\n copy,\n clone,\n add,\n subtract,\n sub,\n mulScalar,\n scale,\n divScalar,\n dot,\n lerp,\n length,\n len,\n lengthSq,\n lenSq,\n normalize,\n equalsApproximately,\n equals,\n identity,\n rotationTo,\n sqlerp,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\n/**\n *\n * Quat4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Quat4`. In other words you can do this\n *\n * const v = quat4.cross(v1, v2); // Creates a new Quat4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = quat4.create();\n * quat4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * quat4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nexport function getAPI(Ctor: QuatCtor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Vec4Arg, Vec4Type } from './vec4';\nimport { Mat4Arg } from './mat4';\nimport { BaseArgType } from './types';\n\nexport { Vec4Arg, Vec4Type };\n\ntype Vec4Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec4\n * */\nfunction getAPIImpl(Ctor: Vec4Ctor) {\n\n/**\n * Creates a vec4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number, w?: number) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a vec4; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec4\n * Also see {@link vec4.create} and {@link vec4.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, w: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n newDst[3] = Math.ceil(v[3]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n newDst[3] = Math.floor(v[3]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n newDst[3] = Math.round(v[3]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec4Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n newDst[3] = Math.min(max, Math.max(min, v[3]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec4Arg, b: Vec4Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n newDst[3] = a[3] + b[3] * scale;\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec4Arg, b: Vec4Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON &&\n Math.abs(a[3] - b[3]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec4Arg, b: Vec4Arg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec4Arg, b: Vec4Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec4Arg, b: Vec4Arg, t: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n newDst[3] = a[3] + t[3] * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n newDst[3] = Math.max(a[3], b[3]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n newDst[3] = Math.min(a[3], b[3]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec4Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec4Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n newDst[3] = 1 / v[3];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the dot product of two vectors\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec4Arg, b: Vec4Arg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec4Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec4Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec4Arg, b: Vec4Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec4Arg, b: Vec4Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return dx * dx + dy * dy + dz * dz + dw * dw;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n }\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n newDst[3] = -v[3];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec4.clone})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n newDst[3] = v[3];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec4.copy})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n newDst[3] = a[3] * b[3];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n newDst[3] = a[3] / b[3];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform vec4 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec4 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec4Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = v[3];\n\n newDst[0] = m[0] * x + m[4] * y + m[ 8] * z + m[12] * w;\n newDst[1] = m[1] * x + m[5] * y + m[ 9] * z + m[13] * w;\n newDst[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n newDst[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n\n return newDst;\n}\n\n\n/**\n * Treat a 4D vector as a direction and set it's length\n *\n * @param a The vec4 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec4Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec4 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec4Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n zero,\n transformMat4,\n setLength,\n truncate,\n midpoint,\n};\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\n/**\n *\n * Vec4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Vec4`. In other words you can do this\n *\n * const v = vec4.cross(v1, v2); // Creates a new Vec4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = vec4.create();\n * vec4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * vec4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nexport function getAPI(Ctor: Vec4Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n\n","/**\n * Some docs\n * @namespace wgpu-matrix\n */\nimport {BaseArgType, ZeroArray} from './types';\nimport {Mat3Arg, Mat3Type, getAPI as getMat3API} from './mat3-impl';\nimport {Mat4Arg, Mat4Type, getAPI as getMat4API} from './mat4-impl';\nimport {QuatArg, QuatType, getAPI as getQuatAPI, RotationOrder} from './quat-impl';\nimport {Vec2Arg, Vec2Type, getAPI as getVec2API} from './vec2-impl';\nimport {Vec3Arg, Vec3Type, getAPI as getVec3API} from './vec3-impl';\nimport {Vec4Arg, Vec4Type, getAPI as getVec4API} from './vec4-impl';\nimport * as utils from './utils';\n\nexport {\n RotationOrder,\n utils,\n\n BaseArgType,\n\n Mat3Arg,\n Mat4Arg,\n QuatArg,\n Vec2Arg,\n Vec3Arg,\n Vec4Arg,\n\n Mat3Type,\n Mat4Type,\n QuatType,\n Vec2Type,\n Vec3Type,\n Vec4Type,\n};\n\nexport type BaseCtor = new (n: number) => T;\n\nexport type Mat3 = Mat3Type;\nexport type Mat4 = Mat4Type;\nexport type Quat = QuatType;\nexport type Vec2 = Vec2Type;\nexport type Vec3 = Vec3Type;\nexport type Vec4 = Vec4Type;\n\nexport type Mat3d = Mat3Type;\nexport type Mat4d = Mat4Type;\nexport type Quatd = QuatType;\nexport type Vec2d = Vec2Type;\nexport type Vec3d = Vec3Type;\nexport type Vec4d = Vec4Type;\n\nexport type Mat3n = Mat3Type;\nexport type Mat4n = Mat4Type;\nexport type Quatn = QuatType;\nexport type Vec2n = Vec2Type;\nexport type Vec3n = Vec3Type;\nexport type Vec4n = Vec4Type;\n\n/**\n * Generate wgpu-matrix API for type\n */\nfunction wgpuMatrixAPI<\n Mat3 extends BaseArgType,\n Mat4 extends BaseArgType,\n Quat extends BaseArgType,\n Vec2 extends BaseArgType,\n Vec3 extends BaseArgType,\n Vec4 extends BaseArgType,\n>(\n Mat3Ctor: BaseCtor,\n Mat4Ctor: BaseCtor,\n QuatCtor: BaseCtor,\n Vec2Ctor: BaseCtor,\n Vec3Ctor: BaseCtor,\n Vec4Ctor: BaseCtor,\n) {\n return {\n /** @namespace mat3 */\n mat3: getMat3API(Mat3Ctor),\n /** @namespace mat4 */\n mat4: getMat4API(Mat4Ctor),\n /** @namespace quat */\n quat: getQuatAPI(QuatCtor),\n /** @namespace vec2 */\n vec2: getVec2API(Vec2Ctor),\n /** @namespace vec3 */\n vec3: getVec3API(Vec3Ctor),\n /** @namespace vec4 */\n vec4: getVec4API(Vec4Ctor),\n };\n}\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat3,\n /**\n * 4x4 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat4,\n /**\n * Quaternion functions that default to returning `Float32Array`\n * @namespace\n */\n quat,\n /**\n * Vec2 functions that default to returning `Float32Array`\n * @namespace\n */\n vec2,\n /**\n * Vec3 functions that default to returning `Float32Array`\n * @namespace\n */\n vec3,\n /**\n * Vec3 functions that default to returning `Float32Array`\n * @namespace\n */\n vec4,\n} = wgpuMatrixAPI<\n Mat3, Mat4, Quat, Vec2, Vec3, Vec4>(\n Float32Array, Float32Array, Float32Array, Float32Array, Float32Array, Float32Array);\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat3: mat3d,\n /**\n * 4x4 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat4: mat4d,\n /**\n * Quaternion functions that default to returning `Float64Array`\n * @namespace\n */\n quat: quatd,\n /**\n * Vec2 functions that default to returning `Float64Array`\n * @namespace\n */\n vec2: vec2d,\n /**\n * Vec3 functions that default to returning `Float64Array`\n * @namespace\n */\n vec3: vec3d,\n /**\n * Vec3 functions that default to returning `Float64Array`\n * @namespace\n */\n vec4: vec4d,\n} = wgpuMatrixAPI<\n Mat3d, Mat4d, Quatd, Vec2d, Vec3d, Vec4d>(\n Float64Array, Float64Array, Float64Array, Float64Array, Float64Array, Float64Array);\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat3: mat3n,\n /**\n * 4x4 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat4: mat4n,\n /**\n * Quaternion functions that default to returning `number[]`\n * @namespace\n */\n quat: quatn,\n /**\n * Vec2 functions that default to returning `number[]`\n * @namespace\n */\n vec2: vec2n,\n /**\n * Vec3 functions that default to returning `number[]`\n * @namespace\n */\n vec3: vec3n,\n /**\n * Vec3 functions that default to returning `number[]`\n * @namespace\n */\n vec4: vec4n,\n} = wgpuMatrixAPI<\n Mat3n, Mat4n, Quatn, Vec2n, Vec3n, Vec4n>(\n ZeroArray, Array, Array, Array, Array, Array);\n"],"names":["ZeroArray","OriginalConstructor","modifier","a","fill","constructor","args","super","this","EPSILON","degrees","Math","PI","n","m","b","v","d","abs","t","radians","old","cache","Map","getAPI","Ctor","api","get","create","x","y","newDst","undefined","subtract","dst","lerp","mulScalar","k","inverse","dot","length","v0","v1","sqrt","lengthSq","distance","dx","dy","distanceSq","normalize","len","copy","multiply","divide","setLength","fromValues","set","ceil","floor","round","clamp","min","max","add","addScaled","scale","angle","ax","ay","bx","by","mag","cosine","acos","sub","equalsApproximately","utils.EPSILON","equals","lerpV","divScalar","invert","cross","z","lenSq","dist","distSq","negate","clone","mul","div","random","cos","sin","zero","transformMat4","transformMat3","rotate","rad","p0","p1","sinC","cosC","truncate","maxLen","midpoint","getAPIImpl","v2","dz","az","bz","t1","t2","zScale","w","transformMat4Upper3x3","transformQuat","q","qx","qy","qz","w2","uvX","uvY","uvZ","getTranslation","getAxis","axis","off","getScaling","xx","xy","xz","yx","yy","yz","zx","zy","zz","rotateX","p","r","rotateY","rotateZ","vec2","getVec2API","vec3","getVec3API","identity","m00","m01","m02","m10","m11","m12","m20","m21","m22","b01","b11","b21","invDet","a00","a01","a02","a10","a11","a12","a20","a21","a22","b00","b02","b10","b12","b20","b22","rotation","angleInRadians","c","s","v3","v4","v5","v6","v7","v8","fromMat4","m4","fromQuat","x2","y2","z2","wx","wy","wz","transpose","determinant","setTranslation","setAxis","get3DScaling","translation","translate","rotationX","rotationY","rotationZ","scaling","uniformScaling","uniformScale","scaling3D","scale3D","uniformScaling3D","uniformScale3D","m03","m13","m23","m30","m31","m32","m33","tmp0","tmp1","tmp2","tmp3","tmp4","tmp5","tmp6","tmp7","tmp8","tmp9","tmp10","tmp11","tmp12","tmp13","tmp14","tmp15","tmp16","tmp17","tmp18","tmp19","tmp20","tmp21","tmp22","tmp23","t0","t3","a03","a13","a23","a30","a31","a32","a33","b03","b13","b23","b30","b31","b32","b33","xAxis","yAxis","zAxis","axisRotation","oneMinusCosine","axisRotate","r00","r01","r02","r10","r11","r12","r20","r21","r22","v9","v10","v11","v12","v13","v14","v15","fromMat3","m3","perspective","fieldOfViewYInRadians","aspect","zNear","zFar","f","tan","Number","isFinite","rangeInv","perspectiveReverseZ","Infinity","ortho","left","right","bottom","top","near","far","frustum","frustumReverseZ","aim","position","target","up","cameraAim","eye","lookAt","fromAxisAngle","halfAngle","aw","bw","slerp","scale0","scale1","cosOmega","omega","sinOmega","tempVec3","xUnitVec3","yUnitVec3","tempQuat1","tempQuat2","toAxisAngle","qw","a0","a1","a2","a3","invDot","conjugate","fromMat","trace","root","invRoot","i","j","fromEuler","xAngleInRadians","yAngleInRadians","zAngleInRadians","order","xHalfAngle","yHalfAngle","zHalfAngle","sx","cx","sy","cy","sz","cz","Error","rotationTo","aUnit","bUnit","sqlerp","dw","wgpuMatrixAPI","Mat3Ctor","Mat4Ctor","QuatCtor","Vec2Ctor","Vec3Ctor","Vec4Ctor","mat3","getMat3API","mat4","getMat4API","quat","getQuatAPI","vec4","getVec4API","Float32Array","mat3d","mat4d","quatd","vec2d","vec3d","vec4d","Float64Array","mat3n","mat4n","quatn","vec2n","vec3n","vec4n","Array"],"mappings":"kPAkBO,MAAMA,GAXXC,EAWsC,MAVtCC,EAUsDC,GAAKA,EAAEC,KAAK,GAR3D,cAAcH,EACnB,WAAAI,IAAeC,GACbC,SAASD,GACTJ,EAASM,KACV,IARL,IACEP,EACAC,ECcK,IAAIO,EAAU,4DAkBf,SAAmBC,GACvB,OAAOA,EAAUC,KAAKC,GAAK,GAC7B,kBAqDgB,SAAgBC,EAAWC,GACzC,OAASD,EAAIC,EAAKA,GAAKA,CACzB,uBAxB4BX,EAAWY,EAAWC,GAChD,MAAMC,EAAIF,EAAIZ,EACd,OAAQQ,KAAKO,IAAIH,EAAIZ,GAAKM,EACrBN,GACCa,EAAIb,GAAKc,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CAEa,MAAAC,KAKXA,EAAIE,KAKJA,EAAIE,KAKJA,EAAIpO,KAKJA,EAAIE,KAKJA,EAAIoO,KAKJA,GACEb,EAEAe,aAAcA,aAAcA,aAAcA,aAAcA,aAAcA,eAOxER,KAAMS,EAKNP,KAAMQ,EAKNN,KAAMO,EAKN3O,KAAM4O,EAKN1O,KAAM2O,EAKNP,KAAMQ,GACJrB,EAEAsB,aAAcA,aAAcA,aAAcA,aAAcA,aAAcA,eAOxEf,KAAMgB,EAKNd,KAAMe,EAKNb,KAAMc,EAKNlP,KAAMmP,EAKNjP,KAAMkP,EAKNd,KAAMe,GACJ5B,EAEAxW,EAAWqY,MAAOA,MAAOA,MAAOA,MAAOA"} \ No newline at end of file diff --git a/dist/3.x/wgpu-matrix.module.js b/dist/3.x/wgpu-matrix.module.js index cdecacb..36e4e92 100644 --- a/dist/3.x/wgpu-matrix.module.js +++ b/dist/3.x/wgpu-matrix.module.js @@ -1,4 +1,4 @@ -/* wgpu-matrix@3.1.0, license MIT */ +/* wgpu-matrix@3.2.0, license MIT */ function wrapConstructor(OriginalConstructor, modifier) { return class extends OriginalConstructor { constructor(...args) { @@ -2313,9 +2313,129 @@ function getAPIImpl$3(Ctor) { } return newDst; } + /** + * Creates a 3-by-3 matrix which rotates around the x-axis by the given angle. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotation matrix. + */ + function rotationX(angleInRadians, dst) { + const newDst = (dst ?? new Ctor(12)); + const c = Math.cos(angleInRadians); + const s = Math.sin(angleInRadians); + newDst[0] = 1; + newDst[1] = 0; + newDst[2] = 0; + newDst[4] = 0; + newDst[5] = c; + newDst[6] = s; + newDst[8] = 0; + newDst[9] = -s; + newDst[10] = c; + return newDst; + } + /** + * Rotates the given 3-by-3 matrix around the x-axis by the given + * angle. + * @param m - The matrix. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotated matrix. + */ + function rotateX(m, angleInRadians, dst) { + const newDst = (dst ?? new Ctor(12)); + const m10 = m[4]; + const m11 = m[5]; + const m12 = m[6]; + const m20 = m[8]; + const m21 = m[9]; + const m22 = m[10]; + const c = Math.cos(angleInRadians); + const s = Math.sin(angleInRadians); + newDst[4] = c * m10 + s * m20; + newDst[5] = c * m11 + s * m21; + newDst[6] = c * m12 + s * m22; + newDst[8] = c * m20 - s * m10; + newDst[9] = c * m21 - s * m11; + newDst[10] = c * m22 - s * m12; + if (m !== newDst) { + newDst[0] = m[0]; + newDst[1] = m[1]; + newDst[2] = m[2]; + } + return newDst; + } + /** + * Creates a 3-by-3 matrix which rotates around the y-axis by the given angle. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotation matrix. + */ + function rotationY(angleInRadians, dst) { + const newDst = (dst ?? new Ctor(12)); + const c = Math.cos(angleInRadians); + const s = Math.sin(angleInRadians); + newDst[0] = c; + newDst[1] = 0; + newDst[2] = -s; + newDst[4] = 0; + newDst[5] = 1; + newDst[6] = 0; + newDst[8] = s; + newDst[9] = 0; + newDst[10] = c; + return newDst; + } + /** + * Rotates the given 3-by-3 matrix around the y-axis by the given + * angle. + * @param m - The matrix. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotated matrix. + */ + function rotateY(m, angleInRadians, dst) { + const newDst = (dst ?? new Ctor(12)); + const m00 = m[0 * 4 + 0]; + const m01 = m[0 * 4 + 1]; + const m02 = m[0 * 4 + 2]; + const m20 = m[2 * 4 + 0]; + const m21 = m[2 * 4 + 1]; + const m22 = m[2 * 4 + 2]; + const c = Math.cos(angleInRadians); + const s = Math.sin(angleInRadians); + newDst[0] = c * m00 - s * m20; + newDst[1] = c * m01 - s * m21; + newDst[2] = c * m02 - s * m22; + newDst[8] = c * m20 + s * m00; + newDst[9] = c * m21 + s * m01; + newDst[10] = c * m22 + s * m02; + if (m !== newDst) { + newDst[4] = m[4]; + newDst[5] = m[5]; + newDst[6] = m[6]; + } + return newDst; + } + /** + * Creates a 3-by-3 matrix which rotates around the z-axis by the given angle. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotation matrix. + */ + const rotationZ = rotation; + /** + * Rotates the given 3-by-3 matrix around the z-axis by the given + * angle. + * @param m - The matrix. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotated matrix. + */ + const rotateZ = rotate; /** * Creates a 3-by-3 matrix which scales in each dimension by an amount given by - * the corresponding entry in the given vector; assumes the vector has three + * the corresponding entry in the given vector; assumes the vector has two * entries. * @param v - A vector of * 2 entries specifying the factor by which to scale in each dimension. @@ -2338,7 +2458,7 @@ function getAPIImpl$3(Ctor) { /** * Scales the given 3-by-3 matrix in each dimension by an amount * given by the corresponding entry in the given vector; assumes the vector has - * three entries. + * two entries. * @param m - The matrix to be modified. * @param v - A vector of 2 entries specifying the * factor by which to scale in each dimension. @@ -2363,7 +2483,55 @@ function getAPIImpl$3(Ctor) { return newDst; } /** - * Creates a 3-by-3 matrix which scales uniformly in each dimension + * Creates a 3-by-3 matrix which scales in each dimension by an amount given by + * the corresponding entry in the given vector; assumes the vector has three + * entries. + * @param v - A vector of + * 3 entries specifying the factor by which to scale in each dimension. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The scaling matrix. + */ + function scaling3D(v, dst) { + const newDst = (dst ?? new Ctor(12)); + newDst[0] = v[0]; + newDst[1] = 0; + newDst[2] = 0; + newDst[4] = 0; + newDst[5] = v[1]; + newDst[6] = 0; + newDst[8] = 0; + newDst[9] = 0; + newDst[10] = v[2]; + return newDst; + } + /** + * Scales the given 3-by-3 matrix in each dimension by an amount + * given by the corresponding entry in the given vector; assumes the vector has + * three entries. + * @param m - The matrix to be modified. + * @param v - A vector of 3 entries specifying the + * factor by which to scale in each dimension. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The scaled matrix. + */ + function scale3D(m, v, dst) { + const newDst = (dst ?? new Ctor(12)); + const v0 = v[0]; + const v1 = v[1]; + const v2 = v[2]; + newDst[0] = v0 * m[0 * 4 + 0]; + newDst[1] = v0 * m[0 * 4 + 1]; + newDst[2] = v0 * m[0 * 4 + 2]; + newDst[4] = v1 * m[1 * 4 + 0]; + newDst[5] = v1 * m[1 * 4 + 1]; + newDst[6] = v1 * m[1 * 4 + 2]; + newDst[8] = v2 * m[2 * 4 + 0]; + newDst[9] = v2 * m[2 * 4 + 1]; + newDst[10] = v2 * m[2 * 4 + 2]; + return newDst; + } + /** + * Creates a 3-by-3 matrix which scales uniformly in the X and Y dimensions * @param s - Amount to scale * @param dst - matrix to hold result. If not passed a new one is created. * @returns The scaling matrix. @@ -2382,7 +2550,7 @@ function getAPIImpl$3(Ctor) { return newDst; } /** - * Scales the given 3-by-3 matrix in each dimension by an amount + * Scales the given 3-by-3 matrix in the X and Y dimension by an amount * given. * @param m - The matrix to be modified. * @param s - Amount to scale. @@ -2404,6 +2572,46 @@ function getAPIImpl$3(Ctor) { } return newDst; } + /** + * Creates a 3-by-3 matrix which scales uniformly in each dimension + * @param s - Amount to scale + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The scaling matrix. + */ + function uniformScaling3D(s, dst) { + const newDst = (dst ?? new Ctor(12)); + newDst[0] = s; + newDst[1] = 0; + newDst[2] = 0; + newDst[4] = 0; + newDst[5] = s; + newDst[6] = 0; + newDst[8] = 0; + newDst[9] = 0; + newDst[10] = s; + return newDst; + } + /** + * Scales the given 3-by-3 matrix in each dimension by an amount + * given. + * @param m - The matrix to be modified. + * @param s - Amount to scale. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The scaled matrix. + */ + function uniformScale3D(m, s, dst) { + const newDst = (dst ?? new Ctor(12)); + newDst[0] = s * m[0 * 4 + 0]; + newDst[1] = s * m[0 * 4 + 1]; + newDst[2] = s * m[0 * 4 + 2]; + newDst[4] = s * m[1 * 4 + 0]; + newDst[5] = s * m[1 * 4 + 1]; + newDst[6] = s * m[1 * 4 + 2]; + newDst[8] = s * m[2 * 4 + 0]; + newDst[9] = s * m[2 * 4 + 1]; + newDst[10] = s * m[2 * 4 + 2]; + return newDst; + } return { clone, create, @@ -2431,10 +2639,20 @@ function getAPIImpl$3(Ctor) { translate, rotation, rotate, + rotationX, + rotateX, + rotationY, + rotateY, + rotationZ, + rotateZ, scaling, scale, uniformScaling, uniformScale, + scaling3D, + scale3D, + uniformScaling3D, + uniformScale3D, }; } const cache$3 = new Map(); diff --git a/dist/3.x/wgpu-matrix.module.js.map b/dist/3.x/wgpu-matrix.module.js.map index 7fa2bd8..f9545e0 100644 --- a/dist/3.x/wgpu-matrix.module.js.map +++ b/dist/3.x/wgpu-matrix.module.js.map @@ -1 +1 @@ -{"version":3,"file":"wgpu-matrix.module.js","sources":["../../../src/types.ts","../../../src/utils.ts","../../../src/vec2-impl.ts","../../../src/vec3-impl.ts","../../../src/mat3-impl.ts","../../../src/mat4-impl.ts","../../../src/quat-impl.ts","../../../src/vec4-impl.ts","../../../src/wgpu-matrix.ts"],"sourcesContent":["/**\n * The types you can pass to most functions that take an\n * array of numbers.\n */\nexport type BaseArgType = Float32Array | Float64Array | number[];\n\nfunction wrapConstructor any>(\n OriginalConstructor: T,\n modifier: (instance: InstanceType) => void\n): T {\n return class extends OriginalConstructor {\n constructor(...args: any[]) {\n super(...args);\n modifier(this as InstanceType);\n }\n } as T; // Type assertion is necessary here\n}\n\nexport const ZeroArray = wrapConstructor(Array, a => a.fill(0));\n\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nexport let EPSILON = 0.000001;\n\n/**\n * Set the value for EPSILON for various checks\n * @param v - Value to use for EPSILON.\n * @returns previous value of EPSILON;\n */\nexport function setEpsilon(v: number): number {\n const old = EPSILON;\n EPSILON = v;\n return old;\n}\n\n/**\n * Convert degrees to radians\n * @param degrees - Angle in degrees\n * @returns angle converted to radians\n */\nexport function degToRad(degrees: number): number {\n return degrees * Math.PI / 180;\n}\n\n/**\n * Convert radians to degrees\n * @param radians - Angle in radians\n * @returns angle converted to degrees\n */\nexport function radToDeg(radians: number): number {\n return radians * 180 / Math.PI;\n}\n\n/**\n * Lerps between a and b via t\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @returns a + (b - a) * t\n */\nexport function lerp(a: number, b: number, t: number): number {\n return a + (b - a) * t;\n}\n\n/**\n * Compute the opposite of lerp. Given a and b and a value between\n * a and b returns a value between 0 and 1. 0 if a, 1 if b.\n * Note: no clamping is done.\n * @param a - start value\n * @param b - end value\n * @param v - value between a and b\n * @returns (v - a) / (b - a)\n */\nexport function inverseLerp(a: number, b: number, v: number): number {\n const d = b - a;\n return (Math.abs(b - a) < EPSILON)\n ? a\n : (v - a) / d;\n}\n\n/**\n * Compute the euclidean modulo\n *\n * ```\n * // table for n / 3\n * -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 <- n\n * ------------------------------------\n * -2 -1 -0 -2 -1 0, 1, 2, 0, 1, 2 <- n % 3\n * 1 2 0 1 2 0, 1, 2, 0, 1, 2 <- euclideanModule(n, 3)\n * ```\n *\n * @param n - dividend\n * @param m - divisor\n * @returns the euclidean modulo of n / m\n */\nexport function euclideanModulo(n: number, m: number) {\n return ((n % m) + m) % m;\n}","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Mat3Arg } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { Vec2Arg, Vec2Type } from './vec2';\nimport { Vec3Arg } from './vec3';\nimport { BaseArgType } from './types';\n\nexport { Vec2Arg, Vec2Type };\n\ntype Vec2Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec3\n */\nfunction getAPIImpl(Ctor: Vec2Ctor) {\n\n/**\n * Creates a Vec2; may be called with x, y, z to set initial values.\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Vec2's specified type\n * it would be faster to use\n *\n * ```\n * const v = vec2.clone(someJSArray);\n * ```\n *\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\nfunction create(x = 0, y = 0) {\n const newDst = new Ctor(2);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n }\n }\n return newDst;\n}\n\n/**\n * Creates a Vec2; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec2\n * Also see {@link vec2.create} and {@link vec2.copy}\n *\n * @param x first value\n * @param y second value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec2Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec2Arg, b: Vec2Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n\n return newDst;\n}\n\n/**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\nfunction angle(a: Vec2Arg, b: Vec2Arg): number {\n const ax = a[0];\n const ay = a[1];\n const bx = b[0];\n const by = b[1];\n const mag1 = Math.sqrt(ax * ax + ay * ay);\n const mag2 = Math.sqrt(bx * bx + by * by);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec2Arg, b: Vec2Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec2Arg, b: Vec2Arg): boolean {\n return a[0] === b[0] && a[1] === b[1];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec2Arg, b: Vec2Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec2Arg, b: Vec2Arg, t: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec2Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec2Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\nfunction cross(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const z = a[0] * b[1] - a[1] * b[0];\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = z;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec2Arg, b: Vec2Arg): number {\n return a[0] * b[0] + a[1] * b[1];\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec2Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n return Math.sqrt(v0 * v0 + v1 * v1);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec2Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n return v0 * v0 + v1 * v1;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec2Arg, b: Vec2Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return Math.sqrt(dx * dx + dy * dy);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec2Arg, b: Vec2Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return dx * dx + dy * dy;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const len = Math.sqrt(v0 * v0 + v1 * v1);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n }\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec2.clone})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec2.copy})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Creates a random unit vector * scale\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\nfunction random(scale = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const angle = Math.random() * 2 * Math.PI;\n newDst[0] = Math.cos(angle) * scale;\n newDst[1] = Math.sin(angle) * scale;\n\n return newDst;\n}\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform Vec2 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec2Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const x = v[0];\n const y = v[1];\n\n newDst[0] = x * m[0] + y * m[4] + m[12];\n newDst[1] = x * m[1] + y * m[5] + m[13];\n\n return newDst;\n}\n\n/**\n * Transforms vec4 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat3(v: Vec2Arg, m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const x = v[0];\n const y = v[1];\n\n newDst[0] = m[0] * x + m[4] * y + m[8];\n newDst[1] = m[1] * x + m[5] * y + m[9];\n\n return newDst;\n}\n\n/**\n * Rotate a 2D vector\n *\n * @param a The vec2 point to rotate\n * @param b The origin of the rotation\n * @param rad The angle of rotation in radians\n * @returns the rotated vector\n */\nfunction rotate(a: Vec2Arg, b: Vec2Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n // Translate point to the origin\n const p0 = a[0] - b[0];\n const p1 = a[1] - b[1];\n const sinC = Math.sin(rad);\n const cosC = Math.cos(rad);\n\n //perform rotation and translate to correct position\n newDst[0] = p0 * cosC - p1 * sinC + b[0];\n newDst[1] = p0 * sinC + p1 * cosC + b[1];\n\n return newDst;\n}\n\n/**\n * Treat a 2D vector as a direction and set it's length\n *\n * @param a The vec2 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec2Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec2 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec2Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat3,\n rotate,\n setLength,\n truncate,\n midpoint,\n};\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Vec2Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Vec3Arg, Vec3Type } from './vec3';\nimport { Mat3Arg } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { QuatArg } from './quat';\nimport { BaseArgType } from './types';\n\nexport { Vec3Arg, Vec3Type };\n\ntype Vec3Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec3\n * */\nfunction getAPIImpl(Ctor: Vec3Ctor) {\n\n/**\n * Creates a vec3; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number) {\n const newDst = new Ctor(3);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a vec3; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec3\n * Also see {@link vec3.create} and {@link vec3.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec3Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec3Arg, b: Vec3Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n\n return newDst;\n}\n\n/**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\nfunction angle(a: Vec3Arg, b: Vec3Arg): number {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const mag1 = Math.sqrt(ax * ax + ay * ay + az * az);\n const mag2 = Math.sqrt(bx * bx + by * by + bz * bz);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec3Arg, b: Vec3Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec3Arg, b: Vec3Arg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec3Arg, b: Vec3Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec3Arg, b: Vec3Arg, t: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec3Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec3Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\nfunction cross(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const t1 = a[2] * b[0] - a[0] * b[2];\n const t2 = a[0] * b[1] - a[1] * b[0];\n newDst[0] = a[1] * b[2] - a[2] * b[1];\n newDst[1] = t1;\n newDst[2] = t2;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec3Arg, b: Vec3Arg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]);\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec3Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec3Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return v0 * v0 + v1 * v1 + v2 * v2;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec3Arg, b: Vec3Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return Math.sqrt(dx * dx + dy * dy + dz * dz);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec3Arg, b: Vec3Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return dx * dx + dy * dy + dz * dz;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec3.clone})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec3.copy})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Creates a random vector\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\nfunction random(scale = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const angle = Math.random() * 2 * Math.PI;\n const z = Math.random() * 2 - 1;\n const zScale = Math.sqrt(1 - z * z) * scale;\n newDst[0] = Math.cos(angle) * zScale;\n newDst[1] = Math.sin(angle) * zScale;\n newDst[2] = z * scale;\n\n return newDst;\n}\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform vec3 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec3Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1;\n\n newDst[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n newDst[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n newDst[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n\n return newDst;\n}\n\n/**\n * Transform vec3 by upper 3x3 matrix inside 4x4 matrix.\n * @param v - The direction.\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns The transformed vector.\n */\nfunction transformMat4Upper3x3(v: Vec3Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[0] = v0 * m[0 * 4 + 0] + v1 * m[1 * 4 + 0] + v2 * m[2 * 4 + 0];\n newDst[1] = v0 * m[0 * 4 + 1] + v1 * m[1 * 4 + 1] + v2 * m[2 * 4 + 1];\n newDst[2] = v0 * m[0 * 4 + 2] + v1 * m[1 * 4 + 2] + v2 * m[2 * 4 + 2];\n\n return newDst;\n}\n\n/**\n * Transforms vec3 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat3(v: Vec3Arg, m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n\n newDst[0] = x * m[0] + y * m[4] + z * m[8];\n newDst[1] = x * m[1] + y * m[5] + z * m[9];\n newDst[2] = x * m[2] + y * m[6] + z * m[10];\n\n return newDst;\n}\n\n/**\n * Transforms vec3 by Quaternion\n * @param v - the vector to transform\n * @param q - the quaternion to transform by\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed\n */\nfunction transformQuat(v: Vec3Arg, q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n\n const uvX = qy * z - qz * y;\n const uvY = qz * x - qx * z;\n const uvZ = qx * y - qy * x;\n\n newDst[0] = x + uvX * w2 + (qy * uvZ - qz * uvY) * 2;\n newDst[1] = y + uvY * w2 + (qz * uvX - qx * uvZ) * 2;\n newDst[2] = z + uvZ * w2 + (qx * uvY - qy * uvX) * 2;\n\n return newDst;\n}\n\n/**\n * Returns the translation component of a 4-by-4 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\nfunction getTranslation(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n}\n/**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat4Arg, axis: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n}\n/**\n * Returns the scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the x-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\nfunction rotateX(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n //Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n //perform rotation\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad);\n\n //translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the y-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\nfunction rotateY(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n // perform rotation\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad);\n\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the z-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns {vec3} out\n */\nfunction rotateZ(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n // perform rotation\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2];\n\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Treat a 3D vector as a direction and set it's length\n *\n * @param a The vec3 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec3Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec3 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec3Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat4Upper3x3,\n transformMat3,\n transformQuat,\n getTranslation,\n getAxis,\n getScaling,\n rotateX,\n rotateY,\n rotateZ,\n setLength,\n truncate,\n midpoint,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Vec3Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nimport * as utils from './utils.js';\nimport { QuatArg } from './quat';\nimport { Mat3Arg, Mat3Type } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { Vec2Arg } from './vec2';\nimport { Vec3Arg } from './vec3';\nimport { getAPI as getVec2API } from './vec2-impl';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\n\nexport { Mat3Arg, Mat3Type };\n\ntype Mat3Ctor = new (n: number) => T;\n\n/**\n * Generates a typed API for Mat3\n * */\nfunction getAPIImpl(Ctor: Mat3Ctor) {\n const vec2 = getVec2API(Ctor);\n const vec3 = getVec3API(Ctor);\n\n/**\n * Create a Mat3 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat3's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat3.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @returns matrix created from values.\n */\nfunction create(\n v0?: number, v1?: number, v2?: number,\n v3?: number, v4?: number, v5?: number,\n v6?: number, v7?: number, v8?: number) {\n const newDst = new Ctor(12);\n // to make the array homogenous\n newDst[3] = 0;\n newDst[7] = 0;\n newDst[11] = 0;\n\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[4] = v3;\n if (v4 !== undefined) {\n newDst[5] = v4;\n if (v5 !== undefined) {\n newDst[6] = v5;\n if (v6 !== undefined) {\n newDst[8] = v6;\n if (v7 !== undefined) {\n newDst[9] = v7;\n if (v8 !== undefined) {\n newDst[10] = v8;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n\n return newDst;\n}\n\n/**\n * Sets the values of a Mat3\n * Also see {@link mat3.create} and {@link mat3.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 set from values.\n */\nfunction set(\n v0: number, v1: number, v2: number,\n v3: number, v4: number, v5: number,\n v6: number, v7: number, v8: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[0] = v0; newDst[1] = v1; newDst[ 2] = v2; newDst[ 3] = 0;\n newDst[4] = v3; newDst[5] = v4; newDst[ 6] = v5; newDst[ 7] = 0;\n newDst[8] = v6; newDst[9] = v7; newDst[10] = v8; newDst[11] = 0;\n\n return newDst;\n}\n\n/**\n * Creates a Mat3 from the upper left 3x3 part of a Mat4\n * @param m4 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from m4\n */\nfunction fromMat4(m4: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n newDst[0] = m4[0]; newDst[1] = m4[1]; newDst[ 2] = m4[ 2]; newDst[ 3] = 0;\n newDst[4] = m4[4]; newDst[5] = m4[5]; newDst[ 6] = m4[ 6]; newDst[ 7] = 0;\n newDst[8] = m4[8]; newDst[9] = m4[9]; newDst[10] = m4[10]; newDst[11] = 0;\n return newDst;\n}\n\n/**\n * Creates a Mat3 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from q\n */\nfunction fromQuat(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3];\n const x2 = x + x; const y2 = y + y; const z2 = z + z;\n\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n newDst[ 0] = 1 - yy - zz; newDst[ 1] = yx + wz; newDst[ 2] = zx - wy; newDst[ 3] = 0;\n newDst[ 4] = yx - wz; newDst[ 5] = 1 - xx - zz; newDst[ 6] = zy + wx; newDst[ 7] = 0;\n newDst[ 8] = zx + wy; newDst[ 9] = zy - wx; newDst[10] = 1 - xx - yy; newDst[11] = 0;\n\n return newDst;\n}\n\n/**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\nfunction negate(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = -m[ 0]; newDst[ 1] = -m[ 1]; newDst[ 2] = -m[ 2];\n newDst[ 4] = -m[ 4]; newDst[ 5] = -m[ 5]; newDst[ 6] = -m[ 6];\n newDst[ 8] = -m[ 8]; newDst[ 9] = -m[ 9]; newDst[10] = -m[10];\n\n return newDst;\n}\n\n/**\n * Copies a matrix. (same as {@link mat3.clone})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nfunction copy(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = m[ 0]; newDst[ 1] = m[ 1]; newDst[ 2] = m[ 2];\n newDst[ 4] = m[ 4]; newDst[ 5] = m[ 5]; newDst[ 6] = m[ 6];\n newDst[ 8] = m[ 8]; newDst[ 9] = m[ 9]; newDst[10] = m[10];\n\n return newDst;\n}\n\n/**\n * Copies a matrix (same as {@link mat3.copy})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nconst clone = copy;\n\n/**\n * Check if 2 matrices are approximately equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are approximately equal\n */\nfunction equalsApproximately(a: Mat3Arg, b: Mat3Arg): boolean {\n return Math.abs(a[ 0] - b[ 0]) < utils.EPSILON &&\n Math.abs(a[ 1] - b[ 1]) < utils.EPSILON &&\n Math.abs(a[ 2] - b[ 2]) < utils.EPSILON &&\n Math.abs(a[ 4] - b[ 4]) < utils.EPSILON &&\n Math.abs(a[ 5] - b[ 5]) < utils.EPSILON &&\n Math.abs(a[ 6] - b[ 6]) < utils.EPSILON &&\n Math.abs(a[ 8] - b[ 8]) < utils.EPSILON &&\n Math.abs(a[ 9] - b[ 9]) < utils.EPSILON &&\n Math.abs(a[10] - b[10]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 matrices are exactly equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are exactly equal\n */\nfunction equals(a: Mat3Arg, b: Mat3Arg): boolean {\n return a[ 0] === b[ 0] &&\n a[ 1] === b[ 1] &&\n a[ 2] === b[ 2] &&\n a[ 4] === b[ 4] &&\n a[ 5] === b[ 5] &&\n a[ 6] === b[ 6] &&\n a[ 8] === b[ 8] &&\n a[ 9] === b[ 9] &&\n a[10] === b[10];\n}\n\n/**\n * Creates a 3-by-3 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 3-by-3 identity matrix.\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\nfunction transpose(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n if (newDst === m) {\n let t: number;\n\n // 0 1 2\n // 4 5 6\n // 8 9 10\n\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n\n return newDst;\n }\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n newDst[ 0] = m00; newDst[ 1] = m10; newDst[ 2] = m20;\n newDst[ 4] = m01; newDst[ 5] = m11; newDst[ 6] = m21;\n newDst[ 8] = m02; newDst[ 9] = m12; newDst[10] = m22;\n\n return newDst;\n}\n\n/**\n * Computes the inverse of a 3-by-3 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nfunction inverse(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n const b01 = m22 * m11 - m12 * m21;\n const b11 = -m22 * m10 + m12 * m20;\n const b21 = m21 * m10 - m11 * m20;\n\n const invDet = 1 / (m00 * b01 + m01 * b11 + m02 * b21);\n\n newDst[ 0] = b01 * invDet;\n newDst[ 1] = (-m22 * m01 + m02 * m21) * invDet;\n newDst[ 2] = ( m12 * m01 - m02 * m11) * invDet;\n newDst[ 4] = b11 * invDet;\n newDst[ 5] = ( m22 * m00 - m02 * m20) * invDet;\n newDst[ 6] = (-m12 * m00 + m02 * m10) * invDet;\n newDst[ 8] = b21 * invDet;\n newDst[ 9] = (-m21 * m00 + m01 * m20) * invDet;\n newDst[10] = ( m11 * m00 - m01 * m10) * invDet;\n\n return newDst;\n}\n\n/**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\nfunction determinant(m: Mat3Arg): number {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n return m00 * (m11 * m22 - m21 * m12) -\n m10 * (m01 * m22 - m21 * m02) +\n m20 * (m01 * m12 - m11 * m02);\n}\n\n/**\n * Computes the inverse of a 3-by-3 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nconst invert = inverse;\n\n/**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nfunction multiply(a: Mat3Arg, b: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[ 4 + 0];\n const a11 = a[ 4 + 1];\n const a12 = a[ 4 + 2];\n const a20 = a[ 8 + 0];\n const a21 = a[ 8 + 1];\n const a22 = a[ 8 + 2];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b10 = b[ 4 + 0];\n const b11 = b[ 4 + 1];\n const b12 = b[ 4 + 2];\n const b20 = b[ 8 + 0];\n const b21 = b[ 8 + 1];\n const b22 = b[ 8 + 2];\n\n newDst[ 0] = a00 * b00 + a10 * b01 + a20 * b02;\n newDst[ 1] = a01 * b00 + a11 * b01 + a21 * b02;\n newDst[ 2] = a02 * b00 + a12 * b01 + a22 * b02;\n newDst[ 4] = a00 * b10 + a10 * b11 + a20 * b12;\n newDst[ 5] = a01 * b10 + a11 * b11 + a21 * b12;\n newDst[ 6] = a02 * b10 + a12 * b11 + a22 * b12;\n newDst[ 8] = a00 * b20 + a10 * b21 + a20 * b22;\n newDst[ 9] = a01 * b20 + a11 * b21 + a21 * b22;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22;\n\n return newDst;\n}\n\n/**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nconst mul = multiply;\n\n/**\n * Sets the translation component of a 3-by-3 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\nfunction setTranslation(a: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? identity()) as T;\n if (a !== newDst) {\n newDst[ 0] = a[ 0];\n newDst[ 1] = a[ 1];\n newDst[ 2] = a[ 2];\n newDst[ 4] = a[ 4];\n newDst[ 5] = a[ 5];\n newDst[ 6] = a[ 6];\n }\n newDst[ 8] = v[0];\n newDst[ 9] = v[1];\n newDst[10] = 1;\n return newDst;\n}\n\n/**\n * Returns the translation component of a 3-by-3 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\nfunction getTranslation(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec2.create()) as T;\n newDst[0] = m[8];\n newDst[1] = m[9];\n return newDst;\n}\n\n/**\n * Returns an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y,\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat3Arg, axis: number, dst?: T) {\n const newDst = (dst ?? vec2.create()) as T;\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n return newDst;\n}\n\n/**\n * Sets an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\nfunction setAxis(m: Mat3Arg, v: Vec2Arg, axis: number, dst?: T) {\n const newDst = (dst === m ? m : copy(m, dst)) as T;\n\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n return newDst;\n}\n\n/**\n * Returns the \"2d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec2.create());\n\n const xx = m[0];\n const xy = m[1];\n const yx = m[4];\n const yy = m[5];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy);\n newDst[1] = Math.sqrt(yx * yx + yy * yy);\n\n return newDst;\n}\n\n\n/**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction get3DScaling(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec3.create());\n\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which translates by the given vector v.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\nfunction translation(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = v[0]; newDst[ 9] = v[1]; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Translates the given 3-by-3 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\nfunction translate(m: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 0] = m00;\n newDst[ 1] = m01;\n newDst[ 2] = m02;\n newDst[ 4] = m10;\n newDst[ 5] = m11;\n newDst[ 6] = m12;\n }\n\n newDst[ 8] = m00 * v0 + m10 * v1 + m20;\n newDst[ 9] = m01 * v0 + m11 * v1 + m21;\n newDst[10] = m02 * v0 + m12 * v1 + m22;\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotation(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = s; newDst[ 2] = 0;\n newDst[ 4] = -s; newDst[ 5] = c; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix by the given angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotate(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 + s * m10;\n newDst[ 1] = c * m01 + s * m11;\n newDst[ 2] = c * m02 + s * m12;\n\n newDst[ 4] = c * m10 - s * m00;\n newDst[ 5] = c * m11 - s * m01;\n newDst[ 6] = c * m12 - s * m02;\n\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * 2 entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of 2 entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale(m: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales uniformly in each dimension\n * @param s - Amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given.\n * @param m - The matrix to be modified.\n * @param s - Amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale(m: Mat3Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\nreturn {\n clone,\n create,\n set,\n fromMat4,\n fromQuat,\n negate,\n copy,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n invert,\n determinant,\n mul,\n multiply,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n get3DScaling,\n translation,\n translate,\n rotation,\n rotate,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Mat3Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","import { Mat4Arg, Mat4Type } from './mat4';\nimport { Mat3Arg } from './mat3';\nimport { QuatArg } from './quat';\nimport { Vec3Arg } from './vec3';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\nimport * as utils from './utils';\n\nexport { Mat4Arg, Mat4Type };\n\ntype Mat4Ctor = new (n: number) => T;\n\n/**\n * Generates a typed API for Mat4\n * */\nfunction getAPIImpl(Ctor: Mat4Ctor) {\n const vec3 = getVec3API(Ctor);\n\n/**\n * 4x4 Matrix math math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new matrix. In other words you can do this\n *\n * const mat = mat4.translation([1, 2, 3]); // Creates a new translation matrix\n *\n * or\n *\n * const mat = mat4.create();\n * mat4.translation([1, 2, 3], mat); // Puts translation matrix in mat.\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always save to pass any matrix as the destination. So for example\n *\n * const mat = mat4.identity();\n * const trans = mat4.translation([1, 2, 3]);\n * mat4.multiply(mat, trans, mat); // Multiplies mat * trans and puts result in mat.\n *\n */\n\n\n/**\n * Create a Mat4 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat4's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat4.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @returns created from values.\n */\nfunction create(\n v0?: number, v1?: number, v2?: number, v3?: number,\n v4?: number, v5?: number, v6?: number, v7?: number,\n v8?: number, v9?: number, v10?: number, v11?: number,\n v12?: number, v13?: number, v14?: number, v15?: number) {\n const newDst = new Ctor(16);\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[3] = v3;\n if (v4 !== undefined) {\n newDst[4] = v4;\n if (v5 !== undefined) {\n newDst[5] = v5;\n if (v6 !== undefined) {\n newDst[6] = v6;\n if (v7 !== undefined) {\n newDst[7] = v7;\n if (v8 !== undefined) {\n newDst[8] = v8;\n if (v9 !== undefined) {\n newDst[9] = v9;\n if (v10 !== undefined) {\n newDst[10] = v10;\n if (v11 !== undefined) {\n newDst[11] = v11;\n if (v12 !== undefined) {\n newDst[12] = v12;\n if (v13 !== undefined) {\n newDst[13] = v13;\n if (v14 !== undefined) {\n newDst[14] = v14;\n if (v15 !== undefined) {\n newDst[15] = v15;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Sets the values of a Mat4\n * Also see {@link mat4.create} and {@link mat4.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 created from values.\n */\nfunction set(\n v0: number, v1: number, v2: number, v3: number,\n v4: number, v5: number, v6: number, v7: number,\n v8: number, v9: number, v10: number, v11: number,\n v12: number, v13: number, v14: number, v15: number,\n dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = v0; newDst[ 1] = v1; newDst[ 2] = v2; newDst[ 3] = v3;\n newDst[ 4] = v4; newDst[ 5] = v5; newDst[ 6] = v6; newDst[ 7] = v7;\n newDst[ 8] = v8; newDst[ 9] = v9; newDst[10] = v10; newDst[11] = v11;\n newDst[12] = v12; newDst[13] = v13; newDst[14] = v14; newDst[15] = v15;\n\n return newDst;\n}\n\n/**\n * Creates a Mat4 from a Mat3\n * @param m3 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from m3\n */\nfunction fromMat3(m3: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = m3[0]; newDst[ 1] = m3[1]; newDst[ 2] = m3[ 2]; newDst[ 3] = 0;\n newDst[ 4] = m3[4]; newDst[ 5] = m3[5]; newDst[ 6] = m3[ 6]; newDst[ 7] = 0;\n newDst[ 8] = m3[8]; newDst[ 9] = m3[9]; newDst[10] = m3[10]; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a Mat4 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from q\n */\nfunction fromQuat(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3];\n const x2 = x + x; const y2 = y + y; const z2 = z + z;\n\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n newDst[ 0] = 1 - yy - zz; newDst[ 1] = yx + wz; newDst[ 2] = zx - wy; newDst[ 3] = 0;\n newDst[ 4] = yx - wz; newDst[ 5] = 1 - xx - zz; newDst[ 6] = zy + wx; newDst[ 7] = 0;\n newDst[ 8] = zx + wy; newDst[ 9] = zy - wx; newDst[10] = 1 - xx - yy; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\nfunction negate(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = -m[ 0]; newDst[ 1] = -m[ 1]; newDst[ 2] = -m[ 2]; newDst[ 3] = -m[ 3];\n newDst[ 4] = -m[ 4]; newDst[ 5] = -m[ 5]; newDst[ 6] = -m[ 6]; newDst[ 7] = -m[ 7];\n newDst[ 8] = -m[ 8]; newDst[ 9] = -m[ 9]; newDst[10] = -m[10]; newDst[11] = -m[11];\n newDst[12] = -m[12]; newDst[13] = -m[13]; newDst[14] = -m[14]; newDst[15] = -m[15];\n\n return newDst;\n}\n\n/**\n * Copies a matrix. (same as {@link mat4.clone})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nfunction copy(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = m[ 0]; newDst[ 1] = m[ 1]; newDst[ 2] = m[ 2]; newDst[ 3] = m[ 3];\n newDst[ 4] = m[ 4]; newDst[ 5] = m[ 5]; newDst[ 6] = m[ 6]; newDst[ 7] = m[ 7];\n newDst[ 8] = m[ 8]; newDst[ 9] = m[ 9]; newDst[10] = m[10]; newDst[11] = m[11];\n newDst[12] = m[12]; newDst[13] = m[13]; newDst[14] = m[14]; newDst[15] = m[15];\n\n return newDst;\n}\n\n/**\n * Copies a matrix (same as {@link mat4.copy})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nconst clone = copy;\n\n/**\n * Check if 2 matrices are approximately equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are approximately equal\n */\nfunction equalsApproximately(a: Mat4Arg, b: Mat4Arg): boolean {\n return Math.abs(a[ 0] - b[ 0]) < utils.EPSILON &&\n Math.abs(a[ 1] - b[ 1]) < utils.EPSILON &&\n Math.abs(a[ 2] - b[ 2]) < utils.EPSILON &&\n Math.abs(a[ 3] - b[ 3]) < utils.EPSILON &&\n Math.abs(a[ 4] - b[ 4]) < utils.EPSILON &&\n Math.abs(a[ 5] - b[ 5]) < utils.EPSILON &&\n Math.abs(a[ 6] - b[ 6]) < utils.EPSILON &&\n Math.abs(a[ 7] - b[ 7]) < utils.EPSILON &&\n Math.abs(a[ 8] - b[ 8]) < utils.EPSILON &&\n Math.abs(a[ 9] - b[ 9]) < utils.EPSILON &&\n Math.abs(a[10] - b[10]) < utils.EPSILON &&\n Math.abs(a[11] - b[11]) < utils.EPSILON &&\n Math.abs(a[12] - b[12]) < utils.EPSILON &&\n Math.abs(a[13] - b[13]) < utils.EPSILON &&\n Math.abs(a[14] - b[14]) < utils.EPSILON &&\n Math.abs(a[15] - b[15]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 matrices are exactly equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are exactly equal\n */\nfunction equals(a: Mat4Arg, b: Mat4Arg): boolean {\n return a[ 0] === b[ 0] &&\n a[ 1] === b[ 1] &&\n a[ 2] === b[ 2] &&\n a[ 3] === b[ 3] &&\n a[ 4] === b[ 4] &&\n a[ 5] === b[ 5] &&\n a[ 6] === b[ 6] &&\n a[ 7] === b[ 7] &&\n a[ 8] === b[ 8] &&\n a[ 9] === b[ 9] &&\n a[10] === b[10] &&\n a[11] === b[11] &&\n a[12] === b[12] &&\n a[13] === b[13] &&\n a[14] === b[14] &&\n a[15] === b[15];\n}\n\n/**\n * Creates a 4-by-4 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 4-by-4 identity matrix.\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\nfunction transpose(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n if (newDst === m) {\n let t;\n\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n\n t = m[3];\n m[3] = m[12];\n m[12] = t;\n\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n\n t = m[7];\n m[7] = m[13];\n m[13] = t;\n\n t = m[11];\n m[11] = m[14];\n m[14] = t;\n return newDst;\n }\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n newDst[ 0] = m00; newDst[ 1] = m10; newDst[ 2] = m20; newDst[ 3] = m30;\n newDst[ 4] = m01; newDst[ 5] = m11; newDst[ 6] = m21; newDst[ 7] = m31;\n newDst[ 8] = m02; newDst[ 9] = m12; newDst[10] = m22; newDst[11] = m32;\n newDst[12] = m03; newDst[13] = m13; newDst[14] = m23; newDst[15] = m33;\n\n return newDst;\n}\n\n/**\n * Computes the inverse of a 4-by-4 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nfunction inverse(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n const tmp12 = m20 * m31;\n const tmp13 = m30 * m21;\n const tmp14 = m10 * m31;\n const tmp15 = m30 * m11;\n const tmp16 = m10 * m21;\n const tmp17 = m20 * m11;\n const tmp18 = m00 * m31;\n const tmp19 = m30 * m01;\n const tmp20 = m00 * m21;\n const tmp21 = m20 * m01;\n const tmp22 = m00 * m11;\n const tmp23 = m10 * m01;\n\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n\n const d = 1 / (m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3);\n\n newDst[ 0] = d * t0;\n newDst[ 1] = d * t1;\n newDst[ 2] = d * t2;\n newDst[ 3] = d * t3;\n newDst[ 4] = d * ((tmp1 * m10 + tmp2 * m20 + tmp5 * m30) -\n (tmp0 * m10 + tmp3 * m20 + tmp4 * m30));\n newDst[ 5] = d * ((tmp0 * m00 + tmp7 * m20 + tmp8 * m30) -\n (tmp1 * m00 + tmp6 * m20 + tmp9 * m30));\n newDst[ 6] = d * ((tmp3 * m00 + tmp6 * m10 + tmp11 * m30) -\n (tmp2 * m00 + tmp7 * m10 + tmp10 * m30));\n newDst[ 7] = d * ((tmp4 * m00 + tmp9 * m10 + tmp10 * m20) -\n (tmp5 * m00 + tmp8 * m10 + tmp11 * m20));\n newDst[ 8] = d * ((tmp12 * m13 + tmp15 * m23 + tmp16 * m33) -\n (tmp13 * m13 + tmp14 * m23 + tmp17 * m33));\n newDst[ 9] = d * ((tmp13 * m03 + tmp18 * m23 + tmp21 * m33) -\n (tmp12 * m03 + tmp19 * m23 + tmp20 * m33));\n newDst[10] = d * ((tmp14 * m03 + tmp19 * m13 + tmp22 * m33) -\n (tmp15 * m03 + tmp18 * m13 + tmp23 * m33));\n newDst[11] = d * ((tmp17 * m03 + tmp20 * m13 + tmp23 * m23) -\n (tmp16 * m03 + tmp21 * m13 + tmp22 * m23));\n newDst[12] = d * ((tmp14 * m22 + tmp17 * m32 + tmp13 * m12) -\n (tmp16 * m32 + tmp12 * m12 + tmp15 * m22));\n newDst[13] = d * ((tmp20 * m32 + tmp12 * m02 + tmp19 * m22) -\n (tmp18 * m22 + tmp21 * m32 + tmp13 * m02));\n newDst[14] = d * ((tmp18 * m12 + tmp23 * m32 + tmp15 * m02) -\n (tmp22 * m32 + tmp14 * m02 + tmp19 * m12));\n newDst[15] = d * ((tmp22 * m22 + tmp16 * m02 + tmp21 * m12) -\n (tmp20 * m12 + tmp23 * m22 + tmp17 * m02));\n\n return newDst;\n}\n\n/**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\nfunction determinant(m: Mat4Arg): number {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n\n return m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3;\n}\n\n/**\n * Computes the inverse of a 4-by-4 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nconst invert = inverse;\n\n/**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nfunction multiply(a: Mat4Arg, b: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[ 4 + 0];\n const a11 = a[ 4 + 1];\n const a12 = a[ 4 + 2];\n const a13 = a[ 4 + 3];\n const a20 = a[ 8 + 0];\n const a21 = a[ 8 + 1];\n const a22 = a[ 8 + 2];\n const a23 = a[ 8 + 3];\n const a30 = a[12 + 0];\n const a31 = a[12 + 1];\n const a32 = a[12 + 2];\n const a33 = a[12 + 3];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b03 = b[3];\n const b10 = b[ 4 + 0];\n const b11 = b[ 4 + 1];\n const b12 = b[ 4 + 2];\n const b13 = b[ 4 + 3];\n const b20 = b[ 8 + 0];\n const b21 = b[ 8 + 1];\n const b22 = b[ 8 + 2];\n const b23 = b[ 8 + 3];\n const b30 = b[12 + 0];\n const b31 = b[12 + 1];\n const b32 = b[12 + 2];\n const b33 = b[12 + 3];\n\n newDst[ 0] = a00 * b00 + a10 * b01 + a20 * b02 + a30 * b03;\n newDst[ 1] = a01 * b00 + a11 * b01 + a21 * b02 + a31 * b03;\n newDst[ 2] = a02 * b00 + a12 * b01 + a22 * b02 + a32 * b03;\n newDst[ 3] = a03 * b00 + a13 * b01 + a23 * b02 + a33 * b03;\n newDst[ 4] = a00 * b10 + a10 * b11 + a20 * b12 + a30 * b13;\n newDst[ 5] = a01 * b10 + a11 * b11 + a21 * b12 + a31 * b13;\n newDst[ 6] = a02 * b10 + a12 * b11 + a22 * b12 + a32 * b13;\n newDst[ 7] = a03 * b10 + a13 * b11 + a23 * b12 + a33 * b13;\n newDst[ 8] = a00 * b20 + a10 * b21 + a20 * b22 + a30 * b23;\n newDst[ 9] = a01 * b20 + a11 * b21 + a21 * b22 + a31 * b23;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22 + a32 * b23;\n newDst[11] = a03 * b20 + a13 * b21 + a23 * b22 + a33 * b23;\n newDst[12] = a00 * b30 + a10 * b31 + a20 * b32 + a30 * b33;\n newDst[13] = a01 * b30 + a11 * b31 + a21 * b32 + a31 * b33;\n newDst[14] = a02 * b30 + a12 * b31 + a22 * b32 + a32 * b33;\n newDst[15] = a03 * b30 + a13 * b31 + a23 * b32 + a33 * b33;\n\n return newDst;\n}\n\n/**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nconst mul = multiply;\n\n/**\n * Sets the translation component of a 4-by-4 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\nfunction setTranslation(a: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? identity()) as T;\n if (a !== newDst) {\n newDst[ 0] = a[ 0];\n newDst[ 1] = a[ 1];\n newDst[ 2] = a[ 2];\n newDst[ 3] = a[ 3];\n newDst[ 4] = a[ 4];\n newDst[ 5] = a[ 5];\n newDst[ 6] = a[ 6];\n newDst[ 7] = a[ 7];\n newDst[ 8] = a[ 8];\n newDst[ 9] = a[ 9];\n newDst[10] = a[10];\n newDst[11] = a[11];\n }\n newDst[12] = v[0];\n newDst[13] = v[1];\n newDst[14] = v[2];\n newDst[15] = 1;\n return newDst;\n}\n\n///**\n// * Returns the translation component of a 4-by-4 matrix as a vector with 3\n// * entries.\n// * @param m - The matrix.\n// * @param dst - vector to hold result. If not passed a new one is created.\n// * @returns The translation component of m.\n// */\nfunction getTranslation(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? vec3.create()) as T;\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n}\n\n/**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat4Arg, axis: number, dst?: T) {\n const newDst = (dst ?? vec3.create());\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n}\n\n/**\n * Sets an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\nfunction setAxis(m: Mat4Arg, v: Vec3Arg, axis: number, dst: T) {\n const newDst = (dst === m) ? dst : copy(m, dst);\n\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n newDst[off + 2] = v[2];\n return newDst;\n}\n\n/**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? vec3.create()) as T;\n\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 0 to 1 in the z dimension.\n *\n * Note: If you pass `Infinity` for zFar then it will produce a projection matrix\n * returns -Infinity for Z when transforming coordinates with Z <= 0 and +Infinity for Z\n * otherwise.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */\nfunction perspective(fieldOfViewYInRadians: number, aspect: number, zNear: number, zFar: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const f = Math.tan(Math.PI * 0.5 - 0.5 * fieldOfViewYInRadians);\n\n newDst[0] = f / aspect;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n newDst[4] = 0;\n newDst[5] = f;\n newDst[6] = 0;\n newDst[7] = 0;\n\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[11] = -1;\n\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (Number.isFinite(zFar)) {\n const rangeInv = 1 / (zNear - zFar);\n newDst[10] = zFar * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n } else {\n newDst[10] = -1;\n newDst[14] = -zNear;\n }\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 1 (at -zNear) to 0 (at -zFar) in the z dimension.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane. (default = Infinity)\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */function perspectiveReverseZ(fieldOfViewYInRadians: number, aspect: number, zNear: number, zFar = Infinity, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const f = 1 / Math.tan(fieldOfViewYInRadians * 0.5);\n\n newDst[ 0] = f / aspect;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n\n newDst[ 4] = 0;\n newDst[ 5] = f;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n\n newDst[ 8] = 0;\n newDst[ 9] = 0;\n newDst[11] = -1;\n\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (zFar === Infinity) {\n newDst[10] = 0;\n newDst[14] = zNear;\n } else {\n const rangeInv = 1 / (zFar - zNear);\n newDst[10] = zNear * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n }\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 orthogonal transformation matrix that transforms from\n * the given the left, right, bottom, and top dimensions to -1 +1 in x, and y\n * and 0 to +1 in z.\n * @param left - Left side of the near clipping plane viewport.\n * @param right - Right side of the near clipping plane viewport.\n * @param bottom - Bottom of the near clipping plane viewport.\n * @param top - Top of the near clipping plane viewport.\n * @param near - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param far - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The orthographic projection matrix.\n */\nfunction ortho(left: number, right: number, bottom: number, top: number, near: number, far: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[0] = 2 / (right - left);\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n newDst[4] = 0;\n newDst[5] = 2 / (top - bottom);\n newDst[6] = 0;\n newDst[7] = 0;\n\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[10] = 1 / (near - far);\n newDst[11] = 0;\n\n newDst[12] = (right + left) / (left - right);\n newDst[13] = (top + bottom) / (bottom - top);\n newDst[14] = near / (near - far);\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 0 to 1 in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\nfunction frustum(left: number, right: number, bottom: number, top: number, near: number, far: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const dx = (right - left);\n const dy = (top - bottom);\n const dz = (near - far);\n\n newDst[ 0] = 2 * near / dx;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n newDst[ 4] = 0;\n newDst[ 5] = 2 * near / dy;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n newDst[ 8] = (left + right) / dx;\n newDst[ 9] = (top + bottom) / dy;\n newDst[10] = far / dz;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = near * far / dz;\n newDst[15] = 0;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 1 (-near) to 0 (-far) in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\nfunction frustumReverseZ(left: number, right: number, bottom: number, top: number, near: number, far = Infinity, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const dx = (right - left);\n const dy = (top - bottom);\n\n newDst[ 0] = 2 * near / dx;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n newDst[ 4] = 0;\n newDst[ 5] = 2 * near / dy;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n newDst[ 8] = (left + right) / dx;\n newDst[ 9] = (top + bottom) / dy;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (far === Infinity) {\n newDst[10] = 0;\n newDst[14] = near;\n } else {\n const rangeInv = 1 / (far - near);\n newDst[10] = near * rangeInv;\n newDst[14] = far * near * rangeInv;\n }\n\n return newDst;\n}\n\nconst xAxis = vec3.create();\nconst yAxis = vec3.create();\nconst zAxis = vec3.create();\n\n/**\n * Computes a 4-by-4 aim transformation.\n *\n * This is a matrix which positions an object aiming down positive Z.\n * toward the target.\n *\n * Note: this is **NOT** the inverse of lookAt as lookAt looks at negative Z.\n *\n * @param position - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\nfunction aim(position: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(target, position, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = xAxis[1]; newDst[ 2] = xAxis[2]; newDst[ 3] = 0;\n newDst[ 4] = yAxis[0]; newDst[ 5] = yAxis[1]; newDst[ 6] = yAxis[2]; newDst[ 7] = 0;\n newDst[ 8] = zAxis[0]; newDst[ 9] = zAxis[1]; newDst[10] = zAxis[2]; newDst[11] = 0;\n newDst[12] = position[0]; newDst[13] = position[1]; newDst[14] = position[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 camera aim transformation.\n *\n * This is a matrix which positions an object aiming down negative Z.\n * toward the target.\n *\n * Note: this is the inverse of `lookAt`\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\nfunction cameraAim(eye: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = xAxis[1]; newDst[ 2] = xAxis[2]; newDst[ 3] = 0;\n newDst[ 4] = yAxis[0]; newDst[ 5] = yAxis[1]; newDst[ 6] = yAxis[2]; newDst[ 7] = 0;\n newDst[ 8] = zAxis[0]; newDst[ 9] = zAxis[1]; newDst[10] = zAxis[2]; newDst[11] = 0;\n newDst[12] = eye[0]; newDst[13] = eye[1]; newDst[14] = eye[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 view transformation.\n *\n * This is a view matrix which transforms all other objects\n * to be in the space of the view defined by the parameters.\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The look-at matrix.\n */\nfunction lookAt(eye: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = yAxis[0]; newDst[ 2] = zAxis[0]; newDst[ 3] = 0;\n newDst[ 4] = xAxis[1]; newDst[ 5] = yAxis[1]; newDst[ 6] = zAxis[1]; newDst[ 7] = 0;\n newDst[ 8] = xAxis[2]; newDst[ 9] = yAxis[2]; newDst[10] = zAxis[2]; newDst[11] = 0;\n\n newDst[12] = -(xAxis[0] * eye[0] + xAxis[1] * eye[1] + xAxis[2] * eye[2]);\n newDst[13] = -(yAxis[0] * eye[0] + yAxis[1] * eye[1] + yAxis[2] * eye[2]);\n newDst[14] = -(zAxis[0] * eye[0] + zAxis[1] * eye[1] + zAxis[2] * eye[2]);\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which translates by the given vector v.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\nfunction translation(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = v[0]; newDst[13] = v[1]; newDst[14] = v[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Translates the given 4-by-4 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\nfunction translate(m: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n if (m !== newDst) {\n newDst[ 0] = m00;\n newDst[ 1] = m01;\n newDst[ 2] = m02;\n newDst[ 3] = m03;\n newDst[ 4] = m10;\n newDst[ 5] = m11;\n newDst[ 6] = m12;\n newDst[ 7] = m13;\n newDst[ 8] = m20;\n newDst[ 9] = m21;\n newDst[10] = m22;\n newDst[11] = m23;\n }\n\n newDst[12] = m00 * v0 + m10 * v1 + m20 * v2 + m30;\n newDst[13] = m01 * v0 + m11 * v1 + m21 * v2 + m31;\n newDst[14] = m02 * v0 + m12 * v1 + m22 * v2 + m32;\n newDst[15] = m03 * v0 + m13 * v1 + m23 * v2 + m33;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the x-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationX(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = c; newDst[ 6] = s; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = -s; newDst[10] = c; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the x-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateX(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[4] = c * m10 + s * m20;\n newDst[5] = c * m11 + s * m21;\n newDst[6] = c * m12 + s * m22;\n newDst[7] = c * m13 + s * m23;\n newDst[8] = c * m20 - s * m10;\n newDst[9] = c * m21 - s * m11;\n newDst[10] = c * m22 - s * m12;\n newDst[11] = c * m23 - s * m13;\n\n if (m !== newDst) {\n newDst[ 0] = m[ 0];\n newDst[ 1] = m[ 1];\n newDst[ 2] = m[ 2];\n newDst[ 3] = m[ 3];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the y-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationY(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = 0; newDst[ 2] = -s; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = s; newDst[ 9] = 0; newDst[10] = c; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the y-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateY(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 - s * m20;\n newDst[ 1] = c * m01 - s * m21;\n newDst[ 2] = c * m02 - s * m22;\n newDst[ 3] = c * m03 - s * m23;\n newDst[ 8] = c * m20 + s * m00;\n newDst[ 9] = c * m21 + s * m01;\n newDst[10] = c * m22 + s * m02;\n newDst[11] = c * m23 + s * m03;\n\n if (m !== newDst) {\n newDst[ 4] = m[ 4];\n newDst[ 5] = m[ 5];\n newDst[ 6] = m[ 6];\n newDst[ 7] = m[ 7];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the z-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationZ(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = s; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = -s; newDst[ 5] = c; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the z-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateZ(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 + s * m10;\n newDst[ 1] = c * m01 + s * m11;\n newDst[ 2] = c * m02 + s * m12;\n newDst[ 3] = c * m03 + s * m13;\n newDst[ 4] = c * m10 - s * m00;\n newDst[ 5] = c * m11 - s * m01;\n newDst[ 6] = c * m12 - s * m02;\n newDst[ 7] = c * m13 - s * m03;\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n newDst[11] = m[11];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\nfunction axisRotation(axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n\n newDst[ 0] = xx + (1 - xx) * c;\n newDst[ 1] = x * y * oneMinusCosine + z * s;\n newDst[ 2] = x * z * oneMinusCosine - y * s;\n newDst[ 3] = 0;\n newDst[ 4] = x * y * oneMinusCosine - z * s;\n newDst[ 5] = yy + (1 - yy) * c;\n newDst[ 6] = y * z * oneMinusCosine + x * s;\n newDst[ 7] = 0;\n newDst[ 8] = x * z * oneMinusCosine + y * s;\n newDst[ 9] = y * z * oneMinusCosine - x * s;\n newDst[10] = zz + (1 - zz) * c;\n newDst[11] = 0;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = 0;\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle. (same as axisRotation)\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\nconst rotation = axisRotation;\n\n/**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle.\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction axisRotate(m: Mat4Arg, axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n\n const r00 = xx + (1 - xx) * c;\n const r01 = x * y * oneMinusCosine + z * s;\n const r02 = x * z * oneMinusCosine - y * s;\n const r10 = x * y * oneMinusCosine - z * s;\n const r11 = yy + (1 - yy) * c;\n const r12 = y * z * oneMinusCosine + x * s;\n const r20 = x * z * oneMinusCosine + y * s;\n const r21 = y * z * oneMinusCosine - x * s;\n const r22 = zz + (1 - zz) * c;\n\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n\n newDst[ 0] = r00 * m00 + r01 * m10 + r02 * m20;\n newDst[ 1] = r00 * m01 + r01 * m11 + r02 * m21;\n newDst[ 2] = r00 * m02 + r01 * m12 + r02 * m22;\n newDst[ 3] = r00 * m03 + r01 * m13 + r02 * m23;\n newDst[ 4] = r10 * m00 + r11 * m10 + r12 * m20;\n newDst[ 5] = r10 * m01 + r11 * m11 + r12 * m21;\n newDst[ 6] = r10 * m02 + r11 * m12 + r12 * m22;\n newDst[ 7] = r10 * m03 + r11 * m13 + r12 * m23;\n newDst[ 8] = r20 * m00 + r21 * m10 + r22 * m20;\n newDst[ 9] = r20 * m01 + r21 * m11 + r22 * m21;\n newDst[10] = r20 * m02 + r21 * m12 + r22 * m22;\n newDst[11] = r20 * m03 + r21 * m13 + r22 * m23;\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle. (same as rotate)\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nconst rotate = axisRotate;\n\n/**\n * Creates a 4-by-4 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * three entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = v[2]; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 4-by-4 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of three entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale(m: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n newDst[ 3] = v0 * m[0 * 4 + 3];\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n newDst[ 7] = v1 * m[1 * 4 + 3];\n newDst[ 8] = v2 * m[2 * 4 + 0];\n newDst[ 9] = v2 * m[2 * 4 + 1];\n newDst[10] = v2 * m[2 * 4 + 2];\n newDst[11] = v2 * m[2 * 4 + 3];\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which scales a uniform amount in each dimension.\n * @param s - the amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = s; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 4-by-4 matrix in each dimension by a uniform scale.\n * @param m - The matrix to be modified.\n * @param s - The amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale(m: Mat4Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n newDst[ 3] = s * m[0 * 4 + 3];\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n newDst[ 7] = s * m[1 * 4 + 3];\n newDst[ 8] = s * m[2 * 4 + 0];\n newDst[ 9] = s * m[2 * 4 + 1];\n newDst[10] = s * m[2 * 4 + 2];\n newDst[11] = s * m[2 * 4 + 3];\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\nreturn {\n create,\n set,\n fromMat3,\n fromQuat,\n negate,\n copy,\n clone,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n determinant,\n invert,\n multiply,\n mul,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n perspective,\n perspectiveReverseZ,\n ortho,\n frustum,\n frustumReverseZ,\n aim,\n cameraAim,\n lookAt,\n translation,\n translate,\n rotationX,\n rotateX,\n rotationY,\n rotateY,\n rotationZ,\n rotateZ,\n axisRotation,\n rotation,\n axisRotate,\n rotate,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n};\n\n}\n\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Mat4Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { QuatArg, QuatType } from './quat';\nimport { Mat3Arg } from './mat3.js';\nimport { Mat4Arg } from './mat4.js';\nimport { Vec3Arg } from './vec3.js';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\n\nexport { QuatArg, QuatType };\n\ntype QuatCtor = new (n: number) => T;\n\nexport type RotationOrder = 'xyz' | 'xzy' | 'yxz' | 'yzx' | 'zxy' | 'zyx';\n\n/**\n * Generates am typed API for Qud\n * */\nfunction getAPIImpl(Ctor: QuatCtor) {\n const vec3 = getVec3API(Ctor);\n\n/**\n * Creates a quat4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number, w?: number) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a Quat; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Quat\n * Also see {@link quat.create} and {@link quat.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, w: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n\n return newDst;\n}\n\n/**\n * Sets a quaternion from the given angle and axis,\n * then returns it.\n *\n * @param axis - the axis to rotate around\n * @param angleInRadians - the angle\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The quaternion that represents the given axis and angle\n **/\nfunction fromAxisAngle(axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n const s = Math.sin(halfAngle);\n\n newDst[0] = s * axis[0];\n newDst[1] = s * axis[1];\n newDst[2] = s * axis[2];\n newDst[3] = Math.cos(halfAngle);\n\n return newDst;\n}\n\n/**\n * Gets the rotation axis and angle\n * @param q - quaternion to compute from\n * @param dst - Vec3 to hold result. If not passed in a new one is created.\n * @return angle and axis\n */\nfunction toAxisAngle(q: QuatArg, dst?: T): { angle: number, axis: T } {\n const newDst = (dst ?? vec3.create(3)) as T;\n\n const angle = Math.acos(q[3]) * 2;\n const s = Math.sin(angle * 0.5);\n if (s > utils.EPSILON) {\n newDst[0] = q[0] / s;\n newDst[1] = q[1] / s;\n newDst[2] = q[2] / s;\n } else {\n newDst[0] = 1;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n\n return { angle, axis: newDst };\n}\n\n/**\n * Returns the angle in degrees between two rotations a and b.\n * @param a - quaternion a\n * @param b - quaternion b\n * @return angle in radians between the two quaternions\n */\nfunction angle(a: QuatArg, b: QuatArg) {\n const d = dot(a, b);\n return Math.acos(2 * d * d - 1);\n}\n\n/**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction multiply(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const bw = b[3];\n\n newDst[0] = ax * bw + aw * bx + ay * bz - az * by;\n newDst[1] = ay * bw + aw * by + az * bx - ax * bz;\n newDst[2] = az * bw + aw * bz + ax * by - ay * bx;\n newDst[3] = aw * bw - ax * bx - ay * by - az * bz;\n\n return newDst;\n}\n\n/**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nconst mul = multiply;\n\n/**\n * Rotates the given quaternion around the X axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateX(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const bx = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw + qw * bx;\n newDst[1] = qy * bw + qz * bx;\n newDst[2] = qz * bw - qy * bx;\n newDst[3] = qw * bw - qx * bx;\n\n return newDst;\n}\n\n/**\n * Rotates the given quaternion around the Y axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateY(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const by = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw - qz * by;\n newDst[1] = qy * bw + qw * by;\n newDst[2] = qz * bw + qx * by;\n newDst[3] = qw * bw - qy * by;\n\n return newDst;\n}\n\n/**\n * Rotates the given quaternion around the Z axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateZ(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const bz = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw + qy * bz;\n newDst[1] = qy * bw - qx * bz;\n newDst[2] = qz * bw + qw * bz;\n newDst[3] = qw * bw - qz * bz;\n\n return newDst;\n}\n\n/**\n * Spherically linear interpolate between two quaternions\n *\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction slerp(a: QuatArg, b: QuatArg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n\n let bx = b[0];\n let by = b[1];\n let bz = b[2];\n let bw = b[3];\n\n let cosOmega = ax * bx + ay * by + az * bz + aw * bw;\n\n if (cosOmega < 0) {\n cosOmega = -cosOmega;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n\n let scale0;\n let scale1;\n\n if (1.0 - cosOmega > utils.EPSILON) {\n const omega = Math.acos(cosOmega);\n const sinOmega = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinOmega;\n scale1 = Math.sin(t * omega) / sinOmega;\n } else {\n scale0 = 1.0 - t;\n scale1 = t;\n }\n\n newDst[0] = scale0 * ax + scale1 * bx;\n newDst[1] = scale0 * ay + scale1 * by;\n newDst[2] = scale0 * az + scale1 * bz;\n newDst[3] = scale0 * aw + scale1 * bw;\n\n return newDst;\n}\n\n/**\n * Compute the inverse of a quaternion\n *\n * @param q - quaternion to compute the inverse of\n * @returns A quaternion that is the result of a * b\n */\nfunction inverse(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const a0 = q[0];\n const a1 = q[1];\n const a2 = q[2];\n const a3 = q[3];\n\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n\n newDst[0] = -a0 * invDot;\n newDst[1] = -a1 * invDot;\n newDst[2] = -a2 * invDot;\n newDst[3] = a3 * invDot;\n\n return newDst;\n}\n\n/**\n * Compute the conjugate of a quaternion\n * For quaternions with a magnitude of 1 (a unit quaternion)\n * this returns the same as the inverse but is faster to calculate.\n *\n * @param q - quaternion to compute the conjugate of.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The conjugate of q\n */\nfunction conjugate(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = -q[0];\n newDst[1] = -q[1];\n newDst[2] = -q[2];\n newDst[3] = q[3];\n\n return newDst;\n}\n\n/**\n * Creates a quaternion from the given rotation matrix.\n *\n * The created quaternion is not normalized.\n *\n * @param m - rotation matrix\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\nfunction fromMat(m: Mat3Arg | Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n /*\n 0 1 2\n 3 4 5\n 6 7 8\n\n 0 1 2\n 4 5 6\n 8 9 10\n */\n\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n const trace = m[0] + m[5] + m[10];\n\n if (trace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n const root = Math.sqrt(trace + 1); // 2w\n newDst[3] = 0.5 * root;\n const invRoot = 0.5 / root; // 1/(4w)\n\n newDst[0] = (m[6] - m[9]) * invRoot;\n newDst[1] = (m[8] - m[2]) * invRoot;\n newDst[2] = (m[1] - m[4]) * invRoot;\n } else {\n // |w| <= 1/2\n let i = 0;\n\n if (m[5] > m[0]) {\n i = 1;\n }\n if (m[10] > m[i * 4 + i]) {\n i = 2;\n }\n\n const j = (i + 1) % 3;\n const k = (i + 2) % 3;\n\n const root = Math.sqrt(m[i * 4 + i] - m[j * 4 + j] - m[k * 4 + k] + 1.0);\n newDst[i] = 0.5 * root;\n\n const invRoot = 0.5 / root;\n\n newDst[3] = (m[j * 4 + k] - m[k * 4 + j]) * invRoot;\n newDst[j] = (m[j * 4 + i] + m[i * 4 + j]) * invRoot;\n newDst[k] = (m[k * 4 + i] + m[i * 4 + k]) * invRoot;\n }\n\n return newDst;\n}\n\n/**\n * Creates a quaternion from the given euler angle x, y, z using the provided intrinsic order for the conversion.\n *\n * @param xAngleInRadians - angle to rotate around X axis in radians.\n * @param yAngleInRadians - angle to rotate around Y axis in radians.\n * @param zAngleInRadians - angle to rotate around Z axis in radians.\n * @param order - order to apply euler angles\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion representing the same rotation as the euler angles applied in the given order\n */\nfunction fromEuler(\n xAngleInRadians: number,\n yAngleInRadians: number,\n zAngleInRadians: number,\n order: RotationOrder,\n dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const xHalfAngle = xAngleInRadians * 0.5;\n const yHalfAngle = yAngleInRadians * 0.5;\n const zHalfAngle = zAngleInRadians * 0.5;\n\n const sx = Math.sin(xHalfAngle);\n const cx = Math.cos(xHalfAngle);\n const sy = Math.sin(yHalfAngle);\n const cy = Math.cos(yHalfAngle);\n const sz = Math.sin(zHalfAngle);\n const cz = Math.cos(zHalfAngle);\n\n switch (order) {\n case 'xyz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'xzy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n case 'yxz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n case 'yzx':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'zxy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'zyx':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n default:\n throw new Error(`Unknown rotation order: ${order}`);\n }\n\n return newDst;\n}\n\n/**\n * Copies a quaternion. (same as {@link quat.clone})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is a copy of q\n */\nfunction copy(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = q[0];\n newDst[1] = q[1];\n newDst[2] = q[2];\n newDst[3] = q[3];\n\n return newDst;\n}\n\n/**\n * Clones a quaternion. (same as {@link quat.copy})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A copy of q.\n */\nconst clone = copy;\n\n/**\n * Adds two quaternions; assumes a and b have the same dimension.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the sum of a and b.\n */\nfunction add(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\nfunction subtract(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Multiplies a quaternion by a scalar.\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nfunction mulScalar(v: QuatArg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a quaternion by a scalar. (same as mulScalar)\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nfunction divScalar(v: QuatArg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two quaternions\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns dot product\n */\nfunction dot(a: QuatArg, b: QuatArg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n}\n\n/**\n * Performs linear interpolation on two quaternions.\n * Given quaternions a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param t - Interpolation coefficient.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: QuatArg, b: QuatArg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Computes the length of quaternion\n * @param v - quaternion.\n * @returns length of quaternion.\n */\nfunction length(v: QuatArg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n}\n\n/**\n * Computes the length of quaternion (same as length)\n * @param v - quaternion.\n * @returns length of quaternion.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of quaternion\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\nfunction lengthSq(v: QuatArg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n}\n\n/**\n * Computes the square of the length of quaternion (same as lengthSq)\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\nconst lenSq = lengthSq;\n\n/**\n * Divides a quaternion by its Euclidean length and returns the quotient.\n * @param v - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The normalized quaternion.\n */\nfunction normalize(v: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n }\n\n return newDst;\n}\n\n/**\n * Check if 2 quaternions are approximately equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are approximately equal\n */\nfunction equalsApproximately(a: QuatArg, b: QuatArg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON &&\n Math.abs(a[3] - b[3]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 quaternions are exactly equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are exactly equal\n */\nfunction equals(a: QuatArg, b: QuatArg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Creates an identity quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns an identity quaternion\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n\n return newDst;\n}\n\nconst tempVec3 = vec3.create();\nconst xUnitVec3 = vec3.create();\nconst yUnitVec3 = vec3.create();\n\n/**\n * Computes a quaternion to represent the shortest rotation from one vector to another.\n *\n * @param aUnit - the start vector\n * @param bUnit - the end vector\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\nfunction rotationTo(aUnit: Vec3Arg, bUnit: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const dot = vec3.dot(aUnit, bUnit);\n if (dot < -0.999999) {\n vec3.cross(xUnitVec3, aUnit, tempVec3);\n if (vec3.len(tempVec3) < 0.000001) {\n vec3.cross(yUnitVec3, aUnit, tempVec3);\n }\n\n vec3.normalize(tempVec3, tempVec3);\n fromAxisAngle(tempVec3, Math.PI, newDst);\n\n return newDst;\n } else if (dot > 0.999999) {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n\n return newDst;\n } else {\n vec3.cross(aUnit, bUnit, tempVec3);\n\n newDst[0] = tempVec3[0];\n newDst[1] = tempVec3[1];\n newDst[2] = tempVec3[2];\n newDst[3] = 1 + dot;\n\n return normalize(newDst, newDst);\n }\n}\n\nconst tempQuat1 = new Ctor(4);\nconst tempQuat2 = new Ctor(4);\n\n/**\n * Performs a spherical linear interpolation with two control points\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param c - the third quaternion\n * @param d - the fourth quaternion\n * @param t - Interpolation coefficient 0 to 1\n * @returns result\n */\nfunction sqlerp(\n a: QuatArg,\n b: QuatArg,\n c: QuatArg,\n d: QuatArg,\n t: number,\n dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n slerp(a, d, t, tempQuat1);\n slerp(b, c, t, tempQuat2);\n slerp(tempQuat1, tempQuat2, 2 * t * (1 - t), newDst);\n\n return newDst;\n}\n\nreturn {\n create,\n fromValues,\n set,\n fromAxisAngle,\n toAxisAngle,\n angle,\n multiply,\n mul,\n rotateX,\n rotateY,\n rotateZ,\n slerp,\n inverse,\n conjugate,\n fromMat,\n fromEuler,\n copy,\n clone,\n add,\n subtract,\n sub,\n mulScalar,\n scale,\n divScalar,\n dot,\n lerp,\n length,\n len,\n lengthSq,\n lenSq,\n normalize,\n equalsApproximately,\n equals,\n identity,\n rotationTo,\n sqlerp,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\n/**\n *\n * Quat4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Quat4`. In other words you can do this\n *\n * const v = quat4.cross(v1, v2); // Creates a new Quat4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = quat4.create();\n * quat4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * quat4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nexport function getAPI(Ctor: QuatCtor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Vec4Arg, Vec4Type } from './vec4';\nimport { Mat4Arg } from './mat4';\nimport { BaseArgType } from './types';\n\nexport { Vec4Arg, Vec4Type };\n\ntype Vec4Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec4\n * */\nfunction getAPIImpl(Ctor: Vec4Ctor) {\n\n/**\n * Creates a vec4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number, w?: number) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a vec4; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec4\n * Also see {@link vec4.create} and {@link vec4.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, w: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n newDst[3] = Math.ceil(v[3]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n newDst[3] = Math.floor(v[3]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n newDst[3] = Math.round(v[3]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec4Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n newDst[3] = Math.min(max, Math.max(min, v[3]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec4Arg, b: Vec4Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n newDst[3] = a[3] + b[3] * scale;\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec4Arg, b: Vec4Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON &&\n Math.abs(a[3] - b[3]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec4Arg, b: Vec4Arg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec4Arg, b: Vec4Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec4Arg, b: Vec4Arg, t: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n newDst[3] = a[3] + t[3] * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n newDst[3] = Math.max(a[3], b[3]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n newDst[3] = Math.min(a[3], b[3]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec4Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec4Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n newDst[3] = 1 / v[3];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the dot product of two vectors\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec4Arg, b: Vec4Arg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec4Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec4Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec4Arg, b: Vec4Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec4Arg, b: Vec4Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return dx * dx + dy * dy + dz * dz + dw * dw;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n }\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n newDst[3] = -v[3];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec4.clone})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n newDst[3] = v[3];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec4.copy})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n newDst[3] = a[3] * b[3];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n newDst[3] = a[3] / b[3];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform vec4 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec4 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec4Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = v[3];\n\n newDst[0] = m[0] * x + m[4] * y + m[ 8] * z + m[12] * w;\n newDst[1] = m[1] * x + m[5] * y + m[ 9] * z + m[13] * w;\n newDst[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n newDst[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n\n return newDst;\n}\n\n\n/**\n * Treat a 4D vector as a direction and set it's length\n *\n * @param a The vec4 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec4Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec4 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec4Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n zero,\n transformMat4,\n setLength,\n truncate,\n midpoint,\n};\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\n/**\n *\n * Vec4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Vec4`. In other words you can do this\n *\n * const v = vec4.cross(v1, v2); // Creates a new Vec4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = vec4.create();\n * vec4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * vec4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nexport function getAPI(Ctor: Vec4Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n\n","/**\n * Some docs\n * @namespace wgpu-matrix\n */\nimport {BaseArgType, ZeroArray} from './types';\nimport {Mat3Arg, Mat3Type, getAPI as getMat3API} from './mat3-impl';\nimport {Mat4Arg, Mat4Type, getAPI as getMat4API} from './mat4-impl';\nimport {QuatArg, QuatType, getAPI as getQuatAPI, RotationOrder} from './quat-impl';\nimport {Vec2Arg, Vec2Type, getAPI as getVec2API} from './vec2-impl';\nimport {Vec3Arg, Vec3Type, getAPI as getVec3API} from './vec3-impl';\nimport {Vec4Arg, Vec4Type, getAPI as getVec4API} from './vec4-impl';\nimport * as utils from './utils';\n\nexport {\n RotationOrder,\n utils,\n\n BaseArgType,\n\n Mat3Arg,\n Mat4Arg,\n QuatArg,\n Vec2Arg,\n Vec3Arg,\n Vec4Arg,\n\n Mat3Type,\n Mat4Type,\n QuatType,\n Vec2Type,\n Vec3Type,\n Vec4Type,\n};\n\nexport type BaseCtor = new (n: number) => T;\n\nexport type Mat3 = Mat3Type;\nexport type Mat4 = Mat4Type;\nexport type Quat = QuatType;\nexport type Vec2 = Vec2Type;\nexport type Vec3 = Vec3Type;\nexport type Vec4 = Vec4Type;\n\nexport type Mat3d = Mat3Type;\nexport type Mat4d = Mat4Type;\nexport type Quatd = QuatType;\nexport type Vec2d = Vec2Type;\nexport type Vec3d = Vec3Type;\nexport type Vec4d = Vec4Type;\n\nexport type Mat3n = Mat3Type;\nexport type Mat4n = Mat4Type;\nexport type Quatn = QuatType;\nexport type Vec2n = Vec2Type;\nexport type Vec3n = Vec3Type;\nexport type Vec4n = Vec4Type;\n\n/**\n * Generate wgpu-matrix API for type\n */\nfunction wgpuMatrixAPI<\n Mat3 extends BaseArgType,\n Mat4 extends BaseArgType,\n Quat extends BaseArgType,\n Vec2 extends BaseArgType,\n Vec3 extends BaseArgType,\n Vec4 extends BaseArgType,\n>(\n Mat3Ctor: BaseCtor,\n Mat4Ctor: BaseCtor,\n QuatCtor: BaseCtor,\n Vec2Ctor: BaseCtor,\n Vec3Ctor: BaseCtor,\n Vec4Ctor: BaseCtor,\n) {\n return {\n /** @namespace mat3 */\n mat3: getMat3API(Mat3Ctor),\n /** @namespace mat4 */\n mat4: getMat4API(Mat4Ctor),\n /** @namespace quat */\n quat: getQuatAPI(QuatCtor),\n /** @namespace vec2 */\n vec2: getVec2API(Vec2Ctor),\n /** @namespace vec3 */\n vec3: getVec3API(Vec3Ctor),\n /** @namespace vec4 */\n vec4: getVec4API(Vec4Ctor),\n };\n}\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat3,\n /**\n * 4x4 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat4,\n /**\n * Quaternion functions that default to returning `Float32Array`\n * @namespace\n */\n quat,\n /**\n * Vec2 functions that default to returning `Float32Array`\n * @namespace\n */\n vec2,\n /**\n * Vec3 functions that default to returning `Float32Array`\n * @namespace\n */\n vec3,\n /**\n * Vec3 functions that default to returning `Float32Array`\n * @namespace\n */\n vec4,\n} = wgpuMatrixAPI<\n Mat3, Mat4, Quat, Vec2, Vec3, Vec4>(\n Float32Array, Float32Array, Float32Array, Float32Array, Float32Array, Float32Array);\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat3: mat3d,\n /**\n * 4x4 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat4: mat4d,\n /**\n * Quaternion functions that default to returning `Float64Array`\n * @namespace\n */\n quat: quatd,\n /**\n * Vec2 functions that default to returning `Float64Array`\n * @namespace\n */\n vec2: vec2d,\n /**\n * Vec3 functions that default to returning `Float64Array`\n * @namespace\n */\n vec3: vec3d,\n /**\n * Vec3 functions that default to returning `Float64Array`\n * @namespace\n */\n vec4: vec4d,\n} = wgpuMatrixAPI<\n Mat3d, Mat4d, Quatd, Vec2d, Vec3d, Vec4d>(\n Float64Array, Float64Array, Float64Array, Float64Array, Float64Array, Float64Array);\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat3: mat3n,\n /**\n * 4x4 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat4: mat4n,\n /**\n * Quaternion functions that default to returning `number[]`\n * @namespace\n */\n quat: quatn,\n /**\n * Vec2 functions that default to returning `number[]`\n * @namespace\n */\n vec2: vec2n,\n /**\n * Vec3 functions that default to returning `number[]`\n * @namespace\n */\n vec3: vec3n,\n /**\n * Vec3 functions that default to returning `number[]`\n * @namespace\n */\n vec4: vec4n,\n} = wgpuMatrixAPI<\n Mat3n, Mat4n, Quatn, Vec2n, Vec3n, Vec4n>(\n ZeroArray, Array, Array, Array, Array, Array);\n"],"names":["getAPIImpl","utils.EPSILON","cache","getAPI","getVec2API","getVec3API","getMat3API","getMat4API","getQuatAPI","getVec4API"],"mappings":";AAMA,SAAS,eAAe,CACtB,mBAAsB,EACtB,QAA6C,EAAA;IAE7C,OAAO,cAAc,mBAAmB,CAAA;AACtC,QAAA,WAAA,CAAY,GAAG,IAAW,EAAA;AACxB,YAAA,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;YACf,QAAQ,CAAC,IAAuB,CAAC,CAAC;SACnC;AACG,KAAA,CAAC;AACT,CAAC;AAEM,MAAM,SAAS,GAAG,eAAe,EAAC,KAAa,GAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;;AClBvE;;;;;;;;;;;;;;;;;;;;AAoBG;AAEI,IAAI,OAAO,GAAG,QAAQ,CAAC;AAE9B;;;;AAIG;AACG,SAAU,UAAU,CAAC,CAAS,EAAA;IAClC,MAAM,GAAG,GAAG,OAAO,CAAC;IACpB,OAAO,GAAG,CAAC,CAAC;AACZ,IAAA,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;AAIG;AACG,SAAU,QAAQ,CAAC,OAAe,EAAA;AACtC,IAAA,OAAO,OAAO,GAAG,IAAI,CAAC,EAAE,GAAG,GAA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AAI,EAAE,KAAK;AACX;;;AAGG;AACH,IAAI,EAAE,KAAK;AACX;;;AAGG;AACH,IAAI,EAAE,KAAK,GACZ,GAAG,aAAa,CAEb,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;;;;"} \ No newline at end of file +{"version":3,"file":"wgpu-matrix.module.js","sources":["../../../src/types.ts","../../../src/utils.ts","../../../src/vec2-impl.ts","../../../src/vec3-impl.ts","../../../src/mat3-impl.ts","../../../src/mat4-impl.ts","../../../src/quat-impl.ts","../../../src/vec4-impl.ts","../../../src/wgpu-matrix.ts"],"sourcesContent":["/**\n * The types you can pass to most functions that take an\n * array of numbers.\n */\nexport type BaseArgType = Float32Array | Float64Array | number[];\n\nfunction wrapConstructor any>(\n OriginalConstructor: T,\n modifier: (instance: InstanceType) => void\n): T {\n return class extends OriginalConstructor {\n constructor(...args: any[]) {\n super(...args);\n modifier(this as InstanceType);\n }\n } as T; // Type assertion is necessary here\n}\n\nexport const ZeroArray = wrapConstructor(Array, a => a.fill(0));\n\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nexport let EPSILON = 0.000001;\n\n/**\n * Set the value for EPSILON for various checks\n * @param v - Value to use for EPSILON.\n * @returns previous value of EPSILON;\n */\nexport function setEpsilon(v: number): number {\n const old = EPSILON;\n EPSILON = v;\n return old;\n}\n\n/**\n * Convert degrees to radians\n * @param degrees - Angle in degrees\n * @returns angle converted to radians\n */\nexport function degToRad(degrees: number): number {\n return degrees * Math.PI / 180;\n}\n\n/**\n * Convert radians to degrees\n * @param radians - Angle in radians\n * @returns angle converted to degrees\n */\nexport function radToDeg(radians: number): number {\n return radians * 180 / Math.PI;\n}\n\n/**\n * Lerps between a and b via t\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @returns a + (b - a) * t\n */\nexport function lerp(a: number, b: number, t: number): number {\n return a + (b - a) * t;\n}\n\n/**\n * Compute the opposite of lerp. Given a and b and a value between\n * a and b returns a value between 0 and 1. 0 if a, 1 if b.\n * Note: no clamping is done.\n * @param a - start value\n * @param b - end value\n * @param v - value between a and b\n * @returns (v - a) / (b - a)\n */\nexport function inverseLerp(a: number, b: number, v: number): number {\n const d = b - a;\n return (Math.abs(b - a) < EPSILON)\n ? a\n : (v - a) / d;\n}\n\n/**\n * Compute the euclidean modulo\n *\n * ```\n * // table for n / 3\n * -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 <- n\n * ------------------------------------\n * -2 -1 -0 -2 -1 0, 1, 2, 0, 1, 2 <- n % 3\n * 1 2 0 1 2 0, 1, 2, 0, 1, 2 <- euclideanModule(n, 3)\n * ```\n *\n * @param n - dividend\n * @param m - divisor\n * @returns the euclidean modulo of n / m\n */\nexport function euclideanModulo(n: number, m: number) {\n return ((n % m) + m) % m;\n}","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Mat3Arg } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { Vec2Arg, Vec2Type } from './vec2';\nimport { Vec3Arg } from './vec3';\nimport { BaseArgType } from './types';\n\nexport { Vec2Arg, Vec2Type };\n\ntype Vec2Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec3\n */\nfunction getAPIImpl(Ctor: Vec2Ctor) {\n\n/**\n * Creates a Vec2; may be called with x, y, z to set initial values.\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Vec2's specified type\n * it would be faster to use\n *\n * ```\n * const v = vec2.clone(someJSArray);\n * ```\n *\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\nfunction create(x = 0, y = 0) {\n const newDst = new Ctor(2);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n }\n }\n return newDst;\n}\n\n/**\n * Creates a Vec2; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec2\n * Also see {@link vec2.create} and {@link vec2.copy}\n *\n * @param x first value\n * @param y second value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec2Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec2Arg, b: Vec2Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n\n return newDst;\n}\n\n/**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\nfunction angle(a: Vec2Arg, b: Vec2Arg): number {\n const ax = a[0];\n const ay = a[1];\n const bx = b[0];\n const by = b[1];\n const mag1 = Math.sqrt(ax * ax + ay * ay);\n const mag2 = Math.sqrt(bx * bx + by * by);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec2Arg, b: Vec2Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec2Arg, b: Vec2Arg): boolean {\n return a[0] === b[0] && a[1] === b[1];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec2Arg, b: Vec2Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec2Arg, b: Vec2Arg, t: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec2Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec2Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\nfunction cross(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const z = a[0] * b[1] - a[1] * b[0];\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = z;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec2Arg, b: Vec2Arg): number {\n return a[0] * b[0] + a[1] * b[1];\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec2Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n return Math.sqrt(v0 * v0 + v1 * v1);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec2Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n return v0 * v0 + v1 * v1;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec2Arg, b: Vec2Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return Math.sqrt(dx * dx + dy * dy);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec2Arg, b: Vec2Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return dx * dx + dy * dy;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const len = Math.sqrt(v0 * v0 + v1 * v1);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n }\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec2.clone})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec2.copy})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Creates a random unit vector * scale\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\nfunction random(scale = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const angle = Math.random() * 2 * Math.PI;\n newDst[0] = Math.cos(angle) * scale;\n newDst[1] = Math.sin(angle) * scale;\n\n return newDst;\n}\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform Vec2 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec2Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const x = v[0];\n const y = v[1];\n\n newDst[0] = x * m[0] + y * m[4] + m[12];\n newDst[1] = x * m[1] + y * m[5] + m[13];\n\n return newDst;\n}\n\n/**\n * Transforms vec4 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat3(v: Vec2Arg, m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const x = v[0];\n const y = v[1];\n\n newDst[0] = m[0] * x + m[4] * y + m[8];\n newDst[1] = m[1] * x + m[5] * y + m[9];\n\n return newDst;\n}\n\n/**\n * Rotate a 2D vector\n *\n * @param a The vec2 point to rotate\n * @param b The origin of the rotation\n * @param rad The angle of rotation in radians\n * @returns the rotated vector\n */\nfunction rotate(a: Vec2Arg, b: Vec2Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n // Translate point to the origin\n const p0 = a[0] - b[0];\n const p1 = a[1] - b[1];\n const sinC = Math.sin(rad);\n const cosC = Math.cos(rad);\n\n //perform rotation and translate to correct position\n newDst[0] = p0 * cosC - p1 * sinC + b[0];\n newDst[1] = p0 * sinC + p1 * cosC + b[1];\n\n return newDst;\n}\n\n/**\n * Treat a 2D vector as a direction and set it's length\n *\n * @param a The vec2 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec2Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec2 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec2Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat3,\n rotate,\n setLength,\n truncate,\n midpoint,\n};\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Vec2Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Vec3Arg, Vec3Type } from './vec3';\nimport { Mat3Arg } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { QuatArg } from './quat';\nimport { BaseArgType } from './types';\n\nexport { Vec3Arg, Vec3Type };\n\ntype Vec3Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec3\n * */\nfunction getAPIImpl(Ctor: Vec3Ctor) {\n\n/**\n * Creates a vec3; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number) {\n const newDst = new Ctor(3);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a vec3; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec3\n * Also see {@link vec3.create} and {@link vec3.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec3Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec3Arg, b: Vec3Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n\n return newDst;\n}\n\n/**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\nfunction angle(a: Vec3Arg, b: Vec3Arg): number {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const mag1 = Math.sqrt(ax * ax + ay * ay + az * az);\n const mag2 = Math.sqrt(bx * bx + by * by + bz * bz);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec3Arg, b: Vec3Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec3Arg, b: Vec3Arg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec3Arg, b: Vec3Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec3Arg, b: Vec3Arg, t: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec3Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec3Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\nfunction cross(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const t1 = a[2] * b[0] - a[0] * b[2];\n const t2 = a[0] * b[1] - a[1] * b[0];\n newDst[0] = a[1] * b[2] - a[2] * b[1];\n newDst[1] = t1;\n newDst[2] = t2;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec3Arg, b: Vec3Arg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]);\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec3Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec3Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return v0 * v0 + v1 * v1 + v2 * v2;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec3Arg, b: Vec3Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return Math.sqrt(dx * dx + dy * dy + dz * dz);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec3Arg, b: Vec3Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return dx * dx + dy * dy + dz * dz;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec3.clone})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec3.copy})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Creates a random vector\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\nfunction random(scale = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const angle = Math.random() * 2 * Math.PI;\n const z = Math.random() * 2 - 1;\n const zScale = Math.sqrt(1 - z * z) * scale;\n newDst[0] = Math.cos(angle) * zScale;\n newDst[1] = Math.sin(angle) * zScale;\n newDst[2] = z * scale;\n\n return newDst;\n}\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform vec3 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec3Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1;\n\n newDst[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n newDst[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n newDst[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n\n return newDst;\n}\n\n/**\n * Transform vec3 by upper 3x3 matrix inside 4x4 matrix.\n * @param v - The direction.\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns The transformed vector.\n */\nfunction transformMat4Upper3x3(v: Vec3Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[0] = v0 * m[0 * 4 + 0] + v1 * m[1 * 4 + 0] + v2 * m[2 * 4 + 0];\n newDst[1] = v0 * m[0 * 4 + 1] + v1 * m[1 * 4 + 1] + v2 * m[2 * 4 + 1];\n newDst[2] = v0 * m[0 * 4 + 2] + v1 * m[1 * 4 + 2] + v2 * m[2 * 4 + 2];\n\n return newDst;\n}\n\n/**\n * Transforms vec3 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat3(v: Vec3Arg, m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n\n newDst[0] = x * m[0] + y * m[4] + z * m[8];\n newDst[1] = x * m[1] + y * m[5] + z * m[9];\n newDst[2] = x * m[2] + y * m[6] + z * m[10];\n\n return newDst;\n}\n\n/**\n * Transforms vec3 by Quaternion\n * @param v - the vector to transform\n * @param q - the quaternion to transform by\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed\n */\nfunction transformQuat(v: Vec3Arg, q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n\n const uvX = qy * z - qz * y;\n const uvY = qz * x - qx * z;\n const uvZ = qx * y - qy * x;\n\n newDst[0] = x + uvX * w2 + (qy * uvZ - qz * uvY) * 2;\n newDst[1] = y + uvY * w2 + (qz * uvX - qx * uvZ) * 2;\n newDst[2] = z + uvZ * w2 + (qx * uvY - qy * uvX) * 2;\n\n return newDst;\n}\n\n/**\n * Returns the translation component of a 4-by-4 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\nfunction getTranslation(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n}\n/**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat4Arg, axis: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n}\n/**\n * Returns the scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the x-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\nfunction rotateX(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n //Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n //perform rotation\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad);\n\n //translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the y-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\nfunction rotateY(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n // perform rotation\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad);\n\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the z-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns {vec3} out\n */\nfunction rotateZ(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n // perform rotation\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2];\n\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Treat a 3D vector as a direction and set it's length\n *\n * @param a The vec3 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec3Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec3 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec3Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat4Upper3x3,\n transformMat3,\n transformQuat,\n getTranslation,\n getAxis,\n getScaling,\n rotateX,\n rotateY,\n rotateZ,\n setLength,\n truncate,\n midpoint,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Vec3Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nimport * as utils from './utils.js';\nimport { QuatArg } from './quat';\nimport { Mat3Arg, Mat3Type } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { Vec2Arg } from './vec2';\nimport { Vec3Arg } from './vec3';\nimport { getAPI as getVec2API } from './vec2-impl';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\n\nexport { Mat3Arg, Mat3Type };\n\ntype Mat3Ctor = new (n: number) => T;\n\n/**\n * Generates a typed API for Mat3\n * */\nfunction getAPIImpl(Ctor: Mat3Ctor) {\n const vec2 = getVec2API(Ctor);\n const vec3 = getVec3API(Ctor);\n\n/**\n * Create a Mat3 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat3's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat3.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @returns matrix created from values.\n */\nfunction create(\n v0?: number, v1?: number, v2?: number,\n v3?: number, v4?: number, v5?: number,\n v6?: number, v7?: number, v8?: number) {\n const newDst = new Ctor(12);\n // to make the array homogenous\n newDst[3] = 0;\n newDst[7] = 0;\n newDst[11] = 0;\n\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[4] = v3;\n if (v4 !== undefined) {\n newDst[5] = v4;\n if (v5 !== undefined) {\n newDst[6] = v5;\n if (v6 !== undefined) {\n newDst[8] = v6;\n if (v7 !== undefined) {\n newDst[9] = v7;\n if (v8 !== undefined) {\n newDst[10] = v8;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n\n return newDst;\n}\n\n/**\n * Sets the values of a Mat3\n * Also see {@link mat3.create} and {@link mat3.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 set from values.\n */\nfunction set(\n v0: number, v1: number, v2: number,\n v3: number, v4: number, v5: number,\n v6: number, v7: number, v8: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[0] = v0; newDst[1] = v1; newDst[ 2] = v2; newDst[ 3] = 0;\n newDst[4] = v3; newDst[5] = v4; newDst[ 6] = v5; newDst[ 7] = 0;\n newDst[8] = v6; newDst[9] = v7; newDst[10] = v8; newDst[11] = 0;\n\n return newDst;\n}\n\n/**\n * Creates a Mat3 from the upper left 3x3 part of a Mat4\n * @param m4 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from m4\n */\nfunction fromMat4(m4: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n newDst[0] = m4[0]; newDst[1] = m4[1]; newDst[ 2] = m4[ 2]; newDst[ 3] = 0;\n newDst[4] = m4[4]; newDst[5] = m4[5]; newDst[ 6] = m4[ 6]; newDst[ 7] = 0;\n newDst[8] = m4[8]; newDst[9] = m4[9]; newDst[10] = m4[10]; newDst[11] = 0;\n return newDst;\n}\n\n/**\n * Creates a Mat3 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from q\n */\nfunction fromQuat(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3];\n const x2 = x + x; const y2 = y + y; const z2 = z + z;\n\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n newDst[ 0] = 1 - yy - zz; newDst[ 1] = yx + wz; newDst[ 2] = zx - wy; newDst[ 3] = 0;\n newDst[ 4] = yx - wz; newDst[ 5] = 1 - xx - zz; newDst[ 6] = zy + wx; newDst[ 7] = 0;\n newDst[ 8] = zx + wy; newDst[ 9] = zy - wx; newDst[10] = 1 - xx - yy; newDst[11] = 0;\n\n return newDst;\n}\n\n/**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\nfunction negate(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = -m[ 0]; newDst[ 1] = -m[ 1]; newDst[ 2] = -m[ 2];\n newDst[ 4] = -m[ 4]; newDst[ 5] = -m[ 5]; newDst[ 6] = -m[ 6];\n newDst[ 8] = -m[ 8]; newDst[ 9] = -m[ 9]; newDst[10] = -m[10];\n\n return newDst;\n}\n\n/**\n * Copies a matrix. (same as {@link mat3.clone})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nfunction copy(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = m[ 0]; newDst[ 1] = m[ 1]; newDst[ 2] = m[ 2];\n newDst[ 4] = m[ 4]; newDst[ 5] = m[ 5]; newDst[ 6] = m[ 6];\n newDst[ 8] = m[ 8]; newDst[ 9] = m[ 9]; newDst[10] = m[10];\n\n return newDst;\n}\n\n/**\n * Copies a matrix (same as {@link mat3.copy})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nconst clone = copy;\n\n/**\n * Check if 2 matrices are approximately equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are approximately equal\n */\nfunction equalsApproximately(a: Mat3Arg, b: Mat3Arg): boolean {\n return Math.abs(a[ 0] - b[ 0]) < utils.EPSILON &&\n Math.abs(a[ 1] - b[ 1]) < utils.EPSILON &&\n Math.abs(a[ 2] - b[ 2]) < utils.EPSILON &&\n Math.abs(a[ 4] - b[ 4]) < utils.EPSILON &&\n Math.abs(a[ 5] - b[ 5]) < utils.EPSILON &&\n Math.abs(a[ 6] - b[ 6]) < utils.EPSILON &&\n Math.abs(a[ 8] - b[ 8]) < utils.EPSILON &&\n Math.abs(a[ 9] - b[ 9]) < utils.EPSILON &&\n Math.abs(a[10] - b[10]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 matrices are exactly equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are exactly equal\n */\nfunction equals(a: Mat3Arg, b: Mat3Arg): boolean {\n return a[ 0] === b[ 0] &&\n a[ 1] === b[ 1] &&\n a[ 2] === b[ 2] &&\n a[ 4] === b[ 4] &&\n a[ 5] === b[ 5] &&\n a[ 6] === b[ 6] &&\n a[ 8] === b[ 8] &&\n a[ 9] === b[ 9] &&\n a[10] === b[10];\n}\n\n/**\n * Creates a 3-by-3 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 3-by-3 identity matrix.\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\nfunction transpose(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n if (newDst === m) {\n let t: number;\n\n // 0 1 2\n // 4 5 6\n // 8 9 10\n\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n\n return newDst;\n }\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n newDst[ 0] = m00; newDst[ 1] = m10; newDst[ 2] = m20;\n newDst[ 4] = m01; newDst[ 5] = m11; newDst[ 6] = m21;\n newDst[ 8] = m02; newDst[ 9] = m12; newDst[10] = m22;\n\n return newDst;\n}\n\n/**\n * Computes the inverse of a 3-by-3 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nfunction inverse(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n const b01 = m22 * m11 - m12 * m21;\n const b11 = -m22 * m10 + m12 * m20;\n const b21 = m21 * m10 - m11 * m20;\n\n const invDet = 1 / (m00 * b01 + m01 * b11 + m02 * b21);\n\n newDst[ 0] = b01 * invDet;\n newDst[ 1] = (-m22 * m01 + m02 * m21) * invDet;\n newDst[ 2] = ( m12 * m01 - m02 * m11) * invDet;\n newDst[ 4] = b11 * invDet;\n newDst[ 5] = ( m22 * m00 - m02 * m20) * invDet;\n newDst[ 6] = (-m12 * m00 + m02 * m10) * invDet;\n newDst[ 8] = b21 * invDet;\n newDst[ 9] = (-m21 * m00 + m01 * m20) * invDet;\n newDst[10] = ( m11 * m00 - m01 * m10) * invDet;\n\n return newDst;\n}\n\n/**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\nfunction determinant(m: Mat3Arg): number {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n return m00 * (m11 * m22 - m21 * m12) -\n m10 * (m01 * m22 - m21 * m02) +\n m20 * (m01 * m12 - m11 * m02);\n}\n\n/**\n * Computes the inverse of a 3-by-3 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nconst invert = inverse;\n\n/**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nfunction multiply(a: Mat3Arg, b: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[ 4 + 0];\n const a11 = a[ 4 + 1];\n const a12 = a[ 4 + 2];\n const a20 = a[ 8 + 0];\n const a21 = a[ 8 + 1];\n const a22 = a[ 8 + 2];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b10 = b[ 4 + 0];\n const b11 = b[ 4 + 1];\n const b12 = b[ 4 + 2];\n const b20 = b[ 8 + 0];\n const b21 = b[ 8 + 1];\n const b22 = b[ 8 + 2];\n\n newDst[ 0] = a00 * b00 + a10 * b01 + a20 * b02;\n newDst[ 1] = a01 * b00 + a11 * b01 + a21 * b02;\n newDst[ 2] = a02 * b00 + a12 * b01 + a22 * b02;\n newDst[ 4] = a00 * b10 + a10 * b11 + a20 * b12;\n newDst[ 5] = a01 * b10 + a11 * b11 + a21 * b12;\n newDst[ 6] = a02 * b10 + a12 * b11 + a22 * b12;\n newDst[ 8] = a00 * b20 + a10 * b21 + a20 * b22;\n newDst[ 9] = a01 * b20 + a11 * b21 + a21 * b22;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22;\n\n return newDst;\n}\n\n/**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nconst mul = multiply;\n\n/**\n * Sets the translation component of a 3-by-3 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\nfunction setTranslation(a: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? identity()) as T;\n if (a !== newDst) {\n newDst[ 0] = a[ 0];\n newDst[ 1] = a[ 1];\n newDst[ 2] = a[ 2];\n newDst[ 4] = a[ 4];\n newDst[ 5] = a[ 5];\n newDst[ 6] = a[ 6];\n }\n newDst[ 8] = v[0];\n newDst[ 9] = v[1];\n newDst[10] = 1;\n return newDst;\n}\n\n/**\n * Returns the translation component of a 3-by-3 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\nfunction getTranslation(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec2.create()) as T;\n newDst[0] = m[8];\n newDst[1] = m[9];\n return newDst;\n}\n\n/**\n * Returns an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y,\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat3Arg, axis: number, dst?: T) {\n const newDst = (dst ?? vec2.create()) as T;\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n return newDst;\n}\n\n/**\n * Sets an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\nfunction setAxis(m: Mat3Arg, v: Vec2Arg, axis: number, dst?: T) {\n const newDst = (dst === m ? m : copy(m, dst)) as T;\n\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n return newDst;\n}\n\n/**\n * Returns the \"2d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec2.create());\n\n const xx = m[0];\n const xy = m[1];\n const yx = m[4];\n const yy = m[5];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy);\n newDst[1] = Math.sqrt(yx * yx + yy * yy);\n\n return newDst;\n}\n\n\n/**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction get3DScaling(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec3.create());\n\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which translates by the given vector v.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\nfunction translation(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = v[0]; newDst[ 9] = v[1]; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Translates the given 3-by-3 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\nfunction translate(m: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 0] = m00;\n newDst[ 1] = m01;\n newDst[ 2] = m02;\n newDst[ 4] = m10;\n newDst[ 5] = m11;\n newDst[ 6] = m12;\n }\n\n newDst[ 8] = m00 * v0 + m10 * v1 + m20;\n newDst[ 9] = m01 * v0 + m11 * v1 + m21;\n newDst[10] = m02 * v0 + m12 * v1 + m22;\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotation(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = s; newDst[ 2] = 0;\n newDst[ 4] = -s; newDst[ 5] = c; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix by the given angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotate(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 + s * m10;\n newDst[ 1] = c * m01 + s * m11;\n newDst[ 2] = c * m02 + s * m12;\n\n newDst[ 4] = c * m10 - s * m00;\n newDst[ 5] = c * m11 - s * m01;\n newDst[ 6] = c * m12 - s * m02;\n\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the x-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationX(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = c; newDst[ 6] = s;\n newDst[ 8] = 0; newDst[ 9] = -s; newDst[10] = c;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix around the x-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateX(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[4] = c * m10 + s * m20;\n newDst[5] = c * m11 + s * m21;\n newDst[6] = c * m12 + s * m22;\n newDst[8] = c * m20 - s * m10;\n newDst[9] = c * m21 - s * m11;\n newDst[10] = c * m22 - s * m12;\n\n if (m !== newDst) {\n newDst[ 0] = m[ 0];\n newDst[ 1] = m[ 1];\n newDst[ 2] = m[ 2];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the y-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationY(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = 0; newDst[ 2] = -s;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = s; newDst[ 9] = 0; newDst[10] = c;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix around the y-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateY(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 - s * m20;\n newDst[ 1] = c * m01 - s * m21;\n newDst[ 2] = c * m02 - s * m22;\n newDst[ 8] = c * m20 + s * m00;\n newDst[ 9] = c * m21 + s * m01;\n newDst[10] = c * m22 + s * m02;\n\n if (m !== newDst) {\n newDst[ 4] = m[ 4];\n newDst[ 5] = m[ 5];\n newDst[ 6] = m[ 6];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the z-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nconst rotationZ = rotation;\n\n/**\n * Rotates the given 3-by-3 matrix around the z-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nconst rotateZ = rotate;\n\n/**\n * Creates a 3-by-3 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has two\n * entries.\n * @param v - A vector of\n * 2 entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * two entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of 2 entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale(m: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * 3 entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling3D(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = v[2];\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of 3 entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale3D(m: Mat3Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n\n newDst[ 8] = v2 * m[2 * 4 + 0];\n newDst[ 9] = v2 * m[2 * 4 + 1];\n newDst[10] = v2 * m[2 * 4 + 2];\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales uniformly in the X and Y dimensions\n * @param s - Amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in the X and Y dimension by an amount\n * given.\n * @param m - The matrix to be modified.\n * @param s - Amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale(m: Mat3Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales uniformly in each dimension\n * @param s - Amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling3D(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = s;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given.\n * @param m - The matrix to be modified.\n * @param s - Amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale3D(m: Mat3Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n\n newDst[ 8] = s * m[2 * 4 + 0];\n newDst[ 9] = s * m[2 * 4 + 1];\n newDst[10] = s * m[2 * 4 + 2];\n\n return newDst;\n}\n\nreturn {\n clone,\n create,\n set,\n fromMat4,\n fromQuat,\n negate,\n copy,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n invert,\n determinant,\n mul,\n multiply,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n get3DScaling,\n translation,\n translate,\n rotation,\n rotate,\n rotationX,\n rotateX,\n rotationY,\n rotateY,\n rotationZ,\n rotateZ,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n scaling3D,\n scale3D,\n uniformScaling3D,\n uniformScale3D,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Mat3Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","import { Mat4Arg, Mat4Type } from './mat4';\nimport { Mat3Arg } from './mat3';\nimport { QuatArg } from './quat';\nimport { Vec3Arg } from './vec3';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\nimport * as utils from './utils';\n\nexport { Mat4Arg, Mat4Type };\n\ntype Mat4Ctor = new (n: number) => T;\n\n/**\n * Generates a typed API for Mat4\n * */\nfunction getAPIImpl(Ctor: Mat4Ctor) {\n const vec3 = getVec3API(Ctor);\n\n/**\n * 4x4 Matrix math math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new matrix. In other words you can do this\n *\n * const mat = mat4.translation([1, 2, 3]); // Creates a new translation matrix\n *\n * or\n *\n * const mat = mat4.create();\n * mat4.translation([1, 2, 3], mat); // Puts translation matrix in mat.\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always save to pass any matrix as the destination. So for example\n *\n * const mat = mat4.identity();\n * const trans = mat4.translation([1, 2, 3]);\n * mat4.multiply(mat, trans, mat); // Multiplies mat * trans and puts result in mat.\n *\n */\n\n\n/**\n * Create a Mat4 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat4's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat4.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @returns created from values.\n */\nfunction create(\n v0?: number, v1?: number, v2?: number, v3?: number,\n v4?: number, v5?: number, v6?: number, v7?: number,\n v8?: number, v9?: number, v10?: number, v11?: number,\n v12?: number, v13?: number, v14?: number, v15?: number) {\n const newDst = new Ctor(16);\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[3] = v3;\n if (v4 !== undefined) {\n newDst[4] = v4;\n if (v5 !== undefined) {\n newDst[5] = v5;\n if (v6 !== undefined) {\n newDst[6] = v6;\n if (v7 !== undefined) {\n newDst[7] = v7;\n if (v8 !== undefined) {\n newDst[8] = v8;\n if (v9 !== undefined) {\n newDst[9] = v9;\n if (v10 !== undefined) {\n newDst[10] = v10;\n if (v11 !== undefined) {\n newDst[11] = v11;\n if (v12 !== undefined) {\n newDst[12] = v12;\n if (v13 !== undefined) {\n newDst[13] = v13;\n if (v14 !== undefined) {\n newDst[14] = v14;\n if (v15 !== undefined) {\n newDst[15] = v15;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Sets the values of a Mat4\n * Also see {@link mat4.create} and {@link mat4.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 created from values.\n */\nfunction set(\n v0: number, v1: number, v2: number, v3: number,\n v4: number, v5: number, v6: number, v7: number,\n v8: number, v9: number, v10: number, v11: number,\n v12: number, v13: number, v14: number, v15: number,\n dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = v0; newDst[ 1] = v1; newDst[ 2] = v2; newDst[ 3] = v3;\n newDst[ 4] = v4; newDst[ 5] = v5; newDst[ 6] = v6; newDst[ 7] = v7;\n newDst[ 8] = v8; newDst[ 9] = v9; newDst[10] = v10; newDst[11] = v11;\n newDst[12] = v12; newDst[13] = v13; newDst[14] = v14; newDst[15] = v15;\n\n return newDst;\n}\n\n/**\n * Creates a Mat4 from a Mat3\n * @param m3 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from m3\n */\nfunction fromMat3(m3: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = m3[0]; newDst[ 1] = m3[1]; newDst[ 2] = m3[ 2]; newDst[ 3] = 0;\n newDst[ 4] = m3[4]; newDst[ 5] = m3[5]; newDst[ 6] = m3[ 6]; newDst[ 7] = 0;\n newDst[ 8] = m3[8]; newDst[ 9] = m3[9]; newDst[10] = m3[10]; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a Mat4 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from q\n */\nfunction fromQuat(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3];\n const x2 = x + x; const y2 = y + y; const z2 = z + z;\n\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n newDst[ 0] = 1 - yy - zz; newDst[ 1] = yx + wz; newDst[ 2] = zx - wy; newDst[ 3] = 0;\n newDst[ 4] = yx - wz; newDst[ 5] = 1 - xx - zz; newDst[ 6] = zy + wx; newDst[ 7] = 0;\n newDst[ 8] = zx + wy; newDst[ 9] = zy - wx; newDst[10] = 1 - xx - yy; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\nfunction negate(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = -m[ 0]; newDst[ 1] = -m[ 1]; newDst[ 2] = -m[ 2]; newDst[ 3] = -m[ 3];\n newDst[ 4] = -m[ 4]; newDst[ 5] = -m[ 5]; newDst[ 6] = -m[ 6]; newDst[ 7] = -m[ 7];\n newDst[ 8] = -m[ 8]; newDst[ 9] = -m[ 9]; newDst[10] = -m[10]; newDst[11] = -m[11];\n newDst[12] = -m[12]; newDst[13] = -m[13]; newDst[14] = -m[14]; newDst[15] = -m[15];\n\n return newDst;\n}\n\n/**\n * Copies a matrix. (same as {@link mat4.clone})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nfunction copy(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = m[ 0]; newDst[ 1] = m[ 1]; newDst[ 2] = m[ 2]; newDst[ 3] = m[ 3];\n newDst[ 4] = m[ 4]; newDst[ 5] = m[ 5]; newDst[ 6] = m[ 6]; newDst[ 7] = m[ 7];\n newDst[ 8] = m[ 8]; newDst[ 9] = m[ 9]; newDst[10] = m[10]; newDst[11] = m[11];\n newDst[12] = m[12]; newDst[13] = m[13]; newDst[14] = m[14]; newDst[15] = m[15];\n\n return newDst;\n}\n\n/**\n * Copies a matrix (same as {@link mat4.copy})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nconst clone = copy;\n\n/**\n * Check if 2 matrices are approximately equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are approximately equal\n */\nfunction equalsApproximately(a: Mat4Arg, b: Mat4Arg): boolean {\n return Math.abs(a[ 0] - b[ 0]) < utils.EPSILON &&\n Math.abs(a[ 1] - b[ 1]) < utils.EPSILON &&\n Math.abs(a[ 2] - b[ 2]) < utils.EPSILON &&\n Math.abs(a[ 3] - b[ 3]) < utils.EPSILON &&\n Math.abs(a[ 4] - b[ 4]) < utils.EPSILON &&\n Math.abs(a[ 5] - b[ 5]) < utils.EPSILON &&\n Math.abs(a[ 6] - b[ 6]) < utils.EPSILON &&\n Math.abs(a[ 7] - b[ 7]) < utils.EPSILON &&\n Math.abs(a[ 8] - b[ 8]) < utils.EPSILON &&\n Math.abs(a[ 9] - b[ 9]) < utils.EPSILON &&\n Math.abs(a[10] - b[10]) < utils.EPSILON &&\n Math.abs(a[11] - b[11]) < utils.EPSILON &&\n Math.abs(a[12] - b[12]) < utils.EPSILON &&\n Math.abs(a[13] - b[13]) < utils.EPSILON &&\n Math.abs(a[14] - b[14]) < utils.EPSILON &&\n Math.abs(a[15] - b[15]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 matrices are exactly equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are exactly equal\n */\nfunction equals(a: Mat4Arg, b: Mat4Arg): boolean {\n return a[ 0] === b[ 0] &&\n a[ 1] === b[ 1] &&\n a[ 2] === b[ 2] &&\n a[ 3] === b[ 3] &&\n a[ 4] === b[ 4] &&\n a[ 5] === b[ 5] &&\n a[ 6] === b[ 6] &&\n a[ 7] === b[ 7] &&\n a[ 8] === b[ 8] &&\n a[ 9] === b[ 9] &&\n a[10] === b[10] &&\n a[11] === b[11] &&\n a[12] === b[12] &&\n a[13] === b[13] &&\n a[14] === b[14] &&\n a[15] === b[15];\n}\n\n/**\n * Creates a 4-by-4 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 4-by-4 identity matrix.\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\nfunction transpose(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n if (newDst === m) {\n let t;\n\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n\n t = m[3];\n m[3] = m[12];\n m[12] = t;\n\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n\n t = m[7];\n m[7] = m[13];\n m[13] = t;\n\n t = m[11];\n m[11] = m[14];\n m[14] = t;\n return newDst;\n }\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n newDst[ 0] = m00; newDst[ 1] = m10; newDst[ 2] = m20; newDst[ 3] = m30;\n newDst[ 4] = m01; newDst[ 5] = m11; newDst[ 6] = m21; newDst[ 7] = m31;\n newDst[ 8] = m02; newDst[ 9] = m12; newDst[10] = m22; newDst[11] = m32;\n newDst[12] = m03; newDst[13] = m13; newDst[14] = m23; newDst[15] = m33;\n\n return newDst;\n}\n\n/**\n * Computes the inverse of a 4-by-4 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nfunction inverse(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n const tmp12 = m20 * m31;\n const tmp13 = m30 * m21;\n const tmp14 = m10 * m31;\n const tmp15 = m30 * m11;\n const tmp16 = m10 * m21;\n const tmp17 = m20 * m11;\n const tmp18 = m00 * m31;\n const tmp19 = m30 * m01;\n const tmp20 = m00 * m21;\n const tmp21 = m20 * m01;\n const tmp22 = m00 * m11;\n const tmp23 = m10 * m01;\n\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n\n const d = 1 / (m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3);\n\n newDst[ 0] = d * t0;\n newDst[ 1] = d * t1;\n newDst[ 2] = d * t2;\n newDst[ 3] = d * t3;\n newDst[ 4] = d * ((tmp1 * m10 + tmp2 * m20 + tmp5 * m30) -\n (tmp0 * m10 + tmp3 * m20 + tmp4 * m30));\n newDst[ 5] = d * ((tmp0 * m00 + tmp7 * m20 + tmp8 * m30) -\n (tmp1 * m00 + tmp6 * m20 + tmp9 * m30));\n newDst[ 6] = d * ((tmp3 * m00 + tmp6 * m10 + tmp11 * m30) -\n (tmp2 * m00 + tmp7 * m10 + tmp10 * m30));\n newDst[ 7] = d * ((tmp4 * m00 + tmp9 * m10 + tmp10 * m20) -\n (tmp5 * m00 + tmp8 * m10 + tmp11 * m20));\n newDst[ 8] = d * ((tmp12 * m13 + tmp15 * m23 + tmp16 * m33) -\n (tmp13 * m13 + tmp14 * m23 + tmp17 * m33));\n newDst[ 9] = d * ((tmp13 * m03 + tmp18 * m23 + tmp21 * m33) -\n (tmp12 * m03 + tmp19 * m23 + tmp20 * m33));\n newDst[10] = d * ((tmp14 * m03 + tmp19 * m13 + tmp22 * m33) -\n (tmp15 * m03 + tmp18 * m13 + tmp23 * m33));\n newDst[11] = d * ((tmp17 * m03 + tmp20 * m13 + tmp23 * m23) -\n (tmp16 * m03 + tmp21 * m13 + tmp22 * m23));\n newDst[12] = d * ((tmp14 * m22 + tmp17 * m32 + tmp13 * m12) -\n (tmp16 * m32 + tmp12 * m12 + tmp15 * m22));\n newDst[13] = d * ((tmp20 * m32 + tmp12 * m02 + tmp19 * m22) -\n (tmp18 * m22 + tmp21 * m32 + tmp13 * m02));\n newDst[14] = d * ((tmp18 * m12 + tmp23 * m32 + tmp15 * m02) -\n (tmp22 * m32 + tmp14 * m02 + tmp19 * m12));\n newDst[15] = d * ((tmp22 * m22 + tmp16 * m02 + tmp21 * m12) -\n (tmp20 * m12 + tmp23 * m22 + tmp17 * m02));\n\n return newDst;\n}\n\n/**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\nfunction determinant(m: Mat4Arg): number {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n\n return m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3;\n}\n\n/**\n * Computes the inverse of a 4-by-4 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nconst invert = inverse;\n\n/**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nfunction multiply(a: Mat4Arg, b: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[ 4 + 0];\n const a11 = a[ 4 + 1];\n const a12 = a[ 4 + 2];\n const a13 = a[ 4 + 3];\n const a20 = a[ 8 + 0];\n const a21 = a[ 8 + 1];\n const a22 = a[ 8 + 2];\n const a23 = a[ 8 + 3];\n const a30 = a[12 + 0];\n const a31 = a[12 + 1];\n const a32 = a[12 + 2];\n const a33 = a[12 + 3];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b03 = b[3];\n const b10 = b[ 4 + 0];\n const b11 = b[ 4 + 1];\n const b12 = b[ 4 + 2];\n const b13 = b[ 4 + 3];\n const b20 = b[ 8 + 0];\n const b21 = b[ 8 + 1];\n const b22 = b[ 8 + 2];\n const b23 = b[ 8 + 3];\n const b30 = b[12 + 0];\n const b31 = b[12 + 1];\n const b32 = b[12 + 2];\n const b33 = b[12 + 3];\n\n newDst[ 0] = a00 * b00 + a10 * b01 + a20 * b02 + a30 * b03;\n newDst[ 1] = a01 * b00 + a11 * b01 + a21 * b02 + a31 * b03;\n newDst[ 2] = a02 * b00 + a12 * b01 + a22 * b02 + a32 * b03;\n newDst[ 3] = a03 * b00 + a13 * b01 + a23 * b02 + a33 * b03;\n newDst[ 4] = a00 * b10 + a10 * b11 + a20 * b12 + a30 * b13;\n newDst[ 5] = a01 * b10 + a11 * b11 + a21 * b12 + a31 * b13;\n newDst[ 6] = a02 * b10 + a12 * b11 + a22 * b12 + a32 * b13;\n newDst[ 7] = a03 * b10 + a13 * b11 + a23 * b12 + a33 * b13;\n newDst[ 8] = a00 * b20 + a10 * b21 + a20 * b22 + a30 * b23;\n newDst[ 9] = a01 * b20 + a11 * b21 + a21 * b22 + a31 * b23;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22 + a32 * b23;\n newDst[11] = a03 * b20 + a13 * b21 + a23 * b22 + a33 * b23;\n newDst[12] = a00 * b30 + a10 * b31 + a20 * b32 + a30 * b33;\n newDst[13] = a01 * b30 + a11 * b31 + a21 * b32 + a31 * b33;\n newDst[14] = a02 * b30 + a12 * b31 + a22 * b32 + a32 * b33;\n newDst[15] = a03 * b30 + a13 * b31 + a23 * b32 + a33 * b33;\n\n return newDst;\n}\n\n/**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nconst mul = multiply;\n\n/**\n * Sets the translation component of a 4-by-4 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\nfunction setTranslation(a: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? identity()) as T;\n if (a !== newDst) {\n newDst[ 0] = a[ 0];\n newDst[ 1] = a[ 1];\n newDst[ 2] = a[ 2];\n newDst[ 3] = a[ 3];\n newDst[ 4] = a[ 4];\n newDst[ 5] = a[ 5];\n newDst[ 6] = a[ 6];\n newDst[ 7] = a[ 7];\n newDst[ 8] = a[ 8];\n newDst[ 9] = a[ 9];\n newDst[10] = a[10];\n newDst[11] = a[11];\n }\n newDst[12] = v[0];\n newDst[13] = v[1];\n newDst[14] = v[2];\n newDst[15] = 1;\n return newDst;\n}\n\n///**\n// * Returns the translation component of a 4-by-4 matrix as a vector with 3\n// * entries.\n// * @param m - The matrix.\n// * @param dst - vector to hold result. If not passed a new one is created.\n// * @returns The translation component of m.\n// */\nfunction getTranslation(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? vec3.create()) as T;\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n}\n\n/**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat4Arg, axis: number, dst?: T) {\n const newDst = (dst ?? vec3.create());\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n}\n\n/**\n * Sets an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\nfunction setAxis(m: Mat4Arg, v: Vec3Arg, axis: number, dst: T) {\n const newDst = (dst === m) ? dst : copy(m, dst);\n\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n newDst[off + 2] = v[2];\n return newDst;\n}\n\n/**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? vec3.create()) as T;\n\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 0 to 1 in the z dimension.\n *\n * Note: If you pass `Infinity` for zFar then it will produce a projection matrix\n * returns -Infinity for Z when transforming coordinates with Z <= 0 and +Infinity for Z\n * otherwise.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */\nfunction perspective(fieldOfViewYInRadians: number, aspect: number, zNear: number, zFar: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const f = Math.tan(Math.PI * 0.5 - 0.5 * fieldOfViewYInRadians);\n\n newDst[0] = f / aspect;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n newDst[4] = 0;\n newDst[5] = f;\n newDst[6] = 0;\n newDst[7] = 0;\n\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[11] = -1;\n\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (Number.isFinite(zFar)) {\n const rangeInv = 1 / (zNear - zFar);\n newDst[10] = zFar * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n } else {\n newDst[10] = -1;\n newDst[14] = -zNear;\n }\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 1 (at -zNear) to 0 (at -zFar) in the z dimension.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane. (default = Infinity)\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */function perspectiveReverseZ(fieldOfViewYInRadians: number, aspect: number, zNear: number, zFar = Infinity, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const f = 1 / Math.tan(fieldOfViewYInRadians * 0.5);\n\n newDst[ 0] = f / aspect;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n\n newDst[ 4] = 0;\n newDst[ 5] = f;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n\n newDst[ 8] = 0;\n newDst[ 9] = 0;\n newDst[11] = -1;\n\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (zFar === Infinity) {\n newDst[10] = 0;\n newDst[14] = zNear;\n } else {\n const rangeInv = 1 / (zFar - zNear);\n newDst[10] = zNear * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n }\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 orthogonal transformation matrix that transforms from\n * the given the left, right, bottom, and top dimensions to -1 +1 in x, and y\n * and 0 to +1 in z.\n * @param left - Left side of the near clipping plane viewport.\n * @param right - Right side of the near clipping plane viewport.\n * @param bottom - Bottom of the near clipping plane viewport.\n * @param top - Top of the near clipping plane viewport.\n * @param near - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param far - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The orthographic projection matrix.\n */\nfunction ortho(left: number, right: number, bottom: number, top: number, near: number, far: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[0] = 2 / (right - left);\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n newDst[4] = 0;\n newDst[5] = 2 / (top - bottom);\n newDst[6] = 0;\n newDst[7] = 0;\n\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[10] = 1 / (near - far);\n newDst[11] = 0;\n\n newDst[12] = (right + left) / (left - right);\n newDst[13] = (top + bottom) / (bottom - top);\n newDst[14] = near / (near - far);\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 0 to 1 in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\nfunction frustum(left: number, right: number, bottom: number, top: number, near: number, far: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const dx = (right - left);\n const dy = (top - bottom);\n const dz = (near - far);\n\n newDst[ 0] = 2 * near / dx;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n newDst[ 4] = 0;\n newDst[ 5] = 2 * near / dy;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n newDst[ 8] = (left + right) / dx;\n newDst[ 9] = (top + bottom) / dy;\n newDst[10] = far / dz;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = near * far / dz;\n newDst[15] = 0;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 1 (-near) to 0 (-far) in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\nfunction frustumReverseZ(left: number, right: number, bottom: number, top: number, near: number, far = Infinity, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const dx = (right - left);\n const dy = (top - bottom);\n\n newDst[ 0] = 2 * near / dx;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n newDst[ 4] = 0;\n newDst[ 5] = 2 * near / dy;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n newDst[ 8] = (left + right) / dx;\n newDst[ 9] = (top + bottom) / dy;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (far === Infinity) {\n newDst[10] = 0;\n newDst[14] = near;\n } else {\n const rangeInv = 1 / (far - near);\n newDst[10] = near * rangeInv;\n newDst[14] = far * near * rangeInv;\n }\n\n return newDst;\n}\n\nconst xAxis = vec3.create();\nconst yAxis = vec3.create();\nconst zAxis = vec3.create();\n\n/**\n * Computes a 4-by-4 aim transformation.\n *\n * This is a matrix which positions an object aiming down positive Z.\n * toward the target.\n *\n * Note: this is **NOT** the inverse of lookAt as lookAt looks at negative Z.\n *\n * @param position - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\nfunction aim(position: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(target, position, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = xAxis[1]; newDst[ 2] = xAxis[2]; newDst[ 3] = 0;\n newDst[ 4] = yAxis[0]; newDst[ 5] = yAxis[1]; newDst[ 6] = yAxis[2]; newDst[ 7] = 0;\n newDst[ 8] = zAxis[0]; newDst[ 9] = zAxis[1]; newDst[10] = zAxis[2]; newDst[11] = 0;\n newDst[12] = position[0]; newDst[13] = position[1]; newDst[14] = position[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 camera aim transformation.\n *\n * This is a matrix which positions an object aiming down negative Z.\n * toward the target.\n *\n * Note: this is the inverse of `lookAt`\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\nfunction cameraAim(eye: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = xAxis[1]; newDst[ 2] = xAxis[2]; newDst[ 3] = 0;\n newDst[ 4] = yAxis[0]; newDst[ 5] = yAxis[1]; newDst[ 6] = yAxis[2]; newDst[ 7] = 0;\n newDst[ 8] = zAxis[0]; newDst[ 9] = zAxis[1]; newDst[10] = zAxis[2]; newDst[11] = 0;\n newDst[12] = eye[0]; newDst[13] = eye[1]; newDst[14] = eye[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 view transformation.\n *\n * This is a view matrix which transforms all other objects\n * to be in the space of the view defined by the parameters.\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The look-at matrix.\n */\nfunction lookAt(eye: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = yAxis[0]; newDst[ 2] = zAxis[0]; newDst[ 3] = 0;\n newDst[ 4] = xAxis[1]; newDst[ 5] = yAxis[1]; newDst[ 6] = zAxis[1]; newDst[ 7] = 0;\n newDst[ 8] = xAxis[2]; newDst[ 9] = yAxis[2]; newDst[10] = zAxis[2]; newDst[11] = 0;\n\n newDst[12] = -(xAxis[0] * eye[0] + xAxis[1] * eye[1] + xAxis[2] * eye[2]);\n newDst[13] = -(yAxis[0] * eye[0] + yAxis[1] * eye[1] + yAxis[2] * eye[2]);\n newDst[14] = -(zAxis[0] * eye[0] + zAxis[1] * eye[1] + zAxis[2] * eye[2]);\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which translates by the given vector v.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\nfunction translation(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = v[0]; newDst[13] = v[1]; newDst[14] = v[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Translates the given 4-by-4 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\nfunction translate(m: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n if (m !== newDst) {\n newDst[ 0] = m00;\n newDst[ 1] = m01;\n newDst[ 2] = m02;\n newDst[ 3] = m03;\n newDst[ 4] = m10;\n newDst[ 5] = m11;\n newDst[ 6] = m12;\n newDst[ 7] = m13;\n newDst[ 8] = m20;\n newDst[ 9] = m21;\n newDst[10] = m22;\n newDst[11] = m23;\n }\n\n newDst[12] = m00 * v0 + m10 * v1 + m20 * v2 + m30;\n newDst[13] = m01 * v0 + m11 * v1 + m21 * v2 + m31;\n newDst[14] = m02 * v0 + m12 * v1 + m22 * v2 + m32;\n newDst[15] = m03 * v0 + m13 * v1 + m23 * v2 + m33;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the x-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationX(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = c; newDst[ 6] = s; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = -s; newDst[10] = c; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the x-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateX(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[4] = c * m10 + s * m20;\n newDst[5] = c * m11 + s * m21;\n newDst[6] = c * m12 + s * m22;\n newDst[7] = c * m13 + s * m23;\n newDst[8] = c * m20 - s * m10;\n newDst[9] = c * m21 - s * m11;\n newDst[10] = c * m22 - s * m12;\n newDst[11] = c * m23 - s * m13;\n\n if (m !== newDst) {\n newDst[ 0] = m[ 0];\n newDst[ 1] = m[ 1];\n newDst[ 2] = m[ 2];\n newDst[ 3] = m[ 3];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the y-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationY(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = 0; newDst[ 2] = -s; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = s; newDst[ 9] = 0; newDst[10] = c; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the y-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateY(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 - s * m20;\n newDst[ 1] = c * m01 - s * m21;\n newDst[ 2] = c * m02 - s * m22;\n newDst[ 3] = c * m03 - s * m23;\n newDst[ 8] = c * m20 + s * m00;\n newDst[ 9] = c * m21 + s * m01;\n newDst[10] = c * m22 + s * m02;\n newDst[11] = c * m23 + s * m03;\n\n if (m !== newDst) {\n newDst[ 4] = m[ 4];\n newDst[ 5] = m[ 5];\n newDst[ 6] = m[ 6];\n newDst[ 7] = m[ 7];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the z-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationZ(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = s; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = -s; newDst[ 5] = c; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the z-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateZ(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 + s * m10;\n newDst[ 1] = c * m01 + s * m11;\n newDst[ 2] = c * m02 + s * m12;\n newDst[ 3] = c * m03 + s * m13;\n newDst[ 4] = c * m10 - s * m00;\n newDst[ 5] = c * m11 - s * m01;\n newDst[ 6] = c * m12 - s * m02;\n newDst[ 7] = c * m13 - s * m03;\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n newDst[11] = m[11];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\nfunction axisRotation(axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n\n newDst[ 0] = xx + (1 - xx) * c;\n newDst[ 1] = x * y * oneMinusCosine + z * s;\n newDst[ 2] = x * z * oneMinusCosine - y * s;\n newDst[ 3] = 0;\n newDst[ 4] = x * y * oneMinusCosine - z * s;\n newDst[ 5] = yy + (1 - yy) * c;\n newDst[ 6] = y * z * oneMinusCosine + x * s;\n newDst[ 7] = 0;\n newDst[ 8] = x * z * oneMinusCosine + y * s;\n newDst[ 9] = y * z * oneMinusCosine - x * s;\n newDst[10] = zz + (1 - zz) * c;\n newDst[11] = 0;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = 0;\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle. (same as axisRotation)\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\nconst rotation = axisRotation;\n\n/**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle.\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction axisRotate(m: Mat4Arg, axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n\n const r00 = xx + (1 - xx) * c;\n const r01 = x * y * oneMinusCosine + z * s;\n const r02 = x * z * oneMinusCosine - y * s;\n const r10 = x * y * oneMinusCosine - z * s;\n const r11 = yy + (1 - yy) * c;\n const r12 = y * z * oneMinusCosine + x * s;\n const r20 = x * z * oneMinusCosine + y * s;\n const r21 = y * z * oneMinusCosine - x * s;\n const r22 = zz + (1 - zz) * c;\n\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n\n newDst[ 0] = r00 * m00 + r01 * m10 + r02 * m20;\n newDst[ 1] = r00 * m01 + r01 * m11 + r02 * m21;\n newDst[ 2] = r00 * m02 + r01 * m12 + r02 * m22;\n newDst[ 3] = r00 * m03 + r01 * m13 + r02 * m23;\n newDst[ 4] = r10 * m00 + r11 * m10 + r12 * m20;\n newDst[ 5] = r10 * m01 + r11 * m11 + r12 * m21;\n newDst[ 6] = r10 * m02 + r11 * m12 + r12 * m22;\n newDst[ 7] = r10 * m03 + r11 * m13 + r12 * m23;\n newDst[ 8] = r20 * m00 + r21 * m10 + r22 * m20;\n newDst[ 9] = r20 * m01 + r21 * m11 + r22 * m21;\n newDst[10] = r20 * m02 + r21 * m12 + r22 * m22;\n newDst[11] = r20 * m03 + r21 * m13 + r22 * m23;\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle. (same as rotate)\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nconst rotate = axisRotate;\n\n/**\n * Creates a 4-by-4 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * three entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = v[2]; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 4-by-4 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of three entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale(m: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n newDst[ 3] = v0 * m[0 * 4 + 3];\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n newDst[ 7] = v1 * m[1 * 4 + 3];\n newDst[ 8] = v2 * m[2 * 4 + 0];\n newDst[ 9] = v2 * m[2 * 4 + 1];\n newDst[10] = v2 * m[2 * 4 + 2];\n newDst[11] = v2 * m[2 * 4 + 3];\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which scales a uniform amount in each dimension.\n * @param s - the amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = s; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 4-by-4 matrix in each dimension by a uniform scale.\n * @param m - The matrix to be modified.\n * @param s - The amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale(m: Mat4Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n newDst[ 3] = s * m[0 * 4 + 3];\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n newDst[ 7] = s * m[1 * 4 + 3];\n newDst[ 8] = s * m[2 * 4 + 0];\n newDst[ 9] = s * m[2 * 4 + 1];\n newDst[10] = s * m[2 * 4 + 2];\n newDst[11] = s * m[2 * 4 + 3];\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\nreturn {\n create,\n set,\n fromMat3,\n fromQuat,\n negate,\n copy,\n clone,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n determinant,\n invert,\n multiply,\n mul,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n perspective,\n perspectiveReverseZ,\n ortho,\n frustum,\n frustumReverseZ,\n aim,\n cameraAim,\n lookAt,\n translation,\n translate,\n rotationX,\n rotateX,\n rotationY,\n rotateY,\n rotationZ,\n rotateZ,\n axisRotation,\n rotation,\n axisRotate,\n rotate,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n};\n\n}\n\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Mat4Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { QuatArg, QuatType } from './quat';\nimport { Mat3Arg } from './mat3.js';\nimport { Mat4Arg } from './mat4.js';\nimport { Vec3Arg } from './vec3.js';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\n\nexport { QuatArg, QuatType };\n\ntype QuatCtor = new (n: number) => T;\n\nexport type RotationOrder = 'xyz' | 'xzy' | 'yxz' | 'yzx' | 'zxy' | 'zyx';\n\n/**\n * Generates am typed API for Qud\n * */\nfunction getAPIImpl(Ctor: QuatCtor) {\n const vec3 = getVec3API(Ctor);\n\n/**\n * Creates a quat4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number, w?: number) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a Quat; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Quat\n * Also see {@link quat.create} and {@link quat.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, w: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n\n return newDst;\n}\n\n/**\n * Sets a quaternion from the given angle and axis,\n * then returns it.\n *\n * @param axis - the axis to rotate around\n * @param angleInRadians - the angle\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The quaternion that represents the given axis and angle\n **/\nfunction fromAxisAngle(axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n const s = Math.sin(halfAngle);\n\n newDst[0] = s * axis[0];\n newDst[1] = s * axis[1];\n newDst[2] = s * axis[2];\n newDst[3] = Math.cos(halfAngle);\n\n return newDst;\n}\n\n/**\n * Gets the rotation axis and angle\n * @param q - quaternion to compute from\n * @param dst - Vec3 to hold result. If not passed in a new one is created.\n * @return angle and axis\n */\nfunction toAxisAngle(q: QuatArg, dst?: T): { angle: number, axis: T } {\n const newDst = (dst ?? vec3.create(3)) as T;\n\n const angle = Math.acos(q[3]) * 2;\n const s = Math.sin(angle * 0.5);\n if (s > utils.EPSILON) {\n newDst[0] = q[0] / s;\n newDst[1] = q[1] / s;\n newDst[2] = q[2] / s;\n } else {\n newDst[0] = 1;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n\n return { angle, axis: newDst };\n}\n\n/**\n * Returns the angle in degrees between two rotations a and b.\n * @param a - quaternion a\n * @param b - quaternion b\n * @return angle in radians between the two quaternions\n */\nfunction angle(a: QuatArg, b: QuatArg) {\n const d = dot(a, b);\n return Math.acos(2 * d * d - 1);\n}\n\n/**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction multiply(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const bw = b[3];\n\n newDst[0] = ax * bw + aw * bx + ay * bz - az * by;\n newDst[1] = ay * bw + aw * by + az * bx - ax * bz;\n newDst[2] = az * bw + aw * bz + ax * by - ay * bx;\n newDst[3] = aw * bw - ax * bx - ay * by - az * bz;\n\n return newDst;\n}\n\n/**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nconst mul = multiply;\n\n/**\n * Rotates the given quaternion around the X axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateX(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const bx = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw + qw * bx;\n newDst[1] = qy * bw + qz * bx;\n newDst[2] = qz * bw - qy * bx;\n newDst[3] = qw * bw - qx * bx;\n\n return newDst;\n}\n\n/**\n * Rotates the given quaternion around the Y axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateY(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const by = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw - qz * by;\n newDst[1] = qy * bw + qw * by;\n newDst[2] = qz * bw + qx * by;\n newDst[3] = qw * bw - qy * by;\n\n return newDst;\n}\n\n/**\n * Rotates the given quaternion around the Z axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateZ(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const bz = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw + qy * bz;\n newDst[1] = qy * bw - qx * bz;\n newDst[2] = qz * bw + qw * bz;\n newDst[3] = qw * bw - qz * bz;\n\n return newDst;\n}\n\n/**\n * Spherically linear interpolate between two quaternions\n *\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction slerp(a: QuatArg, b: QuatArg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n\n let bx = b[0];\n let by = b[1];\n let bz = b[2];\n let bw = b[3];\n\n let cosOmega = ax * bx + ay * by + az * bz + aw * bw;\n\n if (cosOmega < 0) {\n cosOmega = -cosOmega;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n\n let scale0;\n let scale1;\n\n if (1.0 - cosOmega > utils.EPSILON) {\n const omega = Math.acos(cosOmega);\n const sinOmega = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinOmega;\n scale1 = Math.sin(t * omega) / sinOmega;\n } else {\n scale0 = 1.0 - t;\n scale1 = t;\n }\n\n newDst[0] = scale0 * ax + scale1 * bx;\n newDst[1] = scale0 * ay + scale1 * by;\n newDst[2] = scale0 * az + scale1 * bz;\n newDst[3] = scale0 * aw + scale1 * bw;\n\n return newDst;\n}\n\n/**\n * Compute the inverse of a quaternion\n *\n * @param q - quaternion to compute the inverse of\n * @returns A quaternion that is the result of a * b\n */\nfunction inverse(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const a0 = q[0];\n const a1 = q[1];\n const a2 = q[2];\n const a3 = q[3];\n\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n\n newDst[0] = -a0 * invDot;\n newDst[1] = -a1 * invDot;\n newDst[2] = -a2 * invDot;\n newDst[3] = a3 * invDot;\n\n return newDst;\n}\n\n/**\n * Compute the conjugate of a quaternion\n * For quaternions with a magnitude of 1 (a unit quaternion)\n * this returns the same as the inverse but is faster to calculate.\n *\n * @param q - quaternion to compute the conjugate of.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The conjugate of q\n */\nfunction conjugate(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = -q[0];\n newDst[1] = -q[1];\n newDst[2] = -q[2];\n newDst[3] = q[3];\n\n return newDst;\n}\n\n/**\n * Creates a quaternion from the given rotation matrix.\n *\n * The created quaternion is not normalized.\n *\n * @param m - rotation matrix\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\nfunction fromMat(m: Mat3Arg | Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n /*\n 0 1 2\n 3 4 5\n 6 7 8\n\n 0 1 2\n 4 5 6\n 8 9 10\n */\n\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n const trace = m[0] + m[5] + m[10];\n\n if (trace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n const root = Math.sqrt(trace + 1); // 2w\n newDst[3] = 0.5 * root;\n const invRoot = 0.5 / root; // 1/(4w)\n\n newDst[0] = (m[6] - m[9]) * invRoot;\n newDst[1] = (m[8] - m[2]) * invRoot;\n newDst[2] = (m[1] - m[4]) * invRoot;\n } else {\n // |w| <= 1/2\n let i = 0;\n\n if (m[5] > m[0]) {\n i = 1;\n }\n if (m[10] > m[i * 4 + i]) {\n i = 2;\n }\n\n const j = (i + 1) % 3;\n const k = (i + 2) % 3;\n\n const root = Math.sqrt(m[i * 4 + i] - m[j * 4 + j] - m[k * 4 + k] + 1.0);\n newDst[i] = 0.5 * root;\n\n const invRoot = 0.5 / root;\n\n newDst[3] = (m[j * 4 + k] - m[k * 4 + j]) * invRoot;\n newDst[j] = (m[j * 4 + i] + m[i * 4 + j]) * invRoot;\n newDst[k] = (m[k * 4 + i] + m[i * 4 + k]) * invRoot;\n }\n\n return newDst;\n}\n\n/**\n * Creates a quaternion from the given euler angle x, y, z using the provided intrinsic order for the conversion.\n *\n * @param xAngleInRadians - angle to rotate around X axis in radians.\n * @param yAngleInRadians - angle to rotate around Y axis in radians.\n * @param zAngleInRadians - angle to rotate around Z axis in radians.\n * @param order - order to apply euler angles\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion representing the same rotation as the euler angles applied in the given order\n */\nfunction fromEuler(\n xAngleInRadians: number,\n yAngleInRadians: number,\n zAngleInRadians: number,\n order: RotationOrder,\n dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const xHalfAngle = xAngleInRadians * 0.5;\n const yHalfAngle = yAngleInRadians * 0.5;\n const zHalfAngle = zAngleInRadians * 0.5;\n\n const sx = Math.sin(xHalfAngle);\n const cx = Math.cos(xHalfAngle);\n const sy = Math.sin(yHalfAngle);\n const cy = Math.cos(yHalfAngle);\n const sz = Math.sin(zHalfAngle);\n const cz = Math.cos(zHalfAngle);\n\n switch (order) {\n case 'xyz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'xzy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n case 'yxz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n case 'yzx':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'zxy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'zyx':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n default:\n throw new Error(`Unknown rotation order: ${order}`);\n }\n\n return newDst;\n}\n\n/**\n * Copies a quaternion. (same as {@link quat.clone})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is a copy of q\n */\nfunction copy(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = q[0];\n newDst[1] = q[1];\n newDst[2] = q[2];\n newDst[3] = q[3];\n\n return newDst;\n}\n\n/**\n * Clones a quaternion. (same as {@link quat.copy})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A copy of q.\n */\nconst clone = copy;\n\n/**\n * Adds two quaternions; assumes a and b have the same dimension.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the sum of a and b.\n */\nfunction add(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\nfunction subtract(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Multiplies a quaternion by a scalar.\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nfunction mulScalar(v: QuatArg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a quaternion by a scalar. (same as mulScalar)\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nfunction divScalar(v: QuatArg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two quaternions\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns dot product\n */\nfunction dot(a: QuatArg, b: QuatArg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n}\n\n/**\n * Performs linear interpolation on two quaternions.\n * Given quaternions a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param t - Interpolation coefficient.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: QuatArg, b: QuatArg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Computes the length of quaternion\n * @param v - quaternion.\n * @returns length of quaternion.\n */\nfunction length(v: QuatArg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n}\n\n/**\n * Computes the length of quaternion (same as length)\n * @param v - quaternion.\n * @returns length of quaternion.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of quaternion\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\nfunction lengthSq(v: QuatArg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n}\n\n/**\n * Computes the square of the length of quaternion (same as lengthSq)\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\nconst lenSq = lengthSq;\n\n/**\n * Divides a quaternion by its Euclidean length and returns the quotient.\n * @param v - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The normalized quaternion.\n */\nfunction normalize(v: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n }\n\n return newDst;\n}\n\n/**\n * Check if 2 quaternions are approximately equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are approximately equal\n */\nfunction equalsApproximately(a: QuatArg, b: QuatArg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON &&\n Math.abs(a[3] - b[3]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 quaternions are exactly equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are exactly equal\n */\nfunction equals(a: QuatArg, b: QuatArg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Creates an identity quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns an identity quaternion\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n\n return newDst;\n}\n\nconst tempVec3 = vec3.create();\nconst xUnitVec3 = vec3.create();\nconst yUnitVec3 = vec3.create();\n\n/**\n * Computes a quaternion to represent the shortest rotation from one vector to another.\n *\n * @param aUnit - the start vector\n * @param bUnit - the end vector\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\nfunction rotationTo(aUnit: Vec3Arg, bUnit: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const dot = vec3.dot(aUnit, bUnit);\n if (dot < -0.999999) {\n vec3.cross(xUnitVec3, aUnit, tempVec3);\n if (vec3.len(tempVec3) < 0.000001) {\n vec3.cross(yUnitVec3, aUnit, tempVec3);\n }\n\n vec3.normalize(tempVec3, tempVec3);\n fromAxisAngle(tempVec3, Math.PI, newDst);\n\n return newDst;\n } else if (dot > 0.999999) {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n\n return newDst;\n } else {\n vec3.cross(aUnit, bUnit, tempVec3);\n\n newDst[0] = tempVec3[0];\n newDst[1] = tempVec3[1];\n newDst[2] = tempVec3[2];\n newDst[3] = 1 + dot;\n\n return normalize(newDst, newDst);\n }\n}\n\nconst tempQuat1 = new Ctor(4);\nconst tempQuat2 = new Ctor(4);\n\n/**\n * Performs a spherical linear interpolation with two control points\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param c - the third quaternion\n * @param d - the fourth quaternion\n * @param t - Interpolation coefficient 0 to 1\n * @returns result\n */\nfunction sqlerp(\n a: QuatArg,\n b: QuatArg,\n c: QuatArg,\n d: QuatArg,\n t: number,\n dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n slerp(a, d, t, tempQuat1);\n slerp(b, c, t, tempQuat2);\n slerp(tempQuat1, tempQuat2, 2 * t * (1 - t), newDst);\n\n return newDst;\n}\n\nreturn {\n create,\n fromValues,\n set,\n fromAxisAngle,\n toAxisAngle,\n angle,\n multiply,\n mul,\n rotateX,\n rotateY,\n rotateZ,\n slerp,\n inverse,\n conjugate,\n fromMat,\n fromEuler,\n copy,\n clone,\n add,\n subtract,\n sub,\n mulScalar,\n scale,\n divScalar,\n dot,\n lerp,\n length,\n len,\n lengthSq,\n lenSq,\n normalize,\n equalsApproximately,\n equals,\n identity,\n rotationTo,\n sqlerp,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\n/**\n *\n * Quat4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Quat4`. In other words you can do this\n *\n * const v = quat4.cross(v1, v2); // Creates a new Quat4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = quat4.create();\n * quat4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * quat4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nexport function getAPI(Ctor: QuatCtor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Vec4Arg, Vec4Type } from './vec4';\nimport { Mat4Arg } from './mat4';\nimport { BaseArgType } from './types';\n\nexport { Vec4Arg, Vec4Type };\n\ntype Vec4Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec4\n * */\nfunction getAPIImpl(Ctor: Vec4Ctor) {\n\n/**\n * Creates a vec4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number, w?: number) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a vec4; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec4\n * Also see {@link vec4.create} and {@link vec4.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, w: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n newDst[3] = Math.ceil(v[3]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n newDst[3] = Math.floor(v[3]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n newDst[3] = Math.round(v[3]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec4Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n newDst[3] = Math.min(max, Math.max(min, v[3]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec4Arg, b: Vec4Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n newDst[3] = a[3] + b[3] * scale;\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec4Arg, b: Vec4Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON &&\n Math.abs(a[3] - b[3]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec4Arg, b: Vec4Arg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec4Arg, b: Vec4Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec4Arg, b: Vec4Arg, t: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n newDst[3] = a[3] + t[3] * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n newDst[3] = Math.max(a[3], b[3]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n newDst[3] = Math.min(a[3], b[3]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec4Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec4Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n newDst[3] = 1 / v[3];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the dot product of two vectors\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec4Arg, b: Vec4Arg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec4Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec4Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec4Arg, b: Vec4Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec4Arg, b: Vec4Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return dx * dx + dy * dy + dz * dz + dw * dw;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n }\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n newDst[3] = -v[3];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec4.clone})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n newDst[3] = v[3];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec4.copy})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n newDst[3] = a[3] * b[3];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n newDst[3] = a[3] / b[3];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform vec4 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec4 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec4Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = v[3];\n\n newDst[0] = m[0] * x + m[4] * y + m[ 8] * z + m[12] * w;\n newDst[1] = m[1] * x + m[5] * y + m[ 9] * z + m[13] * w;\n newDst[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n newDst[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n\n return newDst;\n}\n\n\n/**\n * Treat a 4D vector as a direction and set it's length\n *\n * @param a The vec4 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec4Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec4 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec4Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n zero,\n transformMat4,\n setLength,\n truncate,\n midpoint,\n};\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\n/**\n *\n * Vec4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Vec4`. In other words you can do this\n *\n * const v = vec4.cross(v1, v2); // Creates a new Vec4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = vec4.create();\n * vec4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * vec4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nexport function getAPI(Ctor: Vec4Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n\n","/**\n * Some docs\n * @namespace wgpu-matrix\n */\nimport {BaseArgType, ZeroArray} from './types';\nimport {Mat3Arg, Mat3Type, getAPI as getMat3API} from './mat3-impl';\nimport {Mat4Arg, Mat4Type, getAPI as getMat4API} from './mat4-impl';\nimport {QuatArg, QuatType, getAPI as getQuatAPI, RotationOrder} from './quat-impl';\nimport {Vec2Arg, Vec2Type, getAPI as getVec2API} from './vec2-impl';\nimport {Vec3Arg, Vec3Type, getAPI as getVec3API} from './vec3-impl';\nimport {Vec4Arg, Vec4Type, getAPI as getVec4API} from './vec4-impl';\nimport * as utils from './utils';\n\nexport {\n RotationOrder,\n utils,\n\n BaseArgType,\n\n Mat3Arg,\n Mat4Arg,\n QuatArg,\n Vec2Arg,\n Vec3Arg,\n Vec4Arg,\n\n Mat3Type,\n Mat4Type,\n QuatType,\n Vec2Type,\n Vec3Type,\n Vec4Type,\n};\n\nexport type BaseCtor = new (n: number) => T;\n\nexport type Mat3 = Mat3Type;\nexport type Mat4 = Mat4Type;\nexport type Quat = QuatType;\nexport type Vec2 = Vec2Type;\nexport type Vec3 = Vec3Type;\nexport type Vec4 = Vec4Type;\n\nexport type Mat3d = Mat3Type;\nexport type Mat4d = Mat4Type;\nexport type Quatd = QuatType;\nexport type Vec2d = Vec2Type;\nexport type Vec3d = Vec3Type;\nexport type Vec4d = Vec4Type;\n\nexport type Mat3n = Mat3Type;\nexport type Mat4n = Mat4Type;\nexport type Quatn = QuatType;\nexport type Vec2n = Vec2Type;\nexport type Vec3n = Vec3Type;\nexport type Vec4n = Vec4Type;\n\n/**\n * Generate wgpu-matrix API for type\n */\nfunction wgpuMatrixAPI<\n Mat3 extends BaseArgType,\n Mat4 extends BaseArgType,\n Quat extends BaseArgType,\n Vec2 extends BaseArgType,\n Vec3 extends BaseArgType,\n Vec4 extends BaseArgType,\n>(\n Mat3Ctor: BaseCtor,\n Mat4Ctor: BaseCtor,\n QuatCtor: BaseCtor,\n Vec2Ctor: BaseCtor,\n Vec3Ctor: BaseCtor,\n Vec4Ctor: BaseCtor,\n) {\n return {\n /** @namespace mat3 */\n mat3: getMat3API(Mat3Ctor),\n /** @namespace mat4 */\n mat4: getMat4API(Mat4Ctor),\n /** @namespace quat */\n quat: getQuatAPI(QuatCtor),\n /** @namespace vec2 */\n vec2: getVec2API(Vec2Ctor),\n /** @namespace vec3 */\n vec3: getVec3API(Vec3Ctor),\n /** @namespace vec4 */\n vec4: getVec4API(Vec4Ctor),\n };\n}\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat3,\n /**\n * 4x4 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat4,\n /**\n * Quaternion functions that default to returning `Float32Array`\n * @namespace\n */\n quat,\n /**\n * Vec2 functions that default to returning `Float32Array`\n * @namespace\n */\n vec2,\n /**\n * Vec3 functions that default to returning `Float32Array`\n * @namespace\n */\n vec3,\n /**\n * Vec3 functions that default to returning `Float32Array`\n * @namespace\n */\n vec4,\n} = wgpuMatrixAPI<\n Mat3, Mat4, Quat, Vec2, Vec3, Vec4>(\n Float32Array, Float32Array, Float32Array, Float32Array, Float32Array, Float32Array);\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat3: mat3d,\n /**\n * 4x4 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat4: mat4d,\n /**\n * Quaternion functions that default to returning `Float64Array`\n * @namespace\n */\n quat: quatd,\n /**\n * Vec2 functions that default to returning `Float64Array`\n * @namespace\n */\n vec2: vec2d,\n /**\n * Vec3 functions that default to returning `Float64Array`\n * @namespace\n */\n vec3: vec3d,\n /**\n * Vec3 functions that default to returning `Float64Array`\n * @namespace\n */\n vec4: vec4d,\n} = wgpuMatrixAPI<\n Mat3d, Mat4d, Quatd, Vec2d, Vec3d, Vec4d>(\n Float64Array, Float64Array, Float64Array, Float64Array, Float64Array, Float64Array);\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat3: mat3n,\n /**\n * 4x4 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat4: mat4n,\n /**\n * Quaternion functions that default to returning `number[]`\n * @namespace\n */\n quat: quatn,\n /**\n * Vec2 functions that default to returning `number[]`\n * @namespace\n */\n vec2: vec2n,\n /**\n * Vec3 functions that default to returning `number[]`\n * @namespace\n */\n vec3: vec3n,\n /**\n * Vec3 functions that default to returning `number[]`\n * @namespace\n */\n vec4: vec4n,\n} = wgpuMatrixAPI<\n Mat3n, Mat4n, Quatn, Vec2n, Vec3n, Vec4n>(\n ZeroArray, Array, Array, Array, Array, Array);\n"],"names":["getAPIImpl","utils.EPSILON","cache","getAPI","getVec2API","getVec3API","getMat3API","getMat4API","getQuatAPI","getVec4API"],"mappings":";AAMA,SAAS,eAAe,CACtB,mBAAsB,EACtB,QAA6C,EAAA;IAE7C,OAAO,cAAc,mBAAmB,CAAA;AACtC,QAAA,WAAA,CAAY,GAAG,IAAW,EAAA;AACxB,YAAA,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;YACf,QAAQ,CAAC,IAAuB,CAAC,CAAC;SACnC;AACG,KAAA,CAAC;AACT,CAAC;AAEM,MAAM,SAAS,GAAG,eAAe,EAAC,KAAa,GAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;;AClBvE;;;;;;;;;;;;;;;;;;;;AAoBG;AAEI,IAAI,OAAO,GAAG,QAAQ,CAAC;AAE9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ACH,IAAI,EAAE,KAAK;AACX;;;AAGG;AACH,IAAI,EAAE,KAAK;AACX;;;AAGG;AACH,IAAI,EAAE,KAAK;AACX;;;AAGG;AACH,IAAI,EAAE,KAAK;AACX;;;AAGG;AACH,IAAI,EAAE,KAAK;AACX;;;AAGG;AACH,IAAI,EAAE,KAAK,GACZ,GAAG,aAAa,CAEb,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE;AAE3E,MAAA;AACX;;;AAGG;AACH,IAAI,EAAE,KAAK;AACX;;;AAGG;AACH,IAAI,EAAE,KAAK;AACX;;;AAGG;AACH,IAAI,EAAE,KAAK;AACX;;;AAGG;AACH,IAAI,EAAE,KAAK;AACX;;;AAGG;AACH,IAAI,EAAE,KAAK;AACX;;;AAGG;AACH,IAAI,EAAE,KAAK,GACZ,GAAG,aAAa,CAEb,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;;;;"} \ No newline at end of file diff --git a/dist/3.x/wgpu-matrix.module.min.js b/dist/3.x/wgpu-matrix.module.min.js index 7a02009..ab2559e 100644 --- a/dist/3.x/wgpu-matrix.module.min.js +++ b/dist/3.x/wgpu-matrix.module.min.js @@ -1,2 +1,2 @@ -const n=(t=Array,r=n=>n.fill(0),class extends t{constructor(...n){super(...n),r(this)}});var t,r;let e=1e-6;var o={__proto__:null,get EPSILON(){return e},degToRad:function(n){return n*Math.PI/180},euclideanModulo:function(n,t){return(n%t+t)%t},inverseLerp:function(n,t,r){const o=t-n;return Math.abs(t-n)1e-5?(e[0]=o/u,e[1]=c/u):(e[0]=0,e[1]=0),e}function l(t,r){const e=r??new n(2);return e[0]=t[0],e[1]=t[1],e}function w(t,r,e){const o=e??new n(2);return o[0]=t[0]*r[0],o[1]=t[1]*r[1],o}function m(t,r,e){const o=e??new n(2);return o[0]=t[0]/r[0],o[1]=t[1]/r[1],o}function d(t,r,e){const o=e??new n(2);return h(t,o),c(o,r,o)}return{create:t,fromValues:t,set:function(t,r,e){const o=e??new n(2);return o[0]=t,o[1]=r,o},ceil:function(t,r){const e=r??new n(2);return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e},floor:function(t,r){const e=r??new n(2);return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e},round:function(t,r){const e=r??new n(2);return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e},clamp:function(t,r=0,e=1,o){const c=o??new n(2);return c[0]=Math.min(e,Math.max(r,t[0])),c[1]=Math.min(e,Math.max(r,t[1])),c},add:function(t,r,e){const o=e??new n(2);return o[0]=t[0]+r[0],o[1]=t[1]+r[1],o},addScaled:function(t,r,e,o){const c=o??new n(2);return c[0]=t[0]+r[0]*e,c[1]=t[1]+r[1]*e,c},angle:function(n,t){const r=n[0],e=n[1],o=t[0],c=t[1],u=Math.sqrt(r*r+e*e)*Math.sqrt(o*o+c*c),s=u&&a(n,t)/u;return Math.acos(s)},subtract:r,sub:r,equalsApproximately:function(n,t){return Math.abs(n[0]-t[0])r?d(t,r,o):l(t,o)},midpoint:function(t,r,e){return o(t,r,.5,e??new n(2))}}}(n),c.set(n,t)),t}const a=new Map;function s(n){let t=a.get(n);return t||(t=function(n){function t(t,r,e){const o=new n(3);return void 0!==t&&(o[0]=t,void 0!==r&&(o[1]=r,void 0!==e&&(o[2]=e))),o}function r(t,r,e){const o=e??new n(3);return o[0]=t[0]-r[0],o[1]=t[1]-r[1],o[2]=t[2]-r[2],o}function o(t,r,e,o){const c=o??new n(3);return c[0]=t[0]+e*(r[0]-t[0]),c[1]=t[1]+e*(r[1]-t[1]),c[2]=t[2]+e*(r[2]-t[2]),c}function c(t,r,e){const o=e??new n(3);return o[0]=t[0]*r,o[1]=t[1]*r,o[2]=t[2]*r,o}function u(t,r){const e=r??new n(3);return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function a(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function s(n){const t=n[0],r=n[1],e=n[2];return Math.sqrt(t*t+r*r+e*e)}function i(n){const t=n[0],r=n[1],e=n[2];return t*t+r*r+e*e}function f(n,t){const r=n[0]-t[0],e=n[1]-t[1],o=n[2]-t[2];return Math.sqrt(r*r+e*e+o*o)}function M(n,t){const r=n[0]-t[0],e=n[1]-t[1],o=n[2]-t[2];return r*r+e*e+o*o}function h(t,r){const e=r??new n(3),o=t[0],c=t[1],u=t[2],a=Math.sqrt(o*o+c*c+u*u);return a>1e-5?(e[0]=o/a,e[1]=c/a,e[2]=u/a):(e[0]=0,e[1]=0,e[2]=0),e}function l(t,r){const e=r??new n(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function w(t,r,e){const o=e??new n(3);return o[0]=t[0]*r[0],o[1]=t[1]*r[1],o[2]=t[2]*r[2],o}function m(t,r,e){const o=e??new n(3);return o[0]=t[0]/r[0],o[1]=t[1]/r[1],o[2]=t[2]/r[2],o}function d(t,r,e){const o=e??new n(3);return h(t,o),c(o,r,o)}return{create:t,fromValues:t,set:function(t,r,e,o){const c=o??new n(3);return c[0]=t,c[1]=r,c[2]=e,c},ceil:function(t,r){const e=r??new n(3);return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e},floor:function(t,r){const e=r??new n(3);return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e},round:function(t,r){const e=r??new n(3);return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e},clamp:function(t,r=0,e=1,o){const c=o??new n(3);return c[0]=Math.min(e,Math.max(r,t[0])),c[1]=Math.min(e,Math.max(r,t[1])),c[2]=Math.min(e,Math.max(r,t[2])),c},add:function(t,r,e){const o=e??new n(3);return o[0]=t[0]+r[0],o[1]=t[1]+r[1],o[2]=t[2]+r[2],o},addScaled:function(t,r,e,o){const c=o??new n(3);return c[0]=t[0]+r[0]*e,c[1]=t[1]+r[1]*e,c[2]=t[2]+r[2]*e,c},angle:function(n,t){const r=n[0],e=n[1],o=n[2],c=t[0],u=t[1],s=t[2],i=Math.sqrt(r*r+e*e+o*o)*Math.sqrt(c*c+u*u+s*s),f=i&&a(n,t)/i;return Math.acos(f)},subtract:r,sub:r,equalsApproximately:function(n,t){return Math.abs(n[0]-t[0])r?d(t,r,o):l(t,o)},midpoint:function(t,r,e){return o(t,r,.5,e??new n(3))}}}(n),a.set(n,t)),t}const i=new Map;function f(n){let t=i.get(n);return t||(t=function(n){const t=u(n),r=s(n);function o(t,r){const e=r??new n(12);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[8]=t[8],e[9]=t[9],e[10]=t[10],e}function c(t){const r=t??new n(12);return r[0]=1,r[1]=0,r[2]=0,r[4]=0,r[5]=1,r[6]=0,r[8]=0,r[9]=0,r[10]=1,r}function a(t,r){const e=r??new n(12),o=t[0],c=t[1],u=t[2],a=t[4],s=t[5],i=t[6],f=t[8],M=t[9],h=t[10],l=h*s-i*M,w=-h*a+i*f,m=M*a-s*f,d=1/(o*l+c*w+u*m);return e[0]=l*d,e[1]=(-h*c+u*M)*d,e[2]=(i*c-u*s)*d,e[4]=w*d,e[5]=(h*o-u*f)*d,e[6]=(-i*o+u*a)*d,e[8]=m*d,e[9]=(-M*o+c*f)*d,e[10]=(s*o-c*a)*d,e}function i(t,r,e){const o=e??new n(12),c=t[0],u=t[1],a=t[2],s=t[4],i=t[5],f=t[6],M=t[8],h=t[9],l=t[10],w=r[0],m=r[1],d=r[2],v=r[4],q=r[5],p=r[6],b=r[8],g=r[9],x=r[10];return o[0]=c*w+s*m+M*d,o[1]=u*w+i*m+h*d,o[2]=a*w+f*m+l*d,o[4]=c*v+s*q+M*p,o[5]=u*v+i*q+h*p,o[6]=a*v+f*q+l*p,o[8]=c*b+s*g+M*x,o[9]=u*b+i*g+h*x,o[10]=a*b+f*g+l*x,o}return{clone:o,create:function(t,r,e,o,c,u,a,s,i){const f=new n(12);return f[3]=0,f[7]=0,f[11]=0,void 0!==t&&(f[0]=t,void 0!==r&&(f[1]=r,void 0!==e&&(f[2]=e,void 0!==o&&(f[4]=o,void 0!==c&&(f[5]=c,void 0!==u&&(f[6]=u,void 0!==a&&(f[8]=a,void 0!==s&&(f[9]=s,void 0!==i&&(f[10]=i))))))))),f},set:function(t,r,e,o,c,u,a,s,i,f){const M=f??new n(12);return M[0]=t,M[1]=r,M[2]=e,M[3]=0,M[4]=o,M[5]=c,M[6]=u,M[7]=0,M[8]=a,M[9]=s,M[10]=i,M[11]=0,M},fromMat4:function(t,r){const e=r??new n(12);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=0,e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=0,e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=0,e},fromQuat:function(t,r){const e=r??new n(12),o=t[0],c=t[1],u=t[2],a=t[3],s=o+o,i=c+c,f=u+u,M=o*s,h=c*s,l=c*i,w=u*s,m=u*i,d=u*f,v=a*s,q=a*i,p=a*f;return e[0]=1-l-d,e[1]=h+p,e[2]=w-q,e[3]=0,e[4]=h-p,e[5]=1-M-d,e[6]=m+v,e[7]=0,e[8]=w+q,e[9]=m-v,e[10]=1-M-l,e[11]=0,e},negate:function(t,r){const e=r??new n(12);return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[8]=-t[8],e[9]=-t[9],e[10]=-t[10],e},copy:o,equalsApproximately:function(n,t){return Math.abs(n[0]-t[0])e){const n=Math.acos(v),t=Math.sin(n);M=Math.sin((1-o)*n)/t,h=Math.sin(o*n)/t}else M=1-o,h=o;return u[0]=M*a+h*l,u[1]=M*s+h*w,u[2]=M*i+h*m,u[3]=M*f+h*d,u}function f(t,r){const e=r??new n(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}const M=f;function h(t,r,e){const o=e??new n(4);return o[0]=t[0]-r[0],o[1]=t[1]-r[1],o[2]=t[2]-r[2],o[3]=t[3]-r[3],o}const l=h;function w(t,r,e){const o=e??new n(4);return o[0]=t[0]*r,o[1]=t[1]*r,o[2]=t[2]*r,o[3]=t[3]*r,o}const m=w;function d(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3]}function v(n){const t=n[0],r=n[1],e=n[2],o=n[3];return Math.sqrt(t*t+r*r+e*e+o*o)}const q=v;function p(n){const t=n[0],r=n[1],e=n[2],o=n[3];return t*t+r*r+e*e+o*o}const b=p;function g(t,r){const e=r??new n(4),o=t[0],c=t[1],u=t[2],a=t[3],s=Math.sqrt(o*o+c*c+u*u+a*a);return s>1e-5?(e[0]=o/s,e[1]=c/s,e[2]=u/s,e[3]=a/s):(e[0]=0,e[1]=0,e[2]=0,e[3]=1),e}const x=t.create(),y=t.create(),A=t.create(),S=new n(4),z=new n(4);return{create:r,fromValues:o,set:function(t,r,e,o,c){const u=c??new n(4);return u[0]=t,u[1]=r,u[2]=e,u[3]=o,u},fromAxisAngle:c,toAxisAngle:function(n,r){const o=r??t.create(3),c=2*Math.acos(n[3]),u=Math.sin(.5*c);return u>e?(o[0]=n[0]/u,o[1]=n[1]/u,o[2]=n[2]/u):(o[0]=1,o[1]=0,o[2]=0),{angle:c,axis:o}},angle:function(n,t){const r=d(n,t);return Math.acos(2*r*r-1)},multiply:u,mul:a,rotateX:function(t,r,e){const o=e??new n(4),c=.5*r,u=t[0],a=t[1],s=t[2],i=t[3],f=Math.sin(c),M=Math.cos(c);return o[0]=u*M+i*f,o[1]=a*M+s*f,o[2]=s*M-a*f,o[3]=i*M-u*f,o},rotateY:function(t,r,e){const o=e??new n(4),c=.5*r,u=t[0],a=t[1],s=t[2],i=t[3],f=Math.sin(c),M=Math.cos(c);return o[0]=u*M-s*f,o[1]=a*M+i*f,o[2]=s*M+u*f,o[3]=i*M-a*f,o},rotateZ:function(t,r,e){const o=e??new n(4),c=.5*r,u=t[0],a=t[1],s=t[2],i=t[3],f=Math.sin(c),M=Math.cos(c);return o[0]=u*M+a*f,o[1]=a*M-u*f,o[2]=s*M+i*f,o[3]=i*M-s*f,o},slerp:i,inverse:function(t,r){const e=r??new n(4),o=t[0],c=t[1],u=t[2],a=t[3],s=o*o+c*c+u*u+a*a,i=s?1/s:0;return e[0]=-o*i,e[1]=-c*i,e[2]=-u*i,e[3]=a*i,e},conjugate:function(t,r){const e=r??new n(4);return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e},fromMat:function(t,r){const e=r??new n(4),o=t[0]+t[5]+t[10];if(o>0){const n=Math.sqrt(o+1);e[3]=.5*n;const r=.5/n;e[0]=(t[6]-t[9])*r,e[1]=(t[8]-t[2])*r,e[2]=(t[1]-t[4])*r}else{let n=0;t[5]>t[0]&&(n=1),t[10]>t[4*n+n]&&(n=2);const r=(n+1)%3,o=(n+2)%3,c=Math.sqrt(t[4*n+n]-t[4*r+r]-t[4*o+o]+1);e[n]=.5*c;const u=.5/c;e[3]=(t[4*r+o]-t[4*o+r])*u,e[r]=(t[4*r+n]+t[4*n+r])*u,e[o]=(t[4*o+n]+t[4*n+o])*u}return e},fromEuler:function(t,r,e,o,c){const u=c??new n(4),a=.5*t,s=.5*r,i=.5*e,f=Math.sin(a),M=Math.cos(a),h=Math.sin(s),l=Math.cos(s),w=Math.sin(i),m=Math.cos(i);switch(o){case"xyz":u[0]=f*l*m+M*h*w,u[1]=M*h*m-f*l*w,u[2]=M*l*w+f*h*m,u[3]=M*l*m-f*h*w;break;case"xzy":u[0]=f*l*m-M*h*w,u[1]=M*h*m-f*l*w,u[2]=M*l*w+f*h*m,u[3]=M*l*m+f*h*w;break;case"yxz":u[0]=f*l*m+M*h*w,u[1]=M*h*m-f*l*w,u[2]=M*l*w-f*h*m,u[3]=M*l*m+f*h*w;break;case"yzx":u[0]=f*l*m+M*h*w,u[1]=M*h*m+f*l*w,u[2]=M*l*w-f*h*m,u[3]=M*l*m-f*h*w;break;case"zxy":u[0]=f*l*m-M*h*w,u[1]=M*h*m+f*l*w,u[2]=M*l*w+f*h*m,u[3]=M*l*m-f*h*w;break;case"zyx":u[0]=f*l*m-M*h*w,u[1]=M*h*m+f*l*w,u[2]=M*l*w-f*h*m,u[3]=M*l*m+f*h*w;break;default:throw new Error(`Unknown rotation order: ${o}`)}return u},copy:f,clone:M,add:function(t,r,e){const o=e??new n(4);return o[0]=t[0]+r[0],o[1]=t[1]+r[1],o[2]=t[2]+r[2],o[3]=t[3]+r[3],o},subtract:h,sub:l,mulScalar:w,scale:m,divScalar:function(t,r,e){const o=e??new n(4);return o[0]=t[0]/r,o[1]=t[1]/r,o[2]=t[2]/r,o[3]=t[3]/r,o},dot:d,lerp:function(t,r,e,o){const c=o??new n(4);return c[0]=t[0]+e*(r[0]-t[0]),c[1]=t[1]+e*(r[1]-t[1]),c[2]=t[2]+e*(r[2]-t[2]),c[3]=t[3]+e*(r[3]-t[3]),c},length:v,len:q,lengthSq:p,lenSq:b,normalize:g,equalsApproximately:function(n,t){return Math.abs(n[0]-t[0]).999999?(u[0]=0,u[1]=0,u[2]=0,u[3]=1,u):(t.cross(r,e,x),u[0]=x[0],u[1]=x[1],u[2]=x[2],u[3]=1+a,g(u,u))},sqlerp:function(t,r,e,o,c,u){const a=u??new n(4);return i(t,o,c,S),i(r,e,c,z),i(S,z,2*c*(1-c),a),a}}}(n),l.set(n,t)),t}const m=new Map;function d(n){let t=m.get(n);return t||(t=function(n){function t(t,r,e,o){const c=new n(4);return void 0!==t&&(c[0]=t,void 0!==r&&(c[1]=r,void 0!==e&&(c[2]=e,void 0!==o&&(c[3]=o)))),c}function r(t,r,e){const o=e??new n(4);return o[0]=t[0]-r[0],o[1]=t[1]-r[1],o[2]=t[2]-r[2],o[3]=t[3]-r[3],o}function o(t,r,e,o){const c=o??new n(4);return c[0]=t[0]+e*(r[0]-t[0]),c[1]=t[1]+e*(r[1]-t[1]),c[2]=t[2]+e*(r[2]-t[2]),c[3]=t[3]+e*(r[3]-t[3]),c}function c(t,r,e){const o=e??new n(4);return o[0]=t[0]*r,o[1]=t[1]*r,o[2]=t[2]*r,o[3]=t[3]*r,o}function u(t,r){const e=r??new n(4);return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}function a(n){const t=n[0],r=n[1],e=n[2],o=n[3];return Math.sqrt(t*t+r*r+e*e+o*o)}function s(n){const t=n[0],r=n[1],e=n[2],o=n[3];return t*t+r*r+e*e+o*o}function i(n,t){const r=n[0]-t[0],e=n[1]-t[1],o=n[2]-t[2],c=n[3]-t[3];return Math.sqrt(r*r+e*e+o*o+c*c)}function f(n,t){const r=n[0]-t[0],e=n[1]-t[1],o=n[2]-t[2],c=n[3]-t[3];return r*r+e*e+o*o+c*c}function M(t,r){const e=r??new n(4),o=t[0],c=t[1],u=t[2],a=t[3],s=Math.sqrt(o*o+c*c+u*u+a*a);return s>1e-5?(e[0]=o/s,e[1]=c/s,e[2]=u/s,e[3]=a/s):(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function h(t,r){const e=r??new n(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function l(t,r,e){const o=e??new n(4);return o[0]=t[0]*r[0],o[1]=t[1]*r[1],o[2]=t[2]*r[2],o[3]=t[3]*r[3],o}function w(t,r,e){const o=e??new n(4);return o[0]=t[0]/r[0],o[1]=t[1]/r[1],o[2]=t[2]/r[2],o[3]=t[3]/r[3],o}function m(t,r,e){const o=e??new n(4);return M(t,o),c(o,r,o)}return{create:t,fromValues:t,set:function(t,r,e,o,c){const u=c??new n(4);return u[0]=t,u[1]=r,u[2]=e,u[3]=o,u},ceil:function(t,r){const e=r??new n(4);return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e},floor:function(t,r){const e=r??new n(4);return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e},round:function(t,r){const e=r??new n(4);return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e},clamp:function(t,r=0,e=1,o){const c=o??new n(4);return c[0]=Math.min(e,Math.max(r,t[0])),c[1]=Math.min(e,Math.max(r,t[1])),c[2]=Math.min(e,Math.max(r,t[2])),c[3]=Math.min(e,Math.max(r,t[3])),c},add:function(t,r,e){const o=e??new n(4);return o[0]=t[0]+r[0],o[1]=t[1]+r[1],o[2]=t[2]+r[2],o[3]=t[3]+r[3],o},addScaled:function(t,r,e,o){const c=o??new n(4);return c[0]=t[0]+r[0]*e,c[1]=t[1]+r[1]*e,c[2]=t[2]+r[2]*e,c[3]=t[3]+r[3]*e,c},subtract:r,sub:r,equalsApproximately:function(n,t){return Math.abs(n[0]-t[0])r?m(t,r,o):h(t,o)},midpoint:function(t,r,e){return o(t,r,.5,e??new n(4))}}}(n),m.set(n,t)),t}function v(n,t,r,e,o,c){return{mat3:f(n),mat4:h(t),quat:w(r),vec2:u(e),vec3:s(o),vec4:d(c)}}const{mat3:q,mat4:p,quat:b,vec2:g,vec3:x,vec4:y}=v(Float32Array,Float32Array,Float32Array,Float32Array,Float32Array,Float32Array),{mat3:A,mat4:S,quat:z,vec2:F,vec3:k,vec4:T}=v(Float64Array,Float64Array,Float64Array,Float64Array,Float64Array,Float64Array),{mat3:I,mat4:P,quat:V,vec2:Z,vec3:L,vec4:R}=v(n,Array,Array,Array,Array,Array);export{q as mat3,A as mat3d,I as mat3n,p as mat4,S as mat4d,P as mat4n,b as quat,z as quatd,V as quatn,o as utils,g as vec2,F as vec2d,Z as vec2n,x as vec3,k as vec3d,L as vec3n,y as vec4,T as vec4d,R as vec4n}; +const n=(t=Array,r=n=>n.fill(0),class extends t{constructor(...n){super(...n),r(this)}});var t,r;let e=1e-6;var o={__proto__:null,get EPSILON(){return e},degToRad:function(n){return n*Math.PI/180},euclideanModulo:function(n,t){return(n%t+t)%t},inverseLerp:function(n,t,r){const o=t-n;return Math.abs(t-n)1e-5?(e[0]=o/u,e[1]=c/u):(e[0]=0,e[1]=0),e}function l(t,r){const e=r??new n(2);return e[0]=t[0],e[1]=t[1],e}function w(t,r,e){const o=e??new n(2);return o[0]=t[0]*r[0],o[1]=t[1]*r[1],o}function m(t,r,e){const o=e??new n(2);return o[0]=t[0]/r[0],o[1]=t[1]/r[1],o}function d(t,r,e){const o=e??new n(2);return h(t,o),c(o,r,o)}return{create:t,fromValues:t,set:function(t,r,e){const o=e??new n(2);return o[0]=t,o[1]=r,o},ceil:function(t,r){const e=r??new n(2);return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e},floor:function(t,r){const e=r??new n(2);return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e},round:function(t,r){const e=r??new n(2);return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e},clamp:function(t,r=0,e=1,o){const c=o??new n(2);return c[0]=Math.min(e,Math.max(r,t[0])),c[1]=Math.min(e,Math.max(r,t[1])),c},add:function(t,r,e){const o=e??new n(2);return o[0]=t[0]+r[0],o[1]=t[1]+r[1],o},addScaled:function(t,r,e,o){const c=o??new n(2);return c[0]=t[0]+r[0]*e,c[1]=t[1]+r[1]*e,c},angle:function(n,t){const r=n[0],e=n[1],o=t[0],c=t[1],u=Math.sqrt(r*r+e*e)*Math.sqrt(o*o+c*c),s=u&&a(n,t)/u;return Math.acos(s)},subtract:r,sub:r,equalsApproximately:function(n,t){return Math.abs(n[0]-t[0])r?d(t,r,o):l(t,o)},midpoint:function(t,r,e){return o(t,r,.5,e??new n(2))}}}(n),c.set(n,t)),t}const a=new Map;function s(n){let t=a.get(n);return t||(t=function(n){function t(t,r,e){const o=new n(3);return void 0!==t&&(o[0]=t,void 0!==r&&(o[1]=r,void 0!==e&&(o[2]=e))),o}function r(t,r,e){const o=e??new n(3);return o[0]=t[0]-r[0],o[1]=t[1]-r[1],o[2]=t[2]-r[2],o}function o(t,r,e,o){const c=o??new n(3);return c[0]=t[0]+e*(r[0]-t[0]),c[1]=t[1]+e*(r[1]-t[1]),c[2]=t[2]+e*(r[2]-t[2]),c}function c(t,r,e){const o=e??new n(3);return o[0]=t[0]*r,o[1]=t[1]*r,o[2]=t[2]*r,o}function u(t,r){const e=r??new n(3);return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function a(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function s(n){const t=n[0],r=n[1],e=n[2];return Math.sqrt(t*t+r*r+e*e)}function i(n){const t=n[0],r=n[1],e=n[2];return t*t+r*r+e*e}function f(n,t){const r=n[0]-t[0],e=n[1]-t[1],o=n[2]-t[2];return Math.sqrt(r*r+e*e+o*o)}function M(n,t){const r=n[0]-t[0],e=n[1]-t[1],o=n[2]-t[2];return r*r+e*e+o*o}function h(t,r){const e=r??new n(3),o=t[0],c=t[1],u=t[2],a=Math.sqrt(o*o+c*c+u*u);return a>1e-5?(e[0]=o/a,e[1]=c/a,e[2]=u/a):(e[0]=0,e[1]=0,e[2]=0),e}function l(t,r){const e=r??new n(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function w(t,r,e){const o=e??new n(3);return o[0]=t[0]*r[0],o[1]=t[1]*r[1],o[2]=t[2]*r[2],o}function m(t,r,e){const o=e??new n(3);return o[0]=t[0]/r[0],o[1]=t[1]/r[1],o[2]=t[2]/r[2],o}function d(t,r,e){const o=e??new n(3);return h(t,o),c(o,r,o)}return{create:t,fromValues:t,set:function(t,r,e,o){const c=o??new n(3);return c[0]=t,c[1]=r,c[2]=e,c},ceil:function(t,r){const e=r??new n(3);return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e},floor:function(t,r){const e=r??new n(3);return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e},round:function(t,r){const e=r??new n(3);return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e},clamp:function(t,r=0,e=1,o){const c=o??new n(3);return c[0]=Math.min(e,Math.max(r,t[0])),c[1]=Math.min(e,Math.max(r,t[1])),c[2]=Math.min(e,Math.max(r,t[2])),c},add:function(t,r,e){const o=e??new n(3);return o[0]=t[0]+r[0],o[1]=t[1]+r[1],o[2]=t[2]+r[2],o},addScaled:function(t,r,e,o){const c=o??new n(3);return c[0]=t[0]+r[0]*e,c[1]=t[1]+r[1]*e,c[2]=t[2]+r[2]*e,c},angle:function(n,t){const r=n[0],e=n[1],o=n[2],c=t[0],u=t[1],s=t[2],i=Math.sqrt(r*r+e*e+o*o)*Math.sqrt(c*c+u*u+s*s),f=i&&a(n,t)/i;return Math.acos(f)},subtract:r,sub:r,equalsApproximately:function(n,t){return Math.abs(n[0]-t[0])r?d(t,r,o):l(t,o)},midpoint:function(t,r,e){return o(t,r,.5,e??new n(3))}}}(n),a.set(n,t)),t}const i=new Map;function f(n){let t=i.get(n);return t||(t=function(n){const t=u(n),r=s(n);function o(t,r){const e=r??new n(12);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[8]=t[8],e[9]=t[9],e[10]=t[10],e}function c(t){const r=t??new n(12);return r[0]=1,r[1]=0,r[2]=0,r[4]=0,r[5]=1,r[6]=0,r[8]=0,r[9]=0,r[10]=1,r}function a(t,r){const e=r??new n(12),o=t[0],c=t[1],u=t[2],a=t[4],s=t[5],i=t[6],f=t[8],M=t[9],h=t[10],l=h*s-i*M,w=-h*a+i*f,m=M*a-s*f,d=1/(o*l+c*w+u*m);return e[0]=l*d,e[1]=(-h*c+u*M)*d,e[2]=(i*c-u*s)*d,e[4]=w*d,e[5]=(h*o-u*f)*d,e[6]=(-i*o+u*a)*d,e[8]=m*d,e[9]=(-M*o+c*f)*d,e[10]=(s*o-c*a)*d,e}function i(t,r,e){const o=e??new n(12),c=t[0],u=t[1],a=t[2],s=t[4],i=t[5],f=t[6],M=t[8],h=t[9],l=t[10],w=r[0],m=r[1],d=r[2],v=r[4],q=r[5],p=r[6],b=r[8],g=r[9],x=r[10];return o[0]=c*w+s*m+M*d,o[1]=u*w+i*m+h*d,o[2]=a*w+f*m+l*d,o[4]=c*v+s*q+M*p,o[5]=u*v+i*q+h*p,o[6]=a*v+f*q+l*p,o[8]=c*b+s*g+M*x,o[9]=u*b+i*g+h*x,o[10]=a*b+f*g+l*x,o}function f(t,r){const e=r??new n(12),o=Math.cos(t),c=Math.sin(t);return e[0]=o,e[1]=c,e[2]=0,e[4]=-c,e[5]=o,e[6]=0,e[8]=0,e[9]=0,e[10]=1,e}function M(t,r,e){const o=e??new n(12),c=t[0],u=t[1],a=t[2],s=t[4],i=t[5],f=t[6],M=Math.cos(r),h=Math.sin(r);return o[0]=M*c+h*s,o[1]=M*u+h*i,o[2]=M*a+h*f,o[4]=M*s-h*c,o[5]=M*i-h*u,o[6]=M*f-h*a,t!==o&&(o[8]=t[8],o[9]=t[9],o[10]=t[10]),o}return{clone:o,create:function(t,r,e,o,c,u,a,s,i){const f=new n(12);return f[3]=0,f[7]=0,f[11]=0,void 0!==t&&(f[0]=t,void 0!==r&&(f[1]=r,void 0!==e&&(f[2]=e,void 0!==o&&(f[4]=o,void 0!==c&&(f[5]=c,void 0!==u&&(f[6]=u,void 0!==a&&(f[8]=a,void 0!==s&&(f[9]=s,void 0!==i&&(f[10]=i))))))))),f},set:function(t,r,e,o,c,u,a,s,i,f){const M=f??new n(12);return M[0]=t,M[1]=r,M[2]=e,M[3]=0,M[4]=o,M[5]=c,M[6]=u,M[7]=0,M[8]=a,M[9]=s,M[10]=i,M[11]=0,M},fromMat4:function(t,r){const e=r??new n(12);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=0,e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=0,e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=0,e},fromQuat:function(t,r){const e=r??new n(12),o=t[0],c=t[1],u=t[2],a=t[3],s=o+o,i=c+c,f=u+u,M=o*s,h=c*s,l=c*i,w=u*s,m=u*i,d=u*f,v=a*s,q=a*i,p=a*f;return e[0]=1-l-d,e[1]=h+p,e[2]=w-q,e[3]=0,e[4]=h-p,e[5]=1-M-d,e[6]=m+v,e[7]=0,e[8]=w+q,e[9]=m-v,e[10]=1-M-l,e[11]=0,e},negate:function(t,r){const e=r??new n(12);return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[8]=-t[8],e[9]=-t[9],e[10]=-t[10],e},copy:o,equalsApproximately:function(n,t){return Math.abs(n[0]-t[0])e){const n=Math.acos(v),t=Math.sin(n);M=Math.sin((1-o)*n)/t,h=Math.sin(o*n)/t}else M=1-o,h=o;return u[0]=M*a+h*l,u[1]=M*s+h*w,u[2]=M*i+h*m,u[3]=M*f+h*d,u}function f(t,r){const e=r??new n(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}const M=f;function h(t,r,e){const o=e??new n(4);return o[0]=t[0]-r[0],o[1]=t[1]-r[1],o[2]=t[2]-r[2],o[3]=t[3]-r[3],o}const l=h;function w(t,r,e){const o=e??new n(4);return o[0]=t[0]*r,o[1]=t[1]*r,o[2]=t[2]*r,o[3]=t[3]*r,o}const m=w;function d(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3]}function v(n){const t=n[0],r=n[1],e=n[2],o=n[3];return Math.sqrt(t*t+r*r+e*e+o*o)}const q=v;function p(n){const t=n[0],r=n[1],e=n[2],o=n[3];return t*t+r*r+e*e+o*o}const b=p;function g(t,r){const e=r??new n(4),o=t[0],c=t[1],u=t[2],a=t[3],s=Math.sqrt(o*o+c*c+u*u+a*a);return s>1e-5?(e[0]=o/s,e[1]=c/s,e[2]=u/s,e[3]=a/s):(e[0]=0,e[1]=0,e[2]=0,e[3]=1),e}const x=t.create(),y=t.create(),S=t.create(),A=new n(4),z=new n(4);return{create:r,fromValues:o,set:function(t,r,e,o,c){const u=c??new n(4);return u[0]=t,u[1]=r,u[2]=e,u[3]=o,u},fromAxisAngle:c,toAxisAngle:function(n,r){const o=r??t.create(3),c=2*Math.acos(n[3]),u=Math.sin(.5*c);return u>e?(o[0]=n[0]/u,o[1]=n[1]/u,o[2]=n[2]/u):(o[0]=1,o[1]=0,o[2]=0),{angle:c,axis:o}},angle:function(n,t){const r=d(n,t);return Math.acos(2*r*r-1)},multiply:u,mul:a,rotateX:function(t,r,e){const o=e??new n(4),c=.5*r,u=t[0],a=t[1],s=t[2],i=t[3],f=Math.sin(c),M=Math.cos(c);return o[0]=u*M+i*f,o[1]=a*M+s*f,o[2]=s*M-a*f,o[3]=i*M-u*f,o},rotateY:function(t,r,e){const o=e??new n(4),c=.5*r,u=t[0],a=t[1],s=t[2],i=t[3],f=Math.sin(c),M=Math.cos(c);return o[0]=u*M-s*f,o[1]=a*M+i*f,o[2]=s*M+u*f,o[3]=i*M-a*f,o},rotateZ:function(t,r,e){const o=e??new n(4),c=.5*r,u=t[0],a=t[1],s=t[2],i=t[3],f=Math.sin(c),M=Math.cos(c);return o[0]=u*M+a*f,o[1]=a*M-u*f,o[2]=s*M+i*f,o[3]=i*M-s*f,o},slerp:i,inverse:function(t,r){const e=r??new n(4),o=t[0],c=t[1],u=t[2],a=t[3],s=o*o+c*c+u*u+a*a,i=s?1/s:0;return e[0]=-o*i,e[1]=-c*i,e[2]=-u*i,e[3]=a*i,e},conjugate:function(t,r){const e=r??new n(4);return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e},fromMat:function(t,r){const e=r??new n(4),o=t[0]+t[5]+t[10];if(o>0){const n=Math.sqrt(o+1);e[3]=.5*n;const r=.5/n;e[0]=(t[6]-t[9])*r,e[1]=(t[8]-t[2])*r,e[2]=(t[1]-t[4])*r}else{let n=0;t[5]>t[0]&&(n=1),t[10]>t[4*n+n]&&(n=2);const r=(n+1)%3,o=(n+2)%3,c=Math.sqrt(t[4*n+n]-t[4*r+r]-t[4*o+o]+1);e[n]=.5*c;const u=.5/c;e[3]=(t[4*r+o]-t[4*o+r])*u,e[r]=(t[4*r+n]+t[4*n+r])*u,e[o]=(t[4*o+n]+t[4*n+o])*u}return e},fromEuler:function(t,r,e,o,c){const u=c??new n(4),a=.5*t,s=.5*r,i=.5*e,f=Math.sin(a),M=Math.cos(a),h=Math.sin(s),l=Math.cos(s),w=Math.sin(i),m=Math.cos(i);switch(o){case"xyz":u[0]=f*l*m+M*h*w,u[1]=M*h*m-f*l*w,u[2]=M*l*w+f*h*m,u[3]=M*l*m-f*h*w;break;case"xzy":u[0]=f*l*m-M*h*w,u[1]=M*h*m-f*l*w,u[2]=M*l*w+f*h*m,u[3]=M*l*m+f*h*w;break;case"yxz":u[0]=f*l*m+M*h*w,u[1]=M*h*m-f*l*w,u[2]=M*l*w-f*h*m,u[3]=M*l*m+f*h*w;break;case"yzx":u[0]=f*l*m+M*h*w,u[1]=M*h*m+f*l*w,u[2]=M*l*w-f*h*m,u[3]=M*l*m-f*h*w;break;case"zxy":u[0]=f*l*m-M*h*w,u[1]=M*h*m+f*l*w,u[2]=M*l*w+f*h*m,u[3]=M*l*m-f*h*w;break;case"zyx":u[0]=f*l*m-M*h*w,u[1]=M*h*m+f*l*w,u[2]=M*l*w-f*h*m,u[3]=M*l*m+f*h*w;break;default:throw new Error(`Unknown rotation order: ${o}`)}return u},copy:f,clone:M,add:function(t,r,e){const o=e??new n(4);return o[0]=t[0]+r[0],o[1]=t[1]+r[1],o[2]=t[2]+r[2],o[3]=t[3]+r[3],o},subtract:h,sub:l,mulScalar:w,scale:m,divScalar:function(t,r,e){const o=e??new n(4);return o[0]=t[0]/r,o[1]=t[1]/r,o[2]=t[2]/r,o[3]=t[3]/r,o},dot:d,lerp:function(t,r,e,o){const c=o??new n(4);return c[0]=t[0]+e*(r[0]-t[0]),c[1]=t[1]+e*(r[1]-t[1]),c[2]=t[2]+e*(r[2]-t[2]),c[3]=t[3]+e*(r[3]-t[3]),c},length:v,len:q,lengthSq:p,lenSq:b,normalize:g,equalsApproximately:function(n,t){return Math.abs(n[0]-t[0]).999999?(u[0]=0,u[1]=0,u[2]=0,u[3]=1,u):(t.cross(r,e,x),u[0]=x[0],u[1]=x[1],u[2]=x[2],u[3]=1+a,g(u,u))},sqlerp:function(t,r,e,o,c,u){const a=u??new n(4);return i(t,o,c,A),i(r,e,c,z),i(A,z,2*c*(1-c),a),a}}}(n),l.set(n,t)),t}const m=new Map;function d(n){let t=m.get(n);return t||(t=function(n){function t(t,r,e,o){const c=new n(4);return void 0!==t&&(c[0]=t,void 0!==r&&(c[1]=r,void 0!==e&&(c[2]=e,void 0!==o&&(c[3]=o)))),c}function r(t,r,e){const o=e??new n(4);return o[0]=t[0]-r[0],o[1]=t[1]-r[1],o[2]=t[2]-r[2],o[3]=t[3]-r[3],o}function o(t,r,e,o){const c=o??new n(4);return c[0]=t[0]+e*(r[0]-t[0]),c[1]=t[1]+e*(r[1]-t[1]),c[2]=t[2]+e*(r[2]-t[2]),c[3]=t[3]+e*(r[3]-t[3]),c}function c(t,r,e){const o=e??new n(4);return o[0]=t[0]*r,o[1]=t[1]*r,o[2]=t[2]*r,o[3]=t[3]*r,o}function u(t,r){const e=r??new n(4);return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}function a(n){const t=n[0],r=n[1],e=n[2],o=n[3];return Math.sqrt(t*t+r*r+e*e+o*o)}function s(n){const t=n[0],r=n[1],e=n[2],o=n[3];return t*t+r*r+e*e+o*o}function i(n,t){const r=n[0]-t[0],e=n[1]-t[1],o=n[2]-t[2],c=n[3]-t[3];return Math.sqrt(r*r+e*e+o*o+c*c)}function f(n,t){const r=n[0]-t[0],e=n[1]-t[1],o=n[2]-t[2],c=n[3]-t[3];return r*r+e*e+o*o+c*c}function M(t,r){const e=r??new n(4),o=t[0],c=t[1],u=t[2],a=t[3],s=Math.sqrt(o*o+c*c+u*u+a*a);return s>1e-5?(e[0]=o/s,e[1]=c/s,e[2]=u/s,e[3]=a/s):(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function h(t,r){const e=r??new n(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function l(t,r,e){const o=e??new n(4);return o[0]=t[0]*r[0],o[1]=t[1]*r[1],o[2]=t[2]*r[2],o[3]=t[3]*r[3],o}function w(t,r,e){const o=e??new n(4);return o[0]=t[0]/r[0],o[1]=t[1]/r[1],o[2]=t[2]/r[2],o[3]=t[3]/r[3],o}function m(t,r,e){const o=e??new n(4);return M(t,o),c(o,r,o)}return{create:t,fromValues:t,set:function(t,r,e,o,c){const u=c??new n(4);return u[0]=t,u[1]=r,u[2]=e,u[3]=o,u},ceil:function(t,r){const e=r??new n(4);return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e},floor:function(t,r){const e=r??new n(4);return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e},round:function(t,r){const e=r??new n(4);return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e},clamp:function(t,r=0,e=1,o){const c=o??new n(4);return c[0]=Math.min(e,Math.max(r,t[0])),c[1]=Math.min(e,Math.max(r,t[1])),c[2]=Math.min(e,Math.max(r,t[2])),c[3]=Math.min(e,Math.max(r,t[3])),c},add:function(t,r,e){const o=e??new n(4);return o[0]=t[0]+r[0],o[1]=t[1]+r[1],o[2]=t[2]+r[2],o[3]=t[3]+r[3],o},addScaled:function(t,r,e,o){const c=o??new n(4);return c[0]=t[0]+r[0]*e,c[1]=t[1]+r[1]*e,c[2]=t[2]+r[2]*e,c[3]=t[3]+r[3]*e,c},subtract:r,sub:r,equalsApproximately:function(n,t){return Math.abs(n[0]-t[0])r?m(t,r,o):h(t,o)},midpoint:function(t,r,e){return o(t,r,.5,e??new n(4))}}}(n),m.set(n,t)),t}function v(n,t,r,e,o,c){return{mat3:f(n),mat4:h(t),quat:w(r),vec2:u(e),vec3:s(o),vec4:d(c)}}const{mat3:q,mat4:p,quat:b,vec2:g,vec3:x,vec4:y}=v(Float32Array,Float32Array,Float32Array,Float32Array,Float32Array,Float32Array),{mat3:S,mat4:A,quat:z,vec2:F,vec3:k,vec4:T}=v(Float64Array,Float64Array,Float64Array,Float64Array,Float64Array,Float64Array),{mat3:Z,mat4:I,quat:P,vec2:V,vec3:D,vec4:X}=v(n,Array,Array,Array,Array,Array);export{q as mat3,S as mat3d,Z as mat3n,p as mat4,A as mat4d,I as mat4n,b as quat,z as quatd,P as quatn,o as utils,g as vec2,F as vec2d,V as vec2n,x as vec3,k as vec3d,D as vec3n,y as vec4,T as vec4d,X as vec4n}; //# sourceMappingURL=wgpu-matrix.module.min.js.map diff --git a/dist/3.x/wgpu-matrix.module.min.js.map b/dist/3.x/wgpu-matrix.module.min.js.map index c2d1801..7859fbb 100644 --- a/dist/3.x/wgpu-matrix.module.min.js.map +++ b/dist/3.x/wgpu-matrix.module.min.js.map @@ -1 +1 @@ -{"version":3,"file":"wgpu-matrix.module.min.js","sources":["../../../src/types.ts","../../../src/utils.ts","../../../src/vec2-impl.ts","../../../src/vec3-impl.ts","../../../src/mat3-impl.ts","../../../src/mat4-impl.ts","../../../src/quat-impl.ts","../../../src/vec4-impl.ts","../../../src/wgpu-matrix.ts"],"sourcesContent":["/**\n * The types you can pass to most functions that take an\n * array of numbers.\n */\nexport type BaseArgType = Float32Array | Float64Array | number[];\n\nfunction wrapConstructor any>(\n OriginalConstructor: T,\n modifier: (instance: InstanceType) => void\n): T {\n return class extends OriginalConstructor {\n constructor(...args: any[]) {\n super(...args);\n modifier(this as InstanceType);\n }\n } as T; // Type assertion is necessary here\n}\n\nexport const ZeroArray = wrapConstructor(Array, a => a.fill(0));\n\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nexport let EPSILON = 0.000001;\n\n/**\n * Set the value for EPSILON for various checks\n * @param v - Value to use for EPSILON.\n * @returns previous value of EPSILON;\n */\nexport function setEpsilon(v: number): number {\n const old = EPSILON;\n EPSILON = v;\n return old;\n}\n\n/**\n * Convert degrees to radians\n * @param degrees - Angle in degrees\n * @returns angle converted to radians\n */\nexport function degToRad(degrees: number): number {\n return degrees * Math.PI / 180;\n}\n\n/**\n * Convert radians to degrees\n * @param radians - Angle in radians\n * @returns angle converted to degrees\n */\nexport function radToDeg(radians: number): number {\n return radians * 180 / Math.PI;\n}\n\n/**\n * Lerps between a and b via t\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @returns a + (b - a) * t\n */\nexport function lerp(a: number, b: number, t: number): number {\n return a + (b - a) * t;\n}\n\n/**\n * Compute the opposite of lerp. Given a and b and a value between\n * a and b returns a value between 0 and 1. 0 if a, 1 if b.\n * Note: no clamping is done.\n * @param a - start value\n * @param b - end value\n * @param v - value between a and b\n * @returns (v - a) / (b - a)\n */\nexport function inverseLerp(a: number, b: number, v: number): number {\n const d = b - a;\n return (Math.abs(b - a) < EPSILON)\n ? a\n : (v - a) / d;\n}\n\n/**\n * Compute the euclidean modulo\n *\n * ```\n * // table for n / 3\n * -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 <- n\n * ------------------------------------\n * -2 -1 -0 -2 -1 0, 1, 2, 0, 1, 2 <- n % 3\n * 1 2 0 1 2 0, 1, 2, 0, 1, 2 <- euclideanModule(n, 3)\n * ```\n *\n * @param n - dividend\n * @param m - divisor\n * @returns the euclidean modulo of n / m\n */\nexport function euclideanModulo(n: number, m: number) {\n return ((n % m) + m) % m;\n}","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Mat3Arg } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { Vec2Arg, Vec2Type } from './vec2';\nimport { Vec3Arg } from './vec3';\nimport { BaseArgType } from './types';\n\nexport { Vec2Arg, Vec2Type };\n\ntype Vec2Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec3\n */\nfunction getAPIImpl(Ctor: Vec2Ctor) {\n\n/**\n * Creates a Vec2; may be called with x, y, z to set initial values.\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Vec2's specified type\n * it would be faster to use\n *\n * ```\n * const v = vec2.clone(someJSArray);\n * ```\n *\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\nfunction create(x = 0, y = 0) {\n const newDst = new Ctor(2);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n }\n }\n return newDst;\n}\n\n/**\n * Creates a Vec2; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec2\n * Also see {@link vec2.create} and {@link vec2.copy}\n *\n * @param x first value\n * @param y second value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec2Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec2Arg, b: Vec2Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n\n return newDst;\n}\n\n/**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\nfunction angle(a: Vec2Arg, b: Vec2Arg): number {\n const ax = a[0];\n const ay = a[1];\n const bx = b[0];\n const by = b[1];\n const mag1 = Math.sqrt(ax * ax + ay * ay);\n const mag2 = Math.sqrt(bx * bx + by * by);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec2Arg, b: Vec2Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec2Arg, b: Vec2Arg): boolean {\n return a[0] === b[0] && a[1] === b[1];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec2Arg, b: Vec2Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec2Arg, b: Vec2Arg, t: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec2Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec2Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\nfunction cross(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const z = a[0] * b[1] - a[1] * b[0];\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = z;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec2Arg, b: Vec2Arg): number {\n return a[0] * b[0] + a[1] * b[1];\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec2Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n return Math.sqrt(v0 * v0 + v1 * v1);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec2Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n return v0 * v0 + v1 * v1;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec2Arg, b: Vec2Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return Math.sqrt(dx * dx + dy * dy);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec2Arg, b: Vec2Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return dx * dx + dy * dy;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const len = Math.sqrt(v0 * v0 + v1 * v1);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n }\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec2.clone})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec2.copy})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Creates a random unit vector * scale\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\nfunction random(scale = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const angle = Math.random() * 2 * Math.PI;\n newDst[0] = Math.cos(angle) * scale;\n newDst[1] = Math.sin(angle) * scale;\n\n return newDst;\n}\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform Vec2 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec2Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const x = v[0];\n const y = v[1];\n\n newDst[0] = x * m[0] + y * m[4] + m[12];\n newDst[1] = x * m[1] + y * m[5] + m[13];\n\n return newDst;\n}\n\n/**\n * Transforms vec4 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat3(v: Vec2Arg, m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const x = v[0];\n const y = v[1];\n\n newDst[0] = m[0] * x + m[4] * y + m[8];\n newDst[1] = m[1] * x + m[5] * y + m[9];\n\n return newDst;\n}\n\n/**\n * Rotate a 2D vector\n *\n * @param a The vec2 point to rotate\n * @param b The origin of the rotation\n * @param rad The angle of rotation in radians\n * @returns the rotated vector\n */\nfunction rotate(a: Vec2Arg, b: Vec2Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n // Translate point to the origin\n const p0 = a[0] - b[0];\n const p1 = a[1] - b[1];\n const sinC = Math.sin(rad);\n const cosC = Math.cos(rad);\n\n //perform rotation and translate to correct position\n newDst[0] = p0 * cosC - p1 * sinC + b[0];\n newDst[1] = p0 * sinC + p1 * cosC + b[1];\n\n return newDst;\n}\n\n/**\n * Treat a 2D vector as a direction and set it's length\n *\n * @param a The vec2 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec2Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec2 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec2Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat3,\n rotate,\n setLength,\n truncate,\n midpoint,\n};\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Vec2Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Vec3Arg, Vec3Type } from './vec3';\nimport { Mat3Arg } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { QuatArg } from './quat';\nimport { BaseArgType } from './types';\n\nexport { Vec3Arg, Vec3Type };\n\ntype Vec3Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec3\n * */\nfunction getAPIImpl(Ctor: Vec3Ctor) {\n\n/**\n * Creates a vec3; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number) {\n const newDst = new Ctor(3);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a vec3; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec3\n * Also see {@link vec3.create} and {@link vec3.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec3Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec3Arg, b: Vec3Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n\n return newDst;\n}\n\n/**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\nfunction angle(a: Vec3Arg, b: Vec3Arg): number {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const mag1 = Math.sqrt(ax * ax + ay * ay + az * az);\n const mag2 = Math.sqrt(bx * bx + by * by + bz * bz);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec3Arg, b: Vec3Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec3Arg, b: Vec3Arg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec3Arg, b: Vec3Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec3Arg, b: Vec3Arg, t: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec3Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec3Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\nfunction cross(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const t1 = a[2] * b[0] - a[0] * b[2];\n const t2 = a[0] * b[1] - a[1] * b[0];\n newDst[0] = a[1] * b[2] - a[2] * b[1];\n newDst[1] = t1;\n newDst[2] = t2;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec3Arg, b: Vec3Arg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]);\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec3Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec3Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return v0 * v0 + v1 * v1 + v2 * v2;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec3Arg, b: Vec3Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return Math.sqrt(dx * dx + dy * dy + dz * dz);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec3Arg, b: Vec3Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return dx * dx + dy * dy + dz * dz;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec3.clone})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec3.copy})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Creates a random vector\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\nfunction random(scale = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const angle = Math.random() * 2 * Math.PI;\n const z = Math.random() * 2 - 1;\n const zScale = Math.sqrt(1 - z * z) * scale;\n newDst[0] = Math.cos(angle) * zScale;\n newDst[1] = Math.sin(angle) * zScale;\n newDst[2] = z * scale;\n\n return newDst;\n}\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform vec3 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec3Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1;\n\n newDst[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n newDst[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n newDst[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n\n return newDst;\n}\n\n/**\n * Transform vec3 by upper 3x3 matrix inside 4x4 matrix.\n * @param v - The direction.\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns The transformed vector.\n */\nfunction transformMat4Upper3x3(v: Vec3Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[0] = v0 * m[0 * 4 + 0] + v1 * m[1 * 4 + 0] + v2 * m[2 * 4 + 0];\n newDst[1] = v0 * m[0 * 4 + 1] + v1 * m[1 * 4 + 1] + v2 * m[2 * 4 + 1];\n newDst[2] = v0 * m[0 * 4 + 2] + v1 * m[1 * 4 + 2] + v2 * m[2 * 4 + 2];\n\n return newDst;\n}\n\n/**\n * Transforms vec3 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat3(v: Vec3Arg, m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n\n newDst[0] = x * m[0] + y * m[4] + z * m[8];\n newDst[1] = x * m[1] + y * m[5] + z * m[9];\n newDst[2] = x * m[2] + y * m[6] + z * m[10];\n\n return newDst;\n}\n\n/**\n * Transforms vec3 by Quaternion\n * @param v - the vector to transform\n * @param q - the quaternion to transform by\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed\n */\nfunction transformQuat(v: Vec3Arg, q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n\n const uvX = qy * z - qz * y;\n const uvY = qz * x - qx * z;\n const uvZ = qx * y - qy * x;\n\n newDst[0] = x + uvX * w2 + (qy * uvZ - qz * uvY) * 2;\n newDst[1] = y + uvY * w2 + (qz * uvX - qx * uvZ) * 2;\n newDst[2] = z + uvZ * w2 + (qx * uvY - qy * uvX) * 2;\n\n return newDst;\n}\n\n/**\n * Returns the translation component of a 4-by-4 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\nfunction getTranslation(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n}\n/**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat4Arg, axis: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n}\n/**\n * Returns the scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the x-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\nfunction rotateX(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n //Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n //perform rotation\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad);\n\n //translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the y-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\nfunction rotateY(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n // perform rotation\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad);\n\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the z-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns {vec3} out\n */\nfunction rotateZ(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n // perform rotation\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2];\n\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Treat a 3D vector as a direction and set it's length\n *\n * @param a The vec3 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec3Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec3 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec3Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat4Upper3x3,\n transformMat3,\n transformQuat,\n getTranslation,\n getAxis,\n getScaling,\n rotateX,\n rotateY,\n rotateZ,\n setLength,\n truncate,\n midpoint,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Vec3Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nimport * as utils from './utils.js';\nimport { QuatArg } from './quat';\nimport { Mat3Arg, Mat3Type } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { Vec2Arg } from './vec2';\nimport { Vec3Arg } from './vec3';\nimport { getAPI as getVec2API } from './vec2-impl';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\n\nexport { Mat3Arg, Mat3Type };\n\ntype Mat3Ctor = new (n: number) => T;\n\n/**\n * Generates a typed API for Mat3\n * */\nfunction getAPIImpl(Ctor: Mat3Ctor) {\n const vec2 = getVec2API(Ctor);\n const vec3 = getVec3API(Ctor);\n\n/**\n * Create a Mat3 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat3's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat3.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @returns matrix created from values.\n */\nfunction create(\n v0?: number, v1?: number, v2?: number,\n v3?: number, v4?: number, v5?: number,\n v6?: number, v7?: number, v8?: number) {\n const newDst = new Ctor(12);\n // to make the array homogenous\n newDst[3] = 0;\n newDst[7] = 0;\n newDst[11] = 0;\n\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[4] = v3;\n if (v4 !== undefined) {\n newDst[5] = v4;\n if (v5 !== undefined) {\n newDst[6] = v5;\n if (v6 !== undefined) {\n newDst[8] = v6;\n if (v7 !== undefined) {\n newDst[9] = v7;\n if (v8 !== undefined) {\n newDst[10] = v8;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n\n return newDst;\n}\n\n/**\n * Sets the values of a Mat3\n * Also see {@link mat3.create} and {@link mat3.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 set from values.\n */\nfunction set(\n v0: number, v1: number, v2: number,\n v3: number, v4: number, v5: number,\n v6: number, v7: number, v8: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[0] = v0; newDst[1] = v1; newDst[ 2] = v2; newDst[ 3] = 0;\n newDst[4] = v3; newDst[5] = v4; newDst[ 6] = v5; newDst[ 7] = 0;\n newDst[8] = v6; newDst[9] = v7; newDst[10] = v8; newDst[11] = 0;\n\n return newDst;\n}\n\n/**\n * Creates a Mat3 from the upper left 3x3 part of a Mat4\n * @param m4 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from m4\n */\nfunction fromMat4(m4: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n newDst[0] = m4[0]; newDst[1] = m4[1]; newDst[ 2] = m4[ 2]; newDst[ 3] = 0;\n newDst[4] = m4[4]; newDst[5] = m4[5]; newDst[ 6] = m4[ 6]; newDst[ 7] = 0;\n newDst[8] = m4[8]; newDst[9] = m4[9]; newDst[10] = m4[10]; newDst[11] = 0;\n return newDst;\n}\n\n/**\n * Creates a Mat3 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from q\n */\nfunction fromQuat(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3];\n const x2 = x + x; const y2 = y + y; const z2 = z + z;\n\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n newDst[ 0] = 1 - yy - zz; newDst[ 1] = yx + wz; newDst[ 2] = zx - wy; newDst[ 3] = 0;\n newDst[ 4] = yx - wz; newDst[ 5] = 1 - xx - zz; newDst[ 6] = zy + wx; newDst[ 7] = 0;\n newDst[ 8] = zx + wy; newDst[ 9] = zy - wx; newDst[10] = 1 - xx - yy; newDst[11] = 0;\n\n return newDst;\n}\n\n/**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\nfunction negate(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = -m[ 0]; newDst[ 1] = -m[ 1]; newDst[ 2] = -m[ 2];\n newDst[ 4] = -m[ 4]; newDst[ 5] = -m[ 5]; newDst[ 6] = -m[ 6];\n newDst[ 8] = -m[ 8]; newDst[ 9] = -m[ 9]; newDst[10] = -m[10];\n\n return newDst;\n}\n\n/**\n * Copies a matrix. (same as {@link mat3.clone})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nfunction copy(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = m[ 0]; newDst[ 1] = m[ 1]; newDst[ 2] = m[ 2];\n newDst[ 4] = m[ 4]; newDst[ 5] = m[ 5]; newDst[ 6] = m[ 6];\n newDst[ 8] = m[ 8]; newDst[ 9] = m[ 9]; newDst[10] = m[10];\n\n return newDst;\n}\n\n/**\n * Copies a matrix (same as {@link mat3.copy})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nconst clone = copy;\n\n/**\n * Check if 2 matrices are approximately equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are approximately equal\n */\nfunction equalsApproximately(a: Mat3Arg, b: Mat3Arg): boolean {\n return Math.abs(a[ 0] - b[ 0]) < utils.EPSILON &&\n Math.abs(a[ 1] - b[ 1]) < utils.EPSILON &&\n Math.abs(a[ 2] - b[ 2]) < utils.EPSILON &&\n Math.abs(a[ 4] - b[ 4]) < utils.EPSILON &&\n Math.abs(a[ 5] - b[ 5]) < utils.EPSILON &&\n Math.abs(a[ 6] - b[ 6]) < utils.EPSILON &&\n Math.abs(a[ 8] - b[ 8]) < utils.EPSILON &&\n Math.abs(a[ 9] - b[ 9]) < utils.EPSILON &&\n Math.abs(a[10] - b[10]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 matrices are exactly equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are exactly equal\n */\nfunction equals(a: Mat3Arg, b: Mat3Arg): boolean {\n return a[ 0] === b[ 0] &&\n a[ 1] === b[ 1] &&\n a[ 2] === b[ 2] &&\n a[ 4] === b[ 4] &&\n a[ 5] === b[ 5] &&\n a[ 6] === b[ 6] &&\n a[ 8] === b[ 8] &&\n a[ 9] === b[ 9] &&\n a[10] === b[10];\n}\n\n/**\n * Creates a 3-by-3 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 3-by-3 identity matrix.\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\nfunction transpose(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n if (newDst === m) {\n let t: number;\n\n // 0 1 2\n // 4 5 6\n // 8 9 10\n\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n\n return newDst;\n }\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n newDst[ 0] = m00; newDst[ 1] = m10; newDst[ 2] = m20;\n newDst[ 4] = m01; newDst[ 5] = m11; newDst[ 6] = m21;\n newDst[ 8] = m02; newDst[ 9] = m12; newDst[10] = m22;\n\n return newDst;\n}\n\n/**\n * Computes the inverse of a 3-by-3 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nfunction inverse(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n const b01 = m22 * m11 - m12 * m21;\n const b11 = -m22 * m10 + m12 * m20;\n const b21 = m21 * m10 - m11 * m20;\n\n const invDet = 1 / (m00 * b01 + m01 * b11 + m02 * b21);\n\n newDst[ 0] = b01 * invDet;\n newDst[ 1] = (-m22 * m01 + m02 * m21) * invDet;\n newDst[ 2] = ( m12 * m01 - m02 * m11) * invDet;\n newDst[ 4] = b11 * invDet;\n newDst[ 5] = ( m22 * m00 - m02 * m20) * invDet;\n newDst[ 6] = (-m12 * m00 + m02 * m10) * invDet;\n newDst[ 8] = b21 * invDet;\n newDst[ 9] = (-m21 * m00 + m01 * m20) * invDet;\n newDst[10] = ( m11 * m00 - m01 * m10) * invDet;\n\n return newDst;\n}\n\n/**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\nfunction determinant(m: Mat3Arg): number {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n return m00 * (m11 * m22 - m21 * m12) -\n m10 * (m01 * m22 - m21 * m02) +\n m20 * (m01 * m12 - m11 * m02);\n}\n\n/**\n * Computes the inverse of a 3-by-3 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nconst invert = inverse;\n\n/**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nfunction multiply(a: Mat3Arg, b: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[ 4 + 0];\n const a11 = a[ 4 + 1];\n const a12 = a[ 4 + 2];\n const a20 = a[ 8 + 0];\n const a21 = a[ 8 + 1];\n const a22 = a[ 8 + 2];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b10 = b[ 4 + 0];\n const b11 = b[ 4 + 1];\n const b12 = b[ 4 + 2];\n const b20 = b[ 8 + 0];\n const b21 = b[ 8 + 1];\n const b22 = b[ 8 + 2];\n\n newDst[ 0] = a00 * b00 + a10 * b01 + a20 * b02;\n newDst[ 1] = a01 * b00 + a11 * b01 + a21 * b02;\n newDst[ 2] = a02 * b00 + a12 * b01 + a22 * b02;\n newDst[ 4] = a00 * b10 + a10 * b11 + a20 * b12;\n newDst[ 5] = a01 * b10 + a11 * b11 + a21 * b12;\n newDst[ 6] = a02 * b10 + a12 * b11 + a22 * b12;\n newDst[ 8] = a00 * b20 + a10 * b21 + a20 * b22;\n newDst[ 9] = a01 * b20 + a11 * b21 + a21 * b22;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22;\n\n return newDst;\n}\n\n/**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nconst mul = multiply;\n\n/**\n * Sets the translation component of a 3-by-3 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\nfunction setTranslation(a: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? identity()) as T;\n if (a !== newDst) {\n newDst[ 0] = a[ 0];\n newDst[ 1] = a[ 1];\n newDst[ 2] = a[ 2];\n newDst[ 4] = a[ 4];\n newDst[ 5] = a[ 5];\n newDst[ 6] = a[ 6];\n }\n newDst[ 8] = v[0];\n newDst[ 9] = v[1];\n newDst[10] = 1;\n return newDst;\n}\n\n/**\n * Returns the translation component of a 3-by-3 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\nfunction getTranslation(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec2.create()) as T;\n newDst[0] = m[8];\n newDst[1] = m[9];\n return newDst;\n}\n\n/**\n * Returns an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y,\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat3Arg, axis: number, dst?: T) {\n const newDst = (dst ?? vec2.create()) as T;\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n return newDst;\n}\n\n/**\n * Sets an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\nfunction setAxis(m: Mat3Arg, v: Vec2Arg, axis: number, dst?: T) {\n const newDst = (dst === m ? m : copy(m, dst)) as T;\n\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n return newDst;\n}\n\n/**\n * Returns the \"2d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec2.create());\n\n const xx = m[0];\n const xy = m[1];\n const yx = m[4];\n const yy = m[5];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy);\n newDst[1] = Math.sqrt(yx * yx + yy * yy);\n\n return newDst;\n}\n\n\n/**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction get3DScaling(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec3.create());\n\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which translates by the given vector v.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\nfunction translation(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = v[0]; newDst[ 9] = v[1]; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Translates the given 3-by-3 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\nfunction translate(m: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 0] = m00;\n newDst[ 1] = m01;\n newDst[ 2] = m02;\n newDst[ 4] = m10;\n newDst[ 5] = m11;\n newDst[ 6] = m12;\n }\n\n newDst[ 8] = m00 * v0 + m10 * v1 + m20;\n newDst[ 9] = m01 * v0 + m11 * v1 + m21;\n newDst[10] = m02 * v0 + m12 * v1 + m22;\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotation(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = s; newDst[ 2] = 0;\n newDst[ 4] = -s; newDst[ 5] = c; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix by the given angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotate(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 + s * m10;\n newDst[ 1] = c * m01 + s * m11;\n newDst[ 2] = c * m02 + s * m12;\n\n newDst[ 4] = c * m10 - s * m00;\n newDst[ 5] = c * m11 - s * m01;\n newDst[ 6] = c * m12 - s * m02;\n\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * 2 entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of 2 entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale(m: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales uniformly in each dimension\n * @param s - Amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given.\n * @param m - The matrix to be modified.\n * @param s - Amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale(m: Mat3Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\nreturn {\n clone,\n create,\n set,\n fromMat4,\n fromQuat,\n negate,\n copy,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n invert,\n determinant,\n mul,\n multiply,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n get3DScaling,\n translation,\n translate,\n rotation,\n rotate,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Mat3Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","import { Mat4Arg, Mat4Type } from './mat4';\nimport { Mat3Arg } from './mat3';\nimport { QuatArg } from './quat';\nimport { Vec3Arg } from './vec3';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\nimport * as utils from './utils';\n\nexport { Mat4Arg, Mat4Type };\n\ntype Mat4Ctor = new (n: number) => T;\n\n/**\n * Generates a typed API for Mat4\n * */\nfunction getAPIImpl(Ctor: Mat4Ctor) {\n const vec3 = getVec3API(Ctor);\n\n/**\n * 4x4 Matrix math math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new matrix. In other words you can do this\n *\n * const mat = mat4.translation([1, 2, 3]); // Creates a new translation matrix\n *\n * or\n *\n * const mat = mat4.create();\n * mat4.translation([1, 2, 3], mat); // Puts translation matrix in mat.\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always save to pass any matrix as the destination. So for example\n *\n * const mat = mat4.identity();\n * const trans = mat4.translation([1, 2, 3]);\n * mat4.multiply(mat, trans, mat); // Multiplies mat * trans and puts result in mat.\n *\n */\n\n\n/**\n * Create a Mat4 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat4's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat4.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @returns created from values.\n */\nfunction create(\n v0?: number, v1?: number, v2?: number, v3?: number,\n v4?: number, v5?: number, v6?: number, v7?: number,\n v8?: number, v9?: number, v10?: number, v11?: number,\n v12?: number, v13?: number, v14?: number, v15?: number) {\n const newDst = new Ctor(16);\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[3] = v3;\n if (v4 !== undefined) {\n newDst[4] = v4;\n if (v5 !== undefined) {\n newDst[5] = v5;\n if (v6 !== undefined) {\n newDst[6] = v6;\n if (v7 !== undefined) {\n newDst[7] = v7;\n if (v8 !== undefined) {\n newDst[8] = v8;\n if (v9 !== undefined) {\n newDst[9] = v9;\n if (v10 !== undefined) {\n newDst[10] = v10;\n if (v11 !== undefined) {\n newDst[11] = v11;\n if (v12 !== undefined) {\n newDst[12] = v12;\n if (v13 !== undefined) {\n newDst[13] = v13;\n if (v14 !== undefined) {\n newDst[14] = v14;\n if (v15 !== undefined) {\n newDst[15] = v15;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Sets the values of a Mat4\n * Also see {@link mat4.create} and {@link mat4.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 created from values.\n */\nfunction set(\n v0: number, v1: number, v2: number, v3: number,\n v4: number, v5: number, v6: number, v7: number,\n v8: number, v9: number, v10: number, v11: number,\n v12: number, v13: number, v14: number, v15: number,\n dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = v0; newDst[ 1] = v1; newDst[ 2] = v2; newDst[ 3] = v3;\n newDst[ 4] = v4; newDst[ 5] = v5; newDst[ 6] = v6; newDst[ 7] = v7;\n newDst[ 8] = v8; newDst[ 9] = v9; newDst[10] = v10; newDst[11] = v11;\n newDst[12] = v12; newDst[13] = v13; newDst[14] = v14; newDst[15] = v15;\n\n return newDst;\n}\n\n/**\n * Creates a Mat4 from a Mat3\n * @param m3 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from m3\n */\nfunction fromMat3(m3: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = m3[0]; newDst[ 1] = m3[1]; newDst[ 2] = m3[ 2]; newDst[ 3] = 0;\n newDst[ 4] = m3[4]; newDst[ 5] = m3[5]; newDst[ 6] = m3[ 6]; newDst[ 7] = 0;\n newDst[ 8] = m3[8]; newDst[ 9] = m3[9]; newDst[10] = m3[10]; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a Mat4 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from q\n */\nfunction fromQuat(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3];\n const x2 = x + x; const y2 = y + y; const z2 = z + z;\n\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n newDst[ 0] = 1 - yy - zz; newDst[ 1] = yx + wz; newDst[ 2] = zx - wy; newDst[ 3] = 0;\n newDst[ 4] = yx - wz; newDst[ 5] = 1 - xx - zz; newDst[ 6] = zy + wx; newDst[ 7] = 0;\n newDst[ 8] = zx + wy; newDst[ 9] = zy - wx; newDst[10] = 1 - xx - yy; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\nfunction negate(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = -m[ 0]; newDst[ 1] = -m[ 1]; newDst[ 2] = -m[ 2]; newDst[ 3] = -m[ 3];\n newDst[ 4] = -m[ 4]; newDst[ 5] = -m[ 5]; newDst[ 6] = -m[ 6]; newDst[ 7] = -m[ 7];\n newDst[ 8] = -m[ 8]; newDst[ 9] = -m[ 9]; newDst[10] = -m[10]; newDst[11] = -m[11];\n newDst[12] = -m[12]; newDst[13] = -m[13]; newDst[14] = -m[14]; newDst[15] = -m[15];\n\n return newDst;\n}\n\n/**\n * Copies a matrix. (same as {@link mat4.clone})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nfunction copy(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = m[ 0]; newDst[ 1] = m[ 1]; newDst[ 2] = m[ 2]; newDst[ 3] = m[ 3];\n newDst[ 4] = m[ 4]; newDst[ 5] = m[ 5]; newDst[ 6] = m[ 6]; newDst[ 7] = m[ 7];\n newDst[ 8] = m[ 8]; newDst[ 9] = m[ 9]; newDst[10] = m[10]; newDst[11] = m[11];\n newDst[12] = m[12]; newDst[13] = m[13]; newDst[14] = m[14]; newDst[15] = m[15];\n\n return newDst;\n}\n\n/**\n * Copies a matrix (same as {@link mat4.copy})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nconst clone = copy;\n\n/**\n * Check if 2 matrices are approximately equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are approximately equal\n */\nfunction equalsApproximately(a: Mat4Arg, b: Mat4Arg): boolean {\n return Math.abs(a[ 0] - b[ 0]) < utils.EPSILON &&\n Math.abs(a[ 1] - b[ 1]) < utils.EPSILON &&\n Math.abs(a[ 2] - b[ 2]) < utils.EPSILON &&\n Math.abs(a[ 3] - b[ 3]) < utils.EPSILON &&\n Math.abs(a[ 4] - b[ 4]) < utils.EPSILON &&\n Math.abs(a[ 5] - b[ 5]) < utils.EPSILON &&\n Math.abs(a[ 6] - b[ 6]) < utils.EPSILON &&\n Math.abs(a[ 7] - b[ 7]) < utils.EPSILON &&\n Math.abs(a[ 8] - b[ 8]) < utils.EPSILON &&\n Math.abs(a[ 9] - b[ 9]) < utils.EPSILON &&\n Math.abs(a[10] - b[10]) < utils.EPSILON &&\n Math.abs(a[11] - b[11]) < utils.EPSILON &&\n Math.abs(a[12] - b[12]) < utils.EPSILON &&\n Math.abs(a[13] - b[13]) < utils.EPSILON &&\n Math.abs(a[14] - b[14]) < utils.EPSILON &&\n Math.abs(a[15] - b[15]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 matrices are exactly equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are exactly equal\n */\nfunction equals(a: Mat4Arg, b: Mat4Arg): boolean {\n return a[ 0] === b[ 0] &&\n a[ 1] === b[ 1] &&\n a[ 2] === b[ 2] &&\n a[ 3] === b[ 3] &&\n a[ 4] === b[ 4] &&\n a[ 5] === b[ 5] &&\n a[ 6] === b[ 6] &&\n a[ 7] === b[ 7] &&\n a[ 8] === b[ 8] &&\n a[ 9] === b[ 9] &&\n a[10] === b[10] &&\n a[11] === b[11] &&\n a[12] === b[12] &&\n a[13] === b[13] &&\n a[14] === b[14] &&\n a[15] === b[15];\n}\n\n/**\n * Creates a 4-by-4 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 4-by-4 identity matrix.\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\nfunction transpose(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n if (newDst === m) {\n let t;\n\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n\n t = m[3];\n m[3] = m[12];\n m[12] = t;\n\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n\n t = m[7];\n m[7] = m[13];\n m[13] = t;\n\n t = m[11];\n m[11] = m[14];\n m[14] = t;\n return newDst;\n }\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n newDst[ 0] = m00; newDst[ 1] = m10; newDst[ 2] = m20; newDst[ 3] = m30;\n newDst[ 4] = m01; newDst[ 5] = m11; newDst[ 6] = m21; newDst[ 7] = m31;\n newDst[ 8] = m02; newDst[ 9] = m12; newDst[10] = m22; newDst[11] = m32;\n newDst[12] = m03; newDst[13] = m13; newDst[14] = m23; newDst[15] = m33;\n\n return newDst;\n}\n\n/**\n * Computes the inverse of a 4-by-4 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nfunction inverse(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n const tmp12 = m20 * m31;\n const tmp13 = m30 * m21;\n const tmp14 = m10 * m31;\n const tmp15 = m30 * m11;\n const tmp16 = m10 * m21;\n const tmp17 = m20 * m11;\n const tmp18 = m00 * m31;\n const tmp19 = m30 * m01;\n const tmp20 = m00 * m21;\n const tmp21 = m20 * m01;\n const tmp22 = m00 * m11;\n const tmp23 = m10 * m01;\n\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n\n const d = 1 / (m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3);\n\n newDst[ 0] = d * t0;\n newDst[ 1] = d * t1;\n newDst[ 2] = d * t2;\n newDst[ 3] = d * t3;\n newDst[ 4] = d * ((tmp1 * m10 + tmp2 * m20 + tmp5 * m30) -\n (tmp0 * m10 + tmp3 * m20 + tmp4 * m30));\n newDst[ 5] = d * ((tmp0 * m00 + tmp7 * m20 + tmp8 * m30) -\n (tmp1 * m00 + tmp6 * m20 + tmp9 * m30));\n newDst[ 6] = d * ((tmp3 * m00 + tmp6 * m10 + tmp11 * m30) -\n (tmp2 * m00 + tmp7 * m10 + tmp10 * m30));\n newDst[ 7] = d * ((tmp4 * m00 + tmp9 * m10 + tmp10 * m20) -\n (tmp5 * m00 + tmp8 * m10 + tmp11 * m20));\n newDst[ 8] = d * ((tmp12 * m13 + tmp15 * m23 + tmp16 * m33) -\n (tmp13 * m13 + tmp14 * m23 + tmp17 * m33));\n newDst[ 9] = d * ((tmp13 * m03 + tmp18 * m23 + tmp21 * m33) -\n (tmp12 * m03 + tmp19 * m23 + tmp20 * m33));\n newDst[10] = d * ((tmp14 * m03 + tmp19 * m13 + tmp22 * m33) -\n (tmp15 * m03 + tmp18 * m13 + tmp23 * m33));\n newDst[11] = d * ((tmp17 * m03 + tmp20 * m13 + tmp23 * m23) -\n (tmp16 * m03 + tmp21 * m13 + tmp22 * m23));\n newDst[12] = d * ((tmp14 * m22 + tmp17 * m32 + tmp13 * m12) -\n (tmp16 * m32 + tmp12 * m12 + tmp15 * m22));\n newDst[13] = d * ((tmp20 * m32 + tmp12 * m02 + tmp19 * m22) -\n (tmp18 * m22 + tmp21 * m32 + tmp13 * m02));\n newDst[14] = d * ((tmp18 * m12 + tmp23 * m32 + tmp15 * m02) -\n (tmp22 * m32 + tmp14 * m02 + tmp19 * m12));\n newDst[15] = d * ((tmp22 * m22 + tmp16 * m02 + tmp21 * m12) -\n (tmp20 * m12 + tmp23 * m22 + tmp17 * m02));\n\n return newDst;\n}\n\n/**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\nfunction determinant(m: Mat4Arg): number {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n\n return m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3;\n}\n\n/**\n * Computes the inverse of a 4-by-4 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nconst invert = inverse;\n\n/**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nfunction multiply(a: Mat4Arg, b: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[ 4 + 0];\n const a11 = a[ 4 + 1];\n const a12 = a[ 4 + 2];\n const a13 = a[ 4 + 3];\n const a20 = a[ 8 + 0];\n const a21 = a[ 8 + 1];\n const a22 = a[ 8 + 2];\n const a23 = a[ 8 + 3];\n const a30 = a[12 + 0];\n const a31 = a[12 + 1];\n const a32 = a[12 + 2];\n const a33 = a[12 + 3];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b03 = b[3];\n const b10 = b[ 4 + 0];\n const b11 = b[ 4 + 1];\n const b12 = b[ 4 + 2];\n const b13 = b[ 4 + 3];\n const b20 = b[ 8 + 0];\n const b21 = b[ 8 + 1];\n const b22 = b[ 8 + 2];\n const b23 = b[ 8 + 3];\n const b30 = b[12 + 0];\n const b31 = b[12 + 1];\n const b32 = b[12 + 2];\n const b33 = b[12 + 3];\n\n newDst[ 0] = a00 * b00 + a10 * b01 + a20 * b02 + a30 * b03;\n newDst[ 1] = a01 * b00 + a11 * b01 + a21 * b02 + a31 * b03;\n newDst[ 2] = a02 * b00 + a12 * b01 + a22 * b02 + a32 * b03;\n newDst[ 3] = a03 * b00 + a13 * b01 + a23 * b02 + a33 * b03;\n newDst[ 4] = a00 * b10 + a10 * b11 + a20 * b12 + a30 * b13;\n newDst[ 5] = a01 * b10 + a11 * b11 + a21 * b12 + a31 * b13;\n newDst[ 6] = a02 * b10 + a12 * b11 + a22 * b12 + a32 * b13;\n newDst[ 7] = a03 * b10 + a13 * b11 + a23 * b12 + a33 * b13;\n newDst[ 8] = a00 * b20 + a10 * b21 + a20 * b22 + a30 * b23;\n newDst[ 9] = a01 * b20 + a11 * b21 + a21 * b22 + a31 * b23;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22 + a32 * b23;\n newDst[11] = a03 * b20 + a13 * b21 + a23 * b22 + a33 * b23;\n newDst[12] = a00 * b30 + a10 * b31 + a20 * b32 + a30 * b33;\n newDst[13] = a01 * b30 + a11 * b31 + a21 * b32 + a31 * b33;\n newDst[14] = a02 * b30 + a12 * b31 + a22 * b32 + a32 * b33;\n newDst[15] = a03 * b30 + a13 * b31 + a23 * b32 + a33 * b33;\n\n return newDst;\n}\n\n/**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nconst mul = multiply;\n\n/**\n * Sets the translation component of a 4-by-4 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\nfunction setTranslation(a: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? identity()) as T;\n if (a !== newDst) {\n newDst[ 0] = a[ 0];\n newDst[ 1] = a[ 1];\n newDst[ 2] = a[ 2];\n newDst[ 3] = a[ 3];\n newDst[ 4] = a[ 4];\n newDst[ 5] = a[ 5];\n newDst[ 6] = a[ 6];\n newDst[ 7] = a[ 7];\n newDst[ 8] = a[ 8];\n newDst[ 9] = a[ 9];\n newDst[10] = a[10];\n newDst[11] = a[11];\n }\n newDst[12] = v[0];\n newDst[13] = v[1];\n newDst[14] = v[2];\n newDst[15] = 1;\n return newDst;\n}\n\n///**\n// * Returns the translation component of a 4-by-4 matrix as a vector with 3\n// * entries.\n// * @param m - The matrix.\n// * @param dst - vector to hold result. If not passed a new one is created.\n// * @returns The translation component of m.\n// */\nfunction getTranslation(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? vec3.create()) as T;\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n}\n\n/**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat4Arg, axis: number, dst?: T) {\n const newDst = (dst ?? vec3.create());\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n}\n\n/**\n * Sets an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\nfunction setAxis(m: Mat4Arg, v: Vec3Arg, axis: number, dst: T) {\n const newDst = (dst === m) ? dst : copy(m, dst);\n\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n newDst[off + 2] = v[2];\n return newDst;\n}\n\n/**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? vec3.create()) as T;\n\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 0 to 1 in the z dimension.\n *\n * Note: If you pass `Infinity` for zFar then it will produce a projection matrix\n * returns -Infinity for Z when transforming coordinates with Z <= 0 and +Infinity for Z\n * otherwise.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */\nfunction perspective(fieldOfViewYInRadians: number, aspect: number, zNear: number, zFar: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const f = Math.tan(Math.PI * 0.5 - 0.5 * fieldOfViewYInRadians);\n\n newDst[0] = f / aspect;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n newDst[4] = 0;\n newDst[5] = f;\n newDst[6] = 0;\n newDst[7] = 0;\n\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[11] = -1;\n\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (Number.isFinite(zFar)) {\n const rangeInv = 1 / (zNear - zFar);\n newDst[10] = zFar * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n } else {\n newDst[10] = -1;\n newDst[14] = -zNear;\n }\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 1 (at -zNear) to 0 (at -zFar) in the z dimension.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane. (default = Infinity)\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */function perspectiveReverseZ(fieldOfViewYInRadians: number, aspect: number, zNear: number, zFar = Infinity, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const f = 1 / Math.tan(fieldOfViewYInRadians * 0.5);\n\n newDst[ 0] = f / aspect;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n\n newDst[ 4] = 0;\n newDst[ 5] = f;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n\n newDst[ 8] = 0;\n newDst[ 9] = 0;\n newDst[11] = -1;\n\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (zFar === Infinity) {\n newDst[10] = 0;\n newDst[14] = zNear;\n } else {\n const rangeInv = 1 / (zFar - zNear);\n newDst[10] = zNear * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n }\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 orthogonal transformation matrix that transforms from\n * the given the left, right, bottom, and top dimensions to -1 +1 in x, and y\n * and 0 to +1 in z.\n * @param left - Left side of the near clipping plane viewport.\n * @param right - Right side of the near clipping plane viewport.\n * @param bottom - Bottom of the near clipping plane viewport.\n * @param top - Top of the near clipping plane viewport.\n * @param near - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param far - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The orthographic projection matrix.\n */\nfunction ortho(left: number, right: number, bottom: number, top: number, near: number, far: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[0] = 2 / (right - left);\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n newDst[4] = 0;\n newDst[5] = 2 / (top - bottom);\n newDst[6] = 0;\n newDst[7] = 0;\n\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[10] = 1 / (near - far);\n newDst[11] = 0;\n\n newDst[12] = (right + left) / (left - right);\n newDst[13] = (top + bottom) / (bottom - top);\n newDst[14] = near / (near - far);\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 0 to 1 in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\nfunction frustum(left: number, right: number, bottom: number, top: number, near: number, far: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const dx = (right - left);\n const dy = (top - bottom);\n const dz = (near - far);\n\n newDst[ 0] = 2 * near / dx;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n newDst[ 4] = 0;\n newDst[ 5] = 2 * near / dy;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n newDst[ 8] = (left + right) / dx;\n newDst[ 9] = (top + bottom) / dy;\n newDst[10] = far / dz;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = near * far / dz;\n newDst[15] = 0;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 1 (-near) to 0 (-far) in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\nfunction frustumReverseZ(left: number, right: number, bottom: number, top: number, near: number, far = Infinity, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const dx = (right - left);\n const dy = (top - bottom);\n\n newDst[ 0] = 2 * near / dx;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n newDst[ 4] = 0;\n newDst[ 5] = 2 * near / dy;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n newDst[ 8] = (left + right) / dx;\n newDst[ 9] = (top + bottom) / dy;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (far === Infinity) {\n newDst[10] = 0;\n newDst[14] = near;\n } else {\n const rangeInv = 1 / (far - near);\n newDst[10] = near * rangeInv;\n newDst[14] = far * near * rangeInv;\n }\n\n return newDst;\n}\n\nconst xAxis = vec3.create();\nconst yAxis = vec3.create();\nconst zAxis = vec3.create();\n\n/**\n * Computes a 4-by-4 aim transformation.\n *\n * This is a matrix which positions an object aiming down positive Z.\n * toward the target.\n *\n * Note: this is **NOT** the inverse of lookAt as lookAt looks at negative Z.\n *\n * @param position - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\nfunction aim(position: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(target, position, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = xAxis[1]; newDst[ 2] = xAxis[2]; newDst[ 3] = 0;\n newDst[ 4] = yAxis[0]; newDst[ 5] = yAxis[1]; newDst[ 6] = yAxis[2]; newDst[ 7] = 0;\n newDst[ 8] = zAxis[0]; newDst[ 9] = zAxis[1]; newDst[10] = zAxis[2]; newDst[11] = 0;\n newDst[12] = position[0]; newDst[13] = position[1]; newDst[14] = position[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 camera aim transformation.\n *\n * This is a matrix which positions an object aiming down negative Z.\n * toward the target.\n *\n * Note: this is the inverse of `lookAt`\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\nfunction cameraAim(eye: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = xAxis[1]; newDst[ 2] = xAxis[2]; newDst[ 3] = 0;\n newDst[ 4] = yAxis[0]; newDst[ 5] = yAxis[1]; newDst[ 6] = yAxis[2]; newDst[ 7] = 0;\n newDst[ 8] = zAxis[0]; newDst[ 9] = zAxis[1]; newDst[10] = zAxis[2]; newDst[11] = 0;\n newDst[12] = eye[0]; newDst[13] = eye[1]; newDst[14] = eye[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 view transformation.\n *\n * This is a view matrix which transforms all other objects\n * to be in the space of the view defined by the parameters.\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The look-at matrix.\n */\nfunction lookAt(eye: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = yAxis[0]; newDst[ 2] = zAxis[0]; newDst[ 3] = 0;\n newDst[ 4] = xAxis[1]; newDst[ 5] = yAxis[1]; newDst[ 6] = zAxis[1]; newDst[ 7] = 0;\n newDst[ 8] = xAxis[2]; newDst[ 9] = yAxis[2]; newDst[10] = zAxis[2]; newDst[11] = 0;\n\n newDst[12] = -(xAxis[0] * eye[0] + xAxis[1] * eye[1] + xAxis[2] * eye[2]);\n newDst[13] = -(yAxis[0] * eye[0] + yAxis[1] * eye[1] + yAxis[2] * eye[2]);\n newDst[14] = -(zAxis[0] * eye[0] + zAxis[1] * eye[1] + zAxis[2] * eye[2]);\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which translates by the given vector v.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\nfunction translation(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = v[0]; newDst[13] = v[1]; newDst[14] = v[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Translates the given 4-by-4 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\nfunction translate(m: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n if (m !== newDst) {\n newDst[ 0] = m00;\n newDst[ 1] = m01;\n newDst[ 2] = m02;\n newDst[ 3] = m03;\n newDst[ 4] = m10;\n newDst[ 5] = m11;\n newDst[ 6] = m12;\n newDst[ 7] = m13;\n newDst[ 8] = m20;\n newDst[ 9] = m21;\n newDst[10] = m22;\n newDst[11] = m23;\n }\n\n newDst[12] = m00 * v0 + m10 * v1 + m20 * v2 + m30;\n newDst[13] = m01 * v0 + m11 * v1 + m21 * v2 + m31;\n newDst[14] = m02 * v0 + m12 * v1 + m22 * v2 + m32;\n newDst[15] = m03 * v0 + m13 * v1 + m23 * v2 + m33;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the x-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationX(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = c; newDst[ 6] = s; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = -s; newDst[10] = c; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the x-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateX(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[4] = c * m10 + s * m20;\n newDst[5] = c * m11 + s * m21;\n newDst[6] = c * m12 + s * m22;\n newDst[7] = c * m13 + s * m23;\n newDst[8] = c * m20 - s * m10;\n newDst[9] = c * m21 - s * m11;\n newDst[10] = c * m22 - s * m12;\n newDst[11] = c * m23 - s * m13;\n\n if (m !== newDst) {\n newDst[ 0] = m[ 0];\n newDst[ 1] = m[ 1];\n newDst[ 2] = m[ 2];\n newDst[ 3] = m[ 3];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the y-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationY(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = 0; newDst[ 2] = -s; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = s; newDst[ 9] = 0; newDst[10] = c; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the y-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateY(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 - s * m20;\n newDst[ 1] = c * m01 - s * m21;\n newDst[ 2] = c * m02 - s * m22;\n newDst[ 3] = c * m03 - s * m23;\n newDst[ 8] = c * m20 + s * m00;\n newDst[ 9] = c * m21 + s * m01;\n newDst[10] = c * m22 + s * m02;\n newDst[11] = c * m23 + s * m03;\n\n if (m !== newDst) {\n newDst[ 4] = m[ 4];\n newDst[ 5] = m[ 5];\n newDst[ 6] = m[ 6];\n newDst[ 7] = m[ 7];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the z-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationZ(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = s; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = -s; newDst[ 5] = c; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the z-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateZ(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 + s * m10;\n newDst[ 1] = c * m01 + s * m11;\n newDst[ 2] = c * m02 + s * m12;\n newDst[ 3] = c * m03 + s * m13;\n newDst[ 4] = c * m10 - s * m00;\n newDst[ 5] = c * m11 - s * m01;\n newDst[ 6] = c * m12 - s * m02;\n newDst[ 7] = c * m13 - s * m03;\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n newDst[11] = m[11];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\nfunction axisRotation(axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n\n newDst[ 0] = xx + (1 - xx) * c;\n newDst[ 1] = x * y * oneMinusCosine + z * s;\n newDst[ 2] = x * z * oneMinusCosine - y * s;\n newDst[ 3] = 0;\n newDst[ 4] = x * y * oneMinusCosine - z * s;\n newDst[ 5] = yy + (1 - yy) * c;\n newDst[ 6] = y * z * oneMinusCosine + x * s;\n newDst[ 7] = 0;\n newDst[ 8] = x * z * oneMinusCosine + y * s;\n newDst[ 9] = y * z * oneMinusCosine - x * s;\n newDst[10] = zz + (1 - zz) * c;\n newDst[11] = 0;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = 0;\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle. (same as axisRotation)\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\nconst rotation = axisRotation;\n\n/**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle.\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction axisRotate(m: Mat4Arg, axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n\n const r00 = xx + (1 - xx) * c;\n const r01 = x * y * oneMinusCosine + z * s;\n const r02 = x * z * oneMinusCosine - y * s;\n const r10 = x * y * oneMinusCosine - z * s;\n const r11 = yy + (1 - yy) * c;\n const r12 = y * z * oneMinusCosine + x * s;\n const r20 = x * z * oneMinusCosine + y * s;\n const r21 = y * z * oneMinusCosine - x * s;\n const r22 = zz + (1 - zz) * c;\n\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n\n newDst[ 0] = r00 * m00 + r01 * m10 + r02 * m20;\n newDst[ 1] = r00 * m01 + r01 * m11 + r02 * m21;\n newDst[ 2] = r00 * m02 + r01 * m12 + r02 * m22;\n newDst[ 3] = r00 * m03 + r01 * m13 + r02 * m23;\n newDst[ 4] = r10 * m00 + r11 * m10 + r12 * m20;\n newDst[ 5] = r10 * m01 + r11 * m11 + r12 * m21;\n newDst[ 6] = r10 * m02 + r11 * m12 + r12 * m22;\n newDst[ 7] = r10 * m03 + r11 * m13 + r12 * m23;\n newDst[ 8] = r20 * m00 + r21 * m10 + r22 * m20;\n newDst[ 9] = r20 * m01 + r21 * m11 + r22 * m21;\n newDst[10] = r20 * m02 + r21 * m12 + r22 * m22;\n newDst[11] = r20 * m03 + r21 * m13 + r22 * m23;\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle. (same as rotate)\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nconst rotate = axisRotate;\n\n/**\n * Creates a 4-by-4 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * three entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = v[2]; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 4-by-4 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of three entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale(m: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n newDst[ 3] = v0 * m[0 * 4 + 3];\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n newDst[ 7] = v1 * m[1 * 4 + 3];\n newDst[ 8] = v2 * m[2 * 4 + 0];\n newDst[ 9] = v2 * m[2 * 4 + 1];\n newDst[10] = v2 * m[2 * 4 + 2];\n newDst[11] = v2 * m[2 * 4 + 3];\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which scales a uniform amount in each dimension.\n * @param s - the amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = s; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 4-by-4 matrix in each dimension by a uniform scale.\n * @param m - The matrix to be modified.\n * @param s - The amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale(m: Mat4Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n newDst[ 3] = s * m[0 * 4 + 3];\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n newDst[ 7] = s * m[1 * 4 + 3];\n newDst[ 8] = s * m[2 * 4 + 0];\n newDst[ 9] = s * m[2 * 4 + 1];\n newDst[10] = s * m[2 * 4 + 2];\n newDst[11] = s * m[2 * 4 + 3];\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\nreturn {\n create,\n set,\n fromMat3,\n fromQuat,\n negate,\n copy,\n clone,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n determinant,\n invert,\n multiply,\n mul,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n perspective,\n perspectiveReverseZ,\n ortho,\n frustum,\n frustumReverseZ,\n aim,\n cameraAim,\n lookAt,\n translation,\n translate,\n rotationX,\n rotateX,\n rotationY,\n rotateY,\n rotationZ,\n rotateZ,\n axisRotation,\n rotation,\n axisRotate,\n rotate,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n};\n\n}\n\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Mat4Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { QuatArg, QuatType } from './quat';\nimport { Mat3Arg } from './mat3.js';\nimport { Mat4Arg } from './mat4.js';\nimport { Vec3Arg } from './vec3.js';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\n\nexport { QuatArg, QuatType };\n\ntype QuatCtor = new (n: number) => T;\n\nexport type RotationOrder = 'xyz' | 'xzy' | 'yxz' | 'yzx' | 'zxy' | 'zyx';\n\n/**\n * Generates am typed API for Qud\n * */\nfunction getAPIImpl(Ctor: QuatCtor) {\n const vec3 = getVec3API(Ctor);\n\n/**\n * Creates a quat4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number, w?: number) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a Quat; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Quat\n * Also see {@link quat.create} and {@link quat.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, w: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n\n return newDst;\n}\n\n/**\n * Sets a quaternion from the given angle and axis,\n * then returns it.\n *\n * @param axis - the axis to rotate around\n * @param angleInRadians - the angle\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The quaternion that represents the given axis and angle\n **/\nfunction fromAxisAngle(axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n const s = Math.sin(halfAngle);\n\n newDst[0] = s * axis[0];\n newDst[1] = s * axis[1];\n newDst[2] = s * axis[2];\n newDst[3] = Math.cos(halfAngle);\n\n return newDst;\n}\n\n/**\n * Gets the rotation axis and angle\n * @param q - quaternion to compute from\n * @param dst - Vec3 to hold result. If not passed in a new one is created.\n * @return angle and axis\n */\nfunction toAxisAngle(q: QuatArg, dst?: T): { angle: number, axis: T } {\n const newDst = (dst ?? vec3.create(3)) as T;\n\n const angle = Math.acos(q[3]) * 2;\n const s = Math.sin(angle * 0.5);\n if (s > utils.EPSILON) {\n newDst[0] = q[0] / s;\n newDst[1] = q[1] / s;\n newDst[2] = q[2] / s;\n } else {\n newDst[0] = 1;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n\n return { angle, axis: newDst };\n}\n\n/**\n * Returns the angle in degrees between two rotations a and b.\n * @param a - quaternion a\n * @param b - quaternion b\n * @return angle in radians between the two quaternions\n */\nfunction angle(a: QuatArg, b: QuatArg) {\n const d = dot(a, b);\n return Math.acos(2 * d * d - 1);\n}\n\n/**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction multiply(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const bw = b[3];\n\n newDst[0] = ax * bw + aw * bx + ay * bz - az * by;\n newDst[1] = ay * bw + aw * by + az * bx - ax * bz;\n newDst[2] = az * bw + aw * bz + ax * by - ay * bx;\n newDst[3] = aw * bw - ax * bx - ay * by - az * bz;\n\n return newDst;\n}\n\n/**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nconst mul = multiply;\n\n/**\n * Rotates the given quaternion around the X axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateX(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const bx = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw + qw * bx;\n newDst[1] = qy * bw + qz * bx;\n newDst[2] = qz * bw - qy * bx;\n newDst[3] = qw * bw - qx * bx;\n\n return newDst;\n}\n\n/**\n * Rotates the given quaternion around the Y axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateY(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const by = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw - qz * by;\n newDst[1] = qy * bw + qw * by;\n newDst[2] = qz * bw + qx * by;\n newDst[3] = qw * bw - qy * by;\n\n return newDst;\n}\n\n/**\n * Rotates the given quaternion around the Z axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateZ(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const bz = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw + qy * bz;\n newDst[1] = qy * bw - qx * bz;\n newDst[2] = qz * bw + qw * bz;\n newDst[3] = qw * bw - qz * bz;\n\n return newDst;\n}\n\n/**\n * Spherically linear interpolate between two quaternions\n *\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction slerp(a: QuatArg, b: QuatArg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n\n let bx = b[0];\n let by = b[1];\n let bz = b[2];\n let bw = b[3];\n\n let cosOmega = ax * bx + ay * by + az * bz + aw * bw;\n\n if (cosOmega < 0) {\n cosOmega = -cosOmega;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n\n let scale0;\n let scale1;\n\n if (1.0 - cosOmega > utils.EPSILON) {\n const omega = Math.acos(cosOmega);\n const sinOmega = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinOmega;\n scale1 = Math.sin(t * omega) / sinOmega;\n } else {\n scale0 = 1.0 - t;\n scale1 = t;\n }\n\n newDst[0] = scale0 * ax + scale1 * bx;\n newDst[1] = scale0 * ay + scale1 * by;\n newDst[2] = scale0 * az + scale1 * bz;\n newDst[3] = scale0 * aw + scale1 * bw;\n\n return newDst;\n}\n\n/**\n * Compute the inverse of a quaternion\n *\n * @param q - quaternion to compute the inverse of\n * @returns A quaternion that is the result of a * b\n */\nfunction inverse(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const a0 = q[0];\n const a1 = q[1];\n const a2 = q[2];\n const a3 = q[3];\n\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n\n newDst[0] = -a0 * invDot;\n newDst[1] = -a1 * invDot;\n newDst[2] = -a2 * invDot;\n newDst[3] = a3 * invDot;\n\n return newDst;\n}\n\n/**\n * Compute the conjugate of a quaternion\n * For quaternions with a magnitude of 1 (a unit quaternion)\n * this returns the same as the inverse but is faster to calculate.\n *\n * @param q - quaternion to compute the conjugate of.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The conjugate of q\n */\nfunction conjugate(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = -q[0];\n newDst[1] = -q[1];\n newDst[2] = -q[2];\n newDst[3] = q[3];\n\n return newDst;\n}\n\n/**\n * Creates a quaternion from the given rotation matrix.\n *\n * The created quaternion is not normalized.\n *\n * @param m - rotation matrix\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\nfunction fromMat(m: Mat3Arg | Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n /*\n 0 1 2\n 3 4 5\n 6 7 8\n\n 0 1 2\n 4 5 6\n 8 9 10\n */\n\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n const trace = m[0] + m[5] + m[10];\n\n if (trace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n const root = Math.sqrt(trace + 1); // 2w\n newDst[3] = 0.5 * root;\n const invRoot = 0.5 / root; // 1/(4w)\n\n newDst[0] = (m[6] - m[9]) * invRoot;\n newDst[1] = (m[8] - m[2]) * invRoot;\n newDst[2] = (m[1] - m[4]) * invRoot;\n } else {\n // |w| <= 1/2\n let i = 0;\n\n if (m[5] > m[0]) {\n i = 1;\n }\n if (m[10] > m[i * 4 + i]) {\n i = 2;\n }\n\n const j = (i + 1) % 3;\n const k = (i + 2) % 3;\n\n const root = Math.sqrt(m[i * 4 + i] - m[j * 4 + j] - m[k * 4 + k] + 1.0);\n newDst[i] = 0.5 * root;\n\n const invRoot = 0.5 / root;\n\n newDst[3] = (m[j * 4 + k] - m[k * 4 + j]) * invRoot;\n newDst[j] = (m[j * 4 + i] + m[i * 4 + j]) * invRoot;\n newDst[k] = (m[k * 4 + i] + m[i * 4 + k]) * invRoot;\n }\n\n return newDst;\n}\n\n/**\n * Creates a quaternion from the given euler angle x, y, z using the provided intrinsic order for the conversion.\n *\n * @param xAngleInRadians - angle to rotate around X axis in radians.\n * @param yAngleInRadians - angle to rotate around Y axis in radians.\n * @param zAngleInRadians - angle to rotate around Z axis in radians.\n * @param order - order to apply euler angles\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion representing the same rotation as the euler angles applied in the given order\n */\nfunction fromEuler(\n xAngleInRadians: number,\n yAngleInRadians: number,\n zAngleInRadians: number,\n order: RotationOrder,\n dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const xHalfAngle = xAngleInRadians * 0.5;\n const yHalfAngle = yAngleInRadians * 0.5;\n const zHalfAngle = zAngleInRadians * 0.5;\n\n const sx = Math.sin(xHalfAngle);\n const cx = Math.cos(xHalfAngle);\n const sy = Math.sin(yHalfAngle);\n const cy = Math.cos(yHalfAngle);\n const sz = Math.sin(zHalfAngle);\n const cz = Math.cos(zHalfAngle);\n\n switch (order) {\n case 'xyz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'xzy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n case 'yxz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n case 'yzx':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'zxy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'zyx':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n default:\n throw new Error(`Unknown rotation order: ${order}`);\n }\n\n return newDst;\n}\n\n/**\n * Copies a quaternion. (same as {@link quat.clone})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is a copy of q\n */\nfunction copy(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = q[0];\n newDst[1] = q[1];\n newDst[2] = q[2];\n newDst[3] = q[3];\n\n return newDst;\n}\n\n/**\n * Clones a quaternion. (same as {@link quat.copy})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A copy of q.\n */\nconst clone = copy;\n\n/**\n * Adds two quaternions; assumes a and b have the same dimension.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the sum of a and b.\n */\nfunction add(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\nfunction subtract(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Multiplies a quaternion by a scalar.\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nfunction mulScalar(v: QuatArg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a quaternion by a scalar. (same as mulScalar)\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nfunction divScalar(v: QuatArg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two quaternions\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns dot product\n */\nfunction dot(a: QuatArg, b: QuatArg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n}\n\n/**\n * Performs linear interpolation on two quaternions.\n * Given quaternions a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param t - Interpolation coefficient.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: QuatArg, b: QuatArg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Computes the length of quaternion\n * @param v - quaternion.\n * @returns length of quaternion.\n */\nfunction length(v: QuatArg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n}\n\n/**\n * Computes the length of quaternion (same as length)\n * @param v - quaternion.\n * @returns length of quaternion.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of quaternion\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\nfunction lengthSq(v: QuatArg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n}\n\n/**\n * Computes the square of the length of quaternion (same as lengthSq)\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\nconst lenSq = lengthSq;\n\n/**\n * Divides a quaternion by its Euclidean length and returns the quotient.\n * @param v - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The normalized quaternion.\n */\nfunction normalize(v: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n }\n\n return newDst;\n}\n\n/**\n * Check if 2 quaternions are approximately equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are approximately equal\n */\nfunction equalsApproximately(a: QuatArg, b: QuatArg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON &&\n Math.abs(a[3] - b[3]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 quaternions are exactly equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are exactly equal\n */\nfunction equals(a: QuatArg, b: QuatArg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Creates an identity quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns an identity quaternion\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n\n return newDst;\n}\n\nconst tempVec3 = vec3.create();\nconst xUnitVec3 = vec3.create();\nconst yUnitVec3 = vec3.create();\n\n/**\n * Computes a quaternion to represent the shortest rotation from one vector to another.\n *\n * @param aUnit - the start vector\n * @param bUnit - the end vector\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\nfunction rotationTo(aUnit: Vec3Arg, bUnit: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const dot = vec3.dot(aUnit, bUnit);\n if (dot < -0.999999) {\n vec3.cross(xUnitVec3, aUnit, tempVec3);\n if (vec3.len(tempVec3) < 0.000001) {\n vec3.cross(yUnitVec3, aUnit, tempVec3);\n }\n\n vec3.normalize(tempVec3, tempVec3);\n fromAxisAngle(tempVec3, Math.PI, newDst);\n\n return newDst;\n } else if (dot > 0.999999) {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n\n return newDst;\n } else {\n vec3.cross(aUnit, bUnit, tempVec3);\n\n newDst[0] = tempVec3[0];\n newDst[1] = tempVec3[1];\n newDst[2] = tempVec3[2];\n newDst[3] = 1 + dot;\n\n return normalize(newDst, newDst);\n }\n}\n\nconst tempQuat1 = new Ctor(4);\nconst tempQuat2 = new Ctor(4);\n\n/**\n * Performs a spherical linear interpolation with two control points\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param c - the third quaternion\n * @param d - the fourth quaternion\n * @param t - Interpolation coefficient 0 to 1\n * @returns result\n */\nfunction sqlerp(\n a: QuatArg,\n b: QuatArg,\n c: QuatArg,\n d: QuatArg,\n t: number,\n dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n slerp(a, d, t, tempQuat1);\n slerp(b, c, t, tempQuat2);\n slerp(tempQuat1, tempQuat2, 2 * t * (1 - t), newDst);\n\n return newDst;\n}\n\nreturn {\n create,\n fromValues,\n set,\n fromAxisAngle,\n toAxisAngle,\n angle,\n multiply,\n mul,\n rotateX,\n rotateY,\n rotateZ,\n slerp,\n inverse,\n conjugate,\n fromMat,\n fromEuler,\n copy,\n clone,\n add,\n subtract,\n sub,\n mulScalar,\n scale,\n divScalar,\n dot,\n lerp,\n length,\n len,\n lengthSq,\n lenSq,\n normalize,\n equalsApproximately,\n equals,\n identity,\n rotationTo,\n sqlerp,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\n/**\n *\n * Quat4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Quat4`. In other words you can do this\n *\n * const v = quat4.cross(v1, v2); // Creates a new Quat4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = quat4.create();\n * quat4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * quat4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nexport function getAPI(Ctor: QuatCtor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Vec4Arg, Vec4Type } from './vec4';\nimport { Mat4Arg } from './mat4';\nimport { BaseArgType } from './types';\n\nexport { Vec4Arg, Vec4Type };\n\ntype Vec4Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec4\n * */\nfunction getAPIImpl(Ctor: Vec4Ctor) {\n\n/**\n * Creates a vec4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number, w?: number) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a vec4; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec4\n * Also see {@link vec4.create} and {@link vec4.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, w: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n newDst[3] = Math.ceil(v[3]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n newDst[3] = Math.floor(v[3]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n newDst[3] = Math.round(v[3]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec4Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n newDst[3] = Math.min(max, Math.max(min, v[3]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec4Arg, b: Vec4Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n newDst[3] = a[3] + b[3] * scale;\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec4Arg, b: Vec4Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON &&\n Math.abs(a[3] - b[3]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec4Arg, b: Vec4Arg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec4Arg, b: Vec4Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec4Arg, b: Vec4Arg, t: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n newDst[3] = a[3] + t[3] * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n newDst[3] = Math.max(a[3], b[3]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n newDst[3] = Math.min(a[3], b[3]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec4Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec4Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n newDst[3] = 1 / v[3];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the dot product of two vectors\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec4Arg, b: Vec4Arg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec4Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec4Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec4Arg, b: Vec4Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec4Arg, b: Vec4Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return dx * dx + dy * dy + dz * dz + dw * dw;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n }\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n newDst[3] = -v[3];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec4.clone})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n newDst[3] = v[3];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec4.copy})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n newDst[3] = a[3] * b[3];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n newDst[3] = a[3] / b[3];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform vec4 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec4 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec4Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = v[3];\n\n newDst[0] = m[0] * x + m[4] * y + m[ 8] * z + m[12] * w;\n newDst[1] = m[1] * x + m[5] * y + m[ 9] * z + m[13] * w;\n newDst[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n newDst[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n\n return newDst;\n}\n\n\n/**\n * Treat a 4D vector as a direction and set it's length\n *\n * @param a The vec4 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec4Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec4 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec4Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n zero,\n transformMat4,\n setLength,\n truncate,\n midpoint,\n};\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\n/**\n *\n * Vec4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Vec4`. In other words you can do this\n *\n * const v = vec4.cross(v1, v2); // Creates a new Vec4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = vec4.create();\n * vec4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * vec4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nexport function getAPI(Ctor: Vec4Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n\n","/**\n * Some docs\n * @namespace wgpu-matrix\n */\nimport {BaseArgType, ZeroArray} from './types';\nimport {Mat3Arg, Mat3Type, getAPI as getMat3API} from './mat3-impl';\nimport {Mat4Arg, Mat4Type, getAPI as getMat4API} from './mat4-impl';\nimport {QuatArg, QuatType, getAPI as getQuatAPI, RotationOrder} from './quat-impl';\nimport {Vec2Arg, Vec2Type, getAPI as getVec2API} from './vec2-impl';\nimport {Vec3Arg, Vec3Type, getAPI as getVec3API} from './vec3-impl';\nimport {Vec4Arg, Vec4Type, getAPI as getVec4API} from './vec4-impl';\nimport * as utils from './utils';\n\nexport {\n RotationOrder,\n utils,\n\n BaseArgType,\n\n Mat3Arg,\n Mat4Arg,\n QuatArg,\n Vec2Arg,\n Vec3Arg,\n Vec4Arg,\n\n Mat3Type,\n Mat4Type,\n QuatType,\n Vec2Type,\n Vec3Type,\n Vec4Type,\n};\n\nexport type BaseCtor = new (n: number) => T;\n\nexport type Mat3 = Mat3Type;\nexport type Mat4 = Mat4Type;\nexport type Quat = QuatType;\nexport type Vec2 = Vec2Type;\nexport type Vec3 = Vec3Type;\nexport type Vec4 = Vec4Type;\n\nexport type Mat3d = Mat3Type;\nexport type Mat4d = Mat4Type;\nexport type Quatd = QuatType;\nexport type Vec2d = Vec2Type;\nexport type Vec3d = Vec3Type;\nexport type Vec4d = Vec4Type;\n\nexport type Mat3n = Mat3Type;\nexport type Mat4n = Mat4Type;\nexport type Quatn = QuatType;\nexport type Vec2n = Vec2Type;\nexport type Vec3n = Vec3Type;\nexport type Vec4n = Vec4Type;\n\n/**\n * Generate wgpu-matrix API for type\n */\nfunction wgpuMatrixAPI<\n Mat3 extends BaseArgType,\n Mat4 extends BaseArgType,\n Quat extends BaseArgType,\n Vec2 extends BaseArgType,\n Vec3 extends BaseArgType,\n Vec4 extends BaseArgType,\n>(\n Mat3Ctor: BaseCtor,\n Mat4Ctor: BaseCtor,\n QuatCtor: BaseCtor,\n Vec2Ctor: BaseCtor,\n Vec3Ctor: BaseCtor,\n Vec4Ctor: BaseCtor,\n) {\n return {\n /** @namespace mat3 */\n mat3: getMat3API(Mat3Ctor),\n /** @namespace mat4 */\n mat4: getMat4API(Mat4Ctor),\n /** @namespace quat */\n quat: getQuatAPI(QuatCtor),\n /** @namespace vec2 */\n vec2: getVec2API(Vec2Ctor),\n /** @namespace vec3 */\n vec3: getVec3API(Vec3Ctor),\n /** @namespace vec4 */\n vec4: getVec4API(Vec4Ctor),\n };\n}\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat3,\n /**\n * 4x4 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat4,\n /**\n * Quaternion functions that default to returning `Float32Array`\n * @namespace\n */\n quat,\n /**\n * Vec2 functions that default to returning `Float32Array`\n * @namespace\n */\n vec2,\n /**\n * Vec3 functions that default to returning `Float32Array`\n * @namespace\n */\n vec3,\n /**\n * Vec3 functions that default to returning `Float32Array`\n * @namespace\n */\n vec4,\n} = wgpuMatrixAPI<\n Mat3, Mat4, Quat, Vec2, Vec3, Vec4>(\n Float32Array, Float32Array, Float32Array, Float32Array, Float32Array, Float32Array);\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat3: mat3d,\n /**\n * 4x4 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat4: mat4d,\n /**\n * Quaternion functions that default to returning `Float64Array`\n * @namespace\n */\n quat: quatd,\n /**\n * Vec2 functions that default to returning `Float64Array`\n * @namespace\n */\n vec2: vec2d,\n /**\n * Vec3 functions that default to returning `Float64Array`\n * @namespace\n */\n vec3: vec3d,\n /**\n * Vec3 functions that default to returning `Float64Array`\n * @namespace\n */\n vec4: vec4d,\n} = wgpuMatrixAPI<\n Mat3d, Mat4d, Quatd, Vec2d, Vec3d, Vec4d>(\n Float64Array, Float64Array, Float64Array, Float64Array, Float64Array, Float64Array);\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat3: mat3n,\n /**\n * 4x4 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat4: mat4n,\n /**\n * Quaternion functions that default to returning `number[]`\n * @namespace\n */\n quat: quatn,\n /**\n * Vec2 functions that default to returning `number[]`\n * @namespace\n */\n vec2: vec2n,\n /**\n * Vec3 functions that default to returning `number[]`\n * @namespace\n */\n vec3: vec3n,\n /**\n * Vec3 functions that default to returning `number[]`\n * @namespace\n */\n vec4: vec4n,\n} = wgpuMatrixAPI<\n Mat3n, Mat4n, Quatn, Vec2n, Vec3n, Vec4n>(\n ZeroArray, Array, Array, Array, Array, Array);\n"],"names":["ZeroArray","OriginalConstructor","modifier","a","fill","constructor","args","super","this","EPSILON","degrees","Math","PI","n","m","b","v","d","abs","t","radians","old","cache","Map","getAPI","Ctor","api","get","create","x","y","newDst","undefined","subtract","dst","lerp","mulScalar","k","inverse","dot","length","v0","v1","sqrt","lengthSq","distance","dx","dy","distanceSq","normalize","len","copy","multiply","divide","setLength","fromValues","set","ceil","floor","round","clamp","min","max","add","addScaled","scale","angle","ax","ay","bx","by","mag","cosine","acos","sub","equalsApproximately","utils.EPSILON","equals","lerpV","divScalar","invert","cross","z","lenSq","dist","distSq","negate","clone","mul","div","random","cos","sin","zero","transformMat4","transformMat3","rotate","rad","p0","p1","sinC","cosC","truncate","maxLen","midpoint","getAPIImpl","v2","dz","az","bz","t1","t2","zScale","w","transformMat4Upper3x3","transformQuat","q","qx","qy","qz","w2","uvX","uvY","uvZ","getTranslation","getAxis","axis","off","getScaling","xx","xy","xz","yx","yy","yz","zx","zy","zz","rotateX","p","r","rotateY","rotateZ","vec2","getVec2API","vec3","getVec3API","identity","m00","m01","m02","m10","m11","m12","m20","m21","m22","b01","b11","b21","invDet","a00","a01","a02","a10","a11","a12","a20","a21","a22","b00","b02","b10","b12","b20","b22","v3","v4","v5","v6","v7","v8","fromMat4","m4","fromQuat","x2","y2","z2","wx","wy","wz","transpose","determinant","setTranslation","setAxis","get3DScaling","translation","translate","rotation","angleInRadians","c","s","scaling","uniformScaling","uniformScale","m03","m13","m23","m30","m31","m32","m33","tmp0","tmp1","tmp2","tmp3","tmp4","tmp5","tmp6","tmp7","tmp8","tmp9","tmp10","tmp11","tmp12","tmp13","tmp14","tmp15","tmp16","tmp17","tmp18","tmp19","tmp20","tmp21","tmp22","tmp23","t0","t3","a03","a13","a23","a30","a31","a32","a33","b03","b13","b23","b30","b31","b32","b33","xAxis","yAxis","zAxis","axisRotation","oneMinusCosine","axisRotate","r00","r01","r02","r10","r11","r12","r20","r21","r22","v9","v10","v11","v12","v13","v14","v15","fromMat3","m3","perspective","fieldOfViewYInRadians","aspect","zNear","zFar","f","tan","Number","isFinite","rangeInv","perspectiveReverseZ","Infinity","ortho","left","right","bottom","top","near","far","frustum","frustumReverseZ","aim","position","target","up","cameraAim","eye","lookAt","rotationX","rotationY","rotationZ","fromAxisAngle","halfAngle","aw","bw","slerp","scale0","scale1","cosOmega","omega","sinOmega","tempVec3","xUnitVec3","yUnitVec3","tempQuat1","tempQuat2","toAxisAngle","qw","a0","a1","a2","a3","invDot","conjugate","fromMat","trace","root","invRoot","i","j","fromEuler","xAngleInRadians","yAngleInRadians","zAngleInRadians","order","xHalfAngle","yHalfAngle","zHalfAngle","sx","cx","sy","cy","sz","cz","Error","rotationTo","aUnit","bUnit","sqlerp","dw","wgpuMatrixAPI","Mat3Ctor","Mat4Ctor","QuatCtor","Vec2Ctor","Vec3Ctor","Vec4Ctor","mat3","getMat3API","mat4","getMat4API","quat","getQuatAPI","vec4","getVec4API","Float32Array","mat3d","mat4d","quatd","vec2d","vec3d","vec4d","Float64Array","mat3n","mat4n","qu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,CA+BUgF,CAAchF,GACpBH,EAAMkC,IAAI/B,EAAMC,IAEXA,CACT,CC3tBA,SAAS0U,EAQLC,EACAC,EACAC,EACAC,EACAC,EACAC,GAEF,MAAO,CAELC,KAAMC,EAAiBP,GAEvBQ,KAAMC,EAAiBR,GAEvBS,KAAMC,EAAiBT,GAEvBxN,KAAMC,EAAiBwN,GAEvBvN,KAAMC,EAAiBuN,GAEvBQ,KAAMC,EAAiBR,GAE3B,CAEa,MAAAC,KAKXA,EAAIE,KAKJA,EAAIE,KAKJA,EAAIhO,KAKJA,EAAIE,KAKJA,EAAIgO,KAKJA,GACEb,EAEAe,aAAcA,aAAcA,aAAcA,aAAcA,aAAcA,eAOxER,KAAMS,EAKNP,KAAMQ,EAKNN,KAAMO,EAKNvO,KAAMwO,EAKNtO,KAAMuO,EAKNP,KAAMQ,GACJrB,EAEAsB,aAAcA,aAAcA,aAAcA,aAAcA,aAAcA,eAOxEf,KAAMgB,EAKNd,KAAMe,EAKNb,KAAMc,EAKN9O,KAAM+O,EAKN7O,KAAM8O,EAKNd,KAAMe,GACJ5B,EAEApW,EAAWiY,MAAOA,MAAOA,MAAOA,MAAOA"} \ No newline at end of file +{"version":3,"file":"wgpu-matrix.module.min.js","sources":["../../../src/types.ts","../../../src/utils.ts","../../../src/vec2-impl.ts","../../../src/vec3-impl.ts","../../../src/mat3-impl.ts","../../../src/mat4-impl.ts","../../../src/quat-impl.ts","../../../src/vec4-impl.ts","../../../src/wgpu-matrix.ts"],"sourcesContent":["/**\n * The types you can pass to most functions that take an\n * array of numbers.\n */\nexport type BaseArgType = Float32Array | Float64Array | number[];\n\nfunction wrapConstructor any>(\n OriginalConstructor: T,\n modifier: (instance: InstanceType) => void\n): T {\n return class extends OriginalConstructor {\n constructor(...args: any[]) {\n super(...args);\n modifier(this as InstanceType);\n }\n } as T; // Type assertion is necessary here\n}\n\nexport const ZeroArray = wrapConstructor(Array, a => a.fill(0));\n\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nexport let EPSILON = 0.000001;\n\n/**\n * Set the value for EPSILON for various checks\n * @param v - Value to use for EPSILON.\n * @returns previous value of EPSILON;\n */\nexport function setEpsilon(v: number): number {\n const old = EPSILON;\n EPSILON = v;\n return old;\n}\n\n/**\n * Convert degrees to radians\n * @param degrees - Angle in degrees\n * @returns angle converted to radians\n */\nexport function degToRad(degrees: number): number {\n return degrees * Math.PI / 180;\n}\n\n/**\n * Convert radians to degrees\n * @param radians - Angle in radians\n * @returns angle converted to degrees\n */\nexport function radToDeg(radians: number): number {\n return radians * 180 / Math.PI;\n}\n\n/**\n * Lerps between a and b via t\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @returns a + (b - a) * t\n */\nexport function lerp(a: number, b: number, t: number): number {\n return a + (b - a) * t;\n}\n\n/**\n * Compute the opposite of lerp. Given a and b and a value between\n * a and b returns a value between 0 and 1. 0 if a, 1 if b.\n * Note: no clamping is done.\n * @param a - start value\n * @param b - end value\n * @param v - value between a and b\n * @returns (v - a) / (b - a)\n */\nexport function inverseLerp(a: number, b: number, v: number): number {\n const d = b - a;\n return (Math.abs(b - a) < EPSILON)\n ? a\n : (v - a) / d;\n}\n\n/**\n * Compute the euclidean modulo\n *\n * ```\n * // table for n / 3\n * -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 <- n\n * ------------------------------------\n * -2 -1 -0 -2 -1 0, 1, 2, 0, 1, 2 <- n % 3\n * 1 2 0 1 2 0, 1, 2, 0, 1, 2 <- euclideanModule(n, 3)\n * ```\n *\n * @param n - dividend\n * @param m - divisor\n * @returns the euclidean modulo of n / m\n */\nexport function euclideanModulo(n: number, m: number) {\n return ((n % m) + m) % m;\n}","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Mat3Arg } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { Vec2Arg, Vec2Type } from './vec2';\nimport { Vec3Arg } from './vec3';\nimport { BaseArgType } from './types';\n\nexport { Vec2Arg, Vec2Type };\n\ntype Vec2Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec3\n */\nfunction getAPIImpl(Ctor: Vec2Ctor) {\n\n/**\n * Creates a Vec2; may be called with x, y, z to set initial values.\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Vec2's specified type\n * it would be faster to use\n *\n * ```\n * const v = vec2.clone(someJSArray);\n * ```\n *\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\nfunction create(x = 0, y = 0) {\n const newDst = new Ctor(2);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n }\n }\n return newDst;\n}\n\n/**\n * Creates a Vec2; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec2\n * Also see {@link vec2.create} and {@link vec2.copy}\n *\n * @param x first value\n * @param y second value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec2Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec2Arg, b: Vec2Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n\n return newDst;\n}\n\n/**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\nfunction angle(a: Vec2Arg, b: Vec2Arg): number {\n const ax = a[0];\n const ay = a[1];\n const bx = b[0];\n const by = b[1];\n const mag1 = Math.sqrt(ax * ax + ay * ay);\n const mag2 = Math.sqrt(bx * bx + by * by);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec2Arg, b: Vec2Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec2Arg, b: Vec2Arg): boolean {\n return a[0] === b[0] && a[1] === b[1];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec2Arg, b: Vec2Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec2Arg, b: Vec2Arg, t: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec2Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec2Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\nfunction cross(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const z = a[0] * b[1] - a[1] * b[0];\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = z;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec2Arg, b: Vec2Arg): number {\n return a[0] * b[0] + a[1] * b[1];\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec2Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n return Math.sqrt(v0 * v0 + v1 * v1);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec2Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n return v0 * v0 + v1 * v1;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec2Arg, b: Vec2Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return Math.sqrt(dx * dx + dy * dy);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec2Arg, b: Vec2Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return dx * dx + dy * dy;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const len = Math.sqrt(v0 * v0 + v1 * v1);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n }\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec2.clone})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec2.copy})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Creates a random unit vector * scale\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\nfunction random(scale = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const angle = Math.random() * 2 * Math.PI;\n newDst[0] = Math.cos(angle) * scale;\n newDst[1] = Math.sin(angle) * scale;\n\n return newDst;\n}\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform Vec2 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec2Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const x = v[0];\n const y = v[1];\n\n newDst[0] = x * m[0] + y * m[4] + m[12];\n newDst[1] = x * m[1] + y * m[5] + m[13];\n\n return newDst;\n}\n\n/**\n * Transforms vec4 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat3(v: Vec2Arg, m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const x = v[0];\n const y = v[1];\n\n newDst[0] = m[0] * x + m[4] * y + m[8];\n newDst[1] = m[1] * x + m[5] * y + m[9];\n\n return newDst;\n}\n\n/**\n * Rotate a 2D vector\n *\n * @param a The vec2 point to rotate\n * @param b The origin of the rotation\n * @param rad The angle of rotation in radians\n * @returns the rotated vector\n */\nfunction rotate(a: Vec2Arg, b: Vec2Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n // Translate point to the origin\n const p0 = a[0] - b[0];\n const p1 = a[1] - b[1];\n const sinC = Math.sin(rad);\n const cosC = Math.cos(rad);\n\n //perform rotation and translate to correct position\n newDst[0] = p0 * cosC - p1 * sinC + b[0];\n newDst[1] = p0 * sinC + p1 * cosC + b[1];\n\n return newDst;\n}\n\n/**\n * Treat a 2D vector as a direction and set it's length\n *\n * @param a The vec2 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec2Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec2 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec2Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat3,\n rotate,\n setLength,\n truncate,\n midpoint,\n};\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Vec2Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Vec3Arg, Vec3Type } from './vec3';\nimport { Mat3Arg } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { QuatArg } from './quat';\nimport { BaseArgType } from './types';\n\nexport { Vec3Arg, Vec3Type };\n\ntype Vec3Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec3\n * */\nfunction getAPIImpl(Ctor: Vec3Ctor) {\n\n/**\n * Creates a vec3; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number) {\n const newDst = new Ctor(3);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a vec3; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec3\n * Also see {@link vec3.create} and {@link vec3.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec3Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec3Arg, b: Vec3Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n\n return newDst;\n}\n\n/**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\nfunction angle(a: Vec3Arg, b: Vec3Arg): number {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const mag1 = Math.sqrt(ax * ax + ay * ay + az * az);\n const mag2 = Math.sqrt(bx * bx + by * by + bz * bz);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec3Arg, b: Vec3Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec3Arg, b: Vec3Arg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec3Arg, b: Vec3Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec3Arg, b: Vec3Arg, t: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec3Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec3Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\nfunction cross(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const t1 = a[2] * b[0] - a[0] * b[2];\n const t2 = a[0] * b[1] - a[1] * b[0];\n newDst[0] = a[1] * b[2] - a[2] * b[1];\n newDst[1] = t1;\n newDst[2] = t2;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec3Arg, b: Vec3Arg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]);\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec3Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec3Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return v0 * v0 + v1 * v1 + v2 * v2;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec3Arg, b: Vec3Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return Math.sqrt(dx * dx + dy * dy + dz * dz);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec3Arg, b: Vec3Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return dx * dx + dy * dy + dz * dz;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec3.clone})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec3.copy})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Creates a random vector\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\nfunction random(scale = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const angle = Math.random() * 2 * Math.PI;\n const z = Math.random() * 2 - 1;\n const zScale = Math.sqrt(1 - z * z) * scale;\n newDst[0] = Math.cos(angle) * zScale;\n newDst[1] = Math.sin(angle) * zScale;\n newDst[2] = z * scale;\n\n return newDst;\n}\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform vec3 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec3Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1;\n\n newDst[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n newDst[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n newDst[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n\n return newDst;\n}\n\n/**\n * Transform vec3 by upper 3x3 matrix inside 4x4 matrix.\n * @param v - The direction.\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns The transformed vector.\n */\nfunction transformMat4Upper3x3(v: Vec3Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[0] = v0 * m[0 * 4 + 0] + v1 * m[1 * 4 + 0] + v2 * m[2 * 4 + 0];\n newDst[1] = v0 * m[0 * 4 + 1] + v1 * m[1 * 4 + 1] + v2 * m[2 * 4 + 1];\n newDst[2] = v0 * m[0 * 4 + 2] + v1 * m[1 * 4 + 2] + v2 * m[2 * 4 + 2];\n\n return newDst;\n}\n\n/**\n * Transforms vec3 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat3(v: Vec3Arg, m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n\n newDst[0] = x * m[0] + y * m[4] + z * m[8];\n newDst[1] = x * m[1] + y * m[5] + z * m[9];\n newDst[2] = x * m[2] + y * m[6] + z * m[10];\n\n return newDst;\n}\n\n/**\n * Transforms vec3 by Quaternion\n * @param v - the vector to transform\n * @param q - the quaternion to transform by\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed\n */\nfunction transformQuat(v: Vec3Arg, q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n\n const uvX = qy * z - qz * y;\n const uvY = qz * x - qx * z;\n const uvZ = qx * y - qy * x;\n\n newDst[0] = x + uvX * w2 + (qy * uvZ - qz * uvY) * 2;\n newDst[1] = y + uvY * w2 + (qz * uvX - qx * uvZ) * 2;\n newDst[2] = z + uvZ * w2 + (qx * uvY - qy * uvX) * 2;\n\n return newDst;\n}\n\n/**\n * Returns the translation component of a 4-by-4 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\nfunction getTranslation(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n}\n/**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat4Arg, axis: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n}\n/**\n * Returns the scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the x-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\nfunction rotateX(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n //Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n //perform rotation\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad);\n\n //translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the y-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\nfunction rotateY(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n // perform rotation\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad);\n\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the z-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns {vec3} out\n */\nfunction rotateZ(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n // perform rotation\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2];\n\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Treat a 3D vector as a direction and set it's length\n *\n * @param a The vec3 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec3Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec3 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec3Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat4Upper3x3,\n transformMat3,\n transformQuat,\n getTranslation,\n getAxis,\n getScaling,\n rotateX,\n rotateY,\n rotateZ,\n setLength,\n truncate,\n midpoint,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Vec3Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nimport * as utils from './utils.js';\nimport { QuatArg } from './quat';\nimport { Mat3Arg, Mat3Type } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { Vec2Arg } from './vec2';\nimport { Vec3Arg } from './vec3';\nimport { getAPI as getVec2API } from './vec2-impl';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\n\nexport { Mat3Arg, Mat3Type };\n\ntype Mat3Ctor = new (n: number) => T;\n\n/**\n * Generates a typed API for Mat3\n * */\nfunction getAPIImpl(Ctor: Mat3Ctor) {\n const vec2 = getVec2API(Ctor);\n const vec3 = getVec3API(Ctor);\n\n/**\n * Create a Mat3 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat3's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat3.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @returns matrix created from values.\n */\nfunction create(\n v0?: number, v1?: number, v2?: number,\n v3?: number, v4?: number, v5?: number,\n v6?: number, v7?: number, v8?: number) {\n const newDst = new Ctor(12);\n // to make the array homogenous\n newDst[3] = 0;\n newDst[7] = 0;\n newDst[11] = 0;\n\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[4] = v3;\n if (v4 !== undefined) {\n newDst[5] = v4;\n if (v5 !== undefined) {\n newDst[6] = v5;\n if (v6 !== undefined) {\n newDst[8] = v6;\n if (v7 !== undefined) {\n newDst[9] = v7;\n if (v8 !== undefined) {\n newDst[10] = v8;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n\n return newDst;\n}\n\n/**\n * Sets the values of a Mat3\n * Also see {@link mat3.create} and {@link mat3.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 set from values.\n */\nfunction set(\n v0: number, v1: number, v2: number,\n v3: number, v4: number, v5: number,\n v6: number, v7: number, v8: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[0] = v0; newDst[1] = v1; newDst[ 2] = v2; newDst[ 3] = 0;\n newDst[4] = v3; newDst[5] = v4; newDst[ 6] = v5; newDst[ 7] = 0;\n newDst[8] = v6; newDst[9] = v7; newDst[10] = v8; newDst[11] = 0;\n\n return newDst;\n}\n\n/**\n * Creates a Mat3 from the upper left 3x3 part of a Mat4\n * @param m4 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from m4\n */\nfunction fromMat4(m4: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n newDst[0] = m4[0]; newDst[1] = m4[1]; newDst[ 2] = m4[ 2]; newDst[ 3] = 0;\n newDst[4] = m4[4]; newDst[5] = m4[5]; newDst[ 6] = m4[ 6]; newDst[ 7] = 0;\n newDst[8] = m4[8]; newDst[9] = m4[9]; newDst[10] = m4[10]; newDst[11] = 0;\n return newDst;\n}\n\n/**\n * Creates a Mat3 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from q\n */\nfunction fromQuat(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3];\n const x2 = x + x; const y2 = y + y; const z2 = z + z;\n\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n newDst[ 0] = 1 - yy - zz; newDst[ 1] = yx + wz; newDst[ 2] = zx - wy; newDst[ 3] = 0;\n newDst[ 4] = yx - wz; newDst[ 5] = 1 - xx - zz; newDst[ 6] = zy + wx; newDst[ 7] = 0;\n newDst[ 8] = zx + wy; newDst[ 9] = zy - wx; newDst[10] = 1 - xx - yy; newDst[11] = 0;\n\n return newDst;\n}\n\n/**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\nfunction negate(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = -m[ 0]; newDst[ 1] = -m[ 1]; newDst[ 2] = -m[ 2];\n newDst[ 4] = -m[ 4]; newDst[ 5] = -m[ 5]; newDst[ 6] = -m[ 6];\n newDst[ 8] = -m[ 8]; newDst[ 9] = -m[ 9]; newDst[10] = -m[10];\n\n return newDst;\n}\n\n/**\n * Copies a matrix. (same as {@link mat3.clone})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nfunction copy(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = m[ 0]; newDst[ 1] = m[ 1]; newDst[ 2] = m[ 2];\n newDst[ 4] = m[ 4]; newDst[ 5] = m[ 5]; newDst[ 6] = m[ 6];\n newDst[ 8] = m[ 8]; newDst[ 9] = m[ 9]; newDst[10] = m[10];\n\n return newDst;\n}\n\n/**\n * Copies a matrix (same as {@link mat3.copy})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nconst clone = copy;\n\n/**\n * Check if 2 matrices are approximately equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are approximately equal\n */\nfunction equalsApproximately(a: Mat3Arg, b: Mat3Arg): boolean {\n return Math.abs(a[ 0] - b[ 0]) < utils.EPSILON &&\n Math.abs(a[ 1] - b[ 1]) < utils.EPSILON &&\n Math.abs(a[ 2] - b[ 2]) < utils.EPSILON &&\n Math.abs(a[ 4] - b[ 4]) < utils.EPSILON &&\n Math.abs(a[ 5] - b[ 5]) < utils.EPSILON &&\n Math.abs(a[ 6] - b[ 6]) < utils.EPSILON &&\n Math.abs(a[ 8] - b[ 8]) < utils.EPSILON &&\n Math.abs(a[ 9] - b[ 9]) < utils.EPSILON &&\n Math.abs(a[10] - b[10]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 matrices are exactly equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are exactly equal\n */\nfunction equals(a: Mat3Arg, b: Mat3Arg): boolean {\n return a[ 0] === b[ 0] &&\n a[ 1] === b[ 1] &&\n a[ 2] === b[ 2] &&\n a[ 4] === b[ 4] &&\n a[ 5] === b[ 5] &&\n a[ 6] === b[ 6] &&\n a[ 8] === b[ 8] &&\n a[ 9] === b[ 9] &&\n a[10] === b[10];\n}\n\n/**\n * Creates a 3-by-3 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 3-by-3 identity matrix.\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\nfunction transpose(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n if (newDst === m) {\n let t: number;\n\n // 0 1 2\n // 4 5 6\n // 8 9 10\n\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n\n return newDst;\n }\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n newDst[ 0] = m00; newDst[ 1] = m10; newDst[ 2] = m20;\n newDst[ 4] = m01; newDst[ 5] = m11; newDst[ 6] = m21;\n newDst[ 8] = m02; newDst[ 9] = m12; newDst[10] = m22;\n\n return newDst;\n}\n\n/**\n * Computes the inverse of a 3-by-3 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nfunction inverse(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n const b01 = m22 * m11 - m12 * m21;\n const b11 = -m22 * m10 + m12 * m20;\n const b21 = m21 * m10 - m11 * m20;\n\n const invDet = 1 / (m00 * b01 + m01 * b11 + m02 * b21);\n\n newDst[ 0] = b01 * invDet;\n newDst[ 1] = (-m22 * m01 + m02 * m21) * invDet;\n newDst[ 2] = ( m12 * m01 - m02 * m11) * invDet;\n newDst[ 4] = b11 * invDet;\n newDst[ 5] = ( m22 * m00 - m02 * m20) * invDet;\n newDst[ 6] = (-m12 * m00 + m02 * m10) * invDet;\n newDst[ 8] = b21 * invDet;\n newDst[ 9] = (-m21 * m00 + m01 * m20) * invDet;\n newDst[10] = ( m11 * m00 - m01 * m10) * invDet;\n\n return newDst;\n}\n\n/**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\nfunction determinant(m: Mat3Arg): number {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n return m00 * (m11 * m22 - m21 * m12) -\n m10 * (m01 * m22 - m21 * m02) +\n m20 * (m01 * m12 - m11 * m02);\n}\n\n/**\n * Computes the inverse of a 3-by-3 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nconst invert = inverse;\n\n/**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nfunction multiply(a: Mat3Arg, b: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[ 4 + 0];\n const a11 = a[ 4 + 1];\n const a12 = a[ 4 + 2];\n const a20 = a[ 8 + 0];\n const a21 = a[ 8 + 1];\n const a22 = a[ 8 + 2];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b10 = b[ 4 + 0];\n const b11 = b[ 4 + 1];\n const b12 = b[ 4 + 2];\n const b20 = b[ 8 + 0];\n const b21 = b[ 8 + 1];\n const b22 = b[ 8 + 2];\n\n newDst[ 0] = a00 * b00 + a10 * b01 + a20 * b02;\n newDst[ 1] = a01 * b00 + a11 * b01 + a21 * b02;\n newDst[ 2] = a02 * b00 + a12 * b01 + a22 * b02;\n newDst[ 4] = a00 * b10 + a10 * b11 + a20 * b12;\n newDst[ 5] = a01 * b10 + a11 * b11 + a21 * b12;\n newDst[ 6] = a02 * b10 + a12 * b11 + a22 * b12;\n newDst[ 8] = a00 * b20 + a10 * b21 + a20 * b22;\n newDst[ 9] = a01 * b20 + a11 * b21 + a21 * b22;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22;\n\n return newDst;\n}\n\n/**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nconst mul = multiply;\n\n/**\n * Sets the translation component of a 3-by-3 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\nfunction setTranslation(a: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? identity()) as T;\n if (a !== newDst) {\n newDst[ 0] = a[ 0];\n newDst[ 1] = a[ 1];\n newDst[ 2] = a[ 2];\n newDst[ 4] = a[ 4];\n newDst[ 5] = a[ 5];\n newDst[ 6] = a[ 6];\n }\n newDst[ 8] = v[0];\n newDst[ 9] = v[1];\n newDst[10] = 1;\n return newDst;\n}\n\n/**\n * Returns the translation component of a 3-by-3 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\nfunction getTranslation(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec2.create()) as T;\n newDst[0] = m[8];\n newDst[1] = m[9];\n return newDst;\n}\n\n/**\n * Returns an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y,\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat3Arg, axis: number, dst?: T) {\n const newDst = (dst ?? vec2.create()) as T;\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n return newDst;\n}\n\n/**\n * Sets an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\nfunction setAxis(m: Mat3Arg, v: Vec2Arg, axis: number, dst?: T) {\n const newDst = (dst === m ? m : copy(m, dst)) as T;\n\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n return newDst;\n}\n\n/**\n * Returns the \"2d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec2.create());\n\n const xx = m[0];\n const xy = m[1];\n const yx = m[4];\n const yy = m[5];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy);\n newDst[1] = Math.sqrt(yx * yx + yy * yy);\n\n return newDst;\n}\n\n\n/**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction get3DScaling(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec3.create());\n\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which translates by the given vector v.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\nfunction translation(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = v[0]; newDst[ 9] = v[1]; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Translates the given 3-by-3 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\nfunction translate(m: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 0] = m00;\n newDst[ 1] = m01;\n newDst[ 2] = m02;\n newDst[ 4] = m10;\n newDst[ 5] = m11;\n newDst[ 6] = m12;\n }\n\n newDst[ 8] = m00 * v0 + m10 * v1 + m20;\n newDst[ 9] = m01 * v0 + m11 * v1 + m21;\n newDst[10] = m02 * v0 + m12 * v1 + m22;\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotation(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = s; newDst[ 2] = 0;\n newDst[ 4] = -s; newDst[ 5] = c; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix by the given angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotate(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 + s * m10;\n newDst[ 1] = c * m01 + s * m11;\n newDst[ 2] = c * m02 + s * m12;\n\n newDst[ 4] = c * m10 - s * m00;\n newDst[ 5] = c * m11 - s * m01;\n newDst[ 6] = c * m12 - s * m02;\n\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the x-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationX(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = c; newDst[ 6] = s;\n newDst[ 8] = 0; newDst[ 9] = -s; newDst[10] = c;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix around the x-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateX(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[4] = c * m10 + s * m20;\n newDst[5] = c * m11 + s * m21;\n newDst[6] = c * m12 + s * m22;\n newDst[8] = c * m20 - s * m10;\n newDst[9] = c * m21 - s * m11;\n newDst[10] = c * m22 - s * m12;\n\n if (m !== newDst) {\n newDst[ 0] = m[ 0];\n newDst[ 1] = m[ 1];\n newDst[ 2] = m[ 2];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the y-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationY(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = 0; newDst[ 2] = -s;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = s; newDst[ 9] = 0; newDst[10] = c;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix around the y-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateY(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 - s * m20;\n newDst[ 1] = c * m01 - s * m21;\n newDst[ 2] = c * m02 - s * m22;\n newDst[ 8] = c * m20 + s * m00;\n newDst[ 9] = c * m21 + s * m01;\n newDst[10] = c * m22 + s * m02;\n\n if (m !== newDst) {\n newDst[ 4] = m[ 4];\n newDst[ 5] = m[ 5];\n newDst[ 6] = m[ 6];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the z-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nconst rotationZ = rotation;\n\n/**\n * Rotates the given 3-by-3 matrix around the z-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nconst rotateZ = rotate;\n\n/**\n * Creates a 3-by-3 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has two\n * entries.\n * @param v - A vector of\n * 2 entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * two entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of 2 entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale(m: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * 3 entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling3D(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = v[2];\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of 3 entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale3D(m: Mat3Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n\n newDst[ 8] = v2 * m[2 * 4 + 0];\n newDst[ 9] = v2 * m[2 * 4 + 1];\n newDst[10] = v2 * m[2 * 4 + 2];\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales uniformly in the X and Y dimensions\n * @param s - Amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in the X and Y dimension by an amount\n * given.\n * @param m - The matrix to be modified.\n * @param s - Amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale(m: Mat3Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales uniformly in each dimension\n * @param s - Amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling3D(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = s;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given.\n * @param m - The matrix to be modified.\n * @param s - Amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale3D(m: Mat3Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n\n newDst[ 8] = s * m[2 * 4 + 0];\n newDst[ 9] = s * m[2 * 4 + 1];\n newDst[10] = s * m[2 * 4 + 2];\n\n return newDst;\n}\n\nreturn {\n clone,\n create,\n set,\n fromMat4,\n fromQuat,\n negate,\n copy,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n invert,\n determinant,\n mul,\n multiply,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n get3DScaling,\n translation,\n translate,\n rotation,\n rotate,\n rotationX,\n rotateX,\n rotationY,\n rotateY,\n rotationZ,\n rotateZ,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n scaling3D,\n scale3D,\n uniformScaling3D,\n uniformScale3D,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Mat3Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","import { Mat4Arg, Mat4Type } from './mat4';\nimport { Mat3Arg } from './mat3';\nimport { QuatArg } from './quat';\nimport { Vec3Arg } from './vec3';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\nimport * as utils from './utils';\n\nexport { Mat4Arg, Mat4Type };\n\ntype Mat4Ctor = new (n: number) => T;\n\n/**\n * Generates a typed API for Mat4\n * */\nfunction getAPIImpl(Ctor: Mat4Ctor) {\n const vec3 = getVec3API(Ctor);\n\n/**\n * 4x4 Matrix math math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new matrix. In other words you can do this\n *\n * const mat = mat4.translation([1, 2, 3]); // Creates a new translation matrix\n *\n * or\n *\n * const mat = mat4.create();\n * mat4.translation([1, 2, 3], mat); // Puts translation matrix in mat.\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always save to pass any matrix as the destination. So for example\n *\n * const mat = mat4.identity();\n * const trans = mat4.translation([1, 2, 3]);\n * mat4.multiply(mat, trans, mat); // Multiplies mat * trans and puts result in mat.\n *\n */\n\n\n/**\n * Create a Mat4 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat4's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat4.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @returns created from values.\n */\nfunction create(\n v0?: number, v1?: number, v2?: number, v3?: number,\n v4?: number, v5?: number, v6?: number, v7?: number,\n v8?: number, v9?: number, v10?: number, v11?: number,\n v12?: number, v13?: number, v14?: number, v15?: number) {\n const newDst = new Ctor(16);\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[3] = v3;\n if (v4 !== undefined) {\n newDst[4] = v4;\n if (v5 !== undefined) {\n newDst[5] = v5;\n if (v6 !== undefined) {\n newDst[6] = v6;\n if (v7 !== undefined) {\n newDst[7] = v7;\n if (v8 !== undefined) {\n newDst[8] = v8;\n if (v9 !== undefined) {\n newDst[9] = v9;\n if (v10 !== undefined) {\n newDst[10] = v10;\n if (v11 !== undefined) {\n newDst[11] = v11;\n if (v12 !== undefined) {\n newDst[12] = v12;\n if (v13 !== undefined) {\n newDst[13] = v13;\n if (v14 !== undefined) {\n newDst[14] = v14;\n if (v15 !== undefined) {\n newDst[15] = v15;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Sets the values of a Mat4\n * Also see {@link mat4.create} and {@link mat4.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 created from values.\n */\nfunction set(\n v0: number, v1: number, v2: number, v3: number,\n v4: number, v5: number, v6: number, v7: number,\n v8: number, v9: number, v10: number, v11: number,\n v12: number, v13: number, v14: number, v15: number,\n dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = v0; newDst[ 1] = v1; newDst[ 2] = v2; newDst[ 3] = v3;\n newDst[ 4] = v4; newDst[ 5] = v5; newDst[ 6] = v6; newDst[ 7] = v7;\n newDst[ 8] = v8; newDst[ 9] = v9; newDst[10] = v10; newDst[11] = v11;\n newDst[12] = v12; newDst[13] = v13; newDst[14] = v14; newDst[15] = v15;\n\n return newDst;\n}\n\n/**\n * Creates a Mat4 from a Mat3\n * @param m3 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from m3\n */\nfunction fromMat3(m3: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = m3[0]; newDst[ 1] = m3[1]; newDst[ 2] = m3[ 2]; newDst[ 3] = 0;\n newDst[ 4] = m3[4]; newDst[ 5] = m3[5]; newDst[ 6] = m3[ 6]; newDst[ 7] = 0;\n newDst[ 8] = m3[8]; newDst[ 9] = m3[9]; newDst[10] = m3[10]; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a Mat4 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from q\n */\nfunction fromQuat(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3];\n const x2 = x + x; const y2 = y + y; const z2 = z + z;\n\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n newDst[ 0] = 1 - yy - zz; newDst[ 1] = yx + wz; newDst[ 2] = zx - wy; newDst[ 3] = 0;\n newDst[ 4] = yx - wz; newDst[ 5] = 1 - xx - zz; newDst[ 6] = zy + wx; newDst[ 7] = 0;\n newDst[ 8] = zx + wy; newDst[ 9] = zy - wx; newDst[10] = 1 - xx - yy; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\nfunction negate(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = -m[ 0]; newDst[ 1] = -m[ 1]; newDst[ 2] = -m[ 2]; newDst[ 3] = -m[ 3];\n newDst[ 4] = -m[ 4]; newDst[ 5] = -m[ 5]; newDst[ 6] = -m[ 6]; newDst[ 7] = -m[ 7];\n newDst[ 8] = -m[ 8]; newDst[ 9] = -m[ 9]; newDst[10] = -m[10]; newDst[11] = -m[11];\n newDst[12] = -m[12]; newDst[13] = -m[13]; newDst[14] = -m[14]; newDst[15] = -m[15];\n\n return newDst;\n}\n\n/**\n * Copies a matrix. (same as {@link mat4.clone})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nfunction copy(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = m[ 0]; newDst[ 1] = m[ 1]; newDst[ 2] = m[ 2]; newDst[ 3] = m[ 3];\n newDst[ 4] = m[ 4]; newDst[ 5] = m[ 5]; newDst[ 6] = m[ 6]; newDst[ 7] = m[ 7];\n newDst[ 8] = m[ 8]; newDst[ 9] = m[ 9]; newDst[10] = m[10]; newDst[11] = m[11];\n newDst[12] = m[12]; newDst[13] = m[13]; newDst[14] = m[14]; newDst[15] = m[15];\n\n return newDst;\n}\n\n/**\n * Copies a matrix (same as {@link mat4.copy})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nconst clone = copy;\n\n/**\n * Check if 2 matrices are approximately equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are approximately equal\n */\nfunction equalsApproximately(a: Mat4Arg, b: Mat4Arg): boolean {\n return Math.abs(a[ 0] - b[ 0]) < utils.EPSILON &&\n Math.abs(a[ 1] - b[ 1]) < utils.EPSILON &&\n Math.abs(a[ 2] - b[ 2]) < utils.EPSILON &&\n Math.abs(a[ 3] - b[ 3]) < utils.EPSILON &&\n Math.abs(a[ 4] - b[ 4]) < utils.EPSILON &&\n Math.abs(a[ 5] - b[ 5]) < utils.EPSILON &&\n Math.abs(a[ 6] - b[ 6]) < utils.EPSILON &&\n Math.abs(a[ 7] - b[ 7]) < utils.EPSILON &&\n Math.abs(a[ 8] - b[ 8]) < utils.EPSILON &&\n Math.abs(a[ 9] - b[ 9]) < utils.EPSILON &&\n Math.abs(a[10] - b[10]) < utils.EPSILON &&\n Math.abs(a[11] - b[11]) < utils.EPSILON &&\n Math.abs(a[12] - b[12]) < utils.EPSILON &&\n Math.abs(a[13] - b[13]) < utils.EPSILON &&\n Math.abs(a[14] - b[14]) < utils.EPSILON &&\n Math.abs(a[15] - b[15]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 matrices are exactly equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are exactly equal\n */\nfunction equals(a: Mat4Arg, b: Mat4Arg): boolean {\n return a[ 0] === b[ 0] &&\n a[ 1] === b[ 1] &&\n a[ 2] === b[ 2] &&\n a[ 3] === b[ 3] &&\n a[ 4] === b[ 4] &&\n a[ 5] === b[ 5] &&\n a[ 6] === b[ 6] &&\n a[ 7] === b[ 7] &&\n a[ 8] === b[ 8] &&\n a[ 9] === b[ 9] &&\n a[10] === b[10] &&\n a[11] === b[11] &&\n a[12] === b[12] &&\n a[13] === b[13] &&\n a[14] === b[14] &&\n a[15] === b[15];\n}\n\n/**\n * Creates a 4-by-4 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 4-by-4 identity matrix.\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\nfunction transpose(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n if (newDst === m) {\n let t;\n\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n\n t = m[3];\n m[3] = m[12];\n m[12] = t;\n\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n\n t = m[7];\n m[7] = m[13];\n m[13] = t;\n\n t = m[11];\n m[11] = m[14];\n m[14] = t;\n return newDst;\n }\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n newDst[ 0] = m00; newDst[ 1] = m10; newDst[ 2] = m20; newDst[ 3] = m30;\n newDst[ 4] = m01; newDst[ 5] = m11; newDst[ 6] = m21; newDst[ 7] = m31;\n newDst[ 8] = m02; newDst[ 9] = m12; newDst[10] = m22; newDst[11] = m32;\n newDst[12] = m03; newDst[13] = m13; newDst[14] = m23; newDst[15] = m33;\n\n return newDst;\n}\n\n/**\n * Computes the inverse of a 4-by-4 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nfunction inverse(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n const tmp12 = m20 * m31;\n const tmp13 = m30 * m21;\n const tmp14 = m10 * m31;\n const tmp15 = m30 * m11;\n const tmp16 = m10 * m21;\n const tmp17 = m20 * m11;\n const tmp18 = m00 * m31;\n const tmp19 = m30 * m01;\n const tmp20 = m00 * m21;\n const tmp21 = m20 * m01;\n const tmp22 = m00 * m11;\n const tmp23 = m10 * m01;\n\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n\n const d = 1 / (m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3);\n\n newDst[ 0] = d * t0;\n newDst[ 1] = d * t1;\n newDst[ 2] = d * t2;\n newDst[ 3] = d * t3;\n newDst[ 4] = d * ((tmp1 * m10 + tmp2 * m20 + tmp5 * m30) -\n (tmp0 * m10 + tmp3 * m20 + tmp4 * m30));\n newDst[ 5] = d * ((tmp0 * m00 + tmp7 * m20 + tmp8 * m30) -\n (tmp1 * m00 + tmp6 * m20 + tmp9 * m30));\n newDst[ 6] = d * ((tmp3 * m00 + tmp6 * m10 + tmp11 * m30) -\n (tmp2 * m00 + tmp7 * m10 + tmp10 * m30));\n newDst[ 7] = d * ((tmp4 * m00 + tmp9 * m10 + tmp10 * m20) -\n (tmp5 * m00 + tmp8 * m10 + tmp11 * m20));\n newDst[ 8] = d * ((tmp12 * m13 + tmp15 * m23 + tmp16 * m33) -\n (tmp13 * m13 + tmp14 * m23 + tmp17 * m33));\n newDst[ 9] = d * ((tmp13 * m03 + tmp18 * m23 + tmp21 * m33) -\n (tmp12 * m03 + tmp19 * m23 + tmp20 * m33));\n newDst[10] = d * ((tmp14 * m03 + tmp19 * m13 + tmp22 * m33) -\n (tmp15 * m03 + tmp18 * m13 + tmp23 * m33));\n newDst[11] = d * ((tmp17 * m03 + tmp20 * m13 + tmp23 * m23) -\n (tmp16 * m03 + tmp21 * m13 + tmp22 * m23));\n newDst[12] = d * ((tmp14 * m22 + tmp17 * m32 + tmp13 * m12) -\n (tmp16 * m32 + tmp12 * m12 + tmp15 * m22));\n newDst[13] = d * ((tmp20 * m32 + tmp12 * m02 + tmp19 * m22) -\n (tmp18 * m22 + tmp21 * m32 + tmp13 * m02));\n newDst[14] = d * ((tmp18 * m12 + tmp23 * m32 + tmp15 * m02) -\n (tmp22 * m32 + tmp14 * m02 + tmp19 * m12));\n newDst[15] = d * ((tmp22 * m22 + tmp16 * m02 + tmp21 * m12) -\n (tmp20 * m12 + tmp23 * m22 + tmp17 * m02));\n\n return newDst;\n}\n\n/**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\nfunction determinant(m: Mat4Arg): number {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n\n return m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3;\n}\n\n/**\n * Computes the inverse of a 4-by-4 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nconst invert = inverse;\n\n/**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nfunction multiply(a: Mat4Arg, b: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[ 4 + 0];\n const a11 = a[ 4 + 1];\n const a12 = a[ 4 + 2];\n const a13 = a[ 4 + 3];\n const a20 = a[ 8 + 0];\n const a21 = a[ 8 + 1];\n const a22 = a[ 8 + 2];\n const a23 = a[ 8 + 3];\n const a30 = a[12 + 0];\n const a31 = a[12 + 1];\n const a32 = a[12 + 2];\n const a33 = a[12 + 3];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b03 = b[3];\n const b10 = b[ 4 + 0];\n const b11 = b[ 4 + 1];\n const b12 = b[ 4 + 2];\n const b13 = b[ 4 + 3];\n const b20 = b[ 8 + 0];\n const b21 = b[ 8 + 1];\n const b22 = b[ 8 + 2];\n const b23 = b[ 8 + 3];\n const b30 = b[12 + 0];\n const b31 = b[12 + 1];\n const b32 = b[12 + 2];\n const b33 = b[12 + 3];\n\n newDst[ 0] = a00 * b00 + a10 * b01 + a20 * b02 + a30 * b03;\n newDst[ 1] = a01 * b00 + a11 * b01 + a21 * b02 + a31 * b03;\n newDst[ 2] = a02 * b00 + a12 * b01 + a22 * b02 + a32 * b03;\n newDst[ 3] = a03 * b00 + a13 * b01 + a23 * b02 + a33 * b03;\n newDst[ 4] = a00 * b10 + a10 * b11 + a20 * b12 + a30 * b13;\n newDst[ 5] = a01 * b10 + a11 * b11 + a21 * b12 + a31 * b13;\n newDst[ 6] = a02 * b10 + a12 * b11 + a22 * b12 + a32 * b13;\n newDst[ 7] = a03 * b10 + a13 * b11 + a23 * b12 + a33 * b13;\n newDst[ 8] = a00 * b20 + a10 * b21 + a20 * b22 + a30 * b23;\n newDst[ 9] = a01 * b20 + a11 * b21 + a21 * b22 + a31 * b23;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22 + a32 * b23;\n newDst[11] = a03 * b20 + a13 * b21 + a23 * b22 + a33 * b23;\n newDst[12] = a00 * b30 + a10 * b31 + a20 * b32 + a30 * b33;\n newDst[13] = a01 * b30 + a11 * b31 + a21 * b32 + a31 * b33;\n newDst[14] = a02 * b30 + a12 * b31 + a22 * b32 + a32 * b33;\n newDst[15] = a03 * b30 + a13 * b31 + a23 * b32 + a33 * b33;\n\n return newDst;\n}\n\n/**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nconst mul = multiply;\n\n/**\n * Sets the translation component of a 4-by-4 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\nfunction setTranslation(a: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? identity()) as T;\n if (a !== newDst) {\n newDst[ 0] = a[ 0];\n newDst[ 1] = a[ 1];\n newDst[ 2] = a[ 2];\n newDst[ 3] = a[ 3];\n newDst[ 4] = a[ 4];\n newDst[ 5] = a[ 5];\n newDst[ 6] = a[ 6];\n newDst[ 7] = a[ 7];\n newDst[ 8] = a[ 8];\n newDst[ 9] = a[ 9];\n newDst[10] = a[10];\n newDst[11] = a[11];\n }\n newDst[12] = v[0];\n newDst[13] = v[1];\n newDst[14] = v[2];\n newDst[15] = 1;\n return newDst;\n}\n\n///**\n// * Returns the translation component of a 4-by-4 matrix as a vector with 3\n// * entries.\n// * @param m - The matrix.\n// * @param dst - vector to hold result. If not passed a new one is created.\n// * @returns The translation component of m.\n// */\nfunction getTranslation(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? vec3.create()) as T;\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n}\n\n/**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat4Arg, axis: number, dst?: T) {\n const newDst = (dst ?? vec3.create());\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n}\n\n/**\n * Sets an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\nfunction setAxis(m: Mat4Arg, v: Vec3Arg, axis: number, dst: T) {\n const newDst = (dst === m) ? dst : copy(m, dst);\n\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n newDst[off + 2] = v[2];\n return newDst;\n}\n\n/**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? vec3.create()) as T;\n\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 0 to 1 in the z dimension.\n *\n * Note: If you pass `Infinity` for zFar then it will produce a projection matrix\n * returns -Infinity for Z when transforming coordinates with Z <= 0 and +Infinity for Z\n * otherwise.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */\nfunction perspective(fieldOfViewYInRadians: number, aspect: number, zNear: number, zFar: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const f = Math.tan(Math.PI * 0.5 - 0.5 * fieldOfViewYInRadians);\n\n newDst[0] = f / aspect;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n newDst[4] = 0;\n newDst[5] = f;\n newDst[6] = 0;\n newDst[7] = 0;\n\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[11] = -1;\n\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (Number.isFinite(zFar)) {\n const rangeInv = 1 / (zNear - zFar);\n newDst[10] = zFar * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n } else {\n newDst[10] = -1;\n newDst[14] = -zNear;\n }\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 1 (at -zNear) to 0 (at -zFar) in the z dimension.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane. (default = Infinity)\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */function perspectiveReverseZ(fieldOfViewYInRadians: number, aspect: number, zNear: number, zFar = Infinity, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const f = 1 / Math.tan(fieldOfViewYInRadians * 0.5);\n\n newDst[ 0] = f / aspect;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n\n newDst[ 4] = 0;\n newDst[ 5] = f;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n\n newDst[ 8] = 0;\n newDst[ 9] = 0;\n newDst[11] = -1;\n\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (zFar === Infinity) {\n newDst[10] = 0;\n newDst[14] = zNear;\n } else {\n const rangeInv = 1 / (zFar - zNear);\n newDst[10] = zNear * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n }\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 orthogonal transformation matrix that transforms from\n * the given the left, right, bottom, and top dimensions to -1 +1 in x, and y\n * and 0 to +1 in z.\n * @param left - Left side of the near clipping plane viewport.\n * @param right - Right side of the near clipping plane viewport.\n * @param bottom - Bottom of the near clipping plane viewport.\n * @param top - Top of the near clipping plane viewport.\n * @param near - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param far - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The orthographic projection matrix.\n */\nfunction ortho(left: number, right: number, bottom: number, top: number, near: number, far: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[0] = 2 / (right - left);\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n newDst[4] = 0;\n newDst[5] = 2 / (top - bottom);\n newDst[6] = 0;\n newDst[7] = 0;\n\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[10] = 1 / (near - far);\n newDst[11] = 0;\n\n newDst[12] = (right + left) / (left - right);\n newDst[13] = (top + bottom) / (bottom - top);\n newDst[14] = near / (near - far);\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 0 to 1 in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\nfunction frustum(left: number, right: number, bottom: number, top: number, near: number, far: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const dx = (right - left);\n const dy = (top - bottom);\n const dz = (near - far);\n\n newDst[ 0] = 2 * near / dx;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n newDst[ 4] = 0;\n newDst[ 5] = 2 * near / dy;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n newDst[ 8] = (left + right) / dx;\n newDst[ 9] = (top + bottom) / dy;\n newDst[10] = far / dz;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = near * far / dz;\n newDst[15] = 0;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 1 (-near) to 0 (-far) in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\nfunction frustumReverseZ(left: number, right: number, bottom: number, top: number, near: number, far = Infinity, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const dx = (right - left);\n const dy = (top - bottom);\n\n newDst[ 0] = 2 * near / dx;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n newDst[ 4] = 0;\n newDst[ 5] = 2 * near / dy;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n newDst[ 8] = (left + right) / dx;\n newDst[ 9] = (top + bottom) / dy;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (far === Infinity) {\n newDst[10] = 0;\n newDst[14] = near;\n } else {\n const rangeInv = 1 / (far - near);\n newDst[10] = near * rangeInv;\n newDst[14] = far * near * rangeInv;\n }\n\n return newDst;\n}\n\nconst xAxis = vec3.create();\nconst yAxis = vec3.create();\nconst zAxis = vec3.create();\n\n/**\n * Computes a 4-by-4 aim transformation.\n *\n * This is a matrix which positions an object aiming down positive Z.\n * toward the target.\n *\n * Note: this is **NOT** the inverse of lookAt as lookAt looks at negative Z.\n *\n * @param position - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\nfunction aim(position: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(target, position, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = xAxis[1]; newDst[ 2] = xAxis[2]; newDst[ 3] = 0;\n newDst[ 4] = yAxis[0]; newDst[ 5] = yAxis[1]; newDst[ 6] = yAxis[2]; newDst[ 7] = 0;\n newDst[ 8] = zAxis[0]; newDst[ 9] = zAxis[1]; newDst[10] = zAxis[2]; newDst[11] = 0;\n newDst[12] = position[0]; newDst[13] = position[1]; newDst[14] = position[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 camera aim transformation.\n *\n * This is a matrix which positions an object aiming down negative Z.\n * toward the target.\n *\n * Note: this is the inverse of `lookAt`\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\nfunction cameraAim(eye: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = xAxis[1]; newDst[ 2] = xAxis[2]; newDst[ 3] = 0;\n newDst[ 4] = yAxis[0]; newDst[ 5] = yAxis[1]; newDst[ 6] = yAxis[2]; newDst[ 7] = 0;\n newDst[ 8] = zAxis[0]; newDst[ 9] = zAxis[1]; newDst[10] = zAxis[2]; newDst[11] = 0;\n newDst[12] = eye[0]; newDst[13] = eye[1]; newDst[14] = eye[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 view transformation.\n *\n * This is a view matrix which transforms all other objects\n * to be in the space of the view defined by the parameters.\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The look-at matrix.\n */\nfunction lookAt(eye: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = yAxis[0]; newDst[ 2] = zAxis[0]; newDst[ 3] = 0;\n newDst[ 4] = xAxis[1]; newDst[ 5] = yAxis[1]; newDst[ 6] = zAxis[1]; newDst[ 7] = 0;\n newDst[ 8] = xAxis[2]; newDst[ 9] = yAxis[2]; newDst[10] = zAxis[2]; newDst[11] = 0;\n\n newDst[12] = -(xAxis[0] * eye[0] + xAxis[1] * eye[1] + xAxis[2] * eye[2]);\n newDst[13] = -(yAxis[0] * eye[0] + yAxis[1] * eye[1] + yAxis[2] * eye[2]);\n newDst[14] = -(zAxis[0] * eye[0] + zAxis[1] * eye[1] + zAxis[2] * eye[2]);\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which translates by the given vector v.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\nfunction translation(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = v[0]; newDst[13] = v[1]; newDst[14] = v[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Translates the given 4-by-4 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\nfunction translate(m: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n if (m !== newDst) {\n newDst[ 0] = m00;\n newDst[ 1] = m01;\n newDst[ 2] = m02;\n newDst[ 3] = m03;\n newDst[ 4] = m10;\n newDst[ 5] = m11;\n newDst[ 6] = m12;\n newDst[ 7] = m13;\n newDst[ 8] = m20;\n newDst[ 9] = m21;\n newDst[10] = m22;\n newDst[11] = m23;\n }\n\n newDst[12] = m00 * v0 + m10 * v1 + m20 * v2 + m30;\n newDst[13] = m01 * v0 + m11 * v1 + m21 * v2 + m31;\n newDst[14] = m02 * v0 + m12 * v1 + m22 * v2 + m32;\n newDst[15] = m03 * v0 + m13 * v1 + m23 * v2 + m33;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the x-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationX(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = c; newDst[ 6] = s; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = -s; newDst[10] = c; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the x-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateX(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[4] = c * m10 + s * m20;\n newDst[5] = c * m11 + s * m21;\n newDst[6] = c * m12 + s * m22;\n newDst[7] = c * m13 + s * m23;\n newDst[8] = c * m20 - s * m10;\n newDst[9] = c * m21 - s * m11;\n newDst[10] = c * m22 - s * m12;\n newDst[11] = c * m23 - s * m13;\n\n if (m !== newDst) {\n newDst[ 0] = m[ 0];\n newDst[ 1] = m[ 1];\n newDst[ 2] = m[ 2];\n newDst[ 3] = m[ 3];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the y-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationY(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = 0; newDst[ 2] = -s; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = s; newDst[ 9] = 0; newDst[10] = c; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the y-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateY(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 - s * m20;\n newDst[ 1] = c * m01 - s * m21;\n newDst[ 2] = c * m02 - s * m22;\n newDst[ 3] = c * m03 - s * m23;\n newDst[ 8] = c * m20 + s * m00;\n newDst[ 9] = c * m21 + s * m01;\n newDst[10] = c * m22 + s * m02;\n newDst[11] = c * m23 + s * m03;\n\n if (m !== newDst) {\n newDst[ 4] = m[ 4];\n newDst[ 5] = m[ 5];\n newDst[ 6] = m[ 6];\n newDst[ 7] = m[ 7];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the z-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationZ(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = s; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = -s; newDst[ 5] = c; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the z-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateZ(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 + s * m10;\n newDst[ 1] = c * m01 + s * m11;\n newDst[ 2] = c * m02 + s * m12;\n newDst[ 3] = c * m03 + s * m13;\n newDst[ 4] = c * m10 - s * m00;\n newDst[ 5] = c * m11 - s * m01;\n newDst[ 6] = c * m12 - s * m02;\n newDst[ 7] = c * m13 - s * m03;\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n newDst[11] = m[11];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\nfunction axisRotation(axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n\n newDst[ 0] = xx + (1 - xx) * c;\n newDst[ 1] = x * y * oneMinusCosine + z * s;\n newDst[ 2] = x * z * oneMinusCosine - y * s;\n newDst[ 3] = 0;\n newDst[ 4] = x * y * oneMinusCosine - z * s;\n newDst[ 5] = yy + (1 - yy) * c;\n newDst[ 6] = y * z * oneMinusCosine + x * s;\n newDst[ 7] = 0;\n newDst[ 8] = x * z * oneMinusCosine + y * s;\n newDst[ 9] = y * z * oneMinusCosine - x * s;\n newDst[10] = zz + (1 - zz) * c;\n newDst[11] = 0;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = 0;\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle. (same as axisRotation)\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\nconst rotation = axisRotation;\n\n/**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle.\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction axisRotate(m: Mat4Arg, axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n\n const r00 = xx + (1 - xx) * c;\n const r01 = x * y * oneMinusCosine + z * s;\n const r02 = x * z * oneMinusCosine - y * s;\n const r10 = x * y * oneMinusCosine - z * s;\n const r11 = yy + (1 - yy) * c;\n const r12 = y * z * oneMinusCosine + x * s;\n const r20 = x * z * oneMinusCosine + y * s;\n const r21 = y * z * oneMinusCosine - x * s;\n const r22 = zz + (1 - zz) * c;\n\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n\n newDst[ 0] = r00 * m00 + r01 * m10 + r02 * m20;\n newDst[ 1] = r00 * m01 + r01 * m11 + r02 * m21;\n newDst[ 2] = r00 * m02 + r01 * m12 + r02 * m22;\n newDst[ 3] = r00 * m03 + r01 * m13 + r02 * m23;\n newDst[ 4] = r10 * m00 + r11 * m10 + r12 * m20;\n newDst[ 5] = r10 * m01 + r11 * m11 + r12 * m21;\n newDst[ 6] = r10 * m02 + r11 * m12 + r12 * m22;\n newDst[ 7] = r10 * m03 + r11 * m13 + r12 * m23;\n newDst[ 8] = r20 * m00 + r21 * m10 + r22 * m20;\n newDst[ 9] = r20 * m01 + r21 * m11 + r22 * m21;\n newDst[10] = r20 * m02 + r21 * m12 + r22 * m22;\n newDst[11] = r20 * m03 + r21 * m13 + r22 * m23;\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle. (same as rotate)\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nconst rotate = axisRotate;\n\n/**\n * Creates a 4-by-4 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * three entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = v[2]; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 4-by-4 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of three entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale(m: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n newDst[ 3] = v0 * m[0 * 4 + 3];\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n newDst[ 7] = v1 * m[1 * 4 + 3];\n newDst[ 8] = v2 * m[2 * 4 + 0];\n newDst[ 9] = v2 * m[2 * 4 + 1];\n newDst[10] = v2 * m[2 * 4 + 2];\n newDst[11] = v2 * m[2 * 4 + 3];\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which scales a uniform amount in each dimension.\n * @param s - the amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = s; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 4-by-4 matrix in each dimension by a uniform scale.\n * @param m - The matrix to be modified.\n * @param s - The amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale(m: Mat4Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n newDst[ 3] = s * m[0 * 4 + 3];\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n newDst[ 7] = s * m[1 * 4 + 3];\n newDst[ 8] = s * m[2 * 4 + 0];\n newDst[ 9] = s * m[2 * 4 + 1];\n newDst[10] = s * m[2 * 4 + 2];\n newDst[11] = s * m[2 * 4 + 3];\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\nreturn {\n create,\n set,\n fromMat3,\n fromQuat,\n negate,\n copy,\n clone,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n determinant,\n invert,\n multiply,\n mul,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n perspective,\n perspectiveReverseZ,\n ortho,\n frustum,\n frustumReverseZ,\n aim,\n cameraAim,\n lookAt,\n translation,\n translate,\n rotationX,\n rotateX,\n rotationY,\n rotateY,\n rotationZ,\n rotateZ,\n axisRotation,\n rotation,\n axisRotate,\n rotate,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n};\n\n}\n\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Mat4Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { QuatArg, QuatType } from './quat';\nimport { Mat3Arg } from './mat3.js';\nimport { Mat4Arg } from './mat4.js';\nimport { Vec3Arg } from './vec3.js';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\n\nexport { QuatArg, QuatType };\n\ntype QuatCtor = new (n: number) => T;\n\nexport type RotationOrder = 'xyz' | 'xzy' | 'yxz' | 'yzx' | 'zxy' | 'zyx';\n\n/**\n * Generates am typed API for Qud\n * */\nfunction getAPIImpl(Ctor: QuatCtor) {\n const vec3 = getVec3API(Ctor);\n\n/**\n * Creates a quat4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number, w?: number) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a Quat; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Quat\n * Also see {@link quat.create} and {@link quat.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, w: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n\n return newDst;\n}\n\n/**\n * Sets a quaternion from the given angle and axis,\n * then returns it.\n *\n * @param axis - the axis to rotate around\n * @param angleInRadians - the angle\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The quaternion that represents the given axis and angle\n **/\nfunction fromAxisAngle(axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n const s = Math.sin(halfAngle);\n\n newDst[0] = s * axis[0];\n newDst[1] = s * axis[1];\n newDst[2] = s * axis[2];\n newDst[3] = Math.cos(halfAngle);\n\n return newDst;\n}\n\n/**\n * Gets the rotation axis and angle\n * @param q - quaternion to compute from\n * @param dst - Vec3 to hold result. If not passed in a new one is created.\n * @return angle and axis\n */\nfunction toAxisAngle(q: QuatArg, dst?: T): { angle: number, axis: T } {\n const newDst = (dst ?? vec3.create(3)) as T;\n\n const angle = Math.acos(q[3]) * 2;\n const s = Math.sin(angle * 0.5);\n if (s > utils.EPSILON) {\n newDst[0] = q[0] / s;\n newDst[1] = q[1] / s;\n newDst[2] = q[2] / s;\n } else {\n newDst[0] = 1;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n\n return { angle, axis: newDst };\n}\n\n/**\n * Returns the angle in degrees between two rotations a and b.\n * @param a - quaternion a\n * @param b - quaternion b\n * @return angle in radians between the two quaternions\n */\nfunction angle(a: QuatArg, b: QuatArg) {\n const d = dot(a, b);\n return Math.acos(2 * d * d - 1);\n}\n\n/**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction multiply(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const bw = b[3];\n\n newDst[0] = ax * bw + aw * bx + ay * bz - az * by;\n newDst[1] = ay * bw + aw * by + az * bx - ax * bz;\n newDst[2] = az * bw + aw * bz + ax * by - ay * bx;\n newDst[3] = aw * bw - ax * bx - ay * by - az * bz;\n\n return newDst;\n}\n\n/**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nconst mul = multiply;\n\n/**\n * Rotates the given quaternion around the X axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateX(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const bx = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw + qw * bx;\n newDst[1] = qy * bw + qz * bx;\n newDst[2] = qz * bw - qy * bx;\n newDst[3] = qw * bw - qx * bx;\n\n return newDst;\n}\n\n/**\n * Rotates the given quaternion around the Y axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateY(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const by = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw - qz * by;\n newDst[1] = qy * bw + qw * by;\n newDst[2] = qz * bw + qx * by;\n newDst[3] = qw * bw - qy * by;\n\n return newDst;\n}\n\n/**\n * Rotates the given quaternion around the Z axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateZ(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const bz = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw + qy * bz;\n newDst[1] = qy * bw - qx * bz;\n newDst[2] = qz * bw + qw * bz;\n newDst[3] = qw * bw - qz * bz;\n\n return newDst;\n}\n\n/**\n * Spherically linear interpolate between two quaternions\n *\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction slerp(a: QuatArg, b: QuatArg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n\n let bx = b[0];\n let by = b[1];\n let bz = b[2];\n let bw = b[3];\n\n let cosOmega = ax * bx + ay * by + az * bz + aw * bw;\n\n if (cosOmega < 0) {\n cosOmega = -cosOmega;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n\n let scale0;\n let scale1;\n\n if (1.0 - cosOmega > utils.EPSILON) {\n const omega = Math.acos(cosOmega);\n const sinOmega = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinOmega;\n scale1 = Math.sin(t * omega) / sinOmega;\n } else {\n scale0 = 1.0 - t;\n scale1 = t;\n }\n\n newDst[0] = scale0 * ax + scale1 * bx;\n newDst[1] = scale0 * ay + scale1 * by;\n newDst[2] = scale0 * az + scale1 * bz;\n newDst[3] = scale0 * aw + scale1 * bw;\n\n return newDst;\n}\n\n/**\n * Compute the inverse of a quaternion\n *\n * @param q - quaternion to compute the inverse of\n * @returns A quaternion that is the result of a * b\n */\nfunction inverse(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const a0 = q[0];\n const a1 = q[1];\n const a2 = q[2];\n const a3 = q[3];\n\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n\n newDst[0] = -a0 * invDot;\n newDst[1] = -a1 * invDot;\n newDst[2] = -a2 * invDot;\n newDst[3] = a3 * invDot;\n\n return newDst;\n}\n\n/**\n * Compute the conjugate of a quaternion\n * For quaternions with a magnitude of 1 (a unit quaternion)\n * this returns the same as the inverse but is faster to calculate.\n *\n * @param q - quaternion to compute the conjugate of.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The conjugate of q\n */\nfunction conjugate(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = -q[0];\n newDst[1] = -q[1];\n newDst[2] = -q[2];\n newDst[3] = q[3];\n\n return newDst;\n}\n\n/**\n * Creates a quaternion from the given rotation matrix.\n *\n * The created quaternion is not normalized.\n *\n * @param m - rotation matrix\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\nfunction fromMat(m: Mat3Arg | Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n /*\n 0 1 2\n 3 4 5\n 6 7 8\n\n 0 1 2\n 4 5 6\n 8 9 10\n */\n\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n const trace = m[0] + m[5] + m[10];\n\n if (trace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n const root = Math.sqrt(trace + 1); // 2w\n newDst[3] = 0.5 * root;\n const invRoot = 0.5 / root; // 1/(4w)\n\n newDst[0] = (m[6] - m[9]) * invRoot;\n newDst[1] = (m[8] - m[2]) * invRoot;\n newDst[2] = (m[1] - m[4]) * invRoot;\n } else {\n // |w| <= 1/2\n let i = 0;\n\n if (m[5] > m[0]) {\n i = 1;\n }\n if (m[10] > m[i * 4 + i]) {\n i = 2;\n }\n\n const j = (i + 1) % 3;\n const k = (i + 2) % 3;\n\n const root = Math.sqrt(m[i * 4 + i] - m[j * 4 + j] - m[k * 4 + k] + 1.0);\n newDst[i] = 0.5 * root;\n\n const invRoot = 0.5 / root;\n\n newDst[3] = (m[j * 4 + k] - m[k * 4 + j]) * invRoot;\n newDst[j] = (m[j * 4 + i] + m[i * 4 + j]) * invRoot;\n newDst[k] = (m[k * 4 + i] + m[i * 4 + k]) * invRoot;\n }\n\n return newDst;\n}\n\n/**\n * Creates a quaternion from the given euler angle x, y, z using the provided intrinsic order for the conversion.\n *\n * @param xAngleInRadians - angle to rotate around X axis in radians.\n * @param yAngleInRadians - angle to rotate around Y axis in radians.\n * @param zAngleInRadians - angle to rotate around Z axis in radians.\n * @param order - order to apply euler angles\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion representing the same rotation as the euler angles applied in the given order\n */\nfunction fromEuler(\n xAngleInRadians: number,\n yAngleInRadians: number,\n zAngleInRadians: number,\n order: RotationOrder,\n dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const xHalfAngle = xAngleInRadians * 0.5;\n const yHalfAngle = yAngleInRadians * 0.5;\n const zHalfAngle = zAngleInRadians * 0.5;\n\n const sx = Math.sin(xHalfAngle);\n const cx = Math.cos(xHalfAngle);\n const sy = Math.sin(yHalfAngle);\n const cy = Math.cos(yHalfAngle);\n const sz = Math.sin(zHalfAngle);\n const cz = Math.cos(zHalfAngle);\n\n switch (order) {\n case 'xyz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'xzy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n case 'yxz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n case 'yzx':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'zxy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'zyx':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n default:\n throw new Error(`Unknown rotation order: ${order}`);\n }\n\n return newDst;\n}\n\n/**\n * Copies a quaternion. (same as {@link quat.clone})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is a copy of q\n */\nfunction copy(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = q[0];\n newDst[1] = q[1];\n newDst[2] = q[2];\n newDst[3] = q[3];\n\n return newDst;\n}\n\n/**\n * Clones a quaternion. (same as {@link quat.copy})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A copy of q.\n */\nconst clone = copy;\n\n/**\n * Adds two quaternions; assumes a and b have the same dimension.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the sum of a and b.\n */\nfunction add(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\nfunction subtract(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Multiplies a quaternion by a scalar.\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nfunction mulScalar(v: QuatArg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a quaternion by a scalar. (same as mulScalar)\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nfunction divScalar(v: QuatArg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two quaternions\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns dot product\n */\nfunction dot(a: QuatArg, b: QuatArg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n}\n\n/**\n * Performs linear interpolation on two quaternions.\n * Given quaternions a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param t - Interpolation coefficient.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: QuatArg, b: QuatArg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Computes the length of quaternion\n * @param v - quaternion.\n * @returns length of quaternion.\n */\nfunction length(v: QuatArg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n}\n\n/**\n * Computes the length of quaternion (same as length)\n * @param v - quaternion.\n * @returns length of quaternion.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of quaternion\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\nfunction lengthSq(v: QuatArg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n}\n\n/**\n * Computes the square of the length of quaternion (same as lengthSq)\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\nconst lenSq = lengthSq;\n\n/**\n * Divides a quaternion by its Euclidean length and returns the quotient.\n * @param v - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The normalized quaternion.\n */\nfunction normalize(v: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n }\n\n return newDst;\n}\n\n/**\n * Check if 2 quaternions are approximately equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are approximately equal\n */\nfunction equalsApproximately(a: QuatArg, b: QuatArg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON &&\n Math.abs(a[3] - b[3]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 quaternions are exactly equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are exactly equal\n */\nfunction equals(a: QuatArg, b: QuatArg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Creates an identity quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns an identity quaternion\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n\n return newDst;\n}\n\nconst tempVec3 = vec3.create();\nconst xUnitVec3 = vec3.create();\nconst yUnitVec3 = vec3.create();\n\n/**\n * Computes a quaternion to represent the shortest rotation from one vector to another.\n *\n * @param aUnit - the start vector\n * @param bUnit - the end vector\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\nfunction rotationTo(aUnit: Vec3Arg, bUnit: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const dot = vec3.dot(aUnit, bUnit);\n if (dot < -0.999999) {\n vec3.cross(xUnitVec3, aUnit, tempVec3);\n if (vec3.len(tempVec3) < 0.000001) {\n vec3.cross(yUnitVec3, aUnit, tempVec3);\n }\n\n vec3.normalize(tempVec3, tempVec3);\n fromAxisAngle(tempVec3, Math.PI, newDst);\n\n return newDst;\n } else if (dot > 0.999999) {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n\n return newDst;\n } else {\n vec3.cross(aUnit, bUnit, tempVec3);\n\n newDst[0] = tempVec3[0];\n newDst[1] = tempVec3[1];\n newDst[2] = tempVec3[2];\n newDst[3] = 1 + dot;\n\n return normalize(newDst, newDst);\n }\n}\n\nconst tempQuat1 = new Ctor(4);\nconst tempQuat2 = new Ctor(4);\n\n/**\n * Performs a spherical linear interpolation with two control points\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param c - the third quaternion\n * @param d - the fourth quaternion\n * @param t - Interpolation coefficient 0 to 1\n * @returns result\n */\nfunction sqlerp(\n a: QuatArg,\n b: QuatArg,\n c: QuatArg,\n d: QuatArg,\n t: number,\n dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n slerp(a, d, t, tempQuat1);\n slerp(b, c, t, tempQuat2);\n slerp(tempQuat1, tempQuat2, 2 * t * (1 - t), newDst);\n\n return newDst;\n}\n\nreturn {\n create,\n fromValues,\n set,\n fromAxisAngle,\n toAxisAngle,\n angle,\n multiply,\n mul,\n rotateX,\n rotateY,\n rotateZ,\n slerp,\n inverse,\n conjugate,\n fromMat,\n fromEuler,\n copy,\n clone,\n add,\n subtract,\n sub,\n mulScalar,\n scale,\n divScalar,\n dot,\n lerp,\n length,\n len,\n lengthSq,\n lenSq,\n normalize,\n equalsApproximately,\n equals,\n identity,\n rotationTo,\n sqlerp,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\n/**\n *\n * Quat4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Quat4`. In other words you can do this\n *\n * const v = quat4.cross(v1, v2); // Creates a new Quat4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = quat4.create();\n * quat4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * quat4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nexport function getAPI(Ctor: QuatCtor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Vec4Arg, Vec4Type } from './vec4';\nimport { Mat4Arg } from './mat4';\nimport { BaseArgType } from './types';\n\nexport { Vec4Arg, Vec4Type };\n\ntype Vec4Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec4\n * */\nfunction getAPIImpl(Ctor: Vec4Ctor) {\n\n/**\n * Creates a vec4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number, w?: number) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a vec4; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec4\n * Also see {@link vec4.create} and {@link vec4.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, w: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n newDst[3] = Math.ceil(v[3]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n newDst[3] = Math.floor(v[3]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n newDst[3] = Math.round(v[3]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec4Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n newDst[3] = Math.min(max, Math.max(min, v[3]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec4Arg, b: Vec4Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n newDst[3] = a[3] + b[3] * scale;\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec4Arg, b: Vec4Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON &&\n Math.abs(a[3] - b[3]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec4Arg, b: Vec4Arg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec4Arg, b: Vec4Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec4Arg, b: Vec4Arg, t: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n newDst[3] = a[3] + t[3] * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n newDst[3] = Math.max(a[3], b[3]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n newDst[3] = Math.min(a[3], b[3]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec4Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec4Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n newDst[3] = 1 / v[3];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the dot product of two vectors\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec4Arg, b: Vec4Arg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec4Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec4Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec4Arg, b: Vec4Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec4Arg, b: Vec4Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return dx * dx + dy * dy + dz * dz + dw * dw;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n }\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n newDst[3] = -v[3];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec4.clone})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n newDst[3] = v[3];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec4.copy})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n newDst[3] = a[3] * b[3];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n newDst[3] = a[3] / b[3];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform vec4 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec4 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec4Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = v[3];\n\n newDst[0] = m[0] * x + m[4] * y + m[ 8] * z + m[12] * w;\n newDst[1] = m[1] * x + m[5] * y + m[ 9] * z + m[13] * w;\n newDst[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n newDst[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n\n return newDst;\n}\n\n\n/**\n * Treat a 4D vector as a direction and set it's length\n *\n * @param a The vec4 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec4Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec4 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec4Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n zero,\n transformMat4,\n setLength,\n truncate,\n midpoint,\n};\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\n/**\n *\n * Vec4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Vec4`. In other words you can do this\n *\n * const v = vec4.cross(v1, v2); // Creates a new Vec4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = vec4.create();\n * vec4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * vec4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nexport function getAPI(Ctor: Vec4Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n\n","/**\n * Some docs\n * @namespace wgpu-matrix\n */\nimport {BaseArgType, ZeroArray} from './types';\nimport {Mat3Arg, Mat3Type, getAPI as getMat3API} from './mat3-impl';\nimport {Mat4Arg, Mat4Type, getAPI as getMat4API} from './mat4-impl';\nimport {QuatArg, QuatType, getAPI as getQuatAPI, RotationOrder} from './quat-impl';\nimport {Vec2Arg, Vec2Type, getAPI as getVec2API} from './vec2-impl';\nimport {Vec3Arg, Vec3Type, getAPI as getVec3API} from './vec3-impl';\nimport {Vec4Arg, Vec4Type, getAPI as getVec4API} from './vec4-impl';\nimport * as utils from './utils';\n\nexport {\n RotationOrder,\n utils,\n\n BaseArgType,\n\n Mat3Arg,\n Mat4Arg,\n QuatArg,\n Vec2Arg,\n Vec3Arg,\n Vec4Arg,\n\n Mat3Type,\n Mat4Type,\n QuatType,\n Vec2Type,\n Vec3Type,\n Vec4Type,\n};\n\nexport type BaseCtor = new (n: number) => T;\n\nexport type Mat3 = Mat3Type;\nexport type Mat4 = Mat4Type;\nexport type Quat = QuatType;\nexport type Vec2 = Vec2Type;\nexport type Vec3 = Vec3Type;\nexport type Vec4 = Vec4Type;\n\nexport type Mat3d = Mat3Type;\nexport type Mat4d = Mat4Type;\nexport type Quatd = QuatType;\nexport type Vec2d = Vec2Type;\nexport type Vec3d = Vec3Type;\nexport type Vec4d = Vec4Type;\n\nexport type Mat3n = Mat3Type;\nexport type Mat4n = Mat4Type;\nexport type Quatn = QuatType;\nexport type Vec2n = Vec2Type;\nexport type Vec3n = Vec3Type;\nexport type Vec4n = Vec4Type;\n\n/**\n * Generate wgpu-matrix API for type\n */\nfunction wgpuMatrixAPI<\n Mat3 extends BaseArgType,\n Mat4 extends BaseArgType,\n Quat extends BaseArgType,\n Vec2 extends BaseArgType,\n Vec3 extends BaseArgType,\n Vec4 extends BaseArgType,\n>(\n Mat3Ctor: BaseCtor,\n Mat4Ctor: BaseCtor,\n QuatCtor: BaseCtor,\n Vec2Ctor: BaseCtor,\n Vec3Ctor: BaseCtor,\n Vec4Ctor: BaseCtor,\n) {\n return {\n /** @namespace mat3 */\n mat3: getMat3API(Mat3Ctor),\n /** @namespace mat4 */\n mat4: getMat4API(Mat4Ctor),\n /** @namespace quat */\n quat: getQuatAPI(QuatCtor),\n /** @namespace vec2 */\n vec2: getVec2API(Vec2Ctor),\n /** @namespace vec3 */\n vec3: getVec3API(Vec3Ctor),\n /** @namespace vec4 */\n vec4: getVec4API(Vec4Ctor),\n };\n}\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat3,\n /**\n * 4x4 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat4,\n /**\n * Quaternion functions that default to returning `Float32Array`\n * @namespace\n */\n quat,\n /**\n * Vec2 functions that default to returning `Float32Array`\n * @namespace\n */\n vec2,\n /**\n * Vec3 functions that default to returning `Float32Array`\n * @namespace\n */\n vec3,\n /**\n * Vec3 functions that default to returning `Float32Array`\n * @namespace\n */\n vec4,\n} = wgpuMatrixAPI<\n Mat3, Mat4, Quat, Vec2, Vec3, Vec4>(\n Float32Array, Float32Array, Float32Array, Float32Array, Float32Array, Float32Array);\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat3: mat3d,\n /**\n * 4x4 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat4: mat4d,\n /**\n * Quaternion functions that default to returning `Float64Array`\n * @namespace\n */\n quat: quatd,\n /**\n * Vec2 functions that default to returning `Float64Array`\n * @namespace\n */\n vec2: vec2d,\n /**\n * Vec3 functions that default to returning `Float64Array`\n * @namespace\n */\n vec3: vec3d,\n /**\n * Vec3 functions that default to returning `Float64Array`\n * @namespace\n */\n vec4: vec4d,\n} = wgpuMatrixAPI<\n Mat3d, Mat4d, Quatd, Vec2d, Vec3d, Vec4d>(\n Float64Array, Float64Array, Float64Array, Float64Array, Float64Array, Float64Array);\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat3: mat3n,\n /**\n * 4x4 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat4: mat4n,\n /**\n * Quaternion functions that default to returning `number[]`\n * @namespace\n */\n quat: quatn,\n /**\n * Vec2 functions that default to returning `number[]`\n * @namespace\n */\n vec2: vec2n,\n /**\n * Vec3 functions that default to returning `number[]`\n * @namespace\n */\n vec3: vec3n,\n /**\n * Vec3 functions that default to returning `number[]`\n * @namespace\n */\n vec4: vec4n,\n} = wgpuMatrixAPI<\n Mat3n, Mat4n, Quatn, Vec2n, Vec3n, Vec4n>(\n ZeroArray, Array, Array, Array, Array, Array);\n"],"names":["ZeroArray","OriginalConstructor","modifier","a","fill","constructor","args","super","this","EPSILON","degrees","Math","PI","n","m","b","v","d","abs","t","radians","old","cache","Map","getAPI","Ctor","api","get","create","x","y","newDst","undefined","subtract","dst","lerp","mulScalar","k","inverse","dot","length","v0","v1","sqrt","lengthSq","distance","dx","dy","distanceSq","normalize","len","copy","multiply","divide","setLength","fromValues","set","ceil","floor","round","clamp","min","max","add","addScaled","scale","angle","ax","ay","bx","by","mag","cosine","acos","sub","equalsApproximately","utils.EPSILON","equals","lerpV","divScalar","invert","cross","z","lenSq","dist","distSq","negate","clone","mul","div","random","cos","sin","zero","transformMat4","transformMat3","rotate","rad","p0","p1","sinC","cosC","truncate","maxLen","midpoint","getAPIImpl","v2","dz","az","bz","t1","t2","zScale","w","transformMat4Upper3x3","transformQuat","q","qx","qy","qz","w2","uvX","uvY","uvZ","getTranslation","getAxis","axis","off","getScaling","xx","xy","xz","yx","yy","yz","zx","zy","zz","rotateX","p","r","rotateY","rotateZ","vec2","getVec2API","vec3","getVec3API","identity","m00","m01","m02","m10","m11","m12","m20","m21","m22","b01","b11","b21","invDet","a00","a01","a02","a10","a11","a12","a20","a21","a22","b00","b02","b10","b12","b20","b22","rotation","angleInRadians","c","s","v3","v4","v5","v6","v7","v8","fromMat4","m4","fromQuat","x2","y2","z2","wx","wy","wz","transpose","determinant","setTranslation","setAxis","get3DScaling","translation","translate","rotationX","rotationY","rotationZ","scaling","uniformScaling","uniformScale","scaling3D","scale3D","uniformScaling3D","uniformScale3D","m03","m13","m23","m30","m31","m32","m33","tmp0","tmp1","tmp2","tmp3","tmp4","tmp5","tmp6","tmp7","tmp8","tmp9","tmp10","tmp11","tmp12","tmp13","tmp14","tmp15","tmp16","tmp17","tmp18","tmp19","tmp20","tmp21","tmp22","tmp23","t0","t3","a03","a13","a23","a30","a31","a32","a33","b03","b13","b23","b30","b31","b32","b33","xAxis","yAxis","zAxis","axisRotation","oneMinusCosine","axisRotate","r00","r01","r02","r10","r11","r12","r20","r21","r22","v9","v10","v11","v12","v13","v14","v15","fromMat3","m3","perspective","fieldOfViewYInRadians","aspect","zNear","zFar","f","tan","Number","isFinite","rangeInv","perspectiveReverseZ","Infinity","ortho","left","right","bottom","top","near","far","frustum","frustumReverseZ","aim","position","target","up","cameraAim","eye","lookAt","fromAxisAngle","halfAngle","aw","bw","slerp","scale0","scale1","cosOmega","omega","sinOmega","tempVec3","xUnitVec3","yUnitVec3","tempQuat1","tempQuat2","toAxisAngle","qw","a0","a1","a2","a3","invDot","conjugate","fromMat","trace","root","invRoot","i","j","fromEuler","xAngleInRadians","yAngleInRadians","zAngleInRadians","order","xHalfAngle","yHalfAngle","zHalfAngle","sx","cx","sy","cy","sz","cz","Error","rotationTo","aUnit","bUnit","sqlerp","dw","wgpuMatrixAPI","Mat3Ctor","Mat4Ctor","QuatCtor","Vec2Ctor","Vec3Ctor","Vec4Ctor","mat3","getMat3API","mat4","getMat4API","quat","getQuatAPI","vec4","getVec4API","Float32Array","mat3d","mat4d","quatd","vec2d","vec3d","vec4d","Float64Array","mat3n","mat4n","quatn","vec2n","vec3n","vec4n","Array"],"mappings":"AAkBO,MAAMA,GAXXC,EAWsC,MAVtCC,EAUsDC,GAAKA,EAAEC,KAAK,GAR3D,cAAcH,EACnB,WAAAI,IAAeC,GACbC,SAASD,GACTJ,EAASM,KACV,IARL,IACEP,EACAC,ECcK,IAAIO,EAAU,4DAkBf,SAAmBC,GACvB,OAAOA,EAAUC,KAAKC,GAAK,GAC7B,kBAqDgB,SAAgBC,EAAWC,GACzC,OAASD,EAAIC,EAAKA,GAAKA,CACzB,uBAxB4BX,EAAWY,EAAWC,GAChD,MAAMC,EAAIF,EAAIZ,EACd,OAAQQ,KAAKO,IAAIH,EAAIZ,GAAKM,EACrBN,GACCa,EAAIb,GAAKc,CACjB,gBAlBqBd,EAAWY,EAAWI,GACzC,OAAOhB,GAAKY,EAAIZ,GAAKgB,CACvB,WAbM,SAAmBC,GACvB,O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Eb,EAEAe,aAAcA,aAAcA,aAAcA,aAAcA,aAAcA,eAOxER,KAAMS,EAKNP,KAAMQ,EAKNN,KAAMO,EAKN3O,KAAM4O,EAKN1O,KAAM2O,EAKNP,KAAMQ,GACJrB,EAEAsB,aAAcA,aAAcA,aAAcA,aAAcA,aAAcA,eAOxEf,KAAMgB,EAKNd,KAAMe,EAKNb,KAAMc,EAKNlP,KAAMmP,EAKNjP,KAAMkP,EAKNd,KAAMe,GACJ5B,EAEAxW,EAAWqY,MAAOA,MAAOA,MAAOA,MAAOA"} \ No newline at end of file diff --git a/docs/assets/navigation.js b/docs/assets/navigation.js index 65ff8c5..57808d9 100644 --- a/docs/assets/navigation.js +++ b/docs/assets/navigation.js @@ -1 +1 @@ -window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA7WdQZPbxhFG/8ueFTtWd5KKb5tYh1TJcSIpKjsuH+BtaIWYbHBBcGvlVP57CgDBBUVMT3O+9lHAdAscgtjv1TwOf/zvTV8/9Tdf32yrnm5e3Oyq/uPwr1YOm3r/5XD0i4/9dnPz4uaXRuXma35xc/ex2UhX683XP57K7zat1s/1Hw561zetHjuMZ8/7/JH/9+K5ut19She3u09WbVdXvfFfj6eNeqn7uts2WmmfbLIYY3SqHw7VZp9sMp3O1t/udl371Gyrvt6kJ2VlrNH5Q9duv616TrabB2R6/PNQpSdpHmD0uK97+ubtXbVp9D7ZZznI7nX71KSn+3je7uC4FteVvOsq3W+qodLqtRhm9Guk1r7p02/+PMDqoY91t09/LI7ncx3S7/Z02qjfHjbJ4u1hY1f2zc64+ecBRg+t762nwnTaqO/a3qqfTufqrbthHmD02N9Vm/QljGcz1datvc/e1/s6/fbva+u932c+m/vsZ3Pv+0ztvZ+p/jgqPZ+nEY4u1iX1/uvZtcYn9DTC6HLQ5kPbbd+aN8pykK+XdducD7vo99Pyc1z1JOuZQvBQIVCqECxWSEiukJBgIaHJQoKjhURkC4kKFxKULiQkXkhkvpC4gCEBCUPgiCFQxhAwZAieM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++aL1+aLHfN1roVNpcMxX+XKfB0Pe6rX5ms+7qm/mK/xoO/KL+ZrPJivfXP8sfXvOqkvPtRnJ3Od3p/9LPPUYDiWv4Zh1MrMHw97qtdmfj7uqb+Y+fGg78ovZn486Kq9eBIOx3yV6/PleRIOwxLz5XoSvj/fgOa52Ddfl0/C8aCr9uJJOBzzVa7Pl+dJOAxLzJfrSfj+fBX6udg3X5dPwvFgqvan/wOr+VFnCdsAAA==" \ No newline at end of file +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA7WdXZPbxhFF/8s+K3asvkkqfttEfkiVHSeSovJH+QHehlaIySZFgirJKf/3FACSC+5ieoZz248GutvYITS8p3gI/vi/m7792N98ebNuerl5drNt+nfDf230sGr3nw9HP3vXr1c3z25+6UxvvsSzm7t33Up3rd18+eO5/W61sfah/+3B7vpuY8cJ49nLOX/Gb88eujfbT+nmzfaT17trm975X4+nnX5t+3a37qyxPjlkVuNMat8fmtU+OWQ6ne2/3W53m4/duunbVXpRFmqdyW93m/U3TY/kuFNBZsa/D016kU4Fzoz7tpcXr+6aVWf3yTnzIn/W7ccuvdzH8/6EgmspupLXu8b2q2bo9GbNypx5nbbWd336xT8VeDPsQ7vbp/9ZHM/nJqRf7em0078+rJLN68PK7+y7rXPznwqcGdbee7vCdNrp3216r386ne3/LjPgu+yE7zMTvs9O+CEz4YfcBO+ePhUUzMisxVBRMCWzHkNFwZTMmgwVzpT9XbNK3xrj2Vy3vPD75UVmgrdp7bM71rEicxVjhTelTW8P+9bbG/aZvXuf3bv3ZXvuvnTP7Y9V6df1XFEwxbukvvx6thtnBz9XOFMO1r3d7Nav3Bt2XlQ4y7lxLsvK5nk382VZ8byyK1y+w3+avxc1vehyLlY+GCuVjJWLxhqSjTUkHGtoOtbgeKwR+VijArIGJWQNicgamZE1LiRrQEpWOiYrlZOVDMrKJ2Vlo7LSWVn5sKx8WtaAuKwheVljArPGJGblI7OymVn50KwRqVnZ2Kxcbtaw4KyByVmjorNGZWcNC88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lXUurNfxcEn30nqdjpf0P1mv8WDZlT9Zr/Fgvvfl8cfWv91p++Qf9cXJ3KQ3Fz/LPA0YjuWvYahaWPnj4ZLupZU/HS/pf7Ly48GyK3+y8uPBot4nO+FwrKxzeb1KdsKhLLFeRTvhm8sH0Dw0l63X051wPFjU+2QnHI6VdS6vV8lOOJQl1qtoJ3xz+Sn0Q3PZej3dCceDqd6f/g/b017/aeMAAA==" \ No newline at end of file diff --git a/docs/assets/search.js b/docs/assets/search.js index d0c956c..8505e43 100644 --- a/docs/assets/search.js +++ b/docs/assets/search.js @@ -1 +1 @@ -window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA62dXZPjynGm/0v7tnfM+i6eO3ntC0dY611bq1jvhELRGlKjtrvZc/rj7JEU+u8bKDAxQOLNRBZ47hgkkQUUElWZ+RTq/evd68v/e7v74fNf7/7r8XK6+8EfjsUlf393eXg+3/1w9w8Pb+f//v7yend/9/H6dPfD3fufv53f/p6+/vSn9+enu/u7L08Pb2/nt7sf7u7+dk+2kvtu5/e/Hw7UrPzd9JeZsfu7bw+v58v7/Ey+N8BP9tcP74E1MXz135x6msBKXFuJnVb+18fDO7MyfNVp5bfnL55ZGb7qt8L7Zfiq3wrvl+Gr/t4NJ3CTTjvuErATe+0MN4Xbad/tuFPcTvtux70Cdrr7Z7g1wE53/wz35gLu12XH/QJ2Yq+d4d5wO+27HfeL22nf7bhfwE53/wz3BtjZ7J84WXiej37PL6ePp/Pb3w9fqsfn7wa+PL1cvg/Rf/y4fHl/fLlcbbQfgaXZCN1OAFt+PT+8y6bbr3ttv53fJcNv5/e9Vv/4+vK8mAiYafr9FvuLKQLYH37fa/9y/qr0+Pjr7rv58u3P4r18+fbnvXbPP348PL396tu315efH58f3s9PYjPgr7e1qje01/bj6Xx5f3wXL4N+32v//fXh8vbt5U280dMfdl/B5afzq2z/+vNN1sVnYPx1r+3T+f38+vx4ebiIDcz+sreV548nyfrzx9MNVt8fv8nuT7/fMGb+ZvCMp4fBqDJ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XwHFe4JnquzRmU6mQxiVHY4OPU9hL6QiN2YHCxEhDVpzGDzfFvxQRU2icp5oyzQaFamSl2pz2DbCx2QM8lf2mfHBaTTzlenQOxgLm2/kdrTqZBzjVuNL77fy+LoUP7+fNKgFUkaC8wk9rRNNUKaJLmRaC0m0pNK9Vb4vV32SaNru+qcJOszrlqYF+SRTXZ2Ol/Y3Xhct88KERJtB4kpMtkX37cVVvnvfutEJwyvONFPTt4w+Lk51PR5RnOZqrHVXW/RRvHKexk+LCCe9NgUeaBlGKh6h3i5H8v3384f314cty4cU8SfTTs05RCYWnflo6QUsBIg2gcVqjRGNHnt5CIOcs1LPFuODi/QUvbZnfrQmqTcAs2rygufQfX15Xa0WGfYVmz9oErKnoR7woTaiLeqwU28g7bzoum57fCPJrH6bHnIKaqSh1mB7zqXxAwWCeHnObYyzO6uPbt/Nr+HnZMW4xRdC8M4G00tnxPNsd9mOa2afCyES/jGibxqplpDAzPRW+prUXU0Q3LcKYQruOa1qPj3HWYXGqR1Gr1Px0M6eBzFg9bK1+e2EYf5ZzTdU/aorcJdAvibwkG6uA768fly+sc92iKkBO6qnC4qf3PshJ07TaZXq5g4aNQnlONUaoH5fHwZnWseFslKAenl6uoIckTC9OUAqWjasAZ83ysG02fNBoP5UEaWgPU92POicb1yN8vD8uF6W6OUqpxnzsp/MXv0hwZp11HfWNWG6wtCo1zeMe43g82GFvR8wne5qTbZHDYGwZis0H1mlFms3DBmPrUtO8mBDNZ7UYUGe9ROUI47LPwdKq0+cvkxhfnR3sLDt9Qd7psbVf3rLTFxMpPejmTl9T1flLLjWau2oxx87fIqSByvbID5ZWnT4vFEbbBDXYWXb6fKHLFMDbhoPB2LLT59HR9Eai/czWnT4v0ETb8PKX8+tyofVhXuqtU82NPlBGE6fF0hQeJ8poyuRBFBVXb7iq393ffXv8dn56vJzvfvj8u7/97f8DyFDAX7JMAgA="; \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA62d25IjyXGm36V0W9tE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UherMar+OD0OznQdz85KC2kqLdCaFKaKwgR0pkKCbbaft8uis1mskafkdspgbfH5zDyPOGeDnaZkla6HisxhqtUS2s3GXSTLltmlzbIyWskCLVfZuBP04/1xuVl5ONNgFifZBuin4xe/6NqsZ5dBMb53NVji5cf5U1SNK8pgZ1l+nM/mVLnytthnMLYMJudbTKaNirZnZDB2XX6cvzZZzL1a7ladefpl0I21wMHS1aDPS9/G16oHO+xdpXmMSBOP/fKWg754+4OmKvOgA9g+301QzEO1iBJmJigHN0byg6WrQZ8Xj4ttiR3sLAd9QQFpkrfNN4Ox5aDP69DTy6r2nl0P+rzIZtwq8dfj63ID/oIl7KciK/2HcrI4cT/qeqKcrEwbaCi9rMlwVd/f3708vhyfHk/Hu+8+f//3v/9/ZQArTStiAgA="; \ No newline at end of file diff --git a/docs/functions/mat3.rotateX.html b/docs/functions/mat3.rotateX.html new file mode 100644 index 0000000..acdd47d --- /dev/null +++ b/docs/functions/mat3.rotateX.html @@ -0,0 +1,7 @@ +rotateX | wgpu-matrix

Function rotateX

  • Rotates the given 3-by-3 matrix around the x-axis by the given +angle.

    +

    Type Parameters

    Parameters

    • m: BaseArgType

      The matrix.

      +
    • angleInRadians: number

      The angle by which to rotate (in radians).

      +
    • Optional dst: T

      matrix to hold result. If not passed a new one is created.

      +

    Returns T

    The rotated matrix.

    +
\ No newline at end of file diff --git a/docs/functions/mat3.rotateY.html b/docs/functions/mat3.rotateY.html new file mode 100644 index 0000000..bd4647a --- /dev/null +++ b/docs/functions/mat3.rotateY.html @@ -0,0 +1,7 @@ +rotateY | wgpu-matrix

Function rotateY

  • Rotates the given 3-by-3 matrix around the y-axis by the given +angle.

    +

    Type Parameters

    Parameters

    • m: BaseArgType

      The matrix.

      +
    • angleInRadians: number

      The angle by which to rotate (in radians).

      +
    • Optional dst: T

      matrix to hold result. If not passed a new one is created.

      +

    Returns T

    The rotated matrix.

    +
\ No newline at end of file diff --git a/docs/functions/mat3.rotateZ.html b/docs/functions/mat3.rotateZ.html new file mode 100644 index 0000000..243b3c1 --- /dev/null +++ b/docs/functions/mat3.rotateZ.html @@ -0,0 +1,6 @@ +rotateZ | wgpu-matrix

Function rotateZ

  • Rotates the given 3-by-3 matrix by the given angle.

    +

    Type Parameters

    Parameters

    • m: BaseArgType

      The matrix.

      +
    • angleInRadians: number

      The angle by which to rotate (in radians).

      +
    • Optional dst: T

      matrix to hold result. If not passed a new one is created.

      +

    Returns T

    The rotated matrix.

    +
\ No newline at end of file diff --git a/docs/functions/mat3.rotationX.html b/docs/functions/mat3.rotationX.html new file mode 100644 index 0000000..2aaff9b --- /dev/null +++ b/docs/functions/mat3.rotationX.html @@ -0,0 +1,5 @@ +rotationX | wgpu-matrix

Function rotationX

  • Creates a 3-by-3 matrix which rotates around the x-axis by the given angle.

    +

    Type Parameters

    Parameters

    • angleInRadians: number

      The angle by which to rotate (in radians).

      +
    • Optional dst: T

      matrix to hold result. If not passed a new one is created.

      +

    Returns T

    The rotation matrix.

    +
\ No newline at end of file diff --git a/docs/functions/mat3.rotationY.html b/docs/functions/mat3.rotationY.html new file mode 100644 index 0000000..a5f418a --- /dev/null +++ b/docs/functions/mat3.rotationY.html @@ -0,0 +1,5 @@ +rotationY | wgpu-matrix

Function rotationY

  • Creates a 3-by-3 matrix which rotates around the y-axis by the given angle.

    +

    Type Parameters

    Parameters

    • angleInRadians: number

      The angle by which to rotate (in radians).

      +
    • Optional dst: T

      matrix to hold result. If not passed a new one is created.

      +

    Returns T

    The rotation matrix.

    +
\ No newline at end of file diff --git a/docs/functions/mat3.rotationZ.html b/docs/functions/mat3.rotationZ.html new file mode 100644 index 0000000..28e167f --- /dev/null +++ b/docs/functions/mat3.rotationZ.html @@ -0,0 +1,5 @@ +rotationZ | wgpu-matrix

Function rotationZ

  • Creates a 3-by-3 matrix which rotates by the given angle.

    +

    Type Parameters

    Parameters

    • angleInRadians: number

      The angle by which to rotate (in radians).

      +
    • Optional dst: T

      matrix to hold result. If not passed a new one is created.

      +

    Returns T

    The rotation matrix.

    +
\ No newline at end of file diff --git a/docs/functions/mat3.scale.html b/docs/functions/mat3.scale.html index 3eef542..c48016a 100644 --- a/docs/functions/mat3.scale.html +++ b/docs/functions/mat3.scale.html @@ -1,6 +1,6 @@ scale | wgpu-matrix

Function scale

  • Scales the given 3-by-3 matrix in each dimension by an amount given by the corresponding entry in the given vector; assumes the vector has -three entries.

    +two entries.

    Type Parameters

    Parameters

    • m: BaseArgType

      The matrix to be modified.

    • v: BaseArgType

      A vector of 2 entries specifying the factor by which to scale in each dimension.

      diff --git a/docs/functions/mat3.scale3D.html b/docs/functions/mat3.scale3D.html new file mode 100644 index 0000000..41efd52 --- /dev/null +++ b/docs/functions/mat3.scale3D.html @@ -0,0 +1,9 @@ +scale3D | wgpu-matrix

      Function scale3D

      • Scales the given 3-by-3 matrix in each dimension by an amount +given by the corresponding entry in the given vector; assumes the vector has +three entries.

        +

        Type Parameters

        Parameters

        • m: BaseArgType

          The matrix to be modified.

          +
        • v: BaseArgType

          A vector of 3 entries specifying the +factor by which to scale in each dimension.

          +
        • Optional dst: T

          matrix to hold result. If not passed a new one is created.

          +

        Returns T

        The scaled matrix.

        +
      \ No newline at end of file diff --git a/docs/functions/mat3.scaling.html b/docs/functions/mat3.scaling.html index 236246d..c0dab28 100644 --- a/docs/functions/mat3.scaling.html +++ b/docs/functions/mat3.scaling.html @@ -1,5 +1,5 @@ scaling | wgpu-matrix

      Function scaling

      • Creates a 3-by-3 matrix which scales in each dimension by an amount given by -the corresponding entry in the given vector; assumes the vector has three +the corresponding entry in the given vector; assumes the vector has two entries.

        Type Parameters

        Parameters

        • v: BaseArgType

          A vector of 2 entries specifying the factor by which to scale in each dimension.

          diff --git a/docs/functions/mat3.scaling3D.html b/docs/functions/mat3.scaling3D.html new file mode 100644 index 0000000..781c3e0 --- /dev/null +++ b/docs/functions/mat3.scaling3D.html @@ -0,0 +1,8 @@ +scaling3D | wgpu-matrix

          Function scaling3D

          • Creates a 3-by-3 matrix which scales in each dimension by an amount given by +the corresponding entry in the given vector; assumes the vector has three +entries.

            +

            Type Parameters

            Parameters

            • v: BaseArgType

              A vector of +3 entries specifying the factor by which to scale in each dimension.

              +
            • Optional dst: T

              matrix to hold result. If not passed a new one is created.

              +

            Returns T

            The scaling matrix.

            +
          \ No newline at end of file diff --git a/docs/functions/mat3.uniformScale.html b/docs/functions/mat3.uniformScale.html index 186410e..ec32e3a 100644 --- a/docs/functions/mat3.uniformScale.html +++ b/docs/functions/mat3.uniformScale.html @@ -1,4 +1,4 @@ -uniformScale | wgpu-matrix

          Function uniformScale

          • Scales the given 3-by-3 matrix in each dimension by an amount +uniformScale | wgpu-matrix

            Function uniformScale

            • Scales the given 3-by-3 matrix in the X and Y dimension by an amount given.

              Type Parameters

              Parameters

              • m: BaseArgType

                The matrix to be modified.

              • s: number

                Amount to scale.

                diff --git a/docs/functions/mat3.uniformScale3D.html b/docs/functions/mat3.uniformScale3D.html new file mode 100644 index 0000000..61deb37 --- /dev/null +++ b/docs/functions/mat3.uniformScale3D.html @@ -0,0 +1,7 @@ +uniformScale3D | wgpu-matrix

                Function uniformScale3D

                • Scales the given 3-by-3 matrix in each dimension by an amount +given.

                  +

                  Type Parameters

                  Parameters

                  • m: BaseArgType

                    The matrix to be modified.

                    +
                  • s: number

                    Amount to scale.

                    +
                  • Optional dst: T

                    matrix to hold result. If not passed a new one is created.

                    +

                  Returns T

                  The scaled matrix.

                  +
                \ No newline at end of file diff --git a/docs/functions/mat3.uniformScaling.html b/docs/functions/mat3.uniformScaling.html index c5c3535..7ae071d 100644 --- a/docs/functions/mat3.uniformScaling.html +++ b/docs/functions/mat3.uniformScaling.html @@ -1,4 +1,4 @@ -uniformScaling | wgpu-matrix

                Function uniformScaling

                • Creates a 3-by-3 matrix which scales uniformly in each dimension

                  +uniformScaling | wgpu-matrix

                  Function uniformScaling

                  • Creates a 3-by-3 matrix which scales uniformly in the X and Y dimensions

                    Type Parameters

                    Parameters

                    • s: number

                      Amount to scale

                    • Optional dst: T

                      matrix to hold result. If not passed a new one is created.

                    Returns T

                    The scaling matrix.

                    diff --git a/docs/functions/mat3.uniformScaling3D.html b/docs/functions/mat3.uniformScaling3D.html new file mode 100644 index 0000000..7367363 --- /dev/null +++ b/docs/functions/mat3.uniformScaling3D.html @@ -0,0 +1,5 @@ +uniformScaling3D | wgpu-matrix

                    Function uniformScaling3D

                    • Creates a 3-by-3 matrix which scales uniformly in each dimension

                      +

                      Type Parameters

                      Parameters

                      • s: number

                        Amount to scale

                        +
                      • Optional dst: T

                        matrix to hold result. If not passed a new one is created.

                        +

                      Returns T

                      The scaling matrix.

                      +
                    \ No newline at end of file diff --git a/docs/functions/mat3d.rotateX.html b/docs/functions/mat3d.rotateX.html new file mode 100644 index 0000000..3333dc2 --- /dev/null +++ b/docs/functions/mat3d.rotateX.html @@ -0,0 +1,7 @@ +rotateX | wgpu-matrix

                    Function rotateX

                    • Rotates the given 3-by-3 matrix around the x-axis by the given +angle.

                      +

                      Type Parameters

                      Parameters

                      • m: BaseArgType

                        The matrix.

                        +
                      • angleInRadians: number

                        The angle by which to rotate (in radians).

                        +
                      • Optional dst: T

                        matrix to hold result. If not passed a new one is created.

                        +

                      Returns T

                      The rotated matrix.

                      +
                    \ No newline at end of file diff --git a/docs/functions/mat3d.rotateY.html b/docs/functions/mat3d.rotateY.html new file mode 100644 index 0000000..b2e2af5 --- /dev/null +++ b/docs/functions/mat3d.rotateY.html @@ -0,0 +1,7 @@ +rotateY | wgpu-matrix

                    Function rotateY

                    • Rotates the given 3-by-3 matrix around the y-axis by the given +angle.

                      +

                      Type Parameters

                      Parameters

                      • m: BaseArgType

                        The matrix.

                        +
                      • angleInRadians: number

                        The angle by which to rotate (in radians).

                        +
                      • Optional dst: T

                        matrix to hold result. If not passed a new one is created.

                        +

                      Returns T

                      The rotated matrix.

                      +
                    \ No newline at end of file diff --git a/docs/functions/mat3d.rotateZ.html b/docs/functions/mat3d.rotateZ.html new file mode 100644 index 0000000..ea3f4ad --- /dev/null +++ b/docs/functions/mat3d.rotateZ.html @@ -0,0 +1,6 @@ +rotateZ | wgpu-matrix

                    Function rotateZ

                    • Rotates the given 3-by-3 matrix by the given angle.

                      +

                      Type Parameters

                      Parameters

                      • m: BaseArgType

                        The matrix.

                        +
                      • angleInRadians: number

                        The angle by which to rotate (in radians).

                        +
                      • Optional dst: T

                        matrix to hold result. If not passed a new one is created.

                        +

                      Returns T

                      The rotated matrix.

                      +
                    \ No newline at end of file diff --git a/docs/functions/mat3d.rotationX.html b/docs/functions/mat3d.rotationX.html new file mode 100644 index 0000000..edc0c66 --- /dev/null +++ b/docs/functions/mat3d.rotationX.html @@ -0,0 +1,5 @@ +rotationX | wgpu-matrix

                    Function rotationX

                    • Creates a 3-by-3 matrix which rotates around the x-axis by the given angle.

                      +

                      Type Parameters

                      Parameters

                      • angleInRadians: number

                        The angle by which to rotate (in radians).

                        +
                      • Optional dst: T

                        matrix to hold result. If not passed a new one is created.

                        +

                      Returns T

                      The rotation matrix.

                      +
                    \ No newline at end of file diff --git a/docs/functions/mat3d.rotationY.html b/docs/functions/mat3d.rotationY.html new file mode 100644 index 0000000..f8130a5 --- /dev/null +++ b/docs/functions/mat3d.rotationY.html @@ -0,0 +1,5 @@ +rotationY | wgpu-matrix

                    Function rotationY

                    • Creates a 3-by-3 matrix which rotates around the y-axis by the given angle.

                      +

                      Type Parameters

                      Parameters

                      • angleInRadians: number

                        The angle by which to rotate (in radians).

                        +
                      • Optional dst: T

                        matrix to hold result. If not passed a new one is created.

                        +

                      Returns T

                      The rotation matrix.

                      +
                    \ No newline at end of file diff --git a/docs/functions/mat3d.rotationZ.html b/docs/functions/mat3d.rotationZ.html new file mode 100644 index 0000000..d90cccf --- /dev/null +++ b/docs/functions/mat3d.rotationZ.html @@ -0,0 +1,5 @@ +rotationZ | wgpu-matrix

                    Function rotationZ

                    • Creates a 3-by-3 matrix which rotates by the given angle.

                      +

                      Type Parameters

                      Parameters

                      • angleInRadians: number

                        The angle by which to rotate (in radians).

                        +
                      • Optional dst: T

                        matrix to hold result. If not passed a new one is created.

                        +

                      Returns T

                      The rotation matrix.

                      +
                    \ No newline at end of file diff --git a/docs/functions/mat3d.scale.html b/docs/functions/mat3d.scale.html index 939e38f..4d1bd00 100644 --- a/docs/functions/mat3d.scale.html +++ b/docs/functions/mat3d.scale.html @@ -1,6 +1,6 @@ scale | wgpu-matrix

                    Function scale

                    • Scales the given 3-by-3 matrix in each dimension by an amount given by the corresponding entry in the given vector; assumes the vector has -three entries.

                      +two entries.

                      Type Parameters

                      Parameters

                      • m: BaseArgType

                        The matrix to be modified.

                      • v: BaseArgType

                        A vector of 2 entries specifying the factor by which to scale in each dimension.

                        diff --git a/docs/functions/mat3d.scale3D.html b/docs/functions/mat3d.scale3D.html new file mode 100644 index 0000000..365f84a --- /dev/null +++ b/docs/functions/mat3d.scale3D.html @@ -0,0 +1,9 @@ +scale3D | wgpu-matrix

                        Function scale3D

                        • Scales the given 3-by-3 matrix in each dimension by an amount +given by the corresponding entry in the given vector; assumes the vector has +three entries.

                          +

                          Type Parameters

                          Parameters

                          • m: BaseArgType

                            The matrix to be modified.

                            +
                          • v: BaseArgType

                            A vector of 3 entries specifying the +factor by which to scale in each dimension.

                            +
                          • Optional dst: T

                            matrix to hold result. If not passed a new one is created.

                            +

                          Returns T

                          The scaled matrix.

                          +
                        \ No newline at end of file diff --git a/docs/functions/mat3d.scaling.html b/docs/functions/mat3d.scaling.html index fa0039a..284edd5 100644 --- a/docs/functions/mat3d.scaling.html +++ b/docs/functions/mat3d.scaling.html @@ -1,5 +1,5 @@ scaling | wgpu-matrix

                        Function scaling

                        • Creates a 3-by-3 matrix which scales in each dimension by an amount given by -the corresponding entry in the given vector; assumes the vector has three +the corresponding entry in the given vector; assumes the vector has two entries.

                          Type Parameters

                          Parameters

                          • v: BaseArgType

                            A vector of 2 entries specifying the factor by which to scale in each dimension.

                            diff --git a/docs/functions/mat3d.scaling3D.html b/docs/functions/mat3d.scaling3D.html new file mode 100644 index 0000000..a53d9f5 --- /dev/null +++ b/docs/functions/mat3d.scaling3D.html @@ -0,0 +1,8 @@ +scaling3D | wgpu-matrix

                            Function scaling3D

                            • Creates a 3-by-3 matrix which scales in each dimension by an amount given by +the corresponding entry in the given vector; assumes the vector has three +entries.

                              +

                              Type Parameters

                              Parameters

                              • v: BaseArgType

                                A vector of +3 entries specifying the factor by which to scale in each dimension.

                                +
                              • Optional dst: T

                                matrix to hold result. If not passed a new one is created.

                                +

                              Returns T

                              The scaling matrix.

                              +
                            \ No newline at end of file diff --git a/docs/functions/mat3d.uniformScale.html b/docs/functions/mat3d.uniformScale.html index 9ca932b..3dfc43d 100644 --- a/docs/functions/mat3d.uniformScale.html +++ b/docs/functions/mat3d.uniformScale.html @@ -1,4 +1,4 @@ -uniformScale | wgpu-matrix

                            Function uniformScale

                            • Scales the given 3-by-3 matrix in each dimension by an amount +uniformScale | wgpu-matrix

                              Function uniformScale

                              • Scales the given 3-by-3 matrix in the X and Y dimension by an amount given.

                                Type Parameters

                                Parameters

                                • m: BaseArgType

                                  The matrix to be modified.

                                • s: number

                                  Amount to scale.

                                  diff --git a/docs/functions/mat3d.uniformScale3D.html b/docs/functions/mat3d.uniformScale3D.html new file mode 100644 index 0000000..78c2c16 --- /dev/null +++ b/docs/functions/mat3d.uniformScale3D.html @@ -0,0 +1,7 @@ +uniformScale3D | wgpu-matrix

                                  Function uniformScale3D

                                  • Scales the given 3-by-3 matrix in each dimension by an amount +given.

                                    +

                                    Type Parameters

                                    Parameters

                                    • m: BaseArgType

                                      The matrix to be modified.

                                      +
                                    • s: number

                                      Amount to scale.

                                      +
                                    • Optional dst: T

                                      matrix to hold result. If not passed a new one is created.

                                      +

                                    Returns T

                                    The scaled matrix.

                                    +
                                  \ No newline at end of file diff --git a/docs/functions/mat3d.uniformScaling.html b/docs/functions/mat3d.uniformScaling.html index d6971ff..2363f92 100644 --- a/docs/functions/mat3d.uniformScaling.html +++ b/docs/functions/mat3d.uniformScaling.html @@ -1,4 +1,4 @@ -uniformScaling | wgpu-matrix

                                  Function uniformScaling

                                  • Creates a 3-by-3 matrix which scales uniformly in each dimension

                                    +uniformScaling | wgpu-matrix

                                    Function uniformScaling

                                    • Creates a 3-by-3 matrix which scales uniformly in the X and Y dimensions

                                      Type Parameters

                                      Parameters

                                      • s: number

                                        Amount to scale

                                      • Optional dst: T

                                        matrix to hold result. If not passed a new one is created.

                                      Returns T

                                      The scaling matrix.

                                      diff --git a/docs/functions/mat3d.uniformScaling3D.html b/docs/functions/mat3d.uniformScaling3D.html new file mode 100644 index 0000000..6a35770 --- /dev/null +++ b/docs/functions/mat3d.uniformScaling3D.html @@ -0,0 +1,5 @@ +uniformScaling3D | wgpu-matrix

                                      Function uniformScaling3D

                                      • Creates a 3-by-3 matrix which scales uniformly in each dimension

                                        +

                                        Type Parameters

                                        Parameters

                                        • s: number

                                          Amount to scale

                                          +
                                        • Optional dst: T

                                          matrix to hold result. If not passed a new one is created.

                                          +

                                        Returns T

                                        The scaling matrix.

                                        +
                                      \ No newline at end of file diff --git a/docs/functions/mat3n.rotateX.html b/docs/functions/mat3n.rotateX.html new file mode 100644 index 0000000..ea1bc9f --- /dev/null +++ b/docs/functions/mat3n.rotateX.html @@ -0,0 +1,7 @@ +rotateX | wgpu-matrix

                                      Function rotateX

                                      • Rotates the given 3-by-3 matrix around the x-axis by the given +angle.

                                        +

                                        Type Parameters

                                        Parameters

                                        • m: BaseArgType

                                          The matrix.

                                          +
                                        • angleInRadians: number

                                          The angle by which to rotate (in radians).

                                          +
                                        • Optional dst: T

                                          matrix to hold result. If not passed a new one is created.

                                          +

                                        Returns T

                                        The rotated matrix.

                                        +
                                      \ No newline at end of file diff --git a/docs/functions/mat3n.rotateY.html b/docs/functions/mat3n.rotateY.html new file mode 100644 index 0000000..a6e6d54 --- /dev/null +++ b/docs/functions/mat3n.rotateY.html @@ -0,0 +1,7 @@ +rotateY | wgpu-matrix

                                      Function rotateY

                                      • Rotates the given 3-by-3 matrix around the y-axis by the given +angle.

                                        +

                                        Type Parameters

                                        Parameters

                                        • m: BaseArgType

                                          The matrix.

                                          +
                                        • angleInRadians: number

                                          The angle by which to rotate (in radians).

                                          +
                                        • Optional dst: T

                                          matrix to hold result. If not passed a new one is created.

                                          +

                                        Returns T

                                        The rotated matrix.

                                        +
                                      \ No newline at end of file diff --git a/docs/functions/mat3n.rotateZ.html b/docs/functions/mat3n.rotateZ.html new file mode 100644 index 0000000..738cf93 --- /dev/null +++ b/docs/functions/mat3n.rotateZ.html @@ -0,0 +1,6 @@ +rotateZ | wgpu-matrix

                                      Function rotateZ

                                      • Rotates the given 3-by-3 matrix by the given angle.

                                        +

                                        Type Parameters

                                        Parameters

                                        • m: BaseArgType

                                          The matrix.

                                          +
                                        • angleInRadians: number

                                          The angle by which to rotate (in radians).

                                          +
                                        • Optional dst: T

                                          matrix to hold result. If not passed a new one is created.

                                          +

                                        Returns T

                                        The rotated matrix.

                                        +
                                      \ No newline at end of file diff --git a/docs/functions/mat3n.rotationX.html b/docs/functions/mat3n.rotationX.html new file mode 100644 index 0000000..1ccad6d --- /dev/null +++ b/docs/functions/mat3n.rotationX.html @@ -0,0 +1,5 @@ +rotationX | wgpu-matrix

                                      Function rotationX

                                      • Creates a 3-by-3 matrix which rotates around the x-axis by the given angle.

                                        +

                                        Type Parameters

                                        Parameters

                                        • angleInRadians: number

                                          The angle by which to rotate (in radians).

                                          +
                                        • Optional dst: T

                                          matrix to hold result. If not passed a new one is created.

                                          +

                                        Returns T

                                        The rotation matrix.

                                        +
                                      \ No newline at end of file diff --git a/docs/functions/mat3n.rotationY.html b/docs/functions/mat3n.rotationY.html new file mode 100644 index 0000000..83315da --- /dev/null +++ b/docs/functions/mat3n.rotationY.html @@ -0,0 +1,5 @@ +rotationY | wgpu-matrix

                                      Function rotationY

                                      • Creates a 3-by-3 matrix which rotates around the y-axis by the given angle.

                                        +

                                        Type Parameters

                                        Parameters

                                        • angleInRadians: number

                                          The angle by which to rotate (in radians).

                                          +
                                        • Optional dst: T

                                          matrix to hold result. If not passed a new one is created.

                                          +

                                        Returns T

                                        The rotation matrix.

                                        +
                                      \ No newline at end of file diff --git a/docs/functions/mat3n.rotationZ.html b/docs/functions/mat3n.rotationZ.html new file mode 100644 index 0000000..81c6423 --- /dev/null +++ b/docs/functions/mat3n.rotationZ.html @@ -0,0 +1,5 @@ +rotationZ | wgpu-matrix

                                      Function rotationZ

                                      • Creates a 3-by-3 matrix which rotates by the given angle.

                                        +

                                        Type Parameters

                                        Parameters

                                        • angleInRadians: number

                                          The angle by which to rotate (in radians).

                                          +
                                        • Optional dst: T

                                          matrix to hold result. If not passed a new one is created.

                                          +

                                        Returns T

                                        The rotation matrix.

                                        +
                                      \ No newline at end of file diff --git a/docs/functions/mat3n.scale.html b/docs/functions/mat3n.scale.html index 3e40c5b..6bfcc60 100644 --- a/docs/functions/mat3n.scale.html +++ b/docs/functions/mat3n.scale.html @@ -1,6 +1,6 @@ scale | wgpu-matrix

                                      Function scale

                                      • Scales the given 3-by-3 matrix in each dimension by an amount given by the corresponding entry in the given vector; assumes the vector has -three entries.

                                        +two entries.

                                        Type Parameters

                                        Parameters

                                        • m: BaseArgType

                                          The matrix to be modified.

                                        • v: BaseArgType

                                          A vector of 2 entries specifying the factor by which to scale in each dimension.

                                          diff --git a/docs/functions/mat3n.scale3D.html b/docs/functions/mat3n.scale3D.html new file mode 100644 index 0000000..0ea4c0a --- /dev/null +++ b/docs/functions/mat3n.scale3D.html @@ -0,0 +1,9 @@ +scale3D | wgpu-matrix

                                          Function scale3D

                                          • Scales the given 3-by-3 matrix in each dimension by an amount +given by the corresponding entry in the given vector; assumes the vector has +three entries.

                                            +

                                            Type Parameters

                                            Parameters

                                            • m: BaseArgType

                                              The matrix to be modified.

                                              +
                                            • v: BaseArgType

                                              A vector of 3 entries specifying the +factor by which to scale in each dimension.

                                              +
                                            • Optional dst: T

                                              matrix to hold result. If not passed a new one is created.

                                              +

                                            Returns T

                                            The scaled matrix.

                                            +
                                          \ No newline at end of file diff --git a/docs/functions/mat3n.scaling.html b/docs/functions/mat3n.scaling.html index 40bc75b..123ca7a 100644 --- a/docs/functions/mat3n.scaling.html +++ b/docs/functions/mat3n.scaling.html @@ -1,5 +1,5 @@ scaling | wgpu-matrix

                                          Function scaling

                                          • Creates a 3-by-3 matrix which scales in each dimension by an amount given by -the corresponding entry in the given vector; assumes the vector has three +the corresponding entry in the given vector; assumes the vector has two entries.

                                            Type Parameters

                                            Parameters

                                            • v: BaseArgType

                                              A vector of 2 entries specifying the factor by which to scale in each dimension.

                                              diff --git a/docs/functions/mat3n.scaling3D.html b/docs/functions/mat3n.scaling3D.html new file mode 100644 index 0000000..4ca77bf --- /dev/null +++ b/docs/functions/mat3n.scaling3D.html @@ -0,0 +1,8 @@ +scaling3D | wgpu-matrix

                                              Function scaling3D

                                              • Creates a 3-by-3 matrix which scales in each dimension by an amount given by +the corresponding entry in the given vector; assumes the vector has three +entries.

                                                +

                                                Type Parameters

                                                Parameters

                                                • v: BaseArgType

                                                  A vector of +3 entries specifying the factor by which to scale in each dimension.

                                                  +
                                                • Optional dst: T

                                                  matrix to hold result. If not passed a new one is created.

                                                  +

                                                Returns T

                                                The scaling matrix.

                                                +
                                              \ No newline at end of file diff --git a/docs/functions/mat3n.uniformScale.html b/docs/functions/mat3n.uniformScale.html index aa0194e..788845a 100644 --- a/docs/functions/mat3n.uniformScale.html +++ b/docs/functions/mat3n.uniformScale.html @@ -1,4 +1,4 @@ -uniformScale | wgpu-matrix

                                              Function uniformScale

                                              • Scales the given 3-by-3 matrix in each dimension by an amount +uniformScale | wgpu-matrix

                                                Function uniformScale

                                                • Scales the given 3-by-3 matrix in the X and Y dimension by an amount given.

                                                  Type Parameters

                                                  Parameters

                                                  • m: BaseArgType

                                                    The matrix to be modified.

                                                  • s: number

                                                    Amount to scale.

                                                    diff --git a/docs/functions/mat3n.uniformScale3D.html b/docs/functions/mat3n.uniformScale3D.html new file mode 100644 index 0000000..0809025 --- /dev/null +++ b/docs/functions/mat3n.uniformScale3D.html @@ -0,0 +1,7 @@ +uniformScale3D | wgpu-matrix

                                                    Function uniformScale3D

                                                    • Scales the given 3-by-3 matrix in each dimension by an amount +given.

                                                      +

                                                      Type Parameters

                                                      Parameters

                                                      • m: BaseArgType

                                                        The matrix to be modified.

                                                        +
                                                      • s: number

                                                        Amount to scale.

                                                        +
                                                      • Optional dst: T

                                                        matrix to hold result. If not passed a new one is created.

                                                        +

                                                      Returns T

                                                      The scaled matrix.

                                                      +
                                                    \ No newline at end of file diff --git a/docs/functions/mat3n.uniformScaling.html b/docs/functions/mat3n.uniformScaling.html index 3aab7bf..3131fde 100644 --- a/docs/functions/mat3n.uniformScaling.html +++ b/docs/functions/mat3n.uniformScaling.html @@ -1,4 +1,4 @@ -uniformScaling | wgpu-matrix

                                                    Function uniformScaling

                                                    • Creates a 3-by-3 matrix which scales uniformly in each dimension

                                                      +uniformScaling | wgpu-matrix

                                                      Function uniformScaling

                                                      • Creates a 3-by-3 matrix which scales uniformly in the X and Y dimensions

                                                        Type Parameters

                                                        Parameters

                                                        • s: number

                                                          Amount to scale

                                                        • Optional dst: T

                                                          matrix to hold result. If not passed a new one is created.

                                                        Returns T

                                                        The scaling matrix.

                                                        diff --git a/docs/functions/mat3n.uniformScaling3D.html b/docs/functions/mat3n.uniformScaling3D.html new file mode 100644 index 0000000..95ee942 --- /dev/null +++ b/docs/functions/mat3n.uniformScaling3D.html @@ -0,0 +1,5 @@ +uniformScaling3D | wgpu-matrix

                                                        Function uniformScaling3D

                                                        • Creates a 3-by-3 matrix which scales uniformly in each dimension

                                                          +

                                                          Type Parameters

                                                          Parameters

                                                          • s: number

                                                            Amount to scale

                                                            +
                                                          • Optional dst: T

                                                            matrix to hold result. If not passed a new one is created.

                                                            +

                                                          Returns T

                                                          The scaling matrix.

                                                          +
                                                        \ No newline at end of file diff --git a/docs/modules/mat3.html b/docs/modules/mat3.html index 473f8e9..1a37e85 100644 --- a/docs/modules/mat3.html +++ b/docs/modules/mat3.html @@ -18,9 +18,17 @@ multiply negate rotate +rotateX +rotateY +rotateZ rotation +rotationX +rotationY +rotationZ scale +scale3D scaling +scaling3D set setAxis setTranslation @@ -28,5 +36,7 @@ translation transpose uniformScale +uniformScale3D uniformScaling +uniformScaling3D
                                              \ No newline at end of file diff --git a/docs/modules/mat3d.html b/docs/modules/mat3d.html index 7460727..c074857 100644 --- a/docs/modules/mat3d.html +++ b/docs/modules/mat3d.html @@ -18,9 +18,17 @@ multiply negate rotate +rotateX +rotateY +rotateZ rotation +rotationX +rotationY +rotationZ scale +scale3D scaling +scaling3D set setAxis setTranslation @@ -28,5 +36,7 @@ translation transpose uniformScale +uniformScale3D uniformScaling +uniformScaling3D
                                    \ No newline at end of file diff --git a/docs/modules/mat3n.html b/docs/modules/mat3n.html index cf9360c..60d1ad8 100644 --- a/docs/modules/mat3n.html +++ b/docs/modules/mat3n.html @@ -18,9 +18,17 @@ multiply negate rotate +rotateX +rotateY +rotateZ rotation +rotationX +rotationY +rotationZ scale +scale3D scaling +scaling3D set setAxis setTranslation @@ -28,5 +36,7 @@ translation transpose uniformScale +uniformScale3D uniformScaling +uniformScaling3D
                            \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index d3fb832..535bb09 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wgpu-matrix", - "version": "3.1.0", + "version": "3.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "wgpu-matrix", - "version": "3.1.0", + "version": "3.2.0", "license": "MIT", "devDependencies": { "@rollup/plugin-terser": "^0.4.4", diff --git a/package.json b/package.json index d688327..5f26743 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wgpu-matrix", - "version": "3.1.0", + "version": "3.2.0", "description": "fast matrix math library for WebGPU", "main": "dist/3.x/wgpu-matrix.module.js", "module": "dist/3.x/wgpu-matrix.module.js", diff --git a/src/mat3-impl.ts b/src/mat3-impl.ts index 40c935e..abf0e07 100644 --- a/src/mat3-impl.ts +++ b/src/mat3-impl.ts @@ -661,9 +661,138 @@ function rotate(m: Mat3Arg, angleInRadians: number, return newDst; } +/** + * Creates a 3-by-3 matrix which rotates around the x-axis by the given angle. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotation matrix. + */ +function rotationX(angleInRadians: number, dst?: T) { + const newDst = (dst ?? new Ctor(12)) as T; + + const c = Math.cos(angleInRadians); + const s = Math.sin(angleInRadians); + + newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; + newDst[ 4] = 0; newDst[ 5] = c; newDst[ 6] = s; + newDst[ 8] = 0; newDst[ 9] = -s; newDst[10] = c; + + return newDst; +} + +/** + * Rotates the given 3-by-3 matrix around the x-axis by the given + * angle. + * @param m - The matrix. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotated matrix. + */ +function rotateX(m: Mat3Arg, angleInRadians: number, dst?: T) { + const newDst = (dst ?? new Ctor(12)) as T; + + const m10 = m[4]; + const m11 = m[5]; + const m12 = m[6]; + const m20 = m[8]; + const m21 = m[9]; + const m22 = m[10]; + + const c = Math.cos(angleInRadians); + const s = Math.sin(angleInRadians); + + newDst[4] = c * m10 + s * m20; + newDst[5] = c * m11 + s * m21; + newDst[6] = c * m12 + s * m22; + newDst[8] = c * m20 - s * m10; + newDst[9] = c * m21 - s * m11; + newDst[10] = c * m22 - s * m12; + + if (m !== newDst) { + newDst[ 0] = m[ 0]; + newDst[ 1] = m[ 1]; + newDst[ 2] = m[ 2]; + } + + return newDst; +} + +/** + * Creates a 3-by-3 matrix which rotates around the y-axis by the given angle. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotation matrix. + */ +function rotationY(angleInRadians: number, dst?: T) { + const newDst = (dst ?? new Ctor(12)) as T; + + const c = Math.cos(angleInRadians); + const s = Math.sin(angleInRadians); + + newDst[ 0] = c; newDst[ 1] = 0; newDst[ 2] = -s; + newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; + newDst[ 8] = s; newDst[ 9] = 0; newDst[10] = c; + + return newDst; +} + +/** + * Rotates the given 3-by-3 matrix around the y-axis by the given + * angle. + * @param m - The matrix. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotated matrix. + */ +function rotateY(m: Mat3Arg, angleInRadians: number, dst?: T) { + const newDst = (dst ?? new Ctor(12)) as T; + + const m00 = m[0 * 4 + 0]; + const m01 = m[0 * 4 + 1]; + const m02 = m[0 * 4 + 2]; + const m20 = m[2 * 4 + 0]; + const m21 = m[2 * 4 + 1]; + const m22 = m[2 * 4 + 2]; + const c = Math.cos(angleInRadians); + const s = Math.sin(angleInRadians); + + newDst[ 0] = c * m00 - s * m20; + newDst[ 1] = c * m01 - s * m21; + newDst[ 2] = c * m02 - s * m22; + newDst[ 8] = c * m20 + s * m00; + newDst[ 9] = c * m21 + s * m01; + newDst[10] = c * m22 + s * m02; + + if (m !== newDst) { + newDst[ 4] = m[ 4]; + newDst[ 5] = m[ 5]; + newDst[ 6] = m[ 6]; + } + + return newDst; +} + +/** + * Creates a 3-by-3 matrix which rotates around the z-axis by the given angle. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotation matrix. + */ +const rotationZ = rotation; + +/** + * Rotates the given 3-by-3 matrix around the z-axis by the given + * angle. + * @param m - The matrix. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotated matrix. + */ +const rotateZ = rotate; + /** * Creates a 3-by-3 matrix which scales in each dimension by an amount given by - * the corresponding entry in the given vector; assumes the vector has three + * the corresponding entry in the given vector; assumes the vector has two * entries. * @param v - A vector of * 2 entries specifying the factor by which to scale in each dimension. @@ -683,7 +812,7 @@ function scaling(v: Vec2Arg, dst?: T) { /** * Scales the given 3-by-3 matrix in each dimension by an amount * given by the corresponding entry in the given vector; assumes the vector has - * three entries. + * two entries. * @param m - The matrix to be modified. * @param v - A vector of 2 entries specifying the * factor by which to scale in each dimension. @@ -714,7 +843,58 @@ function scale(m: Mat3Arg, v: Vec2Arg, dst?: T) { } /** - * Creates a 3-by-3 matrix which scales uniformly in each dimension + * Creates a 3-by-3 matrix which scales in each dimension by an amount given by + * the corresponding entry in the given vector; assumes the vector has three + * entries. + * @param v - A vector of + * 3 entries specifying the factor by which to scale in each dimension. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The scaling matrix. + */ +function scaling3D(v: Vec3Arg, dst?: T) { + const newDst = (dst ?? new Ctor(12)) as T; + + newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0; + newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0; + newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = v[2]; + + return newDst; +} + +/** + * Scales the given 3-by-3 matrix in each dimension by an amount + * given by the corresponding entry in the given vector; assumes the vector has + * three entries. + * @param m - The matrix to be modified. + * @param v - A vector of 3 entries specifying the + * factor by which to scale in each dimension. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The scaled matrix. + */ +function scale3D(m: Mat3Arg, v: Vec3Arg, dst?: T) { + const newDst = (dst ?? new Ctor(12)) as T; + + const v0 = v[0]; + const v1 = v[1]; + const v2 = v[2]; + + newDst[ 0] = v0 * m[0 * 4 + 0]; + newDst[ 1] = v0 * m[0 * 4 + 1]; + newDst[ 2] = v0 * m[0 * 4 + 2]; + + newDst[ 4] = v1 * m[1 * 4 + 0]; + newDst[ 5] = v1 * m[1 * 4 + 1]; + newDst[ 6] = v1 * m[1 * 4 + 2]; + + newDst[ 8] = v2 * m[2 * 4 + 0]; + newDst[ 9] = v2 * m[2 * 4 + 1]; + newDst[10] = v2 * m[2 * 4 + 2]; + + return newDst; +} + +/** + * Creates a 3-by-3 matrix which scales uniformly in the X and Y dimensions * @param s - Amount to scale * @param dst - matrix to hold result. If not passed a new one is created. * @returns The scaling matrix. @@ -730,7 +910,7 @@ function uniformScaling(s: number, dst?: T) { } /** - * Scales the given 3-by-3 matrix in each dimension by an amount + * Scales the given 3-by-3 matrix in the X and Y dimension by an amount * given. * @param m - The matrix to be modified. * @param s - Amount to scale. @@ -757,6 +937,48 @@ function uniformScale(m: Mat3Arg, s: number, dst?: return newDst; } +/** + * Creates a 3-by-3 matrix which scales uniformly in each dimension + * @param s - Amount to scale + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The scaling matrix. + */ +function uniformScaling3D(s: number, dst?: T) { + const newDst = (dst ?? new Ctor(12)) as T; + + newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0; + newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0; + newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = s; + + return newDst; +} + +/** + * Scales the given 3-by-3 matrix in each dimension by an amount + * given. + * @param m - The matrix to be modified. + * @param s - Amount to scale. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The scaled matrix. + */ +function uniformScale3D(m: Mat3Arg, s: number, dst?: T) { + const newDst = (dst ?? new Ctor(12)) as T; + + newDst[ 0] = s * m[0 * 4 + 0]; + newDst[ 1] = s * m[0 * 4 + 1]; + newDst[ 2] = s * m[0 * 4 + 2]; + + newDst[ 4] = s * m[1 * 4 + 0]; + newDst[ 5] = s * m[1 * 4 + 1]; + newDst[ 6] = s * m[1 * 4 + 2]; + + newDst[ 8] = s * m[2 * 4 + 0]; + newDst[ 9] = s * m[2 * 4 + 1]; + newDst[10] = s * m[2 * 4 + 2]; + + return newDst; +} + return { clone, create, @@ -784,10 +1006,20 @@ return { translate, rotation, rotate, + rotationX, + rotateX, + rotationY, + rotateY, + rotationZ, + rotateZ, scaling, scale, uniformScaling, uniformScale, + scaling3D, + scale3D, + uniformScaling3D, + uniformScale3D, }; } diff --git a/test/tests/mat3-test.js b/test/tests/mat3-test.js index 3ccde0c..30691d2 100644 --- a/test/tests/mat3-test.js +++ b/test/tests/mat3-test.js @@ -448,6 +448,78 @@ function check(mat3, Type) { }, expected); }); + it('should make rotationX matrix', () => { + const angle = 1.23; + const c = Math.cos(angle); + const s = Math.sin(angle); + const expected = [ + 1, 0, 0, 0, + 0, c, s, 0, + 0, -s, c, 0, + ]; + testMat3WithAndWithoutDest((newDst) => { + return mat3.rotationX(angle, newDst); + }, expected); + }); + + it('should rotateX', () => { + const angle = 1.23; + // switch to Array type to keep precision high for expected + const expected = mat3n.multiply(m, mat3.rotationX(angle)); + + testMat3WithAndWithoutDest((newDst) => { + return mat3.rotateX(m, angle, newDst); + }, expected); + }); + + it('should make rotationY matrix', () => { + const angle = 1.23; + const c = Math.cos(angle); + const s = Math.sin(angle); + const expected = [ + c, 0, -s, 0, + 0, 1, 0, 0, + s, 0, c, 0, + ]; + testMat3WithAndWithoutDest((newDst) => { + return mat3.rotationY(angle, newDst); + }, expected); + }); + + it('should rotateY', () => { + const angle = 1.23; + // switch to Array type to keep precision high for expected + const expected = mat3n.multiply(m, mat3.rotationY(angle)); + + testMat3WithAndWithoutDest((newDst) => { + return mat3.rotateY(m, angle, newDst); + }, expected); + }); + + it('should make rotationZ matrix', () => { + const angle = 1.23; + const c = Math.cos(angle); + const s = Math.sin(angle); + const expected = [ + c, s, 0, 0, + -s, c, 0, 0, + 0, 0, 1, 0, + ]; + testMat3WithAndWithoutDest((newDst) => { + return mat3.rotationZ(angle, newDst); + }, expected); + }); + + it('should rotateZ', () => { + const angle = 1.23; + // switch to Array type to keep precision high for expected + const expected = mat3n.multiply(m, mat3.rotationZ(angle)); + + testMat3WithAndWithoutDest((newDst) => { + return mat3.rotateZ(m, angle, newDst); + }, expected); + }); + it('should make scaling matrix', () => { const expected = [ 2, 0, 0, 0, @@ -470,6 +542,28 @@ function check(mat3, Type) { }, expected); }); + it('should make 3D scaling matrix', () => { + const expected = [ + 2, 0, 0, 0, + 0, 3, 0, 0, + 0, 0, 4, 0, + ]; + testMat3WithAndWithoutDest((newDst) => { + return mat3.scaling3D([2, 3, 4], newDst); + }, expected); + }); + + it('should scale 3D', () => { + const expected = [ + 0, 2, 4, 0, + 12, 15, 18, 0, + 32, 36, 40, 0, + ]; + testMat3WithAndWithoutDest((newDst) => { + return mat3.scale3D(m, [2, 3, 4], newDst); + }, expected); + }); + it('should make uniform scaling matrix', () => { const expected = [ 2, 0, 0, 0, @@ -492,6 +586,28 @@ function check(mat3, Type) { }, expected); }); + it('should make uniform scaling 3D matrix', () => { + const expected = [ + 2, 0, 0, 0, + 0, 2, 0, 0, + 0, 0, 2, 0, + ]; + testMat3WithAndWithoutDest((newDst) => { + return mat3.uniformScaling3D(2, newDst); + }, expected); + }); + + it('should uniformly scale 3D', () => { + const expected = [ + 0, 2, 4, 0, + 8, 10, 12, 0, + 16, 18, 20, 0, + ]; + testMat3WithAndWithoutDest((newDst) => { + return mat3.uniformScale3D(m, 2, newDst); + }, expected); + }); + it('should make a mat3 from mat4', () => { const expected = [ 1, 2, 3, 0,