diff --git a/dist/3.x/wgpu-matrix.d.ts b/dist/3.x/wgpu-matrix.d.ts index 96a7269..84dc9d7 100644 --- a/dist/3.x/wgpu-matrix.d.ts +++ b/dist/3.x/wgpu-matrix.d.ts @@ -31,6 +31,41 @@ export type Vec2n = Vec2Type; export type Vec3n = Vec3Type; export type Vec4n = Vec4Type; export declare const +/** + * 3x3 Matrix functions that default to returning `Float32Array` + * @namespace + */ +mat3: { + clone: (m: BaseArgType, dst?: T | undefined) => T; + 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) => Float32Array; + set: (v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, dst?: T_1 | undefined) => T_1; + fromMat4: (m4: BaseArgType, dst?: T_2 | undefined) => T_2; + fromQuat: (q: BaseArgType, dst?: T_3 | undefined) => T_3; + negate: (m: BaseArgType, dst?: T_4 | undefined) => T_4; + copy: (m: BaseArgType, dst?: T | undefined) => T; + equalsApproximately: (a: BaseArgType, b: BaseArgType) => boolean; + equals: (a: BaseArgType, b: BaseArgType) => boolean; + identity: (dst?: T_5 | undefined) => T_5; + transpose: (m: BaseArgType, dst?: T_6 | undefined) => T_6; + inverse: (m: BaseArgType, dst?: T_7 | undefined) => T_7; + invert: (m: BaseArgType, dst?: T_7 | undefined) => T_7; + determinant: (m: BaseArgType) => number; + mul: (a: BaseArgType, b: BaseArgType, dst?: T_8 | undefined) => T_8; + multiply: (a: BaseArgType, b: BaseArgType, dst?: T_8 | undefined) => T_8; + setTranslation: (a: BaseArgType, v: BaseArgType, dst?: T_9 | undefined) => T_9; + getTranslation: (m: BaseArgType, dst?: T_10 | undefined) => T_10; + getAxis: (m: BaseArgType, axis: number, dst?: T_11 | undefined) => T_11; + setAxis: (m: BaseArgType, v: BaseArgType, axis: number, dst?: T_12 | undefined) => T_12; + getScaling: (m: BaseArgType, dst?: T_13 | undefined) => Float32Array | T_13; + translation: (v: BaseArgType, dst?: T_14 | undefined) => T_14; + translate: (m: BaseArgType, v: BaseArgType, dst?: T_15 | undefined) => T_15; + rotation: (angleInRadians: number, dst?: T_16 | undefined) => T_16; + rotate: (m: BaseArgType, angleInRadians: number, dst?: T_17 | undefined) => T_17; + scaling: (v: BaseArgType, dst?: T_18 | undefined) => T_18; + scale: (m: BaseArgType, v: BaseArgType, dst?: T_19 | undefined) => T_19; + uniformScaling: (s: number, dst?: T_20 | undefined) => T_20; + uniformScale: (m: BaseArgType, s: number, dst?: T_21 | undefined) => T_21; +}, /** * 4x4 Matrix functions that default to returning `Float32Array` * @namespace @@ -82,41 +117,6 @@ mat4: { uniformScaling: (s: number, dst?: T_34 | undefined) => T_34; uniformScale: (m: BaseArgType, s: number, dst?: T_35 | undefined) => T_35; }, -/** - * 3x3 Matrix functions that default to returning `Float32Array` - * @namespace - */ -mat3: { - clone: (m: BaseArgType, dst?: T | undefined) => T; - 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) => Float32Array; - set: (v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, dst?: T_1 | undefined) => T_1; - fromMat4: (m4: BaseArgType, dst?: T_2 | undefined) => T_2; - fromQuat: (q: BaseArgType, dst?: T_3 | undefined) => T_3; - negate: (m: BaseArgType, dst?: T_4 | undefined) => T_4; - copy: (m: BaseArgType, dst?: T | undefined) => T; - equalsApproximately: (a: BaseArgType, b: BaseArgType) => boolean; - equals: (a: BaseArgType, b: BaseArgType) => boolean; - identity: (dst?: T_5 | undefined) => T_5; - transpose: (m: BaseArgType, dst?: T_6 | undefined) => T_6; - inverse: (m: BaseArgType, dst?: T_7 | undefined) => T_7; - invert: (m: BaseArgType, dst?: T_7 | undefined) => T_7; - determinant: (m: BaseArgType) => number; - mul: (a: BaseArgType, b: BaseArgType, dst?: T_8 | undefined) => T_8; - multiply: (a: BaseArgType, b: BaseArgType, dst?: T_8 | undefined) => T_8; - setTranslation: (a: BaseArgType, v: BaseArgType, dst?: T_9 | undefined) => T_9; - getTranslation: (m: BaseArgType, dst?: T_10 | undefined) => T_10; - getAxis: (m: BaseArgType, axis: number, dst?: T_11 | undefined) => T_11; - setAxis: (m: BaseArgType, v: BaseArgType, axis: number, dst?: T_12 | undefined) => T_12; - getScaling: (m: BaseArgType, dst?: T_13 | undefined) => Float32Array | T_13; - translation: (v: BaseArgType, dst?: T_14 | undefined) => T_14; - translate: (m: BaseArgType, v: BaseArgType, dst?: T_15 | undefined) => T_15; - rotation: (angleInRadians: number, dst?: T_16 | undefined) => T_16; - rotate: (m: BaseArgType, angleInRadians: number, dst?: T_17 | undefined) => T_17; - scaling: (v: BaseArgType, dst?: T_18 | undefined) => T_18; - scale: (m: BaseArgType, v: BaseArgType, dst?: T_19 | undefined) => T_19; - uniformScaling: (s: number, dst?: T_20 | undefined) => T_20; - uniformScale: (m: BaseArgType, s: number, dst?: T_21 | undefined) => T_21; -}, /** * Quaternion functions that default to returning `Float32Array` * @namespace @@ -329,7 +329,37 @@ vec4: { truncate: (a: BaseArgType, maxLen: number, dst?: T_23 | undefined) => T_23; midpoint: (a: BaseArgType, b: BaseArgType, dst?: T_24 | undefined) => T_24; }; -export declare const mat4d: { +export declare const mat3d: { + clone: (m: BaseArgType, dst?: T | undefined) => T; + 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) => Float64Array; + set: (v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, dst?: T_1 | undefined) => T_1; + fromMat4: (m4: BaseArgType, dst?: T_2 | undefined) => T_2; + fromQuat: (q: BaseArgType, dst?: T_3 | undefined) => T_3; + negate: (m: BaseArgType, dst?: T_4 | undefined) => T_4; + copy: (m: BaseArgType, dst?: T | undefined) => T; + equalsApproximately: (a: BaseArgType, b: BaseArgType) => boolean; + equals: (a: BaseArgType, b: BaseArgType) => boolean; + identity: (dst?: T_5 | undefined) => T_5; + transpose: (m: BaseArgType, dst?: T_6 | undefined) => T_6; + inverse: (m: BaseArgType, dst?: T_7 | undefined) => T_7; + invert: (m: BaseArgType, dst?: T_7 | undefined) => T_7; + determinant: (m: BaseArgType) => number; + mul: (a: BaseArgType, b: BaseArgType, dst?: T_8 | undefined) => T_8; + multiply: (a: BaseArgType, b: BaseArgType, dst?: T_8 | undefined) => T_8; + setTranslation: (a: BaseArgType, v: BaseArgType, dst?: T_9 | undefined) => T_9; + getTranslation: (m: BaseArgType, dst?: T_10 | undefined) => T_10; + getAxis: (m: BaseArgType, axis: number, dst?: T_11 | undefined) => T_11; + setAxis: (m: BaseArgType, v: BaseArgType, axis: number, dst?: T_12 | undefined) => T_12; + getScaling: (m: BaseArgType, dst?: T_13 | undefined) => Float64Array | T_13; + translation: (v: BaseArgType, dst?: T_14 | undefined) => T_14; + translate: (m: BaseArgType, v: BaseArgType, dst?: T_15 | undefined) => T_15; + rotation: (angleInRadians: number, dst?: T_16 | undefined) => T_16; + rotate: (m: BaseArgType, angleInRadians: number, dst?: T_17 | undefined) => T_17; + scaling: (v: BaseArgType, dst?: T_18 | undefined) => T_18; + scale: (m: BaseArgType, v: BaseArgType, dst?: T_19 | undefined) => T_19; + uniformScaling: (s: number, dst?: T_20 | undefined) => T_20; + uniformScale: (m: BaseArgType, s: number, dst?: T_21 | undefined) => T_21; +}, 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; fromMat3: (m3: BaseArgType, dst?: T_1 | undefined) => T_1; @@ -375,36 +405,6 @@ export declare const mat4d: { scale: (m: BaseArgType, v: BaseArgType, dst?: T_33 | undefined) => T_33; uniformScaling: (s: number, dst?: T_34 | undefined) => T_34; uniformScale: (m: BaseArgType, s: number, dst?: T_35 | undefined) => T_35; -}, mat3d: { - clone: (m: BaseArgType, dst?: T | undefined) => T; - 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) => Float64Array; - set: (v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, dst?: T_1 | undefined) => T_1; - fromMat4: (m4: BaseArgType, dst?: T_2 | undefined) => T_2; - fromQuat: (q: BaseArgType, dst?: T_3 | undefined) => T_3; - negate: (m: BaseArgType, dst?: T_4 | undefined) => T_4; - copy: (m: BaseArgType, dst?: T | undefined) => T; - equalsApproximately: (a: BaseArgType, b: BaseArgType) => boolean; - equals: (a: BaseArgType, b: BaseArgType) => boolean; - identity: (dst?: T_5 | undefined) => T_5; - transpose: (m: BaseArgType, dst?: T_6 | undefined) => T_6; - inverse: (m: BaseArgType, dst?: T_7 | undefined) => T_7; - invert: (m: BaseArgType, dst?: T_7 | undefined) => T_7; - determinant: (m: BaseArgType) => number; - mul: (a: BaseArgType, b: BaseArgType, dst?: T_8 | undefined) => T_8; - multiply: (a: BaseArgType, b: BaseArgType, dst?: T_8 | undefined) => T_8; - setTranslation: (a: BaseArgType, v: BaseArgType, dst?: T_9 | undefined) => T_9; - getTranslation: (m: BaseArgType, dst?: T_10 | undefined) => T_10; - getAxis: (m: BaseArgType, axis: number, dst?: T_11 | undefined) => T_11; - setAxis: (m: BaseArgType, v: BaseArgType, axis: number, dst?: T_12 | undefined) => T_12; - getScaling: (m: BaseArgType, dst?: T_13 | undefined) => Float64Array | T_13; - translation: (v: BaseArgType, dst?: T_14 | undefined) => T_14; - translate: (m: BaseArgType, v: BaseArgType, dst?: T_15 | undefined) => T_15; - rotation: (angleInRadians: number, dst?: T_16 | undefined) => T_16; - rotate: (m: BaseArgType, angleInRadians: number, dst?: T_17 | undefined) => T_17; - scaling: (v: BaseArgType, dst?: T_18 | undefined) => T_18; - scale: (m: BaseArgType, v: BaseArgType, dst?: T_19 | undefined) => T_19; - uniformScaling: (s: number, dst?: T_20 | undefined) => T_20; - uniformScale: (m: BaseArgType, s: number, dst?: T_21 | undefined) => T_21; }, quatd: { create: (x?: number | undefined, y?: number | undefined, z?: number | undefined, w?: number | undefined) => Float64Array; fromValues: (x?: number | undefined, y?: number | undefined, z?: number | undefined, w?: number | undefined) => Float64Array; @@ -598,7 +598,37 @@ export declare const mat4d: { truncate: (a: BaseArgType, maxLen: number, dst?: T_23 | undefined) => T_23; midpoint: (a: BaseArgType, b: BaseArgType, dst?: T_24 | undefined) => T_24; }; -export declare const mat4n: { +export declare const mat3n: { + clone: (m: BaseArgType, dst?: T | undefined) => T; + 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) => number[]; + set: (v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, dst?: T_1 | undefined) => T_1; + fromMat4: (m4: BaseArgType, dst?: T_2 | undefined) => T_2; + fromQuat: (q: BaseArgType, dst?: T_3 | undefined) => T_3; + negate: (m: BaseArgType, dst?: T_4 | undefined) => T_4; + copy: (m: BaseArgType, dst?: T | undefined) => T; + equalsApproximately: (a: BaseArgType, b: BaseArgType) => boolean; + equals: (a: BaseArgType, b: BaseArgType) => boolean; + identity: (dst?: T_5 | undefined) => T_5; + transpose: (m: BaseArgType, dst?: T_6 | undefined) => T_6; + inverse: (m: BaseArgType, dst?: T_7 | undefined) => T_7; + invert: (m: BaseArgType, dst?: T_7 | undefined) => T_7; + determinant: (m: BaseArgType) => number; + mul: (a: BaseArgType, b: BaseArgType, dst?: T_8 | undefined) => T_8; + multiply: (a: BaseArgType, b: BaseArgType, dst?: T_8 | undefined) => T_8; + setTranslation: (a: BaseArgType, v: BaseArgType, dst?: T_9 | undefined) => T_9; + getTranslation: (m: BaseArgType, dst?: T_10 | undefined) => T_10; + getAxis: (m: BaseArgType, axis: number, dst?: T_11 | undefined) => T_11; + setAxis: (m: BaseArgType, v: BaseArgType, axis: number, dst?: T_12 | undefined) => T_12; + getScaling: (m: BaseArgType, dst?: T_13 | undefined) => number[] | T_13; + translation: (v: BaseArgType, dst?: T_14 | undefined) => T_14; + translate: (m: BaseArgType, v: BaseArgType, dst?: T_15 | undefined) => T_15; + rotation: (angleInRadians: number, dst?: T_16 | undefined) => T_16; + rotate: (m: BaseArgType, angleInRadians: number, dst?: T_17 | undefined) => T_17; + scaling: (v: BaseArgType, dst?: T_18 | undefined) => T_18; + scale: (m: BaseArgType, v: BaseArgType, dst?: T_19 | undefined) => T_19; + uniformScaling: (s: number, dst?: T_20 | undefined) => T_20; + uniformScale: (m: BaseArgType, s: number, dst?: T_21 | undefined) => T_21; +}, 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; fromMat3: (m3: BaseArgType, dst?: T_1 | undefined) => T_1; @@ -644,36 +674,6 @@ export declare const mat4n: { scale: (m: BaseArgType, v: BaseArgType, dst?: T_33 | undefined) => T_33; uniformScaling: (s: number, dst?: T_34 | undefined) => T_34; uniformScale: (m: BaseArgType, s: number, dst?: T_35 | undefined) => T_35; -}, mat3n: { - clone: (m: BaseArgType, dst?: T | undefined) => T; - 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) => number[]; - set: (v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, dst?: T_1 | undefined) => T_1; - fromMat4: (m4: BaseArgType, dst?: T_2 | undefined) => T_2; - fromQuat: (q: BaseArgType, dst?: T_3 | undefined) => T_3; - negate: (m: BaseArgType, dst?: T_4 | undefined) => T_4; - copy: (m: BaseArgType, dst?: T | undefined) => T; - equalsApproximately: (a: BaseArgType, b: BaseArgType) => boolean; - equals: (a: BaseArgType, b: BaseArgType) => boolean; - identity: (dst?: T_5 | undefined) => T_5; - transpose: (m: BaseArgType, dst?: T_6 | undefined) => T_6; - inverse: (m: BaseArgType, dst?: T_7 | undefined) => T_7; - invert: (m: BaseArgType, dst?: T_7 | undefined) => T_7; - determinant: (m: BaseArgType) => number; - mul: (a: BaseArgType, b: BaseArgType, dst?: T_8 | undefined) => T_8; - multiply: (a: BaseArgType, b: BaseArgType, dst?: T_8 | undefined) => T_8; - setTranslation: (a: BaseArgType, v: BaseArgType, dst?: T_9 | undefined) => T_9; - getTranslation: (m: BaseArgType, dst?: T_10 | undefined) => T_10; - getAxis: (m: BaseArgType, axis: number, dst?: T_11 | undefined) => T_11; - setAxis: (m: BaseArgType, v: BaseArgType, axis: number, dst?: T_12 | undefined) => T_12; - getScaling: (m: BaseArgType, dst?: T_13 | undefined) => number[] | T_13; - translation: (v: BaseArgType, dst?: T_14 | undefined) => T_14; - translate: (m: BaseArgType, v: BaseArgType, dst?: T_15 | undefined) => T_15; - rotation: (angleInRadians: number, dst?: T_16 | undefined) => T_16; - rotate: (m: BaseArgType, angleInRadians: number, dst?: T_17 | undefined) => T_17; - scaling: (v: BaseArgType, dst?: T_18 | undefined) => T_18; - scale: (m: BaseArgType, v: BaseArgType, dst?: T_19 | undefined) => T_19; - uniformScaling: (s: number, dst?: T_20 | undefined) => T_20; - uniformScale: (m: BaseArgType, s: number, dst?: T_21 | undefined) => T_21; }, quatn: { create: (x?: number | undefined, y?: number | undefined, z?: number | undefined, w?: number | undefined) => number[]; fromValues: (x?: number | undefined, y?: number | undefined, z?: number | undefined, w?: number | undefined) => number[]; diff --git a/dist/3.x/wgpu-matrix.js b/dist/3.x/wgpu-matrix.js index 6082b38..7f24dbe 100644 --- a/dist/3.x/wgpu-matrix.js +++ b/dist/3.x/wgpu-matrix.js @@ -1,4 +1,4 @@ -/* wgpu-matrix@3.0.2, license MIT */ +/* wgpu-matrix@3.0.3, license MIT */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : @@ -5546,10 +5546,10 @@ */ function wgpuMatrixAPI(Mat3Ctor, Mat4Ctor, QuatCtor, Vec2Ctor, Vec3Ctor, Vec4Ctor) { return { - /** @namespace mat4 */ - mat4: getAPI$2(Mat3Ctor), /** @namespace mat3 */ - mat3: getAPI$4(Mat4Ctor), + mat3: getAPI$4(Mat3Ctor), + /** @namespace mat4 */ + mat4: getAPI$2(Mat4Ctor), /** @namespace quat */ quat: getAPI$1(QuatCtor), /** @namespace vec2 */ @@ -5562,15 +5562,15 @@ } const { /** - * 4x4 Matrix functions that default to returning `Float32Array` + * 3x3 Matrix functions that default to returning `Float32Array` * @namespace */ - mat4, + mat3, /** - * 3x3 Matrix functions that default to returning `Float32Array` + * 4x4 Matrix functions that default to returning `Float32Array` * @namespace */ - mat3, + mat4, /** * Quaternion functions that default to returning `Float32Array` * @namespace @@ -5593,15 +5593,15 @@ vec4, } = wgpuMatrixAPI(Float32Array, Float32Array, Float32Array, Float32Array, Float32Array, Float32Array); const { /** - * 4x4 Matrix functions that default to returning `Float64Array` + * 3x3 Matrix functions that default to returning `Float64Array` * @namespace */ - mat4: mat4d, + mat3: mat3d, /** - * 3x3 Matrix functions that default to returning `Float64Array` + * 4x4 Matrix functions that default to returning `Float64Array` * @namespace */ - mat3: mat3d, + mat4: mat4d, /** * Quaternion functions that default to returning `Float64Array` * @namespace @@ -5624,15 +5624,15 @@ vec4: vec4d, } = wgpuMatrixAPI(Float64Array, Float64Array, Float64Array, Float64Array, Float64Array, Float64Array); const { /** - * 4x4 Matrix functions that default to returning `number[]` + * 3x3 Matrix functions that default to returning `number[]` * @namespace */ - mat4: mat4n, + mat3: mat3n, /** - * 3x3 Matrix functions that default to returning `number[]` + * 4x4 Matrix functions that default to returning `number[]` * @namespace */ - mat3: mat3n, + mat4: mat4n, /** * Quaternion functions that default to returning `number[]` * @namespace diff --git a/dist/3.x/wgpu-matrix.js.map b/dist/3.x/wgpu-matrix.js.map index 92061f6..b371929 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/mat3-impl.ts","../../../src/vec3-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 */\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 { getAPI as getVec2API } from './vec2-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\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 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 * 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 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","/*\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","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 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 mat4 */\n mat4: getMat4API(Mat3Ctor),\n /** @namespace mat3 */\n mat3: getMat3API(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 * 4x4 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat4,\n /**\n * 3x3 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat3,\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 * 4x4 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat4: mat4d,\n /**\n * 3x3 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat3: mat3d,\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 * 4x4 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat4: mat4n,\n /**\n * 3x3 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat3: mat3n,\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","getMat4API","getMat3API","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;;;;;;IAMG;aACa,IAAI,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAA;QAClD,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IAED;;;;;;;;IAQG;aACa,WAAW,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAA;IACzD,IAAA,MAAM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{"version":3,"file":"wgpu-matrix.js","sources":["../../../src/types.ts","../../../src/utils.ts","../../../src/vec2-impl.ts","../../../src/mat3-impl.ts","../../../src/vec3-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 */\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 { getAPI as getVec2API } from './vec2-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\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 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 * 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 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","/*\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","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 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;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;;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 diff --git a/dist/3.x/wgpu-matrix.min.js b/dist/3.x/wgpu-matrix.min.js index a547927..34a7a24 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){const t=a(n);function e(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 r(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 c(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 u(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:e,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:e,equalsApproximately:function(n,t){return Math.abs(n[0]-t[0])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),f.set(n,t)),t}const M=new Map;function l(n){let t=M.get(n);return t||(t=function(n){const t=h(n);function e(t,e){const r=e??new n(16);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r}const r=e;function c(t){const e=t??new n(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function u(t,e){const r=e??new n(16),o=t[0],c=t[1],u=t[2],a=t[3],s=t[4],i=t[5],f=t[6],h=t[7],M=t[8],l=t[9],w=t[10],m=t[11],d=t[12],v=t[13],p=t[14],q=t[15],b=w*q,g=p*m,x=f*q,y=p*h,A=f*m,S=w*h,z=u*q,F=p*a,T=u*m,k=w*a,I=u*h,P=f*a,V=M*v,Z=d*l,L=s*v,R=d*i,E=s*l,X=M*i,Y=o*v,_=d*c,Q=o*l,j=M*c,N=o*i,U=s*c,D=b*i+y*l+A*v-(g*i+x*l+S*v),O=g*c+z*l+k*v-(b*c+F*l+T*v),$=x*c+F*i+I*v-(y*c+z*i+P*v),B=S*c+T*i+P*l-(A*c+k*i+I*l),C=1/(o*D+s*O+M*$+d*B);return r[0]=C*D,r[1]=C*O,r[2]=C*$,r[3]=C*B,r[4]=C*(g*s+x*M+S*d-(b*s+y*M+A*d)),r[5]=C*(b*o+F*M+T*d-(g*o+z*M+k*d)),r[6]=C*(y*o+z*s+P*d-(x*o+F*s+I*d)),r[7]=C*(A*o+k*s+I*M-(S*o+T*s+P*M)),r[8]=C*(V*h+R*m+E*q-(Z*h+L*m+X*q)),r[9]=C*(Z*a+Y*m+j*q-(V*a+_*m+Q*q)),r[10]=C*(L*a+_*h+N*q-(R*a+Y*h+U*q)),r[11]=C*(X*a+Q*h+U*m-(E*a+j*h+N*m)),r[12]=C*(L*w+X*p+Z*f-(E*p+V*f+R*w)),r[13]=C*(Q*p+V*u+_*w-(Y*w+j*p+Z*u)),r[14]=C*(Y*f+U*p+R*u-(N*p+L*u+_*f)),r[15]=C*(N*w+E*u+j*f-(Q*f+U*w+X*u)),r}const a=u;function s(t,e,r){const o=r??new n(16),c=t[0],u=t[1],a=t[2],s=t[3],i=t[4],f=t[5],h=t[6],M=t[7],l=t[8],w=t[9],m=t[10],d=t[11],v=t[12],p=t[13],q=t[14],b=t[15],g=e[0],x=e[1],y=e[2],A=e[3],S=e[4],z=e[5],F=e[6],T=e[7],k=e[8],I=e[9],P=e[10],V=e[11],Z=e[12],L=e[13],R=e[14],E=e[15];return o[0]=c*g+i*x+l*y+v*A,o[1]=u*g+f*x+w*y+p*A,o[2]=a*g+h*x+m*y+q*A,o[3]=s*g+M*x+d*y+b*A,o[4]=c*S+i*z+l*F+v*T,o[5]=u*S+f*z+w*F+p*T,o[6]=a*S+h*z+m*F+q*T,o[7]=s*S+M*z+d*F+b*T,o[8]=c*k+i*I+l*P+v*V,o[9]=u*k+f*I+w*P+p*V,o[10]=a*k+h*I+m*P+q*V,o[11]=s*k+M*I+d*P+b*V,o[12]=c*Z+i*L+l*R+v*E,o[13]=u*Z+f*L+w*R+p*E,o[14]=a*Z+h*L+m*R+q*E,o[15]=s*Z+M*L+d*R+b*E,o}const i=s,f=t.create(),M=t.create(),l=t.create();function w(t,e,r){const o=r??new n(16);let c=t[0],u=t[1],a=t[2];const s=Math.sqrt(c*c+u*u+a*a);c/=s,u/=s,a/=s;const i=c*c,f=u*u,h=a*a,M=Math.cos(e),l=Math.sin(e),w=1-M;return o[0]=i+(1-i)*M,o[1]=c*u*w+a*l,o[2]=c*a*w-u*l,o[3]=0,o[4]=c*u*w-a*l,o[5]=f+(1-f)*M,o[6]=u*a*w+c*l,o[7]=0,o[8]=c*a*w+u*l,o[9]=u*a*w-c*l,o[10]=h+(1-h)*M,o[11]=0,o[12]=0,o[13]=0,o[14]=0,o[15]=1,o}function m(t,e,r,o){const c=o??new n(16);let u=e[0],a=e[1],s=e[2];const i=Math.sqrt(u*u+a*a+s*s);u/=i,a/=i,s/=i;const f=u*u,h=a*a,M=s*s,l=Math.cos(r),w=Math.sin(r),m=1-l,d=f+(1-f)*l,v=u*a*m+s*w,p=u*s*m-a*w,q=u*a*m-s*w,b=h+(1-h)*l,g=a*s*m+u*w,x=u*s*m+a*w,y=a*s*m-u*w,A=M+(1-M)*l,S=t[0],z=t[1],F=t[2],T=t[3],k=t[4],I=t[5],P=t[6],V=t[7],Z=t[8],L=t[9],R=t[10],E=t[11];return c[0]=d*S+v*k+p*Z,c[1]=d*z+v*I+p*L,c[2]=d*F+v*P+p*R,c[3]=d*T+v*V+p*E,c[4]=q*S+b*k+g*Z,c[5]=q*z+b*I+g*L,c[6]=q*F+b*P+g*R,c[7]=q*T+b*V+g*E,c[8]=x*S+y*k+A*Z,c[9]=x*z+y*I+A*L,c[10]=x*F+y*P+A*R,c[11]=x*T+y*V+A*E,t!==c&&(c[12]=t[12],c[13]=t[13],c[14]=t[14],c[15]=t[15]),c}return{create:function(t,e,r,o,c,u,a,s,i,f,h,M,l,w,m,d){const v=new n(16);return void 0!==t&&(v[0]=t,void 0!==e&&(v[1]=e,void 0!==r&&(v[2]=r,void 0!==o&&(v[3]=o,void 0!==c&&(v[4]=c,void 0!==u&&(v[5]=u,void 0!==a&&(v[6]=a,void 0!==s&&(v[7]=s,void 0!==i&&(v[8]=i,void 0!==f&&(v[9]=f,void 0!==h&&(v[10]=h,void 0!==M&&(v[11]=M,void 0!==l&&(v[12]=l,void 0!==w&&(v[13]=w,void 0!==m&&(v[14]=m,void 0!==d&&(v[15]=d)))))))))))))))),v},set:function(t,e,r,o,c,u,a,s,i,f,h,M,l,w,m,d,v){const p=v??new n(16);return p[0]=t,p[1]=e,p[2]=r,p[3]=o,p[4]=c,p[5]=u,p[6]=a,p[7]=s,p[8]=i,p[9]=f,p[10]=h,p[11]=M,p[12]=l,p[13]=w,p[14]=m,p[15]=d,p},fromMat3:function(t,e){const r=e??new n(16);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[12]=0,r[13]=0,r[14]=0,r[15]=1,r},fromQuat:function(t,e){const r=e??new n(16),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[12]=0,r[13]=0,r[14]=0,r[15]=1,r},negate:function(t,e){const r=e??new n(16);return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[3]=-t[3],r[4]=-t[4],r[5]=-t[5],r[6]=-t[6],r[7]=-t[7],r[8]=-t[8],r[9]=-t[9],r[10]=-t[10],r[11]=-t[11],r[12]=-t[12],r[13]=-t[13],r[14]=-t[14],r[15]=-t[15],r},copy:e,clone: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 i(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 f=i;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:i,clone:f,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{mat4:l(n),mat3:i(t),quat:m(e),vec2:a(r),vec3:h(o),vec4:v(c)}}const{mat4:q,mat3:b,quat:g,vec2:x,vec3:y,vec4:A}=p(Float32Array,Float32Array,Float32Array,Float32Array,Float32Array,Float32Array),{mat4:S,mat3:z,quat:F,vec2:T,vec3:k,vec4:I}=p(Float64Array,Float64Array,Float64Array,Float64Array,Float64Array,Float64Array),{mat4:P,mat3:V,quat:Z,vec2:L,vec3:R,vec4:E}=p(t,Array,Array,Array,Array,Array);n.mat3=b,n.mat3d=z,n.mat3n=V,n.mat4=q,n.mat4d=S,n.mat4n=P,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){const t=a(n);function e(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 r(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 c(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 u(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:e,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:e,equalsApproximately:function(n,t){return Math.abs(n[0]-t[0])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),f.set(n,t)),t}const M=new Map;function l(n){let t=M.get(n);return t||(t=function(n){const t=h(n);function e(t,e){const r=e??new n(16);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r}const r=e;function c(t){const e=t??new n(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function u(t,e){const r=e??new n(16),o=t[0],c=t[1],u=t[2],a=t[3],s=t[4],i=t[5],f=t[6],h=t[7],M=t[8],l=t[9],w=t[10],m=t[11],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a*g+h*x+m*y+q*A,o[3]=s*g+M*x+d*y+b*A,o[4]=c*S+i*z+l*F+v*T,o[5]=u*S+f*z+w*F+p*T,o[6]=a*S+h*z+m*F+q*T,o[7]=s*S+M*z+d*F+b*T,o[8]=c*k+i*I+l*P+v*V,o[9]=u*k+f*I+w*P+p*V,o[10]=a*k+h*I+m*P+q*V,o[11]=s*k+M*I+d*P+b*V,o[12]=c*Z+i*L+l*R+v*E,o[13]=u*Z+f*L+w*R+p*E,o[14]=a*Z+h*L+m*R+q*E,o[15]=s*Z+M*L+d*R+b*E,o}const i=s,f=t.create(),M=t.create(),l=t.create();function w(t,e,r){const o=r??new n(16);let c=t[0],u=t[1],a=t[2];const s=Math.sqrt(c*c+u*u+a*a);c/=s,u/=s,a/=s;const i=c*c,f=u*u,h=a*a,M=Math.cos(e),l=Math.sin(e),w=1-M;return o[0]=i+(1-i)*M,o[1]=c*u*w+a*l,o[2]=c*a*w-u*l,o[3]=0,o[4]=c*u*w-a*l,o[5]=f+(1-f)*M,o[6]=u*a*w+c*l,o[7]=0,o[8]=c*a*w+u*l,o[9]=u*a*w-c*l,o[10]=h+(1-h)*M,o[11]=0,o[12]=0,o[13]=0,o[14]=0,o[15]=1,o}function m(t,e,r,o){const c=o??new n(16);let u=e[0],a=e[1],s=e[2];const i=Math.sqrt(u*u+a*a+s*s);u/=i,a/=i,s/=i;const f=u*u,h=a*a,M=s*s,l=Math.cos(r),w=Math.sin(r),m=1-l,d=f+(1-f)*l,v=u*a*m+s*w,p=u*s*m-a*w,q=u*a*m-s*w,b=h+(1-h)*l,g=a*s*m+u*w,x=u*s*m+a*w,y=a*s*m-u*w,A=M+(1-M)*l,S=t[0],z=t[1],F=t[2],T=t[3],k=t[4],I=t[5],P=t[6],V=t[7],Z=t[8],L=t[9],R=t[10],E=t[11];return c[0]=d*S+v*k+p*Z,c[1]=d*z+v*I+p*L,c[2]=d*F+v*P+p*R,c[3]=d*T+v*V+p*E,c[4]=q*S+b*k+g*Z,c[5]=q*z+b*I+g*L,c[6]=q*F+b*P+g*R,c[7]=q*T+b*V+g*E,c[8]=x*S+y*k+A*Z,c[9]=x*z+y*I+A*L,c[10]=x*F+y*P+A*R,c[11]=x*T+y*V+A*E,t!==c&&(c[12]=t[12],c[13]=t[13],c[14]=t[14],c[15]=t[15]),c}return{create:function(t,e,r,o,c,u,a,s,i,f,h,M,l,w,m,d){const v=new n(16);return void 0!==t&&(v[0]=t,void 0!==e&&(v[1]=e,void 0!==r&&(v[2]=r,void 0!==o&&(v[3]=o,void 0!==c&&(v[4]=c,void 0!==u&&(v[5]=u,void 0!==a&&(v[6]=a,void 0!==s&&(v[7]=s,void 0!==i&&(v[8]=i,void 0!==f&&(v[9]=f,void 0!==h&&(v[10]=h,void 0!==M&&(v[11]=M,void 0!==l&&(v[12]=l,void 0!==w&&(v[13]=w,void 0!==m&&(v[14]=m,void 0!==d&&(v[15]=d)))))))))))))))),v},set:function(t,e,r,o,c,u,a,s,i,f,h,M,l,w,m,d,v){const p=v??new n(16);return p[0]=t,p[1]=e,p[2]=r,p[3]=o,p[4]=c,p[5]=u,p[6]=a,p[7]=s,p[8]=i,p[9]=f,p[10]=h,p[11]=M,p[12]=l,p[13]=w,p[14]=m,p[15]=d,p},fromMat3:function(t,e){const r=e??new n(16);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[12]=0,r[13]=0,r[14]=0,r[15]=1,r},fromQuat:function(t,e){const r=e??new n(16),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[12]=0,r[13]=0,r[14]=0,r[15]=1,r},negate:function(t,e){const r=e??new n(16);return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[3]=-t[3],r[4]=-t[4],r[5]=-t[5],r[6]=-t[6],r[7]=-t[7],r[8]=-t[8],r[9]=-t[9],r[10]=-t[10],r[11]=-t[11],r[12]=-t[12],r[13]=-t[13],r[14]=-t[14],r[15]=-t[15],r},copy:e,clone: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 i(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 f=i;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:i,clone:f,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:i(n),mat4:l(t),quat:m(e),vec2:a(r),vec3:h(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})); //# 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 a4a86e6..da7490a 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/mat3-impl.ts","../../../src/vec3-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 */\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 { getAPI as getVec2API } from './vec2-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\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 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 * 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 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","/*\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","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 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 mat4 */\n mat4: getMat4API(Mat3Ctor),\n /** @namespace mat3 */\n mat3: getMat3API(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 * 4x4 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat4,\n /**\n * 3x3 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat3,\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 * 4x4 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat4: mat4d,\n /**\n * 3x3 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat3: mat3d,\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 * 4x4 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat4: mat4n,\n /**\n * 3x3 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat3: mat3n,\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","vec2","getVec2API","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","v2","v3","v4","v5","v6","v7","v8","fromMat4","m4","fromQuat","q","w","x2","y2","z2","xx","yx","yy","zx","zy","zz","wx","wy","wz","transpose","determinant","setTranslation","getTranslation","getAxis","axis","off","setAxis","getScaling","xy","translation","translate","rotation","angleInRadians","c","s","scaling","uniformScaling","uniformScale","dz","az","bz","t1","t2","zScale","transformMat4Upper3x3","transformQuat","qx","qy","qz","w2","uvX","uvY","uvZ","xz","yz","rotateX","p","r","rotateY","rotateZ","vec3","getVec3API","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","mat4","getMat4API","mat3","getMat3API","quat","getQuatAPI","vec4","getVec4API","Float32Array","mat4d","mat3d","quatd","vec2d","vec3d","vec4d","Float64Array","mat4n","mat3n","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,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nG,EAAYoG,EAAgBrE,GACzE,MAAMH,EAAUG,GAAO,IAAIT,EAAK,GAEhC,OAAIe,EAAOrC,GAAKoG,EACPjD,EAAUnD,EAAGoG,EAAQxE,GAGvBoB,EAAKhD,EAAG4B,EAChB,EA0DCyE,SAjDF,SAA+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,SAASyU,EAQLC,EACAC,EACAC,EACAC,EACAC,EACAC,GAEF,MAAO,CAELC,KAAMC,EAAiBP,GAEvBQ,KAAMC,EAAiBR,GAEvBS,KAAMC,EAAiBT,GAEvB5P,KAAMC,EAAiB4P,GAEvB7J,KAAMC,EAAiB6J,GAEvBQ,KAAMC,EAAiBR,GAE3B,CAEa,MAAAC,KAKXA,EAAIE,KAKJA,EAAIE,KAKJA,EAAIpQ,KAKJA,EAAIgG,KAKJA,EAAIsK,KAKJA,GACEb,EAEAe,aAAcA,aAAcA,aAAcA,aAAcA,aAAcA,eAOxER,KAAMS,EAKNP,KAAMQ,EAKNN,KAAMO,EAKN3Q,KAAM4Q,EAKN5K,KAAM6K,EAKNP,KAAMQ,GACJrB,EAEAsB,aAAcA,aAAcA,aAAcA,aAAcA,aAAcA,eAOxEf,KAAMgB,EAKNd,KAAMe,EAKNb,KAAMc,EAKNlR,KAAMmR,EAKNnL,KAAMoL,EAKNd,KAAMe,GACJ5B,EAEAnW,EAAWgY,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/mat3-impl.ts","../../../src/vec3-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 */\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 { getAPI as getVec2API } from './vec2-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\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 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 * 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 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","/*\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","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 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","vec2","getVec2API","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","v2","v3","v4","v5","v6","v7","v8","fromMat4","m4","fromQuat","q","w","x2","y2","z2","xx","yx","yy","zx","zy","zz","wx","wy","wz","transpose","determinant","setTranslation","getTranslation","getAxis","axis","off","setAxis","getScaling","xy","translation","translate","rotation","angleInRadians","c","s","scaling","uniformScaling","uniformScale","dz","az","bz","t1","t2","zScale","transformMat4Upper3x3","transformQuat","qx","qy","qz","w2","uvX","uvY","uvZ","xz","yz","rotateX","p","r","rotateY","rotateZ","vec3","getVec3API","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,IAA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aAAcA,eAOxEf,KAAMgB,EAKNd,KAAMe,EAKNb,KAAMc,EAKNlR,KAAMmR,EAKNnL,KAAMoL,EAKNd,KAAMe,GACJ5B,EAEAnW,EAAWgY,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 9ff0616..a6c0e49 100644 --- a/dist/3.x/wgpu-matrix.module.js +++ b/dist/3.x/wgpu-matrix.module.js @@ -1,4 +1,4 @@ -/* wgpu-matrix@3.0.2, license MIT */ +/* wgpu-matrix@3.0.3, license MIT */ function wrapConstructor(OriginalConstructor, modifier) { return class extends OriginalConstructor { constructor(...args) { @@ -5540,10 +5540,10 @@ function getAPI(Ctor) { */ function wgpuMatrixAPI(Mat3Ctor, Mat4Ctor, QuatCtor, Vec2Ctor, Vec3Ctor, Vec4Ctor) { return { - /** @namespace mat4 */ - mat4: getAPI$2(Mat3Ctor), /** @namespace mat3 */ - mat3: getAPI$4(Mat4Ctor), + mat3: getAPI$4(Mat3Ctor), + /** @namespace mat4 */ + mat4: getAPI$2(Mat4Ctor), /** @namespace quat */ quat: getAPI$1(QuatCtor), /** @namespace vec2 */ @@ -5556,15 +5556,15 @@ function wgpuMatrixAPI(Mat3Ctor, Mat4Ctor, QuatCtor, Vec2Ctor, Vec3Ctor, Vec4Cto } const { /** - * 4x4 Matrix functions that default to returning `Float32Array` + * 3x3 Matrix functions that default to returning `Float32Array` * @namespace */ -mat4, +mat3, /** - * 3x3 Matrix functions that default to returning `Float32Array` + * 4x4 Matrix functions that default to returning `Float32Array` * @namespace */ -mat3, +mat4, /** * Quaternion functions that default to returning `Float32Array` * @namespace @@ -5587,15 +5587,15 @@ vec3, vec4, } = wgpuMatrixAPI(Float32Array, Float32Array, Float32Array, Float32Array, Float32Array, Float32Array); const { /** - * 4x4 Matrix functions that default to returning `Float64Array` + * 3x3 Matrix functions that default to returning `Float64Array` * @namespace */ -mat4: mat4d, +mat3: mat3d, /** - * 3x3 Matrix functions that default to returning `Float64Array` + * 4x4 Matrix functions that default to returning `Float64Array` * @namespace */ -mat3: mat3d, +mat4: mat4d, /** * Quaternion functions that default to returning `Float64Array` * @namespace @@ -5618,15 +5618,15 @@ vec3: vec3d, vec4: vec4d, } = wgpuMatrixAPI(Float64Array, Float64Array, Float64Array, Float64Array, Float64Array, Float64Array); const { /** - * 4x4 Matrix functions that default to returning `number[]` + * 3x3 Matrix functions that default to returning `number[]` * @namespace */ -mat4: mat4n, +mat3: mat3n, /** - * 3x3 Matrix functions that default to returning `number[]` + * 4x4 Matrix functions that default to returning `number[]` * @namespace */ -mat3: mat3n, +mat4: mat4n, /** * Quaternion functions that default to returning `number[]` * @namespace diff --git a/dist/3.x/wgpu-matrix.module.js.map b/dist/3.x/wgpu-matrix.module.js.map index ed75847..a12bd49 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/mat3-impl.ts","../../../src/vec3-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 */\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 { getAPI as getVec2API } from './vec2-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\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 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 * 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 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","/*\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","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 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 mat4 */\n mat4: getMat4API(Mat3Ctor),\n /** @namespace mat3 */\n mat3: getMat3API(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 * 4x4 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat4,\n /**\n * 3x3 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat3,\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 * 4x4 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat4: mat4d,\n /**\n * 3x3 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat3: mat3d,\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 * 4x4 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat4: mat4n,\n /**\n * 3x3 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat3: mat3n,\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","getMat4API","getMat3API","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,GAAG,CAAC;AACjC,CAAC;AAED;;;;AAIG;AACG,SAAU,QAAQ,CAAC,OAAe,EAAA;AACtC,IAAA,OAAO,OAAO,GAAG,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC;AACjC,CAAC;AAED;;;;;;AAMG;SACa,IAAI,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAA;IAClD,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC;AAED;;;;;;;;AAQG;SACa,WAAW,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAA;AACzD,IAAA,MAAM,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hC,QAAA,IAAI,EAAEC,QAAU,CAAO,QAAQ,CAAC;;AAEhC,QAAA,IAAI,EAAEI,MAAU,CAAO,QAAQ,CAAC;KACjC,CAAC;AACJ,CAAC;AAEY,MAAA;AACX;;;AAGG;AACH,IAAI;AACJ;;;AAGG;AACH,IAAI;AACJ;;;AAGG;AACH,IAAI;AACJ;;;AAGG;AACH,IAAI;AACJ;;;AAGG;AACH,IAAI;AACJ;;;AAGG;AACH,IAAI,GACL,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,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 +{"version":3,"file":"wgpu-matrix.module.js","sources":["../../../src/types.ts","../../../src/utils.ts","../../../src/vec2-impl.ts","../../../src/mat3-impl.ts","../../../src/vec3-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 */\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 { getAPI as getVec2API } from './vec2-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\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 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 * 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 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","/*\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","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 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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E,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 80ffec5..bd31313 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){const t=u(n);function r(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 o(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 c(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 a(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],p=r[5],q=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*p+M*q,o[5]=u*v+i*p+h*q,o[6]=a*v+f*p+l*q,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:r,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,p=a*i,q=a*f;return e[0]=1-l-d,e[1]=h+q,e[2]=w-p,e[3]=0,e[4]=h-q,e[5]=1-M-d,e[6]=m+v,e[7]=0,e[8]=w+p,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:r,equalsApproximately:function(n,t){return Math.abs(n[0]-t[0])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),i.set(n,t)),t}const M=new Map;function h(n){let t=M.get(n);return t||(t=function(n){const t=f(n);function r(t,r){const e=r??new n(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}const o=r;function c(t){const r=t??new n(16);return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function u(t,r){const e=r??new n(16),o=t[0],c=t[1],u=t[2],a=t[3],s=t[4],i=t[5],f=t[6],M=t[7],h=t[8],l=t[9],w=t[10],m=t[11],d=t[12],v=t[13],p=t[14],q=t[15],b=w*q,g=p*m,x=f*q,y=p*M,A=f*m,S=w*M,z=u*q,F=p*a,k=u*m,T=w*a,I=u*M,P=f*a,V=h*v,Z=d*l,L=s*v,R=d*i,E=s*l,X=h*i,Y=o*v,_=d*c,Q=o*l,N=h*c,U=o*i,j=s*c,D=b*i+y*l+A*v-(g*i+x*l+S*v),O=g*c+z*l+T*v-(b*c+F*l+k*v),$=x*c+F*i+I*v-(y*c+z*i+P*v),B=S*c+k*i+P*l-(A*c+T*i+I*l),C=1/(o*D+s*O+h*$+d*B);return e[0]=C*D,e[1]=C*O,e[2]=C*$,e[3]=C*B,e[4]=C*(g*s+x*h+S*d-(b*s+y*h+A*d)),e[5]=C*(b*o+F*h+k*d-(g*o+z*h+T*d)),e[6]=C*(y*o+z*s+P*d-(x*o+F*s+I*d)),e[7]=C*(A*o+T*s+I*h-(S*o+k*s+P*h)),e[8]=C*(V*M+R*m+E*q-(Z*M+L*m+X*q)),e[9]=C*(Z*a+Y*m+N*q-(V*a+_*m+Q*q)),e[10]=C*(L*a+_*M+U*q-(R*a+Y*M+j*q)),e[11]=C*(X*a+Q*M+j*m-(E*a+N*M+U*m)),e[12]=C*(L*w+X*p+Z*f-(E*p+V*f+R*w)),e[13]=C*(Q*p+V*u+_*w-(Y*w+N*p+Z*u)),e[14]=C*(Y*f+j*p+R*u-(U*p+L*u+_*f)),e[15]=C*(U*w+E*u+N*f-(Q*f+j*w+X*u)),e}const a=u;function s(t,r,e){const o=e??new n(16),c=t[0],u=t[1],a=t[2],s=t[3],i=t[4],f=t[5],M=t[6],h=t[7],l=t[8],w=t[9],m=t[10],d=t[11],v=t[12],p=t[13],q=t[14],b=t[15],g=r[0],x=r[1],y=r[2],A=r[3],S=r[4],z=r[5],F=r[6],k=r[7],T=r[8],I=r[9],P=r[10],V=r[11],Z=r[12],L=r[13],R=r[14],E=r[15];return o[0]=c*g+i*x+l*y+v*A,o[1]=u*g+f*x+w*y+p*A,o[2]=a*g+M*x+m*y+q*A,o[3]=s*g+h*x+d*y+b*A,o[4]=c*S+i*z+l*F+v*k,o[5]=u*S+f*z+w*F+p*k,o[6]=a*S+M*z+m*F+q*k,o[7]=s*S+h*z+d*F+b*k,o[8]=c*T+i*I+l*P+v*V,o[9]=u*T+f*I+w*P+p*V,o[10]=a*T+M*I+m*P+q*V,o[11]=s*T+h*I+d*P+b*V,o[12]=c*Z+i*L+l*R+v*E,o[13]=u*Z+f*L+w*R+p*E,o[14]=a*Z+M*L+m*R+q*E,o[15]=s*Z+h*L+d*R+b*E,o}const i=s,M=t.create(),h=t.create(),l=t.create();function w(t,r,e){const o=e??new n(16);let c=t[0],u=t[1],a=t[2];const s=Math.sqrt(c*c+u*u+a*a);c/=s,u/=s,a/=s;const i=c*c,f=u*u,M=a*a,h=Math.cos(r),l=Math.sin(r),w=1-h;return o[0]=i+(1-i)*h,o[1]=c*u*w+a*l,o[2]=c*a*w-u*l,o[3]=0,o[4]=c*u*w-a*l,o[5]=f+(1-f)*h,o[6]=u*a*w+c*l,o[7]=0,o[8]=c*a*w+u*l,o[9]=u*a*w-c*l,o[10]=M+(1-M)*h,o[11]=0,o[12]=0,o[13]=0,o[14]=0,o[15]=1,o}function m(t,r,e,o){const c=o??new n(16);let u=r[0],a=r[1],s=r[2];const i=Math.sqrt(u*u+a*a+s*s);u/=i,a/=i,s/=i;const f=u*u,M=a*a,h=s*s,l=Math.cos(e),w=Math.sin(e),m=1-l,d=f+(1-f)*l,v=u*a*m+s*w,p=u*s*m-a*w,q=u*a*m-s*w,b=M+(1-M)*l,g=a*s*m+u*w,x=u*s*m+a*w,y=a*s*m-u*w,A=h+(1-h)*l,S=t[0],z=t[1],F=t[2],k=t[3],T=t[4],I=t[5],P=t[6],V=t[7],Z=t[8],L=t[9],R=t[10],E=t[11];return c[0]=d*S+v*T+p*Z,c[1]=d*z+v*I+p*L,c[2]=d*F+v*P+p*R,c[3]=d*k+v*V+p*E,c[4]=q*S+b*T+g*Z,c[5]=q*z+b*I+g*L,c[6]=q*F+b*P+g*R,c[7]=q*k+b*V+g*E,c[8]=x*S+y*T+A*Z,c[9]=x*z+y*I+A*L,c[10]=x*F+y*P+A*R,c[11]=x*k+y*V+A*E,t!==c&&(c[12]=t[12],c[13]=t[13],c[14]=t[14],c[15]=t[15]),c}return{create:function(t,r,e,o,c,u,a,s,i,f,M,h,l,w,m,d){const v=new n(16);return void 0!==t&&(v[0]=t,void 0!==r&&(v[1]=r,void 0!==e&&(v[2]=e,void 0!==o&&(v[3]=o,void 0!==c&&(v[4]=c,void 0!==u&&(v[5]=u,void 0!==a&&(v[6]=a,void 0!==s&&(v[7]=s,void 0!==i&&(v[8]=i,void 0!==f&&(v[9]=f,void 0!==M&&(v[10]=M,void 0!==h&&(v[11]=h,void 0!==l&&(v[12]=l,void 0!==w&&(v[13]=w,void 0!==m&&(v[14]=m,void 0!==d&&(v[15]=d)))))))))))))))),v},set:function(t,r,e,o,c,u,a,s,i,f,M,h,l,w,m,d,v){const p=v??new n(16);return p[0]=t,p[1]=r,p[2]=e,p[3]=o,p[4]=c,p[5]=u,p[6]=a,p[7]=s,p[8]=i,p[9]=f,p[10]=M,p[11]=h,p[12]=l,p[13]=w,p[14]=m,p[15]=d,p},fromMat3:function(t,r){const e=r??new n(16);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[12]=0,e[13]=0,e[14]=0,e[15]=1,e},fromQuat:function(t,r){const e=r??new n(16),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,p=a*i,q=a*f;return e[0]=1-l-d,e[1]=h+q,e[2]=w-p,e[3]=0,e[4]=h-q,e[5]=1-M-d,e[6]=m+v,e[7]=0,e[8]=w+p,e[9]=m-v,e[10]=1-M-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},negate:function(t,r){const e=r??new n(16);return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=-t[7],e[8]=-t[8],e[9]=-t[9],e[10]=-t[10],e[11]=-t[11],e[12]=-t[12],e[13]=-t[13],e[14]=-t[14],e[15]=-t[15],e},copy:r,clone: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 i(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=i;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 p=v;function q(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=q;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:s,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:i,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: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(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 s(t,o,c,S),s(r,e,c,z),s(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{mat4:h(n),mat3:s(t),quat:w(r),vec2:u(e),vec3:f(o),vec4:d(c)}}const{mat4:p,mat3:q,quat:b,vec2:g,vec3:x,vec4:y}=v(Float32Array,Float32Array,Float32Array,Float32Array,Float32Array,Float32Array),{mat4:A,mat3:S,quat:z,vec2:F,vec3:k,vec4:T}=v(Float64Array,Float64Array,Float64Array,Float64Array,Float64Array,Float64Array),{mat4:I,mat3:P,quat:V,vec2:Z,vec3:L,vec4:R}=v(n,Array,Array,Array,Array,Array);export{q as mat3,S as mat3d,P as mat3n,p as mat4,A as mat4d,I 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){const t=u(n);function r(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 o(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 c(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 a(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],p=r[5],q=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*p+M*q,o[5]=u*v+i*p+h*q,o[6]=a*v+f*p+l*q,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:r,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,p=a*i,q=a*f;return e[0]=1-l-d,e[1]=h+q,e[2]=w-p,e[3]=0,e[4]=h-q,e[5]=1-M-d,e[6]=m+v,e[7]=0,e[8]=w+p,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:r,equalsApproximately:function(n,t){return Math.abs(n[0]-t[0])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),i.set(n,t)),t}const M=new Map;function h(n){let t=M.get(n);return t||(t=function(n){const t=f(n);function r(t,r){const e=r??new n(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}const o=r;function c(t){const r=t??new n(16);return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function u(t,r){const e=r??new n(16),o=t[0],c=t[1],u=t[2],a=t[3],s=t[4],i=t[5],f=t[6],M=t[7],h=t[8],l=t[9],w=t[10],m=t[11],d=t[12],v=t[13],p=t[14],q=t[15],b=w*q,g=p*m,x=f*q,y=p*M,A=f*m,S=w*M,z=u*q,F=p*a,k=u*m,T=w*a,I=u*M,P=f*a,V=h*v,Z=d*l,L=s*v,R=d*i,E=s*l,X=h*i,Y=o*v,_=d*c,Q=o*l,N=h*c,U=o*i,j=s*c,D=b*i+y*l+A*v-(g*i+x*l+S*v),O=g*c+z*l+T*v-(b*c+F*l+k*v),$=x*c+F*i+I*v-(y*c+z*i+P*v),B=S*c+k*i+P*l-(A*c+T*i+I*l),C=1/(o*D+s*O+h*$+d*B);return e[0]=C*D,e[1]=C*O,e[2]=C*$,e[3]=C*B,e[4]=C*(g*s+x*h+S*d-(b*s+y*h+A*d)),e[5]=C*(b*o+F*h+k*d-(g*o+z*h+T*d)),e[6]=C*(y*o+z*s+P*d-(x*o+F*s+I*d)),e[7]=C*(A*o+T*s+I*h-(S*o+k*s+P*h)),e[8]=C*(V*M+R*m+E*q-(Z*M+L*m+X*q)),e[9]=C*(Z*a+Y*m+N*q-(V*a+_*m+Q*q)),e[10]=C*(L*a+_*M+U*q-(R*a+Y*M+j*q)),e[11]=C*(X*a+Q*M+j*m-(E*a+N*M+U*m)),e[12]=C*(L*w+X*p+Z*f-(E*p+V*f+R*w)),e[13]=C*(Q*p+V*u+_*w-(Y*w+N*p+Z*u)),e[14]=C*(Y*f+j*p+R*u-(U*p+L*u+_*f)),e[15]=C*(U*w+E*u+N*f-(Q*f+j*w+X*u)),e}const a=u;function s(t,r,e){const o=e??new n(16),c=t[0],u=t[1],a=t[2],s=t[3],i=t[4],f=t[5],M=t[6],h=t[7],l=t[8],w=t[9],m=t[10],d=t[11],v=t[12],p=t[13],q=t[14],b=t[15],g=r[0],x=r[1],y=r[2],A=r[3],S=r[4],z=r[5],F=r[6],k=r[7],T=r[8],I=r[9],P=r[10],V=r[11],Z=r[12],L=r[13],R=r[14],E=r[15];return o[0]=c*g+i*x+l*y+v*A,o[1]=u*g+f*x+w*y+p*A,o[2]=a*g+M*x+m*y+q*A,o[3]=s*g+h*x+d*y+b*A,o[4]=c*S+i*z+l*F+v*k,o[5]=u*S+f*z+w*F+p*k,o[6]=a*S+M*z+m*F+q*k,o[7]=s*S+h*z+d*F+b*k,o[8]=c*T+i*I+l*P+v*V,o[9]=u*T+f*I+w*P+p*V,o[10]=a*T+M*I+m*P+q*V,o[11]=s*T+h*I+d*P+b*V,o[12]=c*Z+i*L+l*R+v*E,o[13]=u*Z+f*L+w*R+p*E,o[14]=a*Z+M*L+m*R+q*E,o[15]=s*Z+h*L+d*R+b*E,o}const i=s,M=t.create(),h=t.create(),l=t.create();function w(t,r,e){const o=e??new n(16);let c=t[0],u=t[1],a=t[2];const s=Math.sqrt(c*c+u*u+a*a);c/=s,u/=s,a/=s;const i=c*c,f=u*u,M=a*a,h=Math.cos(r),l=Math.sin(r),w=1-h;return o[0]=i+(1-i)*h,o[1]=c*u*w+a*l,o[2]=c*a*w-u*l,o[3]=0,o[4]=c*u*w-a*l,o[5]=f+(1-f)*h,o[6]=u*a*w+c*l,o[7]=0,o[8]=c*a*w+u*l,o[9]=u*a*w-c*l,o[10]=M+(1-M)*h,o[11]=0,o[12]=0,o[13]=0,o[14]=0,o[15]=1,o}function m(t,r,e,o){const c=o??new n(16);let u=r[0],a=r[1],s=r[2];const i=Math.sqrt(u*u+a*a+s*s);u/=i,a/=i,s/=i;const f=u*u,M=a*a,h=s*s,l=Math.cos(e),w=Math.sin(e),m=1-l,d=f+(1-f)*l,v=u*a*m+s*w,p=u*s*m-a*w,q=u*a*m-s*w,b=M+(1-M)*l,g=a*s*m+u*w,x=u*s*m+a*w,y=a*s*m-u*w,A=h+(1-h)*l,S=t[0],z=t[1],F=t[2],k=t[3],T=t[4],I=t[5],P=t[6],V=t[7],Z=t[8],L=t[9],R=t[10],E=t[11];return c[0]=d*S+v*T+p*Z,c[1]=d*z+v*I+p*L,c[2]=d*F+v*P+p*R,c[3]=d*k+v*V+p*E,c[4]=q*S+b*T+g*Z,c[5]=q*z+b*I+g*L,c[6]=q*F+b*P+g*R,c[7]=q*k+b*V+g*E,c[8]=x*S+y*T+A*Z,c[9]=x*z+y*I+A*L,c[10]=x*F+y*P+A*R,c[11]=x*k+y*V+A*E,t!==c&&(c[12]=t[12],c[13]=t[13],c[14]=t[14],c[15]=t[15]),c}return{create:function(t,r,e,o,c,u,a,s,i,f,M,h,l,w,m,d){const v=new n(16);return void 0!==t&&(v[0]=t,void 0!==r&&(v[1]=r,void 0!==e&&(v[2]=e,void 0!==o&&(v[3]=o,void 0!==c&&(v[4]=c,void 0!==u&&(v[5]=u,void 0!==a&&(v[6]=a,void 0!==s&&(v[7]=s,void 0!==i&&(v[8]=i,void 0!==f&&(v[9]=f,void 0!==M&&(v[10]=M,void 0!==h&&(v[11]=h,void 0!==l&&(v[12]=l,void 0!==w&&(v[13]=w,void 0!==m&&(v[14]=m,void 0!==d&&(v[15]=d)))))))))))))))),v},set:function(t,r,e,o,c,u,a,s,i,f,M,h,l,w,m,d,v){const p=v??new n(16);return p[0]=t,p[1]=r,p[2]=e,p[3]=o,p[4]=c,p[5]=u,p[6]=a,p[7]=s,p[8]=i,p[9]=f,p[10]=M,p[11]=h,p[12]=l,p[13]=w,p[14]=m,p[15]=d,p},fromMat3:function(t,r){const e=r??new n(16);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[12]=0,e[13]=0,e[14]=0,e[15]=1,e},fromQuat:function(t,r){const e=r??new n(16),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,p=a*i,q=a*f;return e[0]=1-l-d,e[1]=h+q,e[2]=w-p,e[3]=0,e[4]=h-q,e[5]=1-M-d,e[6]=m+v,e[7]=0,e[8]=w+p,e[9]=m-v,e[10]=1-M-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},negate:function(t,r){const e=r??new n(16);return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=-t[7],e[8]=-t[8],e[9]=-t[9],e[10]=-t[10],e[11]=-t[11],e[12]=-t[12],e[13]=-t[13],e[14]=-t[14],e[15]=-t[15],e},copy:r,clone: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 i(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=i;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 p=v;function q(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=q;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:s,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:i,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: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(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 s(t,o,c,S),s(r,e,c,z),s(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:s(n),mat4:h(t),quat:w(r),vec2:u(e),vec3:f(o),vec4:d(c)}}const{mat3:p,mat4:q,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{p as mat3,A as mat3d,I as mat3n,q 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}; //# 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 ab24ad0..685e076 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/mat3-impl.ts","../../../src/vec3-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 */\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 { getAPI as getVec2API } from './vec2-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\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 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 * 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 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","/*\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","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 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 mat4 */\n mat4: getMat4API(Mat3Ctor),\n /** @namespace mat3 */\n mat3: getMat3API(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 * 4x4 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat4,\n /**\n * 3x3 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat3,\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 * 4x4 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat4: mat4d,\n /**\n * 3x3 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat3: mat3d,\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 * 4x4 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat4: mat4n,\n /**\n * 3x3 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat3: mat3n,\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","vec2","getVec2API","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","v2","v3","v4","v5","v6","v7","v8","fromMat4","m4","fromQuat","q","w","x2","y2","z2","xx","yx","yy","zx","zy","zz","wx","wy","wz","transpose","determinant","setTranslation","getTranslation","getAxis","axis","off","setAxis","getScaling","xy","translation","translate","rotation","angleInRadians","c","s","scaling","uniformScaling","uniformScale","dz","az","bz","t1","t2","zScale","transformMat4Upper3x3","transformQuat","qx","qy","qz","w2","uvX","uvY","uvZ","xz","yz","rotateX","p","r","rotateY","rotateZ","vec3","getVec3API","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","mat4","getMat4API","mat3","getMat3API","quat","getQuatAPI","vec4","getVec4API","Float32Array","mat4d","mat3d","quatd","vec2d","vec3d","vec4d","Float64Array","mat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,eAOxER,KAAMS,EAKNP,KAAMQ,EAKNN,KAAMO,EAKN3Q,KAAM4Q,EAKN5K,KAAM6K,EAKNP,KAAMQ,GACJrB,EAEAsB,aAAcA,aAAcA,aAAcA,aAAcA,aAAcA,eAOxEf,KAAMgB,EAKNd,KAAMe,EAKNb,KAAMc,EAKNlR,KAAMmR,EAKNnL,KAAMoL,EAKNd,KAAMe,GACJ5B,EAEAnW,EAAWgY,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/mat3-impl.ts","../../../src/vec3-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 */\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 { getAPI as getVec2API } from './vec2-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\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 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 * 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 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","/*\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","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 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","vec2","getVec2API","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","v2","v3","v4","v5","v6","v7","v8","fromMat4","m4","fromQuat","q","w","x2","y2","z2","xx","yx","yy","zx","zy","zz","wx","wy","wz","transpose","determinant","setTranslation","getTranslation","getAxis","axis","off","setAxis","getScaling","xy","translation","translate","rotation","angleInRadians","c","s","scaling","uniformScaling","uniformScale","dz","az","bz","t1","t2","zScale","transformMat4Upper3x3","transformQuat","qx","qy","qz","w2","uvX","uvY","uvZ","xz","yz","rotateX","p","r","rotateY","rotateZ","vec3","getVec3API","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":"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,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,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B,EAAMC,IAEXA,CACT,CC3tBA,SAASyU,EAQLC,EACAC,EACAC,EACAC,EACAC,EACAC,GAEF,MAAO,CAELC,KAAMC,EAAiBP,GAEvBQ,KAAMC,EAAiBR,GAEvBS,KAAMC,EAAiBT,GAEvB5P,KAAMC,EAAiB4P,GAEvB7J,KAAMC,EAAiB6J,GAEvBQ,KAAMC,EAAiBR,GAE3B,CAEa,MAAAC,KAKXA,EAAIE,KAKJA,EAAIE,KAKJA,EAAIpQ,KAKJA,EAAIgG,KAKJA,EAAIsK,KAKJA,GACEb,EAEAe,aAAcA,aAAcA,aAAcA,aAAcA,aAAcA,eAOxER,KAAMS,EAKNP,KAAMQ,EAKNN,KAAMO,EAKN3Q,KAAM4Q,EAKN5K,KAAM6K,EAKNP,KAAMQ,GACJrB,EAEAsB,aAAcA,aAAcA,aAAcA,aAAcA,aAAcA,eAOxEf,KAAMgB,EAKNd,KAAMe,EAKNb,KAAMc,EAKNlR,KAAMmR,EAKNnL,KAAMoL,EAKNd,KAAMe,GACJ5B,EAEAnW,EAAWgY,MAAOA,MAAOA,MAAOA,MAAOA"} \ No newline at end of file diff --git a/docs/assets/search.js b/docs/assets/search.js index 0c02a2b..8be40f5 100644 --- a/docs/assets/search.js +++ b/docs/assets/search.js @@ -1 +1 @@ -window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA62dXZPjynGm/0v7tnfE+gbPnbzrC0dY611LVqx3QqGgmtSo7W6yT3/MHumE/vsGCkw0kHgzkQWeq5lokllAIVGVmU9VvT/fvV7+39vdD19/vvuvx/Px7ge/2xeX/P3d+fB8uvvh7h8Pb6f//n55vbu/+3h9uvvh7v2vL6e3X9Gfv/zl/fnp7v7u4enw9nZ6u/vh7u7v92QruU87f/xj/0PNyj+MX5kYu797Obyezu/TK/lsgF/sbw7vgTXR/+m/OfUygZW4tBIbrfzvj8M7s9L/qdHK708Pnlnp/9RuhfdL/6d2K7xf+j+19244god03PCUgJ3Yaqd/KNxO/duGJ8Xt1L9te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3U/WWFp0+3e1h3Nva25l3+mzJBb225k5nUHUWtNKLbu70JVSd7kLpovmqZnPsxBHGHUTmx7ekqtM6YbBNUL2deadPF+SMJM82DvXG5p0+HYvHkN9+ZctOn9Znom14+dvpdb4UejclqxSwe0qfPYWIcVwZRTFnotm6UKhZaDTvLGnEH+7vXh5fTk+P59PdD1//8Pe//3+GYLB9pUkCAA=="; \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA62d23Lsyo2m30V9q1muPJP7zj3TFx3RnkO3xzE9KxwOWVVeVrdUpa3Dnm07/O4TTBa4SPAHiGTtKymqikgewEwAX2b+f7t7u/y/97sfvv7t7j+fzse7H/yhLy75+7vzw8vp7oe7f3x4P/3Xj8vb3f3d59vz3Q93H395Pb3/ij7+8uePl+e7+7vH54f399P73Q93d3+/J1vJfbfzhz8MB2pW/mH6yczY/d3rw9vp/DE/k+8N8JP9zcNHYE0MH/0Xp54msBLXVmKjlf/1+fDBrAwfNVr53enRMyvDR+1W+H0ZPmq3wu/L8FH73Q1H8JCOO54SsBNb7QwPhdupn+14UtxO/WzHswJ2mu/P8GiAneb7MzybM3he5x3PC9iJrXaGZ8Pt1M92PC9up36243kBO833Z3g2wM7m/YmThZd57/dyOX4+n95/NXyoHp+/G3h8vpy/d9F/+jw/fjxdzlcb9UtgadZD1xPAlt9ODx+y6frtXtvvpw/J8PvpY6/VP71dXhYDATNN399ifzFEAPvD93vtn0/flDs+frv7aV5e/yI+y8vrX/baPf34+fD8/uvX17fLz08vDx+nZ7EZ8NPbWtUb2mv76Xg6fzx9iJdB3++1//H2cH5/vbyLD3r6we4rOP90epPtX7++ybr4Dozf7rV9PH2c3l6ezg9nsYHZT/a28vL5LFl/+Xy+werH06vs/vT9DX3mbwfPeH4YjCrd5+xXe9v6Zmrr2y/V1q9/fhJf5uvXN9w1zfr7bda/nT7+7fHh+en8TTn96y9u6i/0B/Fx+1MgE3qv9HzDCPR2+VAvgr6/yb54+uO3u71If8jvtz3h4X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FLhkctdCKX4xTon4uODJJ/OnNTG1iZcFmxdUl/7T5W01m2PY6Wf2rk28epo1OGHqabIgBcrZ1vHOm47LpucPoptiwek1n0oj5Cr99JpP9Q+KBfP0mtscY3FWn6+vp7fw8/LGuPkE7YkFTsAvN954nuwOOyTN7E8l76m2ZvSaa1+1DBRmpqmKQY82TD3J9GinLsU4zVLoH+PshlE8MBUhp+z5e4GRhkBj8bC2+nphFH8WT06TM8mJ6VmFaX7hNEvOWAT8ePs8P7KbOyzOnrkt1fio+OGnFXDkpImSrkSdX6EOslDS1RkD1M/z0+BM69Bw1kvQc51WP9AbG6aVDTSCZuM8vVmzPGqbdR/0aKeKIL2dYSr70e3KxukInx9Py2mjbs6uOmM69tPp0S/ym9kMtmuvb6wQDZZWlaZ53GPsjwc7bPnCfFCiMdmWHw7GlqHYvE+fIhWbhw3G1pWmeS0h2uKZn06Piw511tlTpdwIwAZLq5s+X+1hXNs62Fne9MWUC3ptzTedQdVF0Eovuvmmr6HqfOJNF81ntRhj52icOirz41tT1XmdMNgGqMHO8qbPJ+RMJM/WDw3Gljd93hdPIb/9zNY3fV6fibbu5a+nt+VU6MOcrNLo6mkU8hQixmlFJMWciTKaQqFmoVCzc4ar+v393evT6+n56Xy6++Hr7//+9/8Pc9r91KVJAgA="; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 713d0d2..6d8d13b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wgpu-matrix", - "version": "3.0.2", + "version": "3.0.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "wgpu-matrix", - "version": "3.0.2", + "version": "3.0.3", "license": "MIT", "devDependencies": { "@rollup/plugin-terser": "^0.4.4", diff --git a/package.json b/package.json index ca7c50f..f0b26a0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wgpu-matrix", - "version": "3.0.2", + "version": "3.0.3", "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/wgpu-matrix.ts b/src/wgpu-matrix.ts index 055a283..d757056 100644 --- a/src/wgpu-matrix.ts +++ b/src/wgpu-matrix.ts @@ -74,10 +74,10 @@ function wgpuMatrixAPI< Vec4Ctor: BaseCtor, ) { return { - /** @namespace mat4 */ - mat4: getMat4API(Mat3Ctor), /** @namespace mat3 */ - mat3: getMat3API(Mat4Ctor), + mat3: getMat3API(Mat3Ctor), + /** @namespace mat4 */ + mat4: getMat4API(Mat4Ctor), /** @namespace quat */ quat: getQuatAPI(QuatCtor), /** @namespace vec2 */ @@ -91,15 +91,15 @@ function wgpuMatrixAPI< export const { /** - * 4x4 Matrix functions that default to returning `Float32Array` + * 3x3 Matrix functions that default to returning `Float32Array` * @namespace */ - mat4, + mat3, /** - * 3x3 Matrix functions that default to returning `Float32Array` + * 4x4 Matrix functions that default to returning `Float32Array` * @namespace */ - mat3, + mat4, /** * Quaternion functions that default to returning `Float32Array` * @namespace @@ -126,15 +126,15 @@ export const { export const { /** - * 4x4 Matrix functions that default to returning `Float64Array` + * 3x3 Matrix functions that default to returning `Float64Array` * @namespace */ - mat4: mat4d, + mat3: mat3d, /** - * 3x3 Matrix functions that default to returning `Float64Array` + * 4x4 Matrix functions that default to returning `Float64Array` * @namespace */ - mat3: mat3d, + mat4: mat4d, /** * Quaternion functions that default to returning `Float64Array` * @namespace @@ -161,15 +161,15 @@ export const { export const { /** - * 4x4 Matrix functions that default to returning `number[]` + * 3x3 Matrix functions that default to returning `number[]` * @namespace */ - mat4: mat4n, + mat3: mat3n, /** - * 3x3 Matrix functions that default to returning `number[]` + * 4x4 Matrix functions that default to returning `number[]` * @namespace */ - mat3: mat3n, + mat4: mat4n, /** * Quaternion functions that default to returning `number[]` * @namespace diff --git a/test/tests/mat3-test.js b/test/tests/mat3-test.js index 0a37afb..a93df57 100644 --- a/test/tests/mat3-test.js +++ b/test/tests/mat3-test.js @@ -21,7 +21,7 @@ function assertMat3EqualApproximately(a, b) { } } -function check(Type) { +function check(mat3, Type) { describe('using ' + Type, () => { const m = [ 0, 1, 2, 0, @@ -29,23 +29,25 @@ function check(Type) { 8, 9, 10, 0, ]; + function createCopyOfType(v) { + return Type === Array ? new Type(...v) : new Type(v); + } + function testM3WithoutDest(func, expected, ...args) { const d = func(...args); assertMat3EqualApproximately(d, expected); } function testM3WithDest(func, expected, ...args) { - expected = new Float32Array(expected); - const d = new Float32Array(12); + expected = createCopyOfType(expected); + const d = new Type(12).fill(0); const c = func(...args, d); assertStrictEqual(c, d); assertMat3EqualApproximately(c, expected); } function testMat3WithAndWithoutDest(func, expected, ...args) { - if (Type === Float32Array) { - expected = new Float32Array(expected); - } + expected = createCopyOfType(expected); testM3WithoutDest(func, expected, ...args); testM3WithDest(func, expected, ...args); } @@ -56,14 +58,14 @@ function check(Type) { } function testV2WithDest(func, expected) { - const d = new Float32Array(2); + const d = new Type(2).fill(0); const c = func(d); assertStrictEqual(c, d); assertEqual(c, expected); } function testV2WithAndWithoutDest(func, expected) { - expected = new Float32Array(expected); + expected = createCopyOfType(expected); testV2WithoutDest(func, expected); testV2WithDest(func, expected); } @@ -90,9 +92,9 @@ function check(Type) { it('should negate', () => { const expected = [ - -0, -1, -2, -3, - -4, -5, -6, -7, - -8, -9, -10, -11, + -0, -1, -2, 0, + -4, -5, -6, 0, + -8, -9, -10, 0, ]; testMat3WithAndWithoutDest((newDst) => { return mat3.negate(m, newDst); @@ -350,12 +352,12 @@ function check(Type) { it('should get scaling', () => { const m = [ - 1, 2, 3, 0, + 2, 8, 3, 0, 5, 6, 7, 0, 9, 10, 11, 0, ]; const expected = [ - Math.sqrt(1 * 1 + 2 * 2), + Math.sqrt(2 * 2 + 8 * 8), Math.sqrt(5 * 5 + 6 * 6), ]; testV2WithAndWithoutDest((newDst) => { @@ -491,8 +493,8 @@ function check(Type) { } describe('mat3', () => { - check(mat3n); - check(mat3); - check(mat3d); + check(mat3n, Array); + check(mat3, Float32Array); + check(mat3d, Float64Array); }); diff --git a/test/tests/mat4-test.js b/test/tests/mat4-test.js index 8707b04..ce79fbc 100644 --- a/test/tests/mat4-test.js +++ b/test/tests/mat4-test.js @@ -12,7 +12,6 @@ import {describe, it} from '../mocha-support.js'; function check(mat4, Type) { - describe('using ' + Type, () => { const m = [ 0, 1, 2, 3,