From 6db14ff4f0fc8b4455b635bae7107d001b38032d Mon Sep 17 00:00:00 2001 From: greggman Date: Sun, 27 Oct 2024 03:35:52 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20greggman?= =?UTF-8?q?/wgpu-matrix@a4615769f60116c4ef4f896211a332dcb7f7a612=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/3.x/types.d.ts | 12 +++++++++++- dist/3.x/wgpu-matrix.d.ts | 4 ++-- dist/3.x/wgpu-matrix.js | 2 +- dist/3.x/wgpu-matrix.js.map | 2 +- dist/3.x/wgpu-matrix.min.js.map | 2 +- dist/3.x/wgpu-matrix.module.js | 2 +- dist/3.x/wgpu-matrix.module.js.map | 2 +- dist/3.x/wgpu-matrix.module.min.js.map | 2 +- docs/assets/navigation.js | 2 +- docs/assets/search.js | 2 +- docs/interfaces/MutableNumberArray.html | 6 ++++++ docs/modules.html | 1 + docs/types/BaseArgType.html | 2 +- package-lock.json | 4 ++-- package.json | 2 +- src/types.ts | 13 ++++++++++++- src/wgpu-matrix.ts | 3 ++- 17 files changed, 46 insertions(+), 17 deletions(-) create mode 100644 docs/interfaces/MutableNumberArray.html diff --git a/dist/3.x/types.d.ts b/dist/3.x/types.d.ts index 06e5762..546db9c 100644 --- a/dist/3.x/types.d.ts +++ b/dist/3.x/types.d.ts @@ -1,8 +1,18 @@ +/** + * A type wider than `number[]`, omitting any instance functions + * unused by the API, e.g., map, sort. This allows the math + * functions to operate on a wider range of array-like + * values. + */ +export interface MutableNumberArray { + readonly length: number; + [n: number]: number; +} /** * The types you can pass to most functions that take an * array of numbers. */ -export type BaseArgType = Float32Array | Float64Array | number[]; +export type BaseArgType = Float32Array | Float64Array | MutableNumberArray; export declare const ZeroArray: { (arrayLength: number): number[]; (...items: number[]): number[]; diff --git a/dist/3.x/wgpu-matrix.d.ts b/dist/3.x/wgpu-matrix.d.ts index 4f2b74d..afa0a98 100644 --- a/dist/3.x/wgpu-matrix.d.ts +++ b/dist/3.x/wgpu-matrix.d.ts @@ -2,7 +2,7 @@ * Some docs * @namespace wgpu-matrix */ -import { BaseArgType } from './types'; +import { MutableNumberArray, BaseArgType } from './types'; import { Mat3Arg, Mat3Type } from './mat3-impl'; import { Mat4Arg, Mat4Type } from './mat4-impl'; import { QuatArg, QuatType, RotationOrder } from './quat-impl'; @@ -10,7 +10,7 @@ import { Vec2Arg, Vec2Type } from './vec2-impl'; import { Vec3Arg, Vec3Type } from './vec3-impl'; import { Vec4Arg, Vec4Type } from './vec4-impl'; import * as utils from './utils'; -export { RotationOrder, utils, BaseArgType, Mat3Arg, Mat4Arg, QuatArg, Vec2Arg, Vec3Arg, Vec4Arg, Mat3Type, Mat4Type, QuatType, Vec2Type, Vec3Type, Vec4Type, }; +export { RotationOrder, utils, MutableNumberArray, BaseArgType, Mat3Arg, Mat4Arg, QuatArg, Vec2Arg, Vec3Arg, Vec4Arg, Mat3Type, Mat4Type, QuatType, Vec2Type, Vec3Type, Vec4Type, }; export type BaseCtor = new (n: number) => T; export type Mat3 = Mat3Type; export type Mat4 = Mat4Type; diff --git a/dist/3.x/wgpu-matrix.js b/dist/3.x/wgpu-matrix.js index 6d847f3..f19adf3 100644 --- a/dist/3.x/wgpu-matrix.js +++ b/dist/3.x/wgpu-matrix.js @@ -1,4 +1,4 @@ -/* wgpu-matrix@3.2.0, license MIT */ +/* wgpu-matrix@3.3.0, license MIT */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : diff --git a/dist/3.x/wgpu-matrix.js.map b/dist/3.x/wgpu-matrix.js.map index f80671b..40e62ce 100644 --- a/dist/3.x/wgpu-matrix.js.map +++ b/dist/3.x/wgpu-matrix.js.map @@ -1 +1 @@ -{"version":3,"file":"wgpu-matrix.js","sources":["../../../src/types.ts","../../../src/utils.ts","../../../src/vec2-impl.ts","../../../src/vec3-impl.ts","../../../src/mat3-impl.ts","../../../src/mat4-impl.ts","../../../src/quat-impl.ts","../../../src/vec4-impl.ts","../../../src/wgpu-matrix.ts"],"sourcesContent":["/**\n * The types you can pass to most functions that take an\n * array of numbers.\n */\nexport type BaseArgType = Float32Array | Float64Array | number[];\n\nfunction wrapConstructor any>(\n OriginalConstructor: T,\n modifier: (instance: InstanceType) => void\n): T {\n return class extends OriginalConstructor {\n constructor(...args: any[]) {\n super(...args);\n modifier(this as InstanceType);\n }\n } as T; // Type assertion is necessary here\n}\n\nexport const ZeroArray = wrapConstructor(Array, a => a.fill(0));\n\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nexport let EPSILON = 0.000001;\n\n/**\n * Set the value for EPSILON for various checks\n * @param v - Value to use for EPSILON.\n * @returns previous value of EPSILON;\n */\nexport function setEpsilon(v: number): number {\n const old = EPSILON;\n EPSILON = v;\n return old;\n}\n\n/**\n * Convert degrees to radians\n * @param degrees - Angle in degrees\n * @returns angle converted to radians\n */\nexport function degToRad(degrees: number): number {\n return degrees * Math.PI / 180;\n}\n\n/**\n * Convert radians to degrees\n * @param radians - Angle in radians\n * @returns angle converted to degrees\n */\nexport function radToDeg(radians: number): number {\n return radians * 180 / Math.PI;\n}\n\n/**\n * Lerps between a and b via t\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @returns a + (b - a) * t\n */\nexport function lerp(a: number, b: number, t: number): number {\n return a + (b - a) * t;\n}\n\n/**\n * Compute the opposite of lerp. Given a and b and a value between\n * a and b returns a value between 0 and 1. 0 if a, 1 if b.\n * Note: no clamping is done.\n * @param a - start value\n * @param b - end value\n * @param v - value between a and b\n * @returns (v - a) / (b - a)\n */\nexport function inverseLerp(a: number, b: number, v: number): number {\n const d = b - a;\n return (Math.abs(b - a) < EPSILON)\n ? a\n : (v - a) / d;\n}\n\n/**\n * Compute the euclidean modulo\n *\n * ```\n * // table for n / 3\n * -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 <- n\n * ------------------------------------\n * -2 -1 -0 -2 -1 0, 1, 2, 0, 1, 2 <- n % 3\n * 1 2 0 1 2 0, 1, 2, 0, 1, 2 <- euclideanModule(n, 3)\n * ```\n *\n * @param n - dividend\n * @param m - divisor\n * @returns the euclidean modulo of n / m\n */\nexport function euclideanModulo(n: number, m: number) {\n return ((n % m) + m) % m;\n}","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Mat3Arg } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { Vec2Arg, Vec2Type } from './vec2';\nimport { Vec3Arg } from './vec3';\nimport { BaseArgType } from './types';\n\nexport { Vec2Arg, Vec2Type };\n\ntype Vec2Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec3\n */\nfunction getAPIImpl(Ctor: Vec2Ctor) {\n\n/**\n * Creates a Vec2; may be called with x, y, z to set initial values.\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Vec2's specified type\n * it would be faster to use\n *\n * ```\n * const v = vec2.clone(someJSArray);\n * ```\n *\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\nfunction create(x = 0, y = 0) {\n const newDst = new Ctor(2);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n }\n }\n return newDst;\n}\n\n/**\n * Creates a Vec2; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec2\n * Also see {@link vec2.create} and {@link vec2.copy}\n *\n * @param x first value\n * @param y second value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec2Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec2Arg, b: Vec2Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n\n return newDst;\n}\n\n/**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\nfunction angle(a: Vec2Arg, b: Vec2Arg): number {\n const ax = a[0];\n const ay = a[1];\n const bx = b[0];\n const by = b[1];\n const mag1 = Math.sqrt(ax * ax + ay * ay);\n const mag2 = Math.sqrt(bx * bx + by * by);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec2Arg, b: Vec2Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec2Arg, b: Vec2Arg): boolean {\n return a[0] === b[0] && a[1] === b[1];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec2Arg, b: Vec2Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec2Arg, b: Vec2Arg, t: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec2Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec2Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\nfunction cross(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const z = a[0] * b[1] - a[1] * b[0];\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = z;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec2Arg, b: Vec2Arg): number {\n return a[0] * b[0] + a[1] * b[1];\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec2Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n return Math.sqrt(v0 * v0 + v1 * v1);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec2Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n return v0 * v0 + v1 * v1;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec2Arg, b: Vec2Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return Math.sqrt(dx * dx + dy * dy);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec2Arg, b: Vec2Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return dx * dx + dy * dy;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const len = Math.sqrt(v0 * v0 + v1 * v1);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n }\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec2.clone})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec2.copy})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Creates a random unit vector * scale\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\nfunction random(scale = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const angle = Math.random() * 2 * Math.PI;\n newDst[0] = Math.cos(angle) * scale;\n newDst[1] = Math.sin(angle) * scale;\n\n return newDst;\n}\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform Vec2 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec2Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const x = v[0];\n const y = v[1];\n\n newDst[0] = x * m[0] + y * m[4] + m[12];\n newDst[1] = x * m[1] + y * m[5] + m[13];\n\n return newDst;\n}\n\n/**\n * Transforms vec4 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat3(v: Vec2Arg, m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const x = v[0];\n const y = v[1];\n\n newDst[0] = m[0] * x + m[4] * y + m[8];\n newDst[1] = m[1] * x + m[5] * y + m[9];\n\n return newDst;\n}\n\n/**\n * Rotate a 2D vector\n *\n * @param a The vec2 point to rotate\n * @param b The origin of the rotation\n * @param rad The angle of rotation in radians\n * @returns the rotated vector\n */\nfunction rotate(a: Vec2Arg, b: Vec2Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n // Translate point to the origin\n const p0 = a[0] - b[0];\n const p1 = a[1] - b[1];\n const sinC = Math.sin(rad);\n const cosC = Math.cos(rad);\n\n //perform rotation and translate to correct position\n newDst[0] = p0 * cosC - p1 * sinC + b[0];\n newDst[1] = p0 * sinC + p1 * cosC + b[1];\n\n return newDst;\n}\n\n/**\n * Treat a 2D vector as a direction and set it's length\n *\n * @param a The vec2 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec2Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec2 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec2Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat3,\n rotate,\n setLength,\n truncate,\n midpoint,\n};\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Vec2Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Vec3Arg, Vec3Type } from './vec3';\nimport { Mat3Arg } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { QuatArg } from './quat';\nimport { BaseArgType } from './types';\n\nexport { Vec3Arg, Vec3Type };\n\ntype Vec3Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec3\n * */\nfunction getAPIImpl(Ctor: Vec3Ctor) {\n\n/**\n * Creates a vec3; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number) {\n const newDst = new Ctor(3);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a vec3; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec3\n * Also see {@link vec3.create} and {@link vec3.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec3Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec3Arg, b: Vec3Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n\n return newDst;\n}\n\n/**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\nfunction angle(a: Vec3Arg, b: Vec3Arg): number {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const mag1 = Math.sqrt(ax * ax + ay * ay + az * az);\n const mag2 = Math.sqrt(bx * bx + by * by + bz * bz);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec3Arg, b: Vec3Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec3Arg, b: Vec3Arg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec3Arg, b: Vec3Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec3Arg, b: Vec3Arg, t: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec3Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec3Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\nfunction cross(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const t1 = a[2] * b[0] - a[0] * b[2];\n const t2 = a[0] * b[1] - a[1] * b[0];\n newDst[0] = a[1] * b[2] - a[2] * b[1];\n newDst[1] = t1;\n newDst[2] = t2;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec3Arg, b: Vec3Arg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]);\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec3Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec3Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return v0 * v0 + v1 * v1 + v2 * v2;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec3Arg, b: Vec3Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return Math.sqrt(dx * dx + dy * dy + dz * dz);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec3Arg, b: Vec3Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return dx * dx + dy * dy + dz * dz;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec3.clone})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec3.copy})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Creates a random vector\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\nfunction random(scale = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const angle = Math.random() * 2 * Math.PI;\n const z = Math.random() * 2 - 1;\n const zScale = Math.sqrt(1 - z * z) * scale;\n newDst[0] = Math.cos(angle) * zScale;\n newDst[1] = Math.sin(angle) * zScale;\n newDst[2] = z * scale;\n\n return newDst;\n}\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform vec3 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec3Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1;\n\n newDst[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n newDst[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n newDst[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n\n return newDst;\n}\n\n/**\n * Transform vec3 by upper 3x3 matrix inside 4x4 matrix.\n * @param v - The direction.\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns The transformed vector.\n */\nfunction transformMat4Upper3x3(v: Vec3Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[0] = v0 * m[0 * 4 + 0] + v1 * m[1 * 4 + 0] + v2 * m[2 * 4 + 0];\n newDst[1] = v0 * m[0 * 4 + 1] + v1 * m[1 * 4 + 1] + v2 * m[2 * 4 + 1];\n newDst[2] = v0 * m[0 * 4 + 2] + v1 * m[1 * 4 + 2] + v2 * m[2 * 4 + 2];\n\n return newDst;\n}\n\n/**\n * Transforms vec3 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat3(v: Vec3Arg, m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n\n newDst[0] = x * m[0] + y * m[4] + z * m[8];\n newDst[1] = x * m[1] + y * m[5] + z * m[9];\n newDst[2] = x * m[2] + y * m[6] + z * m[10];\n\n return newDst;\n}\n\n/**\n * Transforms vec3 by Quaternion\n * @param v - the vector to transform\n * @param q - the quaternion to transform by\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed\n */\nfunction transformQuat(v: Vec3Arg, q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n\n const uvX = qy * z - qz * y;\n const uvY = qz * x - qx * z;\n const uvZ = qx * y - qy * x;\n\n newDst[0] = x + uvX * w2 + (qy * uvZ - qz * uvY) * 2;\n newDst[1] = y + uvY * w2 + (qz * uvX - qx * uvZ) * 2;\n newDst[2] = z + uvZ * w2 + (qx * uvY - qy * uvX) * 2;\n\n return newDst;\n}\n\n/**\n * Returns the translation component of a 4-by-4 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\nfunction getTranslation(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n}\n/**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat4Arg, axis: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n}\n/**\n * Returns the scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the x-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\nfunction rotateX(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n //Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n //perform rotation\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad);\n\n //translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the y-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\nfunction rotateY(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n // perform rotation\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad);\n\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the z-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns {vec3} out\n */\nfunction rotateZ(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n // perform rotation\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2];\n\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Treat a 3D vector as a direction and set it's length\n *\n * @param a The vec3 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec3Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec3 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec3Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat4Upper3x3,\n transformMat3,\n transformQuat,\n getTranslation,\n getAxis,\n getScaling,\n rotateX,\n rotateY,\n rotateZ,\n setLength,\n truncate,\n midpoint,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Vec3Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nimport * as utils from './utils.js';\nimport { QuatArg } from './quat';\nimport { Mat3Arg, Mat3Type } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { Vec2Arg } from './vec2';\nimport { Vec3Arg } from './vec3';\nimport { getAPI as getVec2API } from './vec2-impl';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\n\nexport { Mat3Arg, Mat3Type };\n\ntype Mat3Ctor = new (n: number) => T;\n\n/**\n * Generates a typed API for Mat3\n * */\nfunction getAPIImpl(Ctor: Mat3Ctor) {\n const vec2 = getVec2API(Ctor);\n const vec3 = getVec3API(Ctor);\n\n/**\n * Create a Mat3 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat3's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat3.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @returns matrix created from values.\n */\nfunction create(\n v0?: number, v1?: number, v2?: number,\n v3?: number, v4?: number, v5?: number,\n v6?: number, v7?: number, v8?: number) {\n const newDst = new Ctor(12);\n // to make the array homogenous\n newDst[3] = 0;\n newDst[7] = 0;\n newDst[11] = 0;\n\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[4] = v3;\n if (v4 !== undefined) {\n newDst[5] = v4;\n if (v5 !== undefined) {\n newDst[6] = v5;\n if (v6 !== undefined) {\n newDst[8] = v6;\n if (v7 !== undefined) {\n newDst[9] = v7;\n if (v8 !== undefined) {\n newDst[10] = v8;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n\n return newDst;\n}\n\n/**\n * Sets the values of a Mat3\n * Also see {@link mat3.create} and {@link mat3.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 set from values.\n */\nfunction set(\n v0: number, v1: number, v2: number,\n v3: number, v4: number, v5: number,\n v6: number, v7: number, v8: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[0] = v0; newDst[1] = v1; newDst[ 2] = v2; newDst[ 3] = 0;\n newDst[4] = v3; newDst[5] = v4; newDst[ 6] = v5; newDst[ 7] = 0;\n newDst[8] = v6; newDst[9] = v7; newDst[10] = v8; newDst[11] = 0;\n\n return newDst;\n}\n\n/**\n * Creates a Mat3 from the upper left 3x3 part of a Mat4\n * @param m4 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from m4\n */\nfunction fromMat4(m4: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n newDst[0] = m4[0]; newDst[1] = m4[1]; newDst[ 2] = m4[ 2]; newDst[ 3] = 0;\n newDst[4] = m4[4]; newDst[5] = m4[5]; newDst[ 6] = m4[ 6]; newDst[ 7] = 0;\n newDst[8] = m4[8]; newDst[9] = m4[9]; newDst[10] = m4[10]; newDst[11] = 0;\n return newDst;\n}\n\n/**\n * Creates a Mat3 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from q\n */\nfunction fromQuat(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3];\n const x2 = x + x; const y2 = y + y; const z2 = z + z;\n\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n newDst[ 0] = 1 - yy - zz; newDst[ 1] = yx + wz; newDst[ 2] = zx - wy; newDst[ 3] = 0;\n newDst[ 4] = yx - wz; newDst[ 5] = 1 - xx - zz; newDst[ 6] = zy + wx; newDst[ 7] = 0;\n newDst[ 8] = zx + wy; newDst[ 9] = zy - wx; newDst[10] = 1 - xx - yy; newDst[11] = 0;\n\n return newDst;\n}\n\n/**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\nfunction negate(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = -m[ 0]; newDst[ 1] = -m[ 1]; newDst[ 2] = -m[ 2];\n newDst[ 4] = -m[ 4]; newDst[ 5] = -m[ 5]; newDst[ 6] = -m[ 6];\n newDst[ 8] = -m[ 8]; newDst[ 9] = -m[ 9]; newDst[10] = -m[10];\n\n return newDst;\n}\n\n/**\n * Copies a matrix. (same as {@link mat3.clone})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nfunction copy(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = m[ 0]; newDst[ 1] = m[ 1]; newDst[ 2] = m[ 2];\n newDst[ 4] = m[ 4]; newDst[ 5] = m[ 5]; newDst[ 6] = m[ 6];\n newDst[ 8] = m[ 8]; newDst[ 9] = m[ 9]; newDst[10] = m[10];\n\n return newDst;\n}\n\n/**\n * Copies a matrix (same as {@link mat3.copy})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nconst clone = copy;\n\n/**\n * Check if 2 matrices are approximately equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are approximately equal\n */\nfunction equalsApproximately(a: Mat3Arg, b: Mat3Arg): boolean {\n return Math.abs(a[ 0] - b[ 0]) < utils.EPSILON &&\n Math.abs(a[ 1] - b[ 1]) < utils.EPSILON &&\n Math.abs(a[ 2] - b[ 2]) < utils.EPSILON &&\n Math.abs(a[ 4] - b[ 4]) < utils.EPSILON &&\n Math.abs(a[ 5] - b[ 5]) < utils.EPSILON &&\n Math.abs(a[ 6] - b[ 6]) < utils.EPSILON &&\n Math.abs(a[ 8] - b[ 8]) < utils.EPSILON &&\n Math.abs(a[ 9] - b[ 9]) < utils.EPSILON &&\n Math.abs(a[10] - b[10]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 matrices are exactly equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are exactly equal\n */\nfunction equals(a: Mat3Arg, b: Mat3Arg): boolean {\n return a[ 0] === b[ 0] &&\n a[ 1] === b[ 1] &&\n a[ 2] === b[ 2] &&\n a[ 4] === b[ 4] &&\n a[ 5] === b[ 5] &&\n a[ 6] === b[ 6] &&\n a[ 8] === b[ 8] &&\n a[ 9] === b[ 9] &&\n a[10] === b[10];\n}\n\n/**\n * Creates a 3-by-3 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 3-by-3 identity matrix.\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\nfunction transpose(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n if (newDst === m) {\n let t: number;\n\n // 0 1 2\n // 4 5 6\n // 8 9 10\n\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n\n return newDst;\n }\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n newDst[ 0] = m00; newDst[ 1] = m10; newDst[ 2] = m20;\n newDst[ 4] = m01; newDst[ 5] = m11; newDst[ 6] = m21;\n newDst[ 8] = m02; newDst[ 9] = m12; newDst[10] = m22;\n\n return newDst;\n}\n\n/**\n * Computes the inverse of a 3-by-3 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nfunction inverse(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n const b01 = m22 * m11 - m12 * m21;\n const b11 = -m22 * m10 + m12 * m20;\n const b21 = m21 * m10 - m11 * m20;\n\n const invDet = 1 / (m00 * b01 + m01 * b11 + m02 * b21);\n\n newDst[ 0] = b01 * invDet;\n newDst[ 1] = (-m22 * m01 + m02 * m21) * invDet;\n newDst[ 2] = ( m12 * m01 - m02 * m11) * invDet;\n newDst[ 4] = b11 * invDet;\n newDst[ 5] = ( m22 * m00 - m02 * m20) * invDet;\n newDst[ 6] = (-m12 * m00 + m02 * m10) * invDet;\n newDst[ 8] = b21 * invDet;\n newDst[ 9] = (-m21 * m00 + m01 * m20) * invDet;\n newDst[10] = ( m11 * m00 - m01 * m10) * invDet;\n\n return newDst;\n}\n\n/**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\nfunction determinant(m: Mat3Arg): number {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n return m00 * (m11 * m22 - m21 * m12) -\n m10 * (m01 * m22 - m21 * m02) +\n m20 * (m01 * m12 - m11 * m02);\n}\n\n/**\n * Computes the inverse of a 3-by-3 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nconst invert = inverse;\n\n/**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nfunction multiply(a: Mat3Arg, b: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[ 4 + 0];\n const a11 = a[ 4 + 1];\n const a12 = a[ 4 + 2];\n const a20 = a[ 8 + 0];\n const a21 = a[ 8 + 1];\n const a22 = a[ 8 + 2];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b10 = b[ 4 + 0];\n const b11 = b[ 4 + 1];\n const b12 = b[ 4 + 2];\n const b20 = b[ 8 + 0];\n const b21 = b[ 8 + 1];\n const b22 = b[ 8 + 2];\n\n newDst[ 0] = a00 * b00 + a10 * b01 + a20 * b02;\n newDst[ 1] = a01 * b00 + a11 * b01 + a21 * b02;\n newDst[ 2] = a02 * b00 + a12 * b01 + a22 * b02;\n newDst[ 4] = a00 * b10 + a10 * b11 + a20 * b12;\n newDst[ 5] = a01 * b10 + a11 * b11 + a21 * b12;\n newDst[ 6] = a02 * b10 + a12 * b11 + a22 * b12;\n newDst[ 8] = a00 * b20 + a10 * b21 + a20 * b22;\n newDst[ 9] = a01 * b20 + a11 * b21 + a21 * b22;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22;\n\n return newDst;\n}\n\n/**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nconst mul = multiply;\n\n/**\n * Sets the translation component of a 3-by-3 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\nfunction setTranslation(a: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? identity()) as T;\n if (a !== newDst) {\n newDst[ 0] = a[ 0];\n newDst[ 1] = a[ 1];\n newDst[ 2] = a[ 2];\n newDst[ 4] = a[ 4];\n newDst[ 5] = a[ 5];\n newDst[ 6] = a[ 6];\n }\n newDst[ 8] = v[0];\n newDst[ 9] = v[1];\n newDst[10] = 1;\n return newDst;\n}\n\n/**\n * Returns the translation component of a 3-by-3 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\nfunction getTranslation(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec2.create()) as T;\n newDst[0] = m[8];\n newDst[1] = m[9];\n return newDst;\n}\n\n/**\n * Returns an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y,\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat3Arg, axis: number, dst?: T) {\n const newDst = (dst ?? vec2.create()) as T;\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n return newDst;\n}\n\n/**\n * Sets an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\nfunction setAxis(m: Mat3Arg, v: Vec2Arg, axis: number, dst?: T) {\n const newDst = (dst === m ? m : copy(m, dst)) as T;\n\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n return newDst;\n}\n\n/**\n * Returns the \"2d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec2.create());\n\n const xx = m[0];\n const xy = m[1];\n const yx = m[4];\n const yy = m[5];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy);\n newDst[1] = Math.sqrt(yx * yx + yy * yy);\n\n return newDst;\n}\n\n\n/**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction get3DScaling(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec3.create());\n\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which translates by the given vector v.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\nfunction translation(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = v[0]; newDst[ 9] = v[1]; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Translates the given 3-by-3 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\nfunction translate(m: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 0] = m00;\n newDst[ 1] = m01;\n newDst[ 2] = m02;\n newDst[ 4] = m10;\n newDst[ 5] = m11;\n newDst[ 6] = m12;\n }\n\n newDst[ 8] = m00 * v0 + m10 * v1 + m20;\n newDst[ 9] = m01 * v0 + m11 * v1 + m21;\n newDst[10] = m02 * v0 + m12 * v1 + m22;\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotation(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = s; newDst[ 2] = 0;\n newDst[ 4] = -s; newDst[ 5] = c; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix by the given angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotate(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 + s * m10;\n newDst[ 1] = c * m01 + s * m11;\n newDst[ 2] = c * m02 + s * m12;\n\n newDst[ 4] = c * m10 - s * m00;\n newDst[ 5] = c * m11 - s * m01;\n newDst[ 6] = c * m12 - s * m02;\n\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the x-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationX(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = c; newDst[ 6] = s;\n newDst[ 8] = 0; newDst[ 9] = -s; newDst[10] = c;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix around the x-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateX(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[4] = c * m10 + s * m20;\n newDst[5] = c * m11 + s * m21;\n newDst[6] = c * m12 + s * m22;\n newDst[8] = c * m20 - s * m10;\n newDst[9] = c * m21 - s * m11;\n newDst[10] = c * m22 - s * m12;\n\n if (m !== newDst) {\n newDst[ 0] = m[ 0];\n newDst[ 1] = m[ 1];\n newDst[ 2] = m[ 2];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the y-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationY(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = 0; newDst[ 2] = -s;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = s; newDst[ 9] = 0; newDst[10] = c;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix around the y-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateY(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 - s * m20;\n newDst[ 1] = c * m01 - s * m21;\n newDst[ 2] = c * m02 - s * m22;\n newDst[ 8] = c * m20 + s * m00;\n newDst[ 9] = c * m21 + s * m01;\n newDst[10] = c * m22 + s * m02;\n\n if (m !== newDst) {\n newDst[ 4] = m[ 4];\n newDst[ 5] = m[ 5];\n newDst[ 6] = m[ 6];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the z-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nconst rotationZ = rotation;\n\n/**\n * Rotates the given 3-by-3 matrix around the z-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nconst rotateZ = rotate;\n\n/**\n * Creates a 3-by-3 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has two\n * entries.\n * @param v - A vector of\n * 2 entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * two entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of 2 entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale(m: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * 3 entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling3D(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = v[2];\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of 3 entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale3D(m: Mat3Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n\n newDst[ 8] = v2 * m[2 * 4 + 0];\n newDst[ 9] = v2 * m[2 * 4 + 1];\n newDst[10] = v2 * m[2 * 4 + 2];\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales uniformly in the X and Y dimensions\n * @param s - Amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in the X and Y dimension by an amount\n * given.\n * @param m - The matrix to be modified.\n * @param s - Amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale(m: Mat3Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales uniformly in each dimension\n * @param s - Amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling3D(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = s;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given.\n * @param m - The matrix to be modified.\n * @param s - Amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale3D(m: Mat3Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n\n newDst[ 8] = s * m[2 * 4 + 0];\n newDst[ 9] = s * m[2 * 4 + 1];\n newDst[10] = s * m[2 * 4 + 2];\n\n return newDst;\n}\n\nreturn {\n clone,\n create,\n set,\n fromMat4,\n fromQuat,\n negate,\n copy,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n invert,\n determinant,\n mul,\n multiply,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n get3DScaling,\n translation,\n translate,\n rotation,\n rotate,\n rotationX,\n rotateX,\n rotationY,\n rotateY,\n rotationZ,\n rotateZ,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n scaling3D,\n scale3D,\n uniformScaling3D,\n uniformScale3D,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Mat3Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","import { Mat4Arg, Mat4Type } from './mat4';\nimport { Mat3Arg } from './mat3';\nimport { QuatArg } from './quat';\nimport { Vec3Arg } from './vec3';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\nimport * as utils from './utils';\n\nexport { Mat4Arg, Mat4Type };\n\ntype Mat4Ctor = new (n: number) => T;\n\n/**\n * Generates a typed API for Mat4\n * */\nfunction getAPIImpl(Ctor: Mat4Ctor) {\n const vec3 = getVec3API(Ctor);\n\n/**\n * 4x4 Matrix math math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new matrix. In other words you can do this\n *\n * const mat = mat4.translation([1, 2, 3]); // Creates a new translation matrix\n *\n * or\n *\n * const mat = mat4.create();\n * mat4.translation([1, 2, 3], mat); // Puts translation matrix in mat.\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always save to pass any matrix as the destination. So for example\n *\n * const mat = mat4.identity();\n * const trans = mat4.translation([1, 2, 3]);\n * mat4.multiply(mat, trans, mat); // Multiplies mat * trans and puts result in mat.\n *\n */\n\n\n/**\n * Create a Mat4 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat4's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat4.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @returns created from values.\n */\nfunction create(\n v0?: number, v1?: number, v2?: number, v3?: number,\n v4?: number, v5?: number, v6?: number, v7?: number,\n v8?: number, v9?: number, v10?: number, v11?: number,\n v12?: number, v13?: number, v14?: number, v15?: number) {\n const newDst = new Ctor(16);\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[3] = v3;\n if (v4 !== undefined) {\n newDst[4] = v4;\n if (v5 !== undefined) {\n newDst[5] = v5;\n if (v6 !== undefined) {\n newDst[6] = v6;\n if (v7 !== undefined) {\n newDst[7] = v7;\n if (v8 !== undefined) {\n newDst[8] = v8;\n if (v9 !== undefined) {\n newDst[9] = v9;\n if (v10 !== undefined) {\n newDst[10] = v10;\n if (v11 !== undefined) {\n newDst[11] = v11;\n if (v12 !== undefined) {\n newDst[12] = v12;\n if (v13 !== undefined) {\n newDst[13] = v13;\n if (v14 !== undefined) {\n newDst[14] = v14;\n if (v15 !== undefined) {\n newDst[15] = v15;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Sets the values of a Mat4\n * Also see {@link mat4.create} and {@link mat4.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 created from values.\n */\nfunction set(\n v0: number, v1: number, v2: number, v3: number,\n v4: number, v5: number, v6: number, v7: number,\n v8: number, v9: number, v10: number, v11: number,\n v12: number, v13: number, v14: number, v15: number,\n dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = v0; newDst[ 1] = v1; newDst[ 2] = v2; newDst[ 3] = v3;\n newDst[ 4] = v4; newDst[ 5] = v5; newDst[ 6] = v6; newDst[ 7] = v7;\n newDst[ 8] = v8; newDst[ 9] = v9; newDst[10] = v10; newDst[11] = v11;\n newDst[12] = v12; newDst[13] = v13; newDst[14] = v14; newDst[15] = v15;\n\n return newDst;\n}\n\n/**\n * Creates a Mat4 from a Mat3\n * @param m3 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from m3\n */\nfunction fromMat3(m3: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = m3[0]; newDst[ 1] = m3[1]; newDst[ 2] = m3[ 2]; newDst[ 3] = 0;\n newDst[ 4] = m3[4]; newDst[ 5] = m3[5]; newDst[ 6] = m3[ 6]; newDst[ 7] = 0;\n newDst[ 8] = m3[8]; newDst[ 9] = m3[9]; newDst[10] = m3[10]; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a Mat4 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from q\n */\nfunction fromQuat(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3];\n const x2 = x + x; const y2 = y + y; const z2 = z + z;\n\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n newDst[ 0] = 1 - yy - zz; newDst[ 1] = yx + wz; newDst[ 2] = zx - wy; newDst[ 3] = 0;\n newDst[ 4] = yx - wz; newDst[ 5] = 1 - xx - zz; newDst[ 6] = zy + wx; newDst[ 7] = 0;\n newDst[ 8] = zx + wy; newDst[ 9] = zy - wx; newDst[10] = 1 - xx - yy; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\nfunction negate(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = -m[ 0]; newDst[ 1] = -m[ 1]; newDst[ 2] = -m[ 2]; newDst[ 3] = -m[ 3];\n newDst[ 4] = -m[ 4]; newDst[ 5] = -m[ 5]; newDst[ 6] = -m[ 6]; newDst[ 7] = -m[ 7];\n newDst[ 8] = -m[ 8]; newDst[ 9] = -m[ 9]; newDst[10] = -m[10]; newDst[11] = -m[11];\n newDst[12] = -m[12]; newDst[13] = -m[13]; newDst[14] = -m[14]; newDst[15] = -m[15];\n\n return newDst;\n}\n\n/**\n * Copies a matrix. (same as {@link mat4.clone})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nfunction copy(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = m[ 0]; newDst[ 1] = m[ 1]; newDst[ 2] = m[ 2]; newDst[ 3] = m[ 3];\n newDst[ 4] = m[ 4]; newDst[ 5] = m[ 5]; newDst[ 6] = m[ 6]; newDst[ 7] = m[ 7];\n newDst[ 8] = m[ 8]; newDst[ 9] = m[ 9]; newDst[10] = m[10]; newDst[11] = m[11];\n newDst[12] = m[12]; newDst[13] = m[13]; newDst[14] = m[14]; newDst[15] = m[15];\n\n return newDst;\n}\n\n/**\n * Copies a matrix (same as {@link mat4.copy})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nconst clone = copy;\n\n/**\n * Check if 2 matrices are approximately equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are approximately equal\n */\nfunction equalsApproximately(a: Mat4Arg, b: Mat4Arg): boolean {\n return Math.abs(a[ 0] - b[ 0]) < utils.EPSILON &&\n Math.abs(a[ 1] - b[ 1]) < utils.EPSILON &&\n Math.abs(a[ 2] - b[ 2]) < utils.EPSILON &&\n Math.abs(a[ 3] - b[ 3]) < utils.EPSILON &&\n Math.abs(a[ 4] - b[ 4]) < utils.EPSILON &&\n Math.abs(a[ 5] - b[ 5]) < utils.EPSILON &&\n Math.abs(a[ 6] - b[ 6]) < utils.EPSILON &&\n Math.abs(a[ 7] - b[ 7]) < utils.EPSILON &&\n Math.abs(a[ 8] - b[ 8]) < utils.EPSILON &&\n Math.abs(a[ 9] - b[ 9]) < utils.EPSILON &&\n Math.abs(a[10] - b[10]) < utils.EPSILON &&\n Math.abs(a[11] - b[11]) < utils.EPSILON &&\n Math.abs(a[12] - b[12]) < utils.EPSILON &&\n Math.abs(a[13] - b[13]) < utils.EPSILON &&\n Math.abs(a[14] - b[14]) < utils.EPSILON &&\n Math.abs(a[15] - b[15]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 matrices are exactly equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are exactly equal\n */\nfunction equals(a: Mat4Arg, b: Mat4Arg): boolean {\n return a[ 0] === b[ 0] &&\n a[ 1] === b[ 1] &&\n a[ 2] === b[ 2] &&\n a[ 3] === b[ 3] &&\n a[ 4] === b[ 4] &&\n a[ 5] === b[ 5] &&\n a[ 6] === b[ 6] &&\n a[ 7] === b[ 7] &&\n a[ 8] === b[ 8] &&\n a[ 9] === b[ 9] &&\n a[10] === b[10] &&\n a[11] === b[11] &&\n a[12] === b[12] &&\n a[13] === b[13] &&\n a[14] === b[14] &&\n a[15] === b[15];\n}\n\n/**\n * Creates a 4-by-4 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 4-by-4 identity matrix.\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\nfunction transpose(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n if (newDst === m) {\n let t;\n\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n\n t = m[3];\n m[3] = m[12];\n m[12] = t;\n\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n\n t = m[7];\n m[7] = m[13];\n m[13] = t;\n\n t = m[11];\n m[11] = m[14];\n m[14] = t;\n return newDst;\n }\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n newDst[ 0] = m00; newDst[ 1] = m10; newDst[ 2] = m20; newDst[ 3] = m30;\n newDst[ 4] = m01; newDst[ 5] = m11; newDst[ 6] = m21; newDst[ 7] = m31;\n newDst[ 8] = m02; newDst[ 9] = m12; newDst[10] = m22; newDst[11] = m32;\n newDst[12] = m03; newDst[13] = m13; newDst[14] = m23; newDst[15] = m33;\n\n return newDst;\n}\n\n/**\n * Computes the inverse of a 4-by-4 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nfunction inverse(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n const tmp12 = m20 * m31;\n const tmp13 = m30 * m21;\n const tmp14 = m10 * m31;\n const tmp15 = m30 * m11;\n const tmp16 = m10 * m21;\n const tmp17 = m20 * m11;\n const tmp18 = m00 * m31;\n const tmp19 = m30 * m01;\n const tmp20 = m00 * m21;\n const tmp21 = m20 * m01;\n const tmp22 = m00 * m11;\n const tmp23 = m10 * m01;\n\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n\n const d = 1 / (m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3);\n\n newDst[ 0] = d * t0;\n newDst[ 1] = d * t1;\n newDst[ 2] = d * t2;\n newDst[ 3] = d * t3;\n newDst[ 4] = d * ((tmp1 * m10 + tmp2 * m20 + tmp5 * m30) -\n (tmp0 * m10 + tmp3 * m20 + tmp4 * m30));\n newDst[ 5] = d * ((tmp0 * m00 + tmp7 * m20 + tmp8 * m30) -\n (tmp1 * m00 + tmp6 * m20 + tmp9 * m30));\n newDst[ 6] = d * ((tmp3 * m00 + tmp6 * m10 + tmp11 * m30) -\n (tmp2 * m00 + tmp7 * m10 + tmp10 * m30));\n newDst[ 7] = d * ((tmp4 * m00 + tmp9 * m10 + tmp10 * m20) -\n (tmp5 * m00 + tmp8 * m10 + tmp11 * m20));\n newDst[ 8] = d * ((tmp12 * m13 + tmp15 * m23 + tmp16 * m33) -\n (tmp13 * m13 + tmp14 * m23 + tmp17 * m33));\n newDst[ 9] = d * ((tmp13 * m03 + tmp18 * m23 + tmp21 * m33) -\n (tmp12 * m03 + tmp19 * m23 + tmp20 * m33));\n newDst[10] = d * ((tmp14 * m03 + tmp19 * m13 + tmp22 * m33) -\n (tmp15 * m03 + tmp18 * m13 + tmp23 * m33));\n newDst[11] = d * ((tmp17 * m03 + tmp20 * m13 + tmp23 * m23) -\n (tmp16 * m03 + tmp21 * m13 + tmp22 * m23));\n newDst[12] = d * ((tmp14 * m22 + tmp17 * m32 + tmp13 * m12) -\n (tmp16 * m32 + tmp12 * m12 + tmp15 * m22));\n newDst[13] = d * ((tmp20 * m32 + tmp12 * m02 + tmp19 * m22) -\n (tmp18 * m22 + tmp21 * m32 + tmp13 * m02));\n newDst[14] = d * ((tmp18 * m12 + tmp23 * m32 + tmp15 * m02) -\n (tmp22 * m32 + tmp14 * m02 + tmp19 * m12));\n newDst[15] = d * ((tmp22 * m22 + tmp16 * m02 + tmp21 * m12) -\n (tmp20 * m12 + tmp23 * m22 + tmp17 * m02));\n\n return newDst;\n}\n\n/**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\nfunction determinant(m: Mat4Arg): number {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n\n return m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3;\n}\n\n/**\n * Computes the inverse of a 4-by-4 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nconst invert = inverse;\n\n/**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nfunction multiply(a: Mat4Arg, b: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[ 4 + 0];\n const a11 = a[ 4 + 1];\n const a12 = a[ 4 + 2];\n const a13 = a[ 4 + 3];\n const a20 = a[ 8 + 0];\n const a21 = a[ 8 + 1];\n const a22 = a[ 8 + 2];\n const a23 = a[ 8 + 3];\n const a30 = a[12 + 0];\n const a31 = a[12 + 1];\n const a32 = a[12 + 2];\n const a33 = a[12 + 3];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b03 = b[3];\n const b10 = b[ 4 + 0];\n const b11 = b[ 4 + 1];\n const b12 = b[ 4 + 2];\n const b13 = b[ 4 + 3];\n const b20 = b[ 8 + 0];\n const b21 = b[ 8 + 1];\n const b22 = b[ 8 + 2];\n const b23 = b[ 8 + 3];\n const b30 = b[12 + 0];\n const b31 = b[12 + 1];\n const b32 = b[12 + 2];\n const b33 = b[12 + 3];\n\n newDst[ 0] = a00 * b00 + a10 * b01 + a20 * b02 + a30 * b03;\n newDst[ 1] = a01 * b00 + a11 * b01 + a21 * b02 + a31 * b03;\n newDst[ 2] = a02 * b00 + a12 * b01 + a22 * b02 + a32 * b03;\n newDst[ 3] = a03 * b00 + a13 * b01 + a23 * b02 + a33 * b03;\n newDst[ 4] = a00 * b10 + a10 * b11 + a20 * b12 + a30 * b13;\n newDst[ 5] = a01 * b10 + a11 * b11 + a21 * b12 + a31 * b13;\n newDst[ 6] = a02 * b10 + a12 * b11 + a22 * b12 + a32 * b13;\n newDst[ 7] = a03 * b10 + a13 * b11 + a23 * b12 + a33 * b13;\n newDst[ 8] = a00 * b20 + a10 * b21 + a20 * b22 + a30 * b23;\n newDst[ 9] = a01 * b20 + a11 * b21 + a21 * b22 + a31 * b23;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22 + a32 * b23;\n newDst[11] = a03 * b20 + a13 * b21 + a23 * b22 + a33 * b23;\n newDst[12] = a00 * b30 + a10 * b31 + a20 * b32 + a30 * b33;\n newDst[13] = a01 * b30 + a11 * b31 + a21 * b32 + a31 * b33;\n newDst[14] = a02 * b30 + a12 * b31 + a22 * b32 + a32 * b33;\n newDst[15] = a03 * b30 + a13 * b31 + a23 * b32 + a33 * b33;\n\n return newDst;\n}\n\n/**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nconst mul = multiply;\n\n/**\n * Sets the translation component of a 4-by-4 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\nfunction setTranslation(a: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? identity()) as T;\n if (a !== newDst) {\n newDst[ 0] = a[ 0];\n newDst[ 1] = a[ 1];\n newDst[ 2] = a[ 2];\n newDst[ 3] = a[ 3];\n newDst[ 4] = a[ 4];\n newDst[ 5] = a[ 5];\n newDst[ 6] = a[ 6];\n newDst[ 7] = a[ 7];\n newDst[ 8] = a[ 8];\n newDst[ 9] = a[ 9];\n newDst[10] = a[10];\n newDst[11] = a[11];\n }\n newDst[12] = v[0];\n newDst[13] = v[1];\n newDst[14] = v[2];\n newDst[15] = 1;\n return newDst;\n}\n\n///**\n// * Returns the translation component of a 4-by-4 matrix as a vector with 3\n// * entries.\n// * @param m - The matrix.\n// * @param dst - vector to hold result. If not passed a new one is created.\n// * @returns The translation component of m.\n// */\nfunction getTranslation(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? vec3.create()) as T;\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n}\n\n/**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat4Arg, axis: number, dst?: T) {\n const newDst = (dst ?? vec3.create());\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n}\n\n/**\n * Sets an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\nfunction setAxis(m: Mat4Arg, v: Vec3Arg, axis: number, dst: T) {\n const newDst = (dst === m) ? dst : copy(m, dst);\n\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n newDst[off + 2] = v[2];\n return newDst;\n}\n\n/**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? vec3.create()) as T;\n\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 0 to 1 in the z dimension.\n *\n * Note: If you pass `Infinity` for zFar then it will produce a projection matrix\n * returns -Infinity for Z when transforming coordinates with Z <= 0 and +Infinity for Z\n * otherwise.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */\nfunction perspective(fieldOfViewYInRadians: number, aspect: number, zNear: number, zFar: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const f = Math.tan(Math.PI * 0.5 - 0.5 * fieldOfViewYInRadians);\n\n newDst[0] = f / aspect;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n newDst[4] = 0;\n newDst[5] = f;\n newDst[6] = 0;\n newDst[7] = 0;\n\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[11] = -1;\n\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (Number.isFinite(zFar)) {\n const rangeInv = 1 / (zNear - zFar);\n newDst[10] = zFar * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n } else {\n newDst[10] = -1;\n newDst[14] = -zNear;\n }\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 1 (at -zNear) to 0 (at -zFar) in the z dimension.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane. (default = Infinity)\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */function perspectiveReverseZ(fieldOfViewYInRadians: number, aspect: number, zNear: number, zFar = Infinity, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const f = 1 / Math.tan(fieldOfViewYInRadians * 0.5);\n\n newDst[ 0] = f / aspect;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n\n newDst[ 4] = 0;\n newDst[ 5] = f;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n\n newDst[ 8] = 0;\n newDst[ 9] = 0;\n newDst[11] = -1;\n\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (zFar === Infinity) {\n newDst[10] = 0;\n newDst[14] = zNear;\n } else {\n const rangeInv = 1 / (zFar - zNear);\n newDst[10] = zNear * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n }\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 orthogonal transformation matrix that transforms from\n * the given the left, right, bottom, and top dimensions to -1 +1 in x, and y\n * and 0 to +1 in z.\n * @param left - Left side of the near clipping plane viewport.\n * @param right - Right side of the near clipping plane viewport.\n * @param bottom - Bottom of the near clipping plane viewport.\n * @param top - Top of the near clipping plane viewport.\n * @param near - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param far - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The orthographic projection matrix.\n */\nfunction ortho(left: number, right: number, bottom: number, top: number, near: number, far: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[0] = 2 / (right - left);\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n newDst[4] = 0;\n newDst[5] = 2 / (top - bottom);\n newDst[6] = 0;\n newDst[7] = 0;\n\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[10] = 1 / (near - far);\n newDst[11] = 0;\n\n newDst[12] = (right + left) / (left - right);\n newDst[13] = (top + bottom) / (bottom - top);\n newDst[14] = near / (near - far);\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 0 to 1 in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\nfunction frustum(left: number, right: number, bottom: number, top: number, near: number, far: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const dx = (right - left);\n const dy = (top - bottom);\n const dz = (near - far);\n\n newDst[ 0] = 2 * near / dx;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n newDst[ 4] = 0;\n newDst[ 5] = 2 * near / dy;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n newDst[ 8] = (left + right) / dx;\n newDst[ 9] = (top + bottom) / dy;\n newDst[10] = far / dz;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = near * far / dz;\n newDst[15] = 0;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 1 (-near) to 0 (-far) in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\nfunction frustumReverseZ(left: number, right: number, bottom: number, top: number, near: number, far = Infinity, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const dx = (right - left);\n const dy = (top - bottom);\n\n newDst[ 0] = 2 * near / dx;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n newDst[ 4] = 0;\n newDst[ 5] = 2 * near / dy;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n newDst[ 8] = (left + right) / dx;\n newDst[ 9] = (top + bottom) / dy;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (far === Infinity) {\n newDst[10] = 0;\n newDst[14] = near;\n } else {\n const rangeInv = 1 / (far - near);\n newDst[10] = near * rangeInv;\n newDst[14] = far * near * rangeInv;\n }\n\n return newDst;\n}\n\nconst xAxis = vec3.create();\nconst yAxis = vec3.create();\nconst zAxis = vec3.create();\n\n/**\n * Computes a 4-by-4 aim transformation.\n *\n * This is a matrix which positions an object aiming down positive Z.\n * toward the target.\n *\n * Note: this is **NOT** the inverse of lookAt as lookAt looks at negative Z.\n *\n * @param position - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\nfunction aim(position: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(target, position, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = xAxis[1]; newDst[ 2] = xAxis[2]; newDst[ 3] = 0;\n newDst[ 4] = yAxis[0]; newDst[ 5] = yAxis[1]; newDst[ 6] = yAxis[2]; newDst[ 7] = 0;\n newDst[ 8] = zAxis[0]; newDst[ 9] = zAxis[1]; newDst[10] = zAxis[2]; newDst[11] = 0;\n newDst[12] = position[0]; newDst[13] = position[1]; newDst[14] = position[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 camera aim transformation.\n *\n * This is a matrix which positions an object aiming down negative Z.\n * toward the target.\n *\n * Note: this is the inverse of `lookAt`\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\nfunction cameraAim(eye: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = xAxis[1]; newDst[ 2] = xAxis[2]; newDst[ 3] = 0;\n newDst[ 4] = yAxis[0]; newDst[ 5] = yAxis[1]; newDst[ 6] = yAxis[2]; newDst[ 7] = 0;\n newDst[ 8] = zAxis[0]; newDst[ 9] = zAxis[1]; newDst[10] = zAxis[2]; newDst[11] = 0;\n newDst[12] = eye[0]; newDst[13] = eye[1]; newDst[14] = eye[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 view transformation.\n *\n * This is a view matrix which transforms all other objects\n * to be in the space of the view defined by the parameters.\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The look-at matrix.\n */\nfunction lookAt(eye: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = yAxis[0]; newDst[ 2] = zAxis[0]; newDst[ 3] = 0;\n newDst[ 4] = xAxis[1]; newDst[ 5] = yAxis[1]; newDst[ 6] = zAxis[1]; newDst[ 7] = 0;\n newDst[ 8] = xAxis[2]; newDst[ 9] = yAxis[2]; newDst[10] = zAxis[2]; newDst[11] = 0;\n\n newDst[12] = -(xAxis[0] * eye[0] + xAxis[1] * eye[1] + xAxis[2] * eye[2]);\n newDst[13] = -(yAxis[0] * eye[0] + yAxis[1] * eye[1] + yAxis[2] * eye[2]);\n newDst[14] = -(zAxis[0] * eye[0] + zAxis[1] * eye[1] + zAxis[2] * eye[2]);\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which translates by the given vector v.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\nfunction translation(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = v[0]; newDst[13] = v[1]; newDst[14] = v[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Translates the given 4-by-4 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\nfunction translate(m: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n if (m !== newDst) {\n newDst[ 0] = m00;\n newDst[ 1] = m01;\n newDst[ 2] = m02;\n newDst[ 3] = m03;\n newDst[ 4] = m10;\n newDst[ 5] = m11;\n newDst[ 6] = m12;\n newDst[ 7] = m13;\n newDst[ 8] = m20;\n newDst[ 9] = m21;\n newDst[10] = m22;\n newDst[11] = m23;\n }\n\n newDst[12] = m00 * v0 + m10 * v1 + m20 * v2 + m30;\n newDst[13] = m01 * v0 + m11 * v1 + m21 * v2 + m31;\n newDst[14] = m02 * v0 + m12 * v1 + m22 * v2 + m32;\n newDst[15] = m03 * v0 + m13 * v1 + m23 * v2 + m33;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the x-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationX(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = c; newDst[ 6] = s; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = -s; newDst[10] = c; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the x-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateX(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[4] = c * m10 + s * m20;\n newDst[5] = c * m11 + s * m21;\n newDst[6] = c * m12 + s * m22;\n newDst[7] = c * m13 + s * m23;\n newDst[8] = c * m20 - s * m10;\n newDst[9] = c * m21 - s * m11;\n newDst[10] = c * m22 - s * m12;\n newDst[11] = c * m23 - s * m13;\n\n if (m !== newDst) {\n newDst[ 0] = m[ 0];\n newDst[ 1] = m[ 1];\n newDst[ 2] = m[ 2];\n newDst[ 3] = m[ 3];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the y-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationY(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = 0; newDst[ 2] = -s; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = s; newDst[ 9] = 0; newDst[10] = c; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the y-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateY(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 - s * m20;\n newDst[ 1] = c * m01 - s * m21;\n newDst[ 2] = c * m02 - s * m22;\n newDst[ 3] = c * m03 - s * m23;\n newDst[ 8] = c * m20 + s * m00;\n newDst[ 9] = c * m21 + s * m01;\n newDst[10] = c * m22 + s * m02;\n newDst[11] = c * m23 + s * m03;\n\n if (m !== newDst) {\n newDst[ 4] = m[ 4];\n newDst[ 5] = m[ 5];\n newDst[ 6] = m[ 6];\n newDst[ 7] = m[ 7];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the z-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationZ(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = s; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = -s; newDst[ 5] = c; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the z-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateZ(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 + s * m10;\n newDst[ 1] = c * m01 + s * m11;\n newDst[ 2] = c * m02 + s * m12;\n newDst[ 3] = c * m03 + s * m13;\n newDst[ 4] = c * m10 - s * m00;\n newDst[ 5] = c * m11 - s * m01;\n newDst[ 6] = c * m12 - s * m02;\n newDst[ 7] = c * m13 - s * m03;\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n newDst[11] = m[11];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\nfunction axisRotation(axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n\n newDst[ 0] = xx + (1 - xx) * c;\n newDst[ 1] = x * y * oneMinusCosine + z * s;\n newDst[ 2] = x * z * oneMinusCosine - y * s;\n newDst[ 3] = 0;\n newDst[ 4] = x * y * oneMinusCosine - z * s;\n newDst[ 5] = yy + (1 - yy) * c;\n newDst[ 6] = y * z * oneMinusCosine + x * s;\n newDst[ 7] = 0;\n newDst[ 8] = x * z * oneMinusCosine + y * s;\n newDst[ 9] = y * z * oneMinusCosine - x * s;\n newDst[10] = zz + (1 - zz) * c;\n newDst[11] = 0;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = 0;\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle. (same as axisRotation)\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\nconst rotation = axisRotation;\n\n/**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle.\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction axisRotate(m: Mat4Arg, axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n\n const r00 = xx + (1 - xx) * c;\n const r01 = x * y * oneMinusCosine + z * s;\n const r02 = x * z * oneMinusCosine - y * s;\n const r10 = x * y * oneMinusCosine - z * s;\n const r11 = yy + (1 - yy) * c;\n const r12 = y * z * oneMinusCosine + x * s;\n const r20 = x * z * oneMinusCosine + y * s;\n const r21 = y * z * oneMinusCosine - x * s;\n const r22 = zz + (1 - zz) * c;\n\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n\n newDst[ 0] = r00 * m00 + r01 * m10 + r02 * m20;\n newDst[ 1] = r00 * m01 + r01 * m11 + r02 * m21;\n newDst[ 2] = r00 * m02 + r01 * m12 + r02 * m22;\n newDst[ 3] = r00 * m03 + r01 * m13 + r02 * m23;\n newDst[ 4] = r10 * m00 + r11 * m10 + r12 * m20;\n newDst[ 5] = r10 * m01 + r11 * m11 + r12 * m21;\n newDst[ 6] = r10 * m02 + r11 * m12 + r12 * m22;\n newDst[ 7] = r10 * m03 + r11 * m13 + r12 * m23;\n newDst[ 8] = r20 * m00 + r21 * m10 + r22 * m20;\n newDst[ 9] = r20 * m01 + r21 * m11 + r22 * m21;\n newDst[10] = r20 * m02 + r21 * m12 + r22 * m22;\n newDst[11] = r20 * m03 + r21 * m13 + r22 * m23;\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle. (same as rotate)\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nconst rotate = axisRotate;\n\n/**\n * Creates a 4-by-4 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * three entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = v[2]; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 4-by-4 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of three entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale(m: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n newDst[ 3] = v0 * m[0 * 4 + 3];\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n newDst[ 7] = v1 * m[1 * 4 + 3];\n newDst[ 8] = v2 * m[2 * 4 + 0];\n newDst[ 9] = v2 * m[2 * 4 + 1];\n newDst[10] = v2 * m[2 * 4 + 2];\n newDst[11] = v2 * m[2 * 4 + 3];\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which scales a uniform amount in each dimension.\n * @param s - the amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = s; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 4-by-4 matrix in each dimension by a uniform scale.\n * @param m - The matrix to be modified.\n * @param s - The amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale(m: Mat4Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n newDst[ 3] = s * m[0 * 4 + 3];\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n newDst[ 7] = s * m[1 * 4 + 3];\n newDst[ 8] = s * m[2 * 4 + 0];\n newDst[ 9] = s * m[2 * 4 + 1];\n newDst[10] = s * m[2 * 4 + 2];\n newDst[11] = s * m[2 * 4 + 3];\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\nreturn {\n create,\n set,\n fromMat3,\n fromQuat,\n negate,\n copy,\n clone,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n determinant,\n invert,\n multiply,\n mul,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n perspective,\n perspectiveReverseZ,\n ortho,\n frustum,\n frustumReverseZ,\n aim,\n cameraAim,\n lookAt,\n translation,\n translate,\n rotationX,\n rotateX,\n rotationY,\n rotateY,\n rotationZ,\n rotateZ,\n axisRotation,\n rotation,\n axisRotate,\n rotate,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n};\n\n}\n\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Mat4Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { QuatArg, QuatType } from './quat';\nimport { Mat3Arg } from './mat3.js';\nimport { Mat4Arg } from './mat4.js';\nimport { Vec3Arg } from './vec3.js';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\n\nexport { QuatArg, QuatType };\n\ntype QuatCtor = new (n: number) => T;\n\nexport type RotationOrder = 'xyz' | 'xzy' | 'yxz' | 'yzx' | 'zxy' | 'zyx';\n\n/**\n * Generates am typed API for Qud\n * */\nfunction getAPIImpl(Ctor: QuatCtor) {\n const vec3 = getVec3API(Ctor);\n\n/**\n * Creates a quat4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number, w?: number) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a Quat; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Quat\n * Also see {@link quat.create} and {@link quat.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, w: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n\n return newDst;\n}\n\n/**\n * Sets a quaternion from the given angle and axis,\n * then returns it.\n *\n * @param axis - the axis to rotate around\n * @param angleInRadians - the angle\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The quaternion that represents the given axis and angle\n **/\nfunction fromAxisAngle(axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n const s = Math.sin(halfAngle);\n\n newDst[0] = s * axis[0];\n newDst[1] = s * axis[1];\n newDst[2] = s * axis[2];\n newDst[3] = Math.cos(halfAngle);\n\n return newDst;\n}\n\n/**\n * Gets the rotation axis and angle\n * @param q - quaternion to compute from\n * @param dst - Vec3 to hold result. If not passed in a new one is created.\n * @return angle and axis\n */\nfunction toAxisAngle(q: QuatArg, dst?: T): { angle: number, axis: T } {\n const newDst = (dst ?? vec3.create(3)) as T;\n\n const angle = Math.acos(q[3]) * 2;\n const s = Math.sin(angle * 0.5);\n if (s > utils.EPSILON) {\n newDst[0] = q[0] / s;\n newDst[1] = q[1] / s;\n newDst[2] = q[2] / s;\n } else {\n newDst[0] = 1;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n\n return { angle, axis: newDst };\n}\n\n/**\n * Returns the angle in degrees between two rotations a and b.\n * @param a - quaternion a\n * @param b - quaternion b\n * @return angle in radians between the two quaternions\n */\nfunction angle(a: QuatArg, b: QuatArg) {\n const d = dot(a, b);\n return Math.acos(2 * d * d - 1);\n}\n\n/**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction multiply(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const bw = b[3];\n\n newDst[0] = ax * bw + aw * bx + ay * bz - az * by;\n newDst[1] = ay * bw + aw * by + az * bx - ax * bz;\n newDst[2] = az * bw + aw * bz + ax * by - ay * bx;\n newDst[3] = aw * bw - ax * bx - ay * by - az * bz;\n\n return newDst;\n}\n\n/**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nconst mul = multiply;\n\n/**\n * Rotates the given quaternion around the X axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateX(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const bx = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw + qw * bx;\n newDst[1] = qy * bw + qz * bx;\n newDst[2] = qz * bw - qy * bx;\n newDst[3] = qw * bw - qx * bx;\n\n return newDst;\n}\n\n/**\n * Rotates the given quaternion around the Y axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateY(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const by = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw - qz * by;\n newDst[1] = qy * bw + qw * by;\n newDst[2] = qz * bw + qx * by;\n newDst[3] = qw * bw - qy * by;\n\n return newDst;\n}\n\n/**\n * Rotates the given quaternion around the Z axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateZ(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const bz = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw + qy * bz;\n newDst[1] = qy * bw - qx * bz;\n newDst[2] = qz * bw + qw * bz;\n newDst[3] = qw * bw - qz * bz;\n\n return newDst;\n}\n\n/**\n * Spherically linear interpolate between two quaternions\n *\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction slerp(a: QuatArg, b: QuatArg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n\n let bx = b[0];\n let by = b[1];\n let bz = b[2];\n let bw = b[3];\n\n let cosOmega = ax * bx + ay * by + az * bz + aw * bw;\n\n if (cosOmega < 0) {\n cosOmega = -cosOmega;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n\n let scale0;\n let scale1;\n\n if (1.0 - cosOmega > utils.EPSILON) {\n const omega = Math.acos(cosOmega);\n const sinOmega = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinOmega;\n scale1 = Math.sin(t * omega) / sinOmega;\n } else {\n scale0 = 1.0 - t;\n scale1 = t;\n }\n\n newDst[0] = scale0 * ax + scale1 * bx;\n newDst[1] = scale0 * ay + scale1 * by;\n newDst[2] = scale0 * az + scale1 * bz;\n newDst[3] = scale0 * aw + scale1 * bw;\n\n return newDst;\n}\n\n/**\n * Compute the inverse of a quaternion\n *\n * @param q - quaternion to compute the inverse of\n * @returns A quaternion that is the result of a * b\n */\nfunction inverse(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const a0 = q[0];\n const a1 = q[1];\n const a2 = q[2];\n const a3 = q[3];\n\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n\n newDst[0] = -a0 * invDot;\n newDst[1] = -a1 * invDot;\n newDst[2] = -a2 * invDot;\n newDst[3] = a3 * invDot;\n\n return newDst;\n}\n\n/**\n * Compute the conjugate of a quaternion\n * For quaternions with a magnitude of 1 (a unit quaternion)\n * this returns the same as the inverse but is faster to calculate.\n *\n * @param q - quaternion to compute the conjugate of.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The conjugate of q\n */\nfunction conjugate(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = -q[0];\n newDst[1] = -q[1];\n newDst[2] = -q[2];\n newDst[3] = q[3];\n\n return newDst;\n}\n\n/**\n * Creates a quaternion from the given rotation matrix.\n *\n * The created quaternion is not normalized.\n *\n * @param m - rotation matrix\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\nfunction fromMat(m: Mat3Arg | Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n /*\n 0 1 2\n 3 4 5\n 6 7 8\n\n 0 1 2\n 4 5 6\n 8 9 10\n */\n\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n const trace = m[0] + m[5] + m[10];\n\n if (trace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n const root = Math.sqrt(trace + 1); // 2w\n newDst[3] = 0.5 * root;\n const invRoot = 0.5 / root; // 1/(4w)\n\n newDst[0] = (m[6] - m[9]) * invRoot;\n newDst[1] = (m[8] - m[2]) * invRoot;\n newDst[2] = (m[1] - m[4]) * invRoot;\n } else {\n // |w| <= 1/2\n let i = 0;\n\n if (m[5] > m[0]) {\n i = 1;\n }\n if (m[10] > m[i * 4 + i]) {\n i = 2;\n }\n\n const j = (i + 1) % 3;\n const k = (i + 2) % 3;\n\n const root = Math.sqrt(m[i * 4 + i] - m[j * 4 + j] - m[k * 4 + k] + 1.0);\n newDst[i] = 0.5 * root;\n\n const invRoot = 0.5 / root;\n\n newDst[3] = (m[j * 4 + k] - m[k * 4 + j]) * invRoot;\n newDst[j] = (m[j * 4 + i] + m[i * 4 + j]) * invRoot;\n newDst[k] = (m[k * 4 + i] + m[i * 4 + k]) * invRoot;\n }\n\n return newDst;\n}\n\n/**\n * Creates a quaternion from the given euler angle x, y, z using the provided intrinsic order for the conversion.\n *\n * @param xAngleInRadians - angle to rotate around X axis in radians.\n * @param yAngleInRadians - angle to rotate around Y axis in radians.\n * @param zAngleInRadians - angle to rotate around Z axis in radians.\n * @param order - order to apply euler angles\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion representing the same rotation as the euler angles applied in the given order\n */\nfunction fromEuler(\n xAngleInRadians: number,\n yAngleInRadians: number,\n zAngleInRadians: number,\n order: RotationOrder,\n dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const xHalfAngle = xAngleInRadians * 0.5;\n const yHalfAngle = yAngleInRadians * 0.5;\n const zHalfAngle = zAngleInRadians * 0.5;\n\n const sx = Math.sin(xHalfAngle);\n const cx = Math.cos(xHalfAngle);\n const sy = Math.sin(yHalfAngle);\n const cy = Math.cos(yHalfAngle);\n const sz = Math.sin(zHalfAngle);\n const cz = Math.cos(zHalfAngle);\n\n switch (order) {\n case 'xyz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'xzy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n case 'yxz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n case 'yzx':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'zxy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'zyx':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n default:\n throw new Error(`Unknown rotation order: ${order}`);\n }\n\n return newDst;\n}\n\n/**\n * Copies a quaternion. (same as {@link quat.clone})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is a copy of q\n */\nfunction copy(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = q[0];\n newDst[1] = q[1];\n newDst[2] = q[2];\n newDst[3] = q[3];\n\n return newDst;\n}\n\n/**\n * Clones a quaternion. (same as {@link quat.copy})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A copy of q.\n */\nconst clone = copy;\n\n/**\n * Adds two quaternions; assumes a and b have the same dimension.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the sum of a and b.\n */\nfunction add(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\nfunction subtract(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Multiplies a quaternion by a scalar.\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nfunction mulScalar(v: QuatArg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a quaternion by a scalar. (same as mulScalar)\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nfunction divScalar(v: QuatArg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two quaternions\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns dot product\n */\nfunction dot(a: QuatArg, b: QuatArg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n}\n\n/**\n * Performs linear interpolation on two quaternions.\n * Given quaternions a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param t - Interpolation coefficient.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: QuatArg, b: QuatArg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Computes the length of quaternion\n * @param v - quaternion.\n * @returns length of quaternion.\n */\nfunction length(v: QuatArg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n}\n\n/**\n * Computes the length of quaternion (same as length)\n * @param v - quaternion.\n * @returns length of quaternion.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of quaternion\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\nfunction lengthSq(v: QuatArg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n}\n\n/**\n * Computes the square of the length of quaternion (same as lengthSq)\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\nconst lenSq = lengthSq;\n\n/**\n * Divides a quaternion by its Euclidean length and returns the quotient.\n * @param v - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The normalized quaternion.\n */\nfunction normalize(v: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n }\n\n return newDst;\n}\n\n/**\n * Check if 2 quaternions are approximately equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are approximately equal\n */\nfunction equalsApproximately(a: QuatArg, b: QuatArg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON &&\n Math.abs(a[3] - b[3]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 quaternions are exactly equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are exactly equal\n */\nfunction equals(a: QuatArg, b: QuatArg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Creates an identity quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns an identity quaternion\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n\n return newDst;\n}\n\nconst tempVec3 = vec3.create();\nconst xUnitVec3 = vec3.create();\nconst yUnitVec3 = vec3.create();\n\n/**\n * Computes a quaternion to represent the shortest rotation from one vector to another.\n *\n * @param aUnit - the start vector\n * @param bUnit - the end vector\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\nfunction rotationTo(aUnit: Vec3Arg, bUnit: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const dot = vec3.dot(aUnit, bUnit);\n if (dot < -0.999999) {\n vec3.cross(xUnitVec3, aUnit, tempVec3);\n if (vec3.len(tempVec3) < 0.000001) {\n vec3.cross(yUnitVec3, aUnit, tempVec3);\n }\n\n vec3.normalize(tempVec3, tempVec3);\n fromAxisAngle(tempVec3, Math.PI, newDst);\n\n return newDst;\n } else if (dot > 0.999999) {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n\n return newDst;\n } else {\n vec3.cross(aUnit, bUnit, tempVec3);\n\n newDst[0] = tempVec3[0];\n newDst[1] = tempVec3[1];\n newDst[2] = tempVec3[2];\n newDst[3] = 1 + dot;\n\n return normalize(newDst, newDst);\n }\n}\n\nconst tempQuat1 = new Ctor(4);\nconst tempQuat2 = new Ctor(4);\n\n/**\n * Performs a spherical linear interpolation with two control points\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param c - the third quaternion\n * @param d - the fourth quaternion\n * @param t - Interpolation coefficient 0 to 1\n * @returns result\n */\nfunction sqlerp(\n a: QuatArg,\n b: QuatArg,\n c: QuatArg,\n d: QuatArg,\n t: number,\n dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n slerp(a, d, t, tempQuat1);\n slerp(b, c, t, tempQuat2);\n slerp(tempQuat1, tempQuat2, 2 * t * (1 - t), newDst);\n\n return newDst;\n}\n\nreturn {\n create,\n fromValues,\n set,\n fromAxisAngle,\n toAxisAngle,\n angle,\n multiply,\n mul,\n rotateX,\n rotateY,\n rotateZ,\n slerp,\n inverse,\n conjugate,\n fromMat,\n fromEuler,\n copy,\n clone,\n add,\n subtract,\n sub,\n mulScalar,\n scale,\n divScalar,\n dot,\n lerp,\n length,\n len,\n lengthSq,\n lenSq,\n normalize,\n equalsApproximately,\n equals,\n identity,\n rotationTo,\n sqlerp,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\n/**\n *\n * Quat4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Quat4`. In other words you can do this\n *\n * const v = quat4.cross(v1, v2); // Creates a new Quat4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = quat4.create();\n * quat4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * quat4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nexport function getAPI(Ctor: QuatCtor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Vec4Arg, Vec4Type } from './vec4';\nimport { Mat4Arg } from './mat4';\nimport { BaseArgType } from './types';\n\nexport { Vec4Arg, Vec4Type };\n\ntype Vec4Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec4\n * */\nfunction getAPIImpl(Ctor: Vec4Ctor) {\n\n/**\n * Creates a vec4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number, w?: number) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a vec4; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec4\n * Also see {@link vec4.create} and {@link vec4.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, w: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n newDst[3] = Math.ceil(v[3]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n newDst[3] = Math.floor(v[3]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n newDst[3] = Math.round(v[3]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec4Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n newDst[3] = Math.min(max, Math.max(min, v[3]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec4Arg, b: Vec4Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n newDst[3] = a[3] + b[3] * scale;\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec4Arg, b: Vec4Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON &&\n Math.abs(a[3] - b[3]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec4Arg, b: Vec4Arg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec4Arg, b: Vec4Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec4Arg, b: Vec4Arg, t: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n newDst[3] = a[3] + t[3] * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n newDst[3] = Math.max(a[3], b[3]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n newDst[3] = Math.min(a[3], b[3]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec4Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec4Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n newDst[3] = 1 / v[3];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the dot product of two vectors\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec4Arg, b: Vec4Arg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec4Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec4Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec4Arg, b: Vec4Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec4Arg, b: Vec4Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return dx * dx + dy * dy + dz * dz + dw * dw;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n }\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n newDst[3] = -v[3];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec4.clone})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n newDst[3] = v[3];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec4.copy})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n newDst[3] = a[3] * b[3];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n newDst[3] = a[3] / b[3];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform vec4 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec4 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec4Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = v[3];\n\n newDst[0] = m[0] * x + m[4] * y + m[ 8] * z + m[12] * w;\n newDst[1] = m[1] * x + m[5] * y + m[ 9] * z + m[13] * w;\n newDst[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n newDst[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n\n return newDst;\n}\n\n\n/**\n * Treat a 4D vector as a direction and set it's length\n *\n * @param a The vec4 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec4Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec4 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec4Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n zero,\n transformMat4,\n setLength,\n truncate,\n midpoint,\n};\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\n/**\n *\n * Vec4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Vec4`. In other words you can do this\n *\n * const v = vec4.cross(v1, v2); // Creates a new Vec4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = vec4.create();\n * vec4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * vec4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nexport function getAPI(Ctor: Vec4Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n\n","/**\n * Some docs\n * @namespace wgpu-matrix\n */\nimport {BaseArgType, ZeroArray} from './types';\nimport {Mat3Arg, Mat3Type, getAPI as getMat3API} from './mat3-impl';\nimport {Mat4Arg, Mat4Type, getAPI as getMat4API} from './mat4-impl';\nimport {QuatArg, QuatType, getAPI as getQuatAPI, RotationOrder} from './quat-impl';\nimport {Vec2Arg, Vec2Type, getAPI as getVec2API} from './vec2-impl';\nimport {Vec3Arg, Vec3Type, getAPI as getVec3API} from './vec3-impl';\nimport {Vec4Arg, Vec4Type, getAPI as getVec4API} from './vec4-impl';\nimport * as utils from './utils';\n\nexport {\n RotationOrder,\n utils,\n\n BaseArgType,\n\n Mat3Arg,\n Mat4Arg,\n QuatArg,\n Vec2Arg,\n Vec3Arg,\n Vec4Arg,\n\n Mat3Type,\n Mat4Type,\n QuatType,\n Vec2Type,\n Vec3Type,\n Vec4Type,\n};\n\nexport type BaseCtor = new (n: number) => T;\n\nexport type Mat3 = Mat3Type;\nexport type Mat4 = Mat4Type;\nexport type Quat = QuatType;\nexport type Vec2 = Vec2Type;\nexport type Vec3 = Vec3Type;\nexport type Vec4 = Vec4Type;\n\nexport type Mat3d = Mat3Type;\nexport type Mat4d = Mat4Type;\nexport type Quatd = QuatType;\nexport type Vec2d = Vec2Type;\nexport type Vec3d = Vec3Type;\nexport type Vec4d = Vec4Type;\n\nexport type Mat3n = Mat3Type;\nexport type Mat4n = Mat4Type;\nexport type Quatn = QuatType;\nexport type Vec2n = Vec2Type;\nexport type Vec3n = Vec3Type;\nexport type Vec4n = Vec4Type;\n\n/**\n * Generate wgpu-matrix API for type\n */\nfunction wgpuMatrixAPI<\n Mat3 extends BaseArgType,\n Mat4 extends BaseArgType,\n Quat extends BaseArgType,\n Vec2 extends BaseArgType,\n Vec3 extends BaseArgType,\n Vec4 extends BaseArgType,\n>(\n Mat3Ctor: BaseCtor,\n Mat4Ctor: BaseCtor,\n QuatCtor: BaseCtor,\n Vec2Ctor: BaseCtor,\n Vec3Ctor: BaseCtor,\n Vec4Ctor: BaseCtor,\n) {\n return {\n /** @namespace mat3 */\n mat3: getMat3API(Mat3Ctor),\n /** @namespace mat4 */\n mat4: getMat4API(Mat4Ctor),\n /** @namespace quat */\n quat: getQuatAPI(QuatCtor),\n /** @namespace vec2 */\n vec2: getVec2API(Vec2Ctor),\n /** @namespace vec3 */\n vec3: getVec3API(Vec3Ctor),\n /** @namespace vec4 */\n vec4: getVec4API(Vec4Ctor),\n };\n}\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat3,\n /**\n * 4x4 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat4,\n /**\n * Quaternion functions that default to returning `Float32Array`\n * @namespace\n */\n quat,\n /**\n * Vec2 functions that default to returning `Float32Array`\n * @namespace\n */\n vec2,\n /**\n * Vec3 functions that default to returning `Float32Array`\n * @namespace\n */\n vec3,\n /**\n * Vec3 functions that default to returning `Float32Array`\n * @namespace\n */\n vec4,\n} = wgpuMatrixAPI<\n Mat3, Mat4, Quat, Vec2, Vec3, Vec4>(\n Float32Array, Float32Array, Float32Array, Float32Array, Float32Array, Float32Array);\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat3: mat3d,\n /**\n * 4x4 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat4: mat4d,\n /**\n * Quaternion functions that default to returning `Float64Array`\n * @namespace\n */\n quat: quatd,\n /**\n * Vec2 functions that default to returning `Float64Array`\n * @namespace\n */\n vec2: vec2d,\n /**\n * Vec3 functions that default to returning `Float64Array`\n * @namespace\n */\n vec3: vec3d,\n /**\n * Vec3 functions that default to returning `Float64Array`\n * @namespace\n */\n vec4: vec4d,\n} = wgpuMatrixAPI<\n Mat3d, Mat4d, Quatd, Vec2d, Vec3d, Vec4d>(\n Float64Array, Float64Array, Float64Array, Float64Array, Float64Array, Float64Array);\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat3: mat3n,\n /**\n * 4x4 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat4: mat4n,\n /**\n * Quaternion functions that default to returning `number[]`\n * @namespace\n */\n quat: quatn,\n /**\n * Vec2 functions that default to returning `number[]`\n * @namespace\n */\n vec2: vec2n,\n /**\n * Vec3 functions that default to returning `number[]`\n * @namespace\n */\n vec3: vec3n,\n /**\n * Vec3 functions that default to returning `number[]`\n * @namespace\n */\n vec4: vec4n,\n} = wgpuMatrixAPI<\n Mat3n, Mat4n, Quatn, Vec2n, Vec3n, Vec4n>(\n ZeroArray, Array, Array, Array, Array, Array);\n"],"names":["getAPIImpl","utils.EPSILON","cache","getAPI","getVec2API","getVec3API","getMat3API","getMat4API","getQuatAPI","getVec4API"],"mappings":";;;;;;;IAMA,SAAS,eAAe,CACtB,mBAAsB,EACtB,QAA6C,EAAA;QAE7C,OAAO,cAAc,mBAAmB,CAAA;IACtC,QAAA,WAAA,CAAY,GAAG,IAAW,EAAA;IACxB,YAAA,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;gBACf,QAAQ,CAAC,IAAuB,CAAC,CAAC;aACnC;IACG,KAAA,CAAC;IACT,CAAC;IAEM,MAAM,SAAS,GAAG,eAAe,EAAC,KAAa,GAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;;IClBvE;;;;;;;;;;;;;;;;;;;;IAoBG;IAEI,IAAI,OAAO,GAAG,QAAQ,CAAC;IAE9B;;;;IAIG;IACG,SAAU,UAAU,CAAC,CAAS,EAAA;QAClC,MAAM,GAAG,GAAG,OAAO,CAAC;QACpB,OAAO,GAAG,CAAC,CAAC;IACZ,IAAA,OAAO,GAAG,CAAC;IACb,CAAC;IAED;;;;IAIG;IACG,SAAU,QAAQ,CAAC,OAAe,EAAA;IACtC,IAAA,OAAO,OAAO,GAAG,IAAI,CAAC,EAAE,GAAG,GAAG,C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IAGG;IACH,IAAI,EAAE,KAAK;IACX;;;IAGG;IACH,IAAI,EAAE,KAAK;IACX;;;IAGG;IACH,IAAI,EAAE,KAAK,GACZ,GAAG,aAAa,CAEb,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE;AAE3E,UAAA;IACX;;;IAGG;IACH,IAAI,EAAE,KAAK;IACX;;;IAGG;IACH,IAAI,EAAE,KAAK;IACX;;;IAGG;IACH,IAAI,EAAE,KAAK;IACX;;;IAGG;IACH,IAAI,EAAE,KAAK;IACX;;;IAGG;IACH,IAAI,EAAE,KAAK;IACX;;;IAGG;IACH,IAAI,EAAE,KAAK,GACZ,GAAG,aAAa,CAEb,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"wgpu-matrix.js","sources":["../../../src/types.ts","../../../src/utils.ts","../../../src/vec2-impl.ts","../../../src/vec3-impl.ts","../../../src/mat3-impl.ts","../../../src/mat4-impl.ts","../../../src/quat-impl.ts","../../../src/vec4-impl.ts","../../../src/wgpu-matrix.ts"],"sourcesContent":["/**\n * A type wider than `number[]`, omitting any instance functions\n * unused by the API, e.g., map, sort. This allows the math\n * functions to operate on a wider range of array-like\n * values.\n */\nexport interface MutableNumberArray {\n readonly length: number;\n [n: number]: number;\n}\n\n/**\n * The types you can pass to most functions that take an\n * array of numbers.\n */\nexport type BaseArgType = Float32Array | Float64Array | MutableNumberArray;\n\nfunction wrapConstructor any>(\n OriginalConstructor: T,\n modifier: (instance: InstanceType) => void\n): T {\n return class extends OriginalConstructor {\n constructor(...args: any[]) {\n super(...args);\n modifier(this as InstanceType);\n }\n } as T; // Type assertion is necessary here\n}\n\nexport const ZeroArray = wrapConstructor(Array, a => a.fill(0));\n\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nexport let EPSILON = 0.000001;\n\n/**\n * Set the value for EPSILON for various checks\n * @param v - Value to use for EPSILON.\n * @returns previous value of EPSILON;\n */\nexport function setEpsilon(v: number): number {\n const old = EPSILON;\n EPSILON = v;\n return old;\n}\n\n/**\n * Convert degrees to radians\n * @param degrees - Angle in degrees\n * @returns angle converted to radians\n */\nexport function degToRad(degrees: number): number {\n return degrees * Math.PI / 180;\n}\n\n/**\n * Convert radians to degrees\n * @param radians - Angle in radians\n * @returns angle converted to degrees\n */\nexport function radToDeg(radians: number): number {\n return radians * 180 / Math.PI;\n}\n\n/**\n * Lerps between a and b via t\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @returns a + (b - a) * t\n */\nexport function lerp(a: number, b: number, t: number): number {\n return a + (b - a) * t;\n}\n\n/**\n * Compute the opposite of lerp. Given a and b and a value between\n * a and b returns a value between 0 and 1. 0 if a, 1 if b.\n * Note: no clamping is done.\n * @param a - start value\n * @param b - end value\n * @param v - value between a and b\n * @returns (v - a) / (b - a)\n */\nexport function inverseLerp(a: number, b: number, v: number): number {\n const d = b - a;\n return (Math.abs(b - a) < EPSILON)\n ? a\n : (v - a) / d;\n}\n\n/**\n * Compute the euclidean modulo\n *\n * ```\n * // table for n / 3\n * -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 <- n\n * ------------------------------------\n * -2 -1 -0 -2 -1 0, 1, 2, 0, 1, 2 <- n % 3\n * 1 2 0 1 2 0, 1, 2, 0, 1, 2 <- euclideanModule(n, 3)\n * ```\n *\n * @param n - dividend\n * @param m - divisor\n * @returns the euclidean modulo of n / m\n */\nexport function euclideanModulo(n: number, m: number) {\n return ((n % m) + m) % m;\n}","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Mat3Arg } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { Vec2Arg, Vec2Type } from './vec2';\nimport { Vec3Arg } from './vec3';\nimport { BaseArgType } from './types';\n\nexport { Vec2Arg, Vec2Type };\n\ntype Vec2Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec3\n */\nfunction getAPIImpl(Ctor: Vec2Ctor) {\n\n/**\n * Creates a Vec2; may be called with x, y, z to set initial values.\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Vec2's specified type\n * it would be faster to use\n *\n * ```\n * const v = vec2.clone(someJSArray);\n * ```\n *\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\nfunction create(x = 0, y = 0) {\n const newDst = new Ctor(2);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n }\n }\n return newDst;\n}\n\n/**\n * Creates a Vec2; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec2\n * Also see {@link vec2.create} and {@link vec2.copy}\n *\n * @param x first value\n * @param y second value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec2Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec2Arg, b: Vec2Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n\n return newDst;\n}\n\n/**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\nfunction angle(a: Vec2Arg, b: Vec2Arg): number {\n const ax = a[0];\n const ay = a[1];\n const bx = b[0];\n const by = b[1];\n const mag1 = Math.sqrt(ax * ax + ay * ay);\n const mag2 = Math.sqrt(bx * bx + by * by);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec2Arg, b: Vec2Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec2Arg, b: Vec2Arg): boolean {\n return a[0] === b[0] && a[1] === b[1];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec2Arg, b: Vec2Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec2Arg, b: Vec2Arg, t: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec2Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec2Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\nfunction cross(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const z = a[0] * b[1] - a[1] * b[0];\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = z;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec2Arg, b: Vec2Arg): number {\n return a[0] * b[0] + a[1] * b[1];\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec2Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n return Math.sqrt(v0 * v0 + v1 * v1);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec2Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n return v0 * v0 + v1 * v1;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec2Arg, b: Vec2Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return Math.sqrt(dx * dx + dy * dy);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec2Arg, b: Vec2Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return dx * dx + dy * dy;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const len = Math.sqrt(v0 * v0 + v1 * v1);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n }\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec2.clone})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec2.copy})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Creates a random unit vector * scale\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\nfunction random(scale = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const angle = Math.random() * 2 * Math.PI;\n newDst[0] = Math.cos(angle) * scale;\n newDst[1] = Math.sin(angle) * scale;\n\n return newDst;\n}\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform Vec2 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec2Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const x = v[0];\n const y = v[1];\n\n newDst[0] = x * m[0] + y * m[4] + m[12];\n newDst[1] = x * m[1] + y * m[5] + m[13];\n\n return newDst;\n}\n\n/**\n * Transforms vec4 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat3(v: Vec2Arg, m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const x = v[0];\n const y = v[1];\n\n newDst[0] = m[0] * x + m[4] * y + m[8];\n newDst[1] = m[1] * x + m[5] * y + m[9];\n\n return newDst;\n}\n\n/**\n * Rotate a 2D vector\n *\n * @param a The vec2 point to rotate\n * @param b The origin of the rotation\n * @param rad The angle of rotation in radians\n * @returns the rotated vector\n */\nfunction rotate(a: Vec2Arg, b: Vec2Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n // Translate point to the origin\n const p0 = a[0] - b[0];\n const p1 = a[1] - b[1];\n const sinC = Math.sin(rad);\n const cosC = Math.cos(rad);\n\n //perform rotation and translate to correct position\n newDst[0] = p0 * cosC - p1 * sinC + b[0];\n newDst[1] = p0 * sinC + p1 * cosC + b[1];\n\n return newDst;\n}\n\n/**\n * Treat a 2D vector as a direction and set it's length\n *\n * @param a The vec2 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec2Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec2 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec2Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat3,\n rotate,\n setLength,\n truncate,\n midpoint,\n};\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Vec2Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Vec3Arg, Vec3Type } from './vec3';\nimport { Mat3Arg } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { QuatArg } from './quat';\nimport { BaseArgType } from './types';\n\nexport { Vec3Arg, Vec3Type };\n\ntype Vec3Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec3\n * */\nfunction getAPIImpl(Ctor: Vec3Ctor) {\n\n/**\n * Creates a vec3; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number) {\n const newDst = new Ctor(3);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a vec3; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec3\n * Also see {@link vec3.create} and {@link vec3.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec3Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec3Arg, b: Vec3Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n\n return newDst;\n}\n\n/**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\nfunction angle(a: Vec3Arg, b: Vec3Arg): number {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const mag1 = Math.sqrt(ax * ax + ay * ay + az * az);\n const mag2 = Math.sqrt(bx * bx + by * by + bz * bz);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec3Arg, b: Vec3Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec3Arg, b: Vec3Arg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec3Arg, b: Vec3Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec3Arg, b: Vec3Arg, t: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec3Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec3Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\nfunction cross(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const t1 = a[2] * b[0] - a[0] * b[2];\n const t2 = a[0] * b[1] - a[1] * b[0];\n newDst[0] = a[1] * b[2] - a[2] * b[1];\n newDst[1] = t1;\n newDst[2] = t2;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec3Arg, b: Vec3Arg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]);\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec3Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec3Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return v0 * v0 + v1 * v1 + v2 * v2;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec3Arg, b: Vec3Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return Math.sqrt(dx * dx + dy * dy + dz * dz);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec3Arg, b: Vec3Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return dx * dx + dy * dy + dz * dz;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec3.clone})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec3.copy})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Creates a random vector\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\nfunction random(scale = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const angle = Math.random() * 2 * Math.PI;\n const z = Math.random() * 2 - 1;\n const zScale = Math.sqrt(1 - z * z) * scale;\n newDst[0] = Math.cos(angle) * zScale;\n newDst[1] = Math.sin(angle) * zScale;\n newDst[2] = z * scale;\n\n return newDst;\n}\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform vec3 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec3Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1;\n\n newDst[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n newDst[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n newDst[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n\n return newDst;\n}\n\n/**\n * Transform vec3 by upper 3x3 matrix inside 4x4 matrix.\n * @param v - The direction.\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns The transformed vector.\n */\nfunction transformMat4Upper3x3(v: Vec3Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[0] = v0 * m[0 * 4 + 0] + v1 * m[1 * 4 + 0] + v2 * m[2 * 4 + 0];\n newDst[1] = v0 * m[0 * 4 + 1] + v1 * m[1 * 4 + 1] + v2 * m[2 * 4 + 1];\n newDst[2] = v0 * m[0 * 4 + 2] + v1 * m[1 * 4 + 2] + v2 * m[2 * 4 + 2];\n\n return newDst;\n}\n\n/**\n * Transforms vec3 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat3(v: Vec3Arg, m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n\n newDst[0] = x * m[0] + y * m[4] + z * m[8];\n newDst[1] = x * m[1] + y * m[5] + z * m[9];\n newDst[2] = x * m[2] + y * m[6] + z * m[10];\n\n return newDst;\n}\n\n/**\n * Transforms vec3 by Quaternion\n * @param v - the vector to transform\n * @param q - the quaternion to transform by\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed\n */\nfunction transformQuat(v: Vec3Arg, q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n\n const uvX = qy * z - qz * y;\n const uvY = qz * x - qx * z;\n const uvZ = qx * y - qy * x;\n\n newDst[0] = x + uvX * w2 + (qy * uvZ - qz * uvY) * 2;\n newDst[1] = y + uvY * w2 + (qz * uvX - qx * uvZ) * 2;\n newDst[2] = z + uvZ * w2 + (qx * uvY - qy * uvX) * 2;\n\n return newDst;\n}\n\n/**\n * Returns the translation component of a 4-by-4 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\nfunction getTranslation(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n}\n/**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat4Arg, axis: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n}\n/**\n * Returns the scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the x-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\nfunction rotateX(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n //Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n //perform rotation\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad);\n\n //translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the y-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\nfunction rotateY(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n // perform rotation\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad);\n\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the z-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns {vec3} out\n */\nfunction rotateZ(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n // perform rotation\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2];\n\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Treat a 3D vector as a direction and set it's length\n *\n * @param a The vec3 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec3Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec3 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec3Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat4Upper3x3,\n transformMat3,\n transformQuat,\n getTranslation,\n getAxis,\n getScaling,\n rotateX,\n rotateY,\n rotateZ,\n setLength,\n truncate,\n midpoint,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Vec3Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nimport * as utils from './utils.js';\nimport { QuatArg } from './quat';\nimport { Mat3Arg, Mat3Type } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { Vec2Arg } from './vec2';\nimport { Vec3Arg } from './vec3';\nimport { getAPI as getVec2API } from './vec2-impl';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\n\nexport { Mat3Arg, Mat3Type };\n\ntype Mat3Ctor = new (n: number) => T;\n\n/**\n * Generates a typed API for Mat3\n * */\nfunction getAPIImpl(Ctor: Mat3Ctor) {\n const vec2 = getVec2API(Ctor);\n const vec3 = getVec3API(Ctor);\n\n/**\n * Create a Mat3 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat3's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat3.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @returns matrix created from values.\n */\nfunction create(\n v0?: number, v1?: number, v2?: number,\n v3?: number, v4?: number, v5?: number,\n v6?: number, v7?: number, v8?: number) {\n const newDst = new Ctor(12);\n // to make the array homogenous\n newDst[3] = 0;\n newDst[7] = 0;\n newDst[11] = 0;\n\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[4] = v3;\n if (v4 !== undefined) {\n newDst[5] = v4;\n if (v5 !== undefined) {\n newDst[6] = v5;\n if (v6 !== undefined) {\n newDst[8] = v6;\n if (v7 !== undefined) {\n newDst[9] = v7;\n if (v8 !== undefined) {\n newDst[10] = v8;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n\n return newDst;\n}\n\n/**\n * Sets the values of a Mat3\n * Also see {@link mat3.create} and {@link mat3.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 set from values.\n */\nfunction set(\n v0: number, v1: number, v2: number,\n v3: number, v4: number, v5: number,\n v6: number, v7: number, v8: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[0] = v0; newDst[1] = v1; newDst[ 2] = v2; newDst[ 3] = 0;\n newDst[4] = v3; newDst[5] = v4; newDst[ 6] = v5; newDst[ 7] = 0;\n newDst[8] = v6; newDst[9] = v7; newDst[10] = v8; newDst[11] = 0;\n\n return newDst;\n}\n\n/**\n * Creates a Mat3 from the upper left 3x3 part of a Mat4\n * @param m4 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from m4\n */\nfunction fromMat4(m4: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n newDst[0] = m4[0]; newDst[1] = m4[1]; newDst[ 2] = m4[ 2]; newDst[ 3] = 0;\n newDst[4] = m4[4]; newDst[5] = m4[5]; newDst[ 6] = m4[ 6]; newDst[ 7] = 0;\n newDst[8] = m4[8]; newDst[9] = m4[9]; newDst[10] = m4[10]; newDst[11] = 0;\n return newDst;\n}\n\n/**\n * Creates a Mat3 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from q\n */\nfunction fromQuat(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3];\n const x2 = x + x; const y2 = y + y; const z2 = z + z;\n\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n newDst[ 0] = 1 - yy - zz; newDst[ 1] = yx + wz; newDst[ 2] = zx - wy; newDst[ 3] = 0;\n newDst[ 4] = yx - wz; newDst[ 5] = 1 - xx - zz; newDst[ 6] = zy + wx; newDst[ 7] = 0;\n newDst[ 8] = zx + wy; newDst[ 9] = zy - wx; newDst[10] = 1 - xx - yy; newDst[11] = 0;\n\n return newDst;\n}\n\n/**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\nfunction negate(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = -m[ 0]; newDst[ 1] = -m[ 1]; newDst[ 2] = -m[ 2];\n newDst[ 4] = -m[ 4]; newDst[ 5] = -m[ 5]; newDst[ 6] = -m[ 6];\n newDst[ 8] = -m[ 8]; newDst[ 9] = -m[ 9]; newDst[10] = -m[10];\n\n return newDst;\n}\n\n/**\n * Copies a matrix. (same as {@link mat3.clone})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nfunction copy(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = m[ 0]; newDst[ 1] = m[ 1]; newDst[ 2] = m[ 2];\n newDst[ 4] = m[ 4]; newDst[ 5] = m[ 5]; newDst[ 6] = m[ 6];\n newDst[ 8] = m[ 8]; newDst[ 9] = m[ 9]; newDst[10] = m[10];\n\n return newDst;\n}\n\n/**\n * Copies a matrix (same as {@link mat3.copy})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nconst clone = copy;\n\n/**\n * Check if 2 matrices are approximately equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are approximately equal\n */\nfunction equalsApproximately(a: Mat3Arg, b: Mat3Arg): boolean {\n return Math.abs(a[ 0] - b[ 0]) < utils.EPSILON &&\n Math.abs(a[ 1] - b[ 1]) < utils.EPSILON &&\n Math.abs(a[ 2] - b[ 2]) < utils.EPSILON &&\n Math.abs(a[ 4] - b[ 4]) < utils.EPSILON &&\n Math.abs(a[ 5] - b[ 5]) < utils.EPSILON &&\n Math.abs(a[ 6] - b[ 6]) < utils.EPSILON &&\n Math.abs(a[ 8] - b[ 8]) < utils.EPSILON &&\n Math.abs(a[ 9] - b[ 9]) < utils.EPSILON &&\n Math.abs(a[10] - b[10]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 matrices are exactly equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are exactly equal\n */\nfunction equals(a: Mat3Arg, b: Mat3Arg): boolean {\n return a[ 0] === b[ 0] &&\n a[ 1] === b[ 1] &&\n a[ 2] === b[ 2] &&\n a[ 4] === b[ 4] &&\n a[ 5] === b[ 5] &&\n a[ 6] === b[ 6] &&\n a[ 8] === b[ 8] &&\n a[ 9] === b[ 9] &&\n a[10] === b[10];\n}\n\n/**\n * Creates a 3-by-3 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 3-by-3 identity matrix.\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\nfunction transpose(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n if (newDst === m) {\n let t: number;\n\n // 0 1 2\n // 4 5 6\n // 8 9 10\n\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n\n return newDst;\n }\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n newDst[ 0] = m00; newDst[ 1] = m10; newDst[ 2] = m20;\n newDst[ 4] = m01; newDst[ 5] = m11; newDst[ 6] = m21;\n newDst[ 8] = m02; newDst[ 9] = m12; newDst[10] = m22;\n\n return newDst;\n}\n\n/**\n * Computes the inverse of a 3-by-3 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nfunction inverse(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n const b01 = m22 * m11 - m12 * m21;\n const b11 = -m22 * m10 + m12 * m20;\n const b21 = m21 * m10 - m11 * m20;\n\n const invDet = 1 / (m00 * b01 + m01 * b11 + m02 * b21);\n\n newDst[ 0] = b01 * invDet;\n newDst[ 1] = (-m22 * m01 + m02 * m21) * invDet;\n newDst[ 2] = ( m12 * m01 - m02 * m11) * invDet;\n newDst[ 4] = b11 * invDet;\n newDst[ 5] = ( m22 * m00 - m02 * m20) * invDet;\n newDst[ 6] = (-m12 * m00 + m02 * m10) * invDet;\n newDst[ 8] = b21 * invDet;\n newDst[ 9] = (-m21 * m00 + m01 * m20) * invDet;\n newDst[10] = ( m11 * m00 - m01 * m10) * invDet;\n\n return newDst;\n}\n\n/**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\nfunction determinant(m: Mat3Arg): number {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n return m00 * (m11 * m22 - m21 * m12) -\n m10 * (m01 * m22 - m21 * m02) +\n m20 * (m01 * m12 - m11 * m02);\n}\n\n/**\n * Computes the inverse of a 3-by-3 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nconst invert = inverse;\n\n/**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nfunction multiply(a: Mat3Arg, b: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[ 4 + 0];\n const a11 = a[ 4 + 1];\n const a12 = a[ 4 + 2];\n const a20 = a[ 8 + 0];\n const a21 = a[ 8 + 1];\n const a22 = a[ 8 + 2];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b10 = b[ 4 + 0];\n const b11 = b[ 4 + 1];\n const b12 = b[ 4 + 2];\n const b20 = b[ 8 + 0];\n const b21 = b[ 8 + 1];\n const b22 = b[ 8 + 2];\n\n newDst[ 0] = a00 * b00 + a10 * b01 + a20 * b02;\n newDst[ 1] = a01 * b00 + a11 * b01 + a21 * b02;\n newDst[ 2] = a02 * b00 + a12 * b01 + a22 * b02;\n newDst[ 4] = a00 * b10 + a10 * b11 + a20 * b12;\n newDst[ 5] = a01 * b10 + a11 * b11 + a21 * b12;\n newDst[ 6] = a02 * b10 + a12 * b11 + a22 * b12;\n newDst[ 8] = a00 * b20 + a10 * b21 + a20 * b22;\n newDst[ 9] = a01 * b20 + a11 * b21 + a21 * b22;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22;\n\n return newDst;\n}\n\n/**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nconst mul = multiply;\n\n/**\n * Sets the translation component of a 3-by-3 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\nfunction setTranslation(a: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? identity()) as T;\n if (a !== newDst) {\n newDst[ 0] = a[ 0];\n newDst[ 1] = a[ 1];\n newDst[ 2] = a[ 2];\n newDst[ 4] = a[ 4];\n newDst[ 5] = a[ 5];\n newDst[ 6] = a[ 6];\n }\n newDst[ 8] = v[0];\n newDst[ 9] = v[1];\n newDst[10] = 1;\n return newDst;\n}\n\n/**\n * Returns the translation component of a 3-by-3 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\nfunction getTranslation(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec2.create()) as T;\n newDst[0] = m[8];\n newDst[1] = m[9];\n return newDst;\n}\n\n/**\n * Returns an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y,\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat3Arg, axis: number, dst?: T) {\n const newDst = (dst ?? vec2.create()) as T;\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n return newDst;\n}\n\n/**\n * Sets an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\nfunction setAxis(m: Mat3Arg, v: Vec2Arg, axis: number, dst?: T) {\n const newDst = (dst === m ? m : copy(m, dst)) as T;\n\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n return newDst;\n}\n\n/**\n * Returns the \"2d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec2.create());\n\n const xx = m[0];\n const xy = m[1];\n const yx = m[4];\n const yy = m[5];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy);\n newDst[1] = Math.sqrt(yx * yx + yy * yy);\n\n return newDst;\n}\n\n\n/**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction get3DScaling(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec3.create());\n\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which translates by the given vector v.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\nfunction translation(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = v[0]; newDst[ 9] = v[1]; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Translates the given 3-by-3 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\nfunction translate(m: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 0] = m00;\n newDst[ 1] = m01;\n newDst[ 2] = m02;\n newDst[ 4] = m10;\n newDst[ 5] = m11;\n newDst[ 6] = m12;\n }\n\n newDst[ 8] = m00 * v0 + m10 * v1 + m20;\n newDst[ 9] = m01 * v0 + m11 * v1 + m21;\n newDst[10] = m02 * v0 + m12 * v1 + m22;\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotation(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = s; newDst[ 2] = 0;\n newDst[ 4] = -s; newDst[ 5] = c; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix by the given angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotate(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 + s * m10;\n newDst[ 1] = c * m01 + s * m11;\n newDst[ 2] = c * m02 + s * m12;\n\n newDst[ 4] = c * m10 - s * m00;\n newDst[ 5] = c * m11 - s * m01;\n newDst[ 6] = c * m12 - s * m02;\n\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the x-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationX(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = c; newDst[ 6] = s;\n newDst[ 8] = 0; newDst[ 9] = -s; newDst[10] = c;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix around the x-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateX(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[4] = c * m10 + s * m20;\n newDst[5] = c * m11 + s * m21;\n newDst[6] = c * m12 + s * m22;\n newDst[8] = c * m20 - s * m10;\n newDst[9] = c * m21 - s * m11;\n newDst[10] = c * m22 - s * m12;\n\n if (m !== newDst) {\n newDst[ 0] = m[ 0];\n newDst[ 1] = m[ 1];\n newDst[ 2] = m[ 2];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the y-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationY(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = 0; newDst[ 2] = -s;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = s; newDst[ 9] = 0; newDst[10] = c;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix around the y-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateY(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 - s * m20;\n newDst[ 1] = c * m01 - s * m21;\n newDst[ 2] = c * m02 - s * m22;\n newDst[ 8] = c * m20 + s * m00;\n newDst[ 9] = c * m21 + s * m01;\n newDst[10] = c * m22 + s * m02;\n\n if (m !== newDst) {\n newDst[ 4] = m[ 4];\n newDst[ 5] = m[ 5];\n newDst[ 6] = m[ 6];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the z-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nconst rotationZ = rotation;\n\n/**\n * Rotates the given 3-by-3 matrix around the z-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nconst rotateZ = rotate;\n\n/**\n * Creates a 3-by-3 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has two\n * entries.\n * @param v - A vector of\n * 2 entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * two entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of 2 entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale(m: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * 3 entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling3D(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = v[2];\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of 3 entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale3D(m: Mat3Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n\n newDst[ 8] = v2 * m[2 * 4 + 0];\n newDst[ 9] = v2 * m[2 * 4 + 1];\n newDst[10] = v2 * m[2 * 4 + 2];\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales uniformly in the X and Y dimensions\n * @param s - Amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in the X and Y dimension by an amount\n * given.\n * @param m - The matrix to be modified.\n * @param s - Amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale(m: Mat3Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales uniformly in each dimension\n * @param s - Amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling3D(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = s;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given.\n * @param m - The matrix to be modified.\n * @param s - Amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale3D(m: Mat3Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n\n newDst[ 8] = s * m[2 * 4 + 0];\n newDst[ 9] = s * m[2 * 4 + 1];\n newDst[10] = s * m[2 * 4 + 2];\n\n return newDst;\n}\n\nreturn {\n clone,\n create,\n set,\n fromMat4,\n fromQuat,\n negate,\n copy,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n invert,\n determinant,\n mul,\n multiply,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n get3DScaling,\n translation,\n translate,\n rotation,\n rotate,\n rotationX,\n rotateX,\n rotationY,\n rotateY,\n rotationZ,\n rotateZ,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n scaling3D,\n scale3D,\n uniformScaling3D,\n uniformScale3D,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Mat3Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","import { Mat4Arg, Mat4Type } from './mat4';\nimport { Mat3Arg } from './mat3';\nimport { QuatArg } from './quat';\nimport { Vec3Arg } from './vec3';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\nimport * as utils from './utils';\n\nexport { Mat4Arg, Mat4Type };\n\ntype Mat4Ctor = new (n: number) => T;\n\n/**\n * Generates a typed API for Mat4\n * */\nfunction getAPIImpl(Ctor: Mat4Ctor) {\n const vec3 = getVec3API(Ctor);\n\n/**\n * 4x4 Matrix math math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new matrix. In other words you can do this\n *\n * const mat = mat4.translation([1, 2, 3]); // Creates a new translation matrix\n *\n * or\n *\n * const mat = mat4.create();\n * mat4.translation([1, 2, 3], mat); // Puts translation matrix in mat.\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always save to pass any matrix as the destination. So for example\n *\n * const mat = mat4.identity();\n * const trans = mat4.translation([1, 2, 3]);\n * mat4.multiply(mat, trans, mat); // Multiplies mat * trans and puts result in mat.\n *\n */\n\n\n/**\n * Create a Mat4 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat4's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat4.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @returns created from values.\n */\nfunction create(\n v0?: number, v1?: number, v2?: number, v3?: number,\n v4?: number, v5?: number, v6?: number, v7?: number,\n v8?: number, v9?: number, v10?: number, v11?: number,\n v12?: number, v13?: number, v14?: number, v15?: number) {\n const newDst = new Ctor(16);\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[3] = v3;\n if (v4 !== undefined) {\n newDst[4] = v4;\n if (v5 !== undefined) {\n newDst[5] = v5;\n if (v6 !== undefined) {\n newDst[6] = v6;\n if (v7 !== undefined) {\n newDst[7] = v7;\n if (v8 !== undefined) {\n newDst[8] = v8;\n if (v9 !== undefined) {\n newDst[9] = v9;\n if (v10 !== undefined) {\n newDst[10] = v10;\n if (v11 !== undefined) {\n newDst[11] = v11;\n if (v12 !== undefined) {\n newDst[12] = v12;\n if (v13 !== undefined) {\n newDst[13] = v13;\n if (v14 !== undefined) {\n newDst[14] = v14;\n if (v15 !== undefined) {\n newDst[15] = v15;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Sets the values of a Mat4\n * Also see {@link mat4.create} and {@link mat4.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 created from values.\n */\nfunction set(\n v0: number, v1: number, v2: number, v3: number,\n v4: number, v5: number, v6: number, v7: number,\n v8: number, v9: number, v10: number, v11: number,\n v12: number, v13: number, v14: number, v15: number,\n dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = v0; newDst[ 1] = v1; newDst[ 2] = v2; newDst[ 3] = v3;\n newDst[ 4] = v4; newDst[ 5] = v5; newDst[ 6] = v6; newDst[ 7] = v7;\n newDst[ 8] = v8; newDst[ 9] = v9; newDst[10] = v10; newDst[11] = v11;\n newDst[12] = v12; newDst[13] = v13; newDst[14] = v14; newDst[15] = v15;\n\n return newDst;\n}\n\n/**\n * Creates a Mat4 from a Mat3\n * @param m3 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from m3\n */\nfunction fromMat3(m3: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = m3[0]; newDst[ 1] = m3[1]; newDst[ 2] = m3[ 2]; newDst[ 3] = 0;\n newDst[ 4] = m3[4]; newDst[ 5] = m3[5]; newDst[ 6] = m3[ 6]; newDst[ 7] = 0;\n newDst[ 8] = m3[8]; newDst[ 9] = m3[9]; newDst[10] = m3[10]; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a Mat4 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from q\n */\nfunction fromQuat(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3];\n const x2 = x + x; const y2 = y + y; const z2 = z + z;\n\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n newDst[ 0] = 1 - yy - zz; newDst[ 1] = yx + wz; newDst[ 2] = zx - wy; newDst[ 3] = 0;\n newDst[ 4] = yx - wz; newDst[ 5] = 1 - xx - zz; newDst[ 6] = zy + wx; newDst[ 7] = 0;\n newDst[ 8] = zx + wy; newDst[ 9] = zy - wx; newDst[10] = 1 - xx - yy; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\nfunction negate(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = -m[ 0]; newDst[ 1] = -m[ 1]; newDst[ 2] = -m[ 2]; newDst[ 3] = -m[ 3];\n newDst[ 4] = -m[ 4]; newDst[ 5] = -m[ 5]; newDst[ 6] = -m[ 6]; newDst[ 7] = -m[ 7];\n newDst[ 8] = -m[ 8]; newDst[ 9] = -m[ 9]; newDst[10] = -m[10]; newDst[11] = -m[11];\n newDst[12] = -m[12]; newDst[13] = -m[13]; newDst[14] = -m[14]; newDst[15] = -m[15];\n\n return newDst;\n}\n\n/**\n * Copies a matrix. (same as {@link mat4.clone})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nfunction copy(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = m[ 0]; newDst[ 1] = m[ 1]; newDst[ 2] = m[ 2]; newDst[ 3] = m[ 3];\n newDst[ 4] = m[ 4]; newDst[ 5] = m[ 5]; newDst[ 6] = m[ 6]; newDst[ 7] = m[ 7];\n newDst[ 8] = m[ 8]; newDst[ 9] = m[ 9]; newDst[10] = m[10]; newDst[11] = m[11];\n newDst[12] = m[12]; newDst[13] = m[13]; newDst[14] = m[14]; newDst[15] = m[15];\n\n return newDst;\n}\n\n/**\n * Copies a matrix (same as {@link mat4.copy})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nconst clone = copy;\n\n/**\n * Check if 2 matrices are approximately equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are approximately equal\n */\nfunction equalsApproximately(a: Mat4Arg, b: Mat4Arg): boolean {\n return Math.abs(a[ 0] - b[ 0]) < utils.EPSILON &&\n Math.abs(a[ 1] - b[ 1]) < utils.EPSILON &&\n Math.abs(a[ 2] - b[ 2]) < utils.EPSILON &&\n Math.abs(a[ 3] - b[ 3]) < utils.EPSILON &&\n Math.abs(a[ 4] - b[ 4]) < utils.EPSILON &&\n Math.abs(a[ 5] - b[ 5]) < utils.EPSILON &&\n Math.abs(a[ 6] - b[ 6]) < utils.EPSILON &&\n Math.abs(a[ 7] - b[ 7]) < utils.EPSILON &&\n Math.abs(a[ 8] - b[ 8]) < utils.EPSILON &&\n Math.abs(a[ 9] - b[ 9]) < utils.EPSILON &&\n Math.abs(a[10] - b[10]) < utils.EPSILON &&\n Math.abs(a[11] - b[11]) < utils.EPSILON &&\n Math.abs(a[12] - b[12]) < utils.EPSILON &&\n Math.abs(a[13] - b[13]) < utils.EPSILON &&\n Math.abs(a[14] - b[14]) < utils.EPSILON &&\n Math.abs(a[15] - b[15]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 matrices are exactly equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are exactly equal\n */\nfunction equals(a: Mat4Arg, b: Mat4Arg): boolean {\n return a[ 0] === b[ 0] &&\n a[ 1] === b[ 1] &&\n a[ 2] === b[ 2] &&\n a[ 3] === b[ 3] &&\n a[ 4] === b[ 4] &&\n a[ 5] === b[ 5] &&\n a[ 6] === b[ 6] &&\n a[ 7] === b[ 7] &&\n a[ 8] === b[ 8] &&\n a[ 9] === b[ 9] &&\n a[10] === b[10] &&\n a[11] === b[11] &&\n a[12] === b[12] &&\n a[13] === b[13] &&\n a[14] === b[14] &&\n a[15] === b[15];\n}\n\n/**\n * Creates a 4-by-4 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 4-by-4 identity matrix.\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\nfunction transpose(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n if (newDst === m) {\n let t;\n\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n\n t = m[3];\n m[3] = m[12];\n m[12] = t;\n\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n\n t = m[7];\n m[7] = m[13];\n m[13] = t;\n\n t = m[11];\n m[11] = m[14];\n m[14] = t;\n return newDst;\n }\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n newDst[ 0] = m00; newDst[ 1] = m10; newDst[ 2] = m20; newDst[ 3] = m30;\n newDst[ 4] = m01; newDst[ 5] = m11; newDst[ 6] = m21; newDst[ 7] = m31;\n newDst[ 8] = m02; newDst[ 9] = m12; newDst[10] = m22; newDst[11] = m32;\n newDst[12] = m03; newDst[13] = m13; newDst[14] = m23; newDst[15] = m33;\n\n return newDst;\n}\n\n/**\n * Computes the inverse of a 4-by-4 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nfunction inverse(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n const tmp12 = m20 * m31;\n const tmp13 = m30 * m21;\n const tmp14 = m10 * m31;\n const tmp15 = m30 * m11;\n const tmp16 = m10 * m21;\n const tmp17 = m20 * m11;\n const tmp18 = m00 * m31;\n const tmp19 = m30 * m01;\n const tmp20 = m00 * m21;\n const tmp21 = m20 * m01;\n const tmp22 = m00 * m11;\n const tmp23 = m10 * m01;\n\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n\n const d = 1 / (m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3);\n\n newDst[ 0] = d * t0;\n newDst[ 1] = d * t1;\n newDst[ 2] = d * t2;\n newDst[ 3] = d * t3;\n newDst[ 4] = d * ((tmp1 * m10 + tmp2 * m20 + tmp5 * m30) -\n (tmp0 * m10 + tmp3 * m20 + tmp4 * m30));\n newDst[ 5] = d * ((tmp0 * m00 + tmp7 * m20 + tmp8 * m30) -\n (tmp1 * m00 + tmp6 * m20 + tmp9 * m30));\n newDst[ 6] = d * ((tmp3 * m00 + tmp6 * m10 + tmp11 * m30) -\n (tmp2 * m00 + tmp7 * m10 + tmp10 * m30));\n newDst[ 7] = d * ((tmp4 * m00 + tmp9 * m10 + tmp10 * m20) -\n (tmp5 * m00 + tmp8 * m10 + tmp11 * m20));\n newDst[ 8] = d * ((tmp12 * m13 + tmp15 * m23 + tmp16 * m33) -\n (tmp13 * m13 + tmp14 * m23 + tmp17 * m33));\n newDst[ 9] = d * ((tmp13 * m03 + tmp18 * m23 + tmp21 * m33) -\n (tmp12 * m03 + tmp19 * m23 + tmp20 * m33));\n newDst[10] = d * ((tmp14 * m03 + tmp19 * m13 + tmp22 * m33) -\n (tmp15 * m03 + tmp18 * m13 + tmp23 * m33));\n newDst[11] = d * ((tmp17 * m03 + tmp20 * m13 + tmp23 * m23) -\n (tmp16 * m03 + tmp21 * m13 + tmp22 * m23));\n newDst[12] = d * ((tmp14 * m22 + tmp17 * m32 + tmp13 * m12) -\n (tmp16 * m32 + tmp12 * m12 + tmp15 * m22));\n newDst[13] = d * ((tmp20 * m32 + tmp12 * m02 + tmp19 * m22) -\n (tmp18 * m22 + tmp21 * m32 + tmp13 * m02));\n newDst[14] = d * ((tmp18 * m12 + tmp23 * m32 + tmp15 * m02) -\n (tmp22 * m32 + tmp14 * m02 + tmp19 * m12));\n newDst[15] = d * ((tmp22 * m22 + tmp16 * m02 + tmp21 * m12) -\n (tmp20 * m12 + tmp23 * m22 + tmp17 * m02));\n\n return newDst;\n}\n\n/**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\nfunction determinant(m: Mat4Arg): number {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n\n return m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3;\n}\n\n/**\n * Computes the inverse of a 4-by-4 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nconst invert = inverse;\n\n/**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nfunction multiply(a: Mat4Arg, b: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[ 4 + 0];\n const a11 = a[ 4 + 1];\n const a12 = a[ 4 + 2];\n const a13 = a[ 4 + 3];\n const a20 = a[ 8 + 0];\n const a21 = a[ 8 + 1];\n const a22 = a[ 8 + 2];\n const a23 = a[ 8 + 3];\n const a30 = a[12 + 0];\n const a31 = a[12 + 1];\n const a32 = a[12 + 2];\n const a33 = a[12 + 3];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b03 = b[3];\n const b10 = b[ 4 + 0];\n const b11 = b[ 4 + 1];\n const b12 = b[ 4 + 2];\n const b13 = b[ 4 + 3];\n const b20 = b[ 8 + 0];\n const b21 = b[ 8 + 1];\n const b22 = b[ 8 + 2];\n const b23 = b[ 8 + 3];\n const b30 = b[12 + 0];\n const b31 = b[12 + 1];\n const b32 = b[12 + 2];\n const b33 = b[12 + 3];\n\n newDst[ 0] = a00 * b00 + a10 * b01 + a20 * b02 + a30 * b03;\n newDst[ 1] = a01 * b00 + a11 * b01 + a21 * b02 + a31 * b03;\n newDst[ 2] = a02 * b00 + a12 * b01 + a22 * b02 + a32 * b03;\n newDst[ 3] = a03 * b00 + a13 * b01 + a23 * b02 + a33 * b03;\n newDst[ 4] = a00 * b10 + a10 * b11 + a20 * b12 + a30 * b13;\n newDst[ 5] = a01 * b10 + a11 * b11 + a21 * b12 + a31 * b13;\n newDst[ 6] = a02 * b10 + a12 * b11 + a22 * b12 + a32 * b13;\n newDst[ 7] = a03 * b10 + a13 * b11 + a23 * b12 + a33 * b13;\n newDst[ 8] = a00 * b20 + a10 * b21 + a20 * b22 + a30 * b23;\n newDst[ 9] = a01 * b20 + a11 * b21 + a21 * b22 + a31 * b23;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22 + a32 * b23;\n newDst[11] = a03 * b20 + a13 * b21 + a23 * b22 + a33 * b23;\n newDst[12] = a00 * b30 + a10 * b31 + a20 * b32 + a30 * b33;\n newDst[13] = a01 * b30 + a11 * b31 + a21 * b32 + a31 * b33;\n newDst[14] = a02 * b30 + a12 * b31 + a22 * b32 + a32 * b33;\n newDst[15] = a03 * b30 + a13 * b31 + a23 * b32 + a33 * b33;\n\n return newDst;\n}\n\n/**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nconst mul = multiply;\n\n/**\n * Sets the translation component of a 4-by-4 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\nfunction setTranslation(a: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? identity()) as T;\n if (a !== newDst) {\n newDst[ 0] = a[ 0];\n newDst[ 1] = a[ 1];\n newDst[ 2] = a[ 2];\n newDst[ 3] = a[ 3];\n newDst[ 4] = a[ 4];\n newDst[ 5] = a[ 5];\n newDst[ 6] = a[ 6];\n newDst[ 7] = a[ 7];\n newDst[ 8] = a[ 8];\n newDst[ 9] = a[ 9];\n newDst[10] = a[10];\n newDst[11] = a[11];\n }\n newDst[12] = v[0];\n newDst[13] = v[1];\n newDst[14] = v[2];\n newDst[15] = 1;\n return newDst;\n}\n\n///**\n// * Returns the translation component of a 4-by-4 matrix as a vector with 3\n// * entries.\n// * @param m - The matrix.\n// * @param dst - vector to hold result. If not passed a new one is created.\n// * @returns The translation component of m.\n// */\nfunction getTranslation(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? vec3.create()) as T;\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n}\n\n/**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat4Arg, axis: number, dst?: T) {\n const newDst = (dst ?? vec3.create());\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n}\n\n/**\n * Sets an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\nfunction setAxis(m: Mat4Arg, v: Vec3Arg, axis: number, dst: T) {\n const newDst = (dst === m) ? dst : copy(m, dst);\n\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n newDst[off + 2] = v[2];\n return newDst;\n}\n\n/**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? vec3.create()) as T;\n\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 0 to 1 in the z dimension.\n *\n * Note: If you pass `Infinity` for zFar then it will produce a projection matrix\n * returns -Infinity for Z when transforming coordinates with Z <= 0 and +Infinity for Z\n * otherwise.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */\nfunction perspective(fieldOfViewYInRadians: number, aspect: number, zNear: number, zFar: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const f = Math.tan(Math.PI * 0.5 - 0.5 * fieldOfViewYInRadians);\n\n newDst[0] = f / aspect;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n newDst[4] = 0;\n newDst[5] = f;\n newDst[6] = 0;\n newDst[7] = 0;\n\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[11] = -1;\n\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (Number.isFinite(zFar)) {\n const rangeInv = 1 / (zNear - zFar);\n newDst[10] = zFar * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n } else {\n newDst[10] = -1;\n newDst[14] = -zNear;\n }\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 1 (at -zNear) to 0 (at -zFar) in the z dimension.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane. (default = Infinity)\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */function perspectiveReverseZ(fieldOfViewYInRadians: number, aspect: number, zNear: number, zFar = Infinity, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const f = 1 / Math.tan(fieldOfViewYInRadians * 0.5);\n\n newDst[ 0] = f / aspect;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n\n newDst[ 4] = 0;\n newDst[ 5] = f;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n\n newDst[ 8] = 0;\n newDst[ 9] = 0;\n newDst[11] = -1;\n\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (zFar === Infinity) {\n newDst[10] = 0;\n newDst[14] = zNear;\n } else {\n const rangeInv = 1 / (zFar - zNear);\n newDst[10] = zNear * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n }\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 orthogonal transformation matrix that transforms from\n * the given the left, right, bottom, and top dimensions to -1 +1 in x, and y\n * and 0 to +1 in z.\n * @param left - Left side of the near clipping plane viewport.\n * @param right - Right side of the near clipping plane viewport.\n * @param bottom - Bottom of the near clipping plane viewport.\n * @param top - Top of the near clipping plane viewport.\n * @param near - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param far - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The orthographic projection matrix.\n */\nfunction ortho(left: number, right: number, bottom: number, top: number, near: number, far: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[0] = 2 / (right - left);\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n newDst[4] = 0;\n newDst[5] = 2 / (top - bottom);\n newDst[6] = 0;\n newDst[7] = 0;\n\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[10] = 1 / (near - far);\n newDst[11] = 0;\n\n newDst[12] = (right + left) / (left - right);\n newDst[13] = (top + bottom) / (bottom - top);\n newDst[14] = near / (near - far);\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 0 to 1 in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\nfunction frustum(left: number, right: number, bottom: number, top: number, near: number, far: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const dx = (right - left);\n const dy = (top - bottom);\n const dz = (near - far);\n\n newDst[ 0] = 2 * near / dx;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n newDst[ 4] = 0;\n newDst[ 5] = 2 * near / dy;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n newDst[ 8] = (left + right) / dx;\n newDst[ 9] = (top + bottom) / dy;\n newDst[10] = far / dz;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = near * far / dz;\n newDst[15] = 0;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 1 (-near) to 0 (-far) in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\nfunction frustumReverseZ(left: number, right: number, bottom: number, top: number, near: number, far = Infinity, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const dx = (right - left);\n const dy = (top - bottom);\n\n newDst[ 0] = 2 * near / dx;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n newDst[ 4] = 0;\n newDst[ 5] = 2 * near / dy;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n newDst[ 8] = (left + right) / dx;\n newDst[ 9] = (top + bottom) / dy;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (far === Infinity) {\n newDst[10] = 0;\n newDst[14] = near;\n } else {\n const rangeInv = 1 / (far - near);\n newDst[10] = near * rangeInv;\n newDst[14] = far * near * rangeInv;\n }\n\n return newDst;\n}\n\nconst xAxis = vec3.create();\nconst yAxis = vec3.create();\nconst zAxis = vec3.create();\n\n/**\n * Computes a 4-by-4 aim transformation.\n *\n * This is a matrix which positions an object aiming down positive Z.\n * toward the target.\n *\n * Note: this is **NOT** the inverse of lookAt as lookAt looks at negative Z.\n *\n * @param position - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\nfunction aim(position: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(target, position, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = xAxis[1]; newDst[ 2] = xAxis[2]; newDst[ 3] = 0;\n newDst[ 4] = yAxis[0]; newDst[ 5] = yAxis[1]; newDst[ 6] = yAxis[2]; newDst[ 7] = 0;\n newDst[ 8] = zAxis[0]; newDst[ 9] = zAxis[1]; newDst[10] = zAxis[2]; newDst[11] = 0;\n newDst[12] = position[0]; newDst[13] = position[1]; newDst[14] = position[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 camera aim transformation.\n *\n * This is a matrix which positions an object aiming down negative Z.\n * toward the target.\n *\n * Note: this is the inverse of `lookAt`\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\nfunction cameraAim(eye: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = xAxis[1]; newDst[ 2] = xAxis[2]; newDst[ 3] = 0;\n newDst[ 4] = yAxis[0]; newDst[ 5] = yAxis[1]; newDst[ 6] = yAxis[2]; newDst[ 7] = 0;\n newDst[ 8] = zAxis[0]; newDst[ 9] = zAxis[1]; newDst[10] = zAxis[2]; newDst[11] = 0;\n newDst[12] = eye[0]; newDst[13] = eye[1]; newDst[14] = eye[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 view transformation.\n *\n * This is a view matrix which transforms all other objects\n * to be in the space of the view defined by the parameters.\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The look-at matrix.\n */\nfunction lookAt(eye: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = yAxis[0]; newDst[ 2] = zAxis[0]; newDst[ 3] = 0;\n newDst[ 4] = xAxis[1]; newDst[ 5] = yAxis[1]; newDst[ 6] = zAxis[1]; newDst[ 7] = 0;\n newDst[ 8] = xAxis[2]; newDst[ 9] = yAxis[2]; newDst[10] = zAxis[2]; newDst[11] = 0;\n\n newDst[12] = -(xAxis[0] * eye[0] + xAxis[1] * eye[1] + xAxis[2] * eye[2]);\n newDst[13] = -(yAxis[0] * eye[0] + yAxis[1] * eye[1] + yAxis[2] * eye[2]);\n newDst[14] = -(zAxis[0] * eye[0] + zAxis[1] * eye[1] + zAxis[2] * eye[2]);\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which translates by the given vector v.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\nfunction translation(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = v[0]; newDst[13] = v[1]; newDst[14] = v[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Translates the given 4-by-4 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\nfunction translate(m: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n if (m !== newDst) {\n newDst[ 0] = m00;\n newDst[ 1] = m01;\n newDst[ 2] = m02;\n newDst[ 3] = m03;\n newDst[ 4] = m10;\n newDst[ 5] = m11;\n newDst[ 6] = m12;\n newDst[ 7] = m13;\n newDst[ 8] = m20;\n newDst[ 9] = m21;\n newDst[10] = m22;\n newDst[11] = m23;\n }\n\n newDst[12] = m00 * v0 + m10 * v1 + m20 * v2 + m30;\n newDst[13] = m01 * v0 + m11 * v1 + m21 * v2 + m31;\n newDst[14] = m02 * v0 + m12 * v1 + m22 * v2 + m32;\n newDst[15] = m03 * v0 + m13 * v1 + m23 * v2 + m33;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the x-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationX(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = c; newDst[ 6] = s; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = -s; newDst[10] = c; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the x-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateX(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[4] = c * m10 + s * m20;\n newDst[5] = c * m11 + s * m21;\n newDst[6] = c * m12 + s * m22;\n newDst[7] = c * m13 + s * m23;\n newDst[8] = c * m20 - s * m10;\n newDst[9] = c * m21 - s * m11;\n newDst[10] = c * m22 - s * m12;\n newDst[11] = c * m23 - s * m13;\n\n if (m !== newDst) {\n newDst[ 0] = m[ 0];\n newDst[ 1] = m[ 1];\n newDst[ 2] = m[ 2];\n newDst[ 3] = m[ 3];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the y-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationY(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = 0; newDst[ 2] = -s; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = s; newDst[ 9] = 0; newDst[10] = c; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the y-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateY(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 - s * m20;\n newDst[ 1] = c * m01 - s * m21;\n newDst[ 2] = c * m02 - s * m22;\n newDst[ 3] = c * m03 - s * m23;\n newDst[ 8] = c * m20 + s * m00;\n newDst[ 9] = c * m21 + s * m01;\n newDst[10] = c * m22 + s * m02;\n newDst[11] = c * m23 + s * m03;\n\n if (m !== newDst) {\n newDst[ 4] = m[ 4];\n newDst[ 5] = m[ 5];\n newDst[ 6] = m[ 6];\n newDst[ 7] = m[ 7];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the z-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationZ(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = s; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = -s; newDst[ 5] = c; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the z-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateZ(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 + s * m10;\n newDst[ 1] = c * m01 + s * m11;\n newDst[ 2] = c * m02 + s * m12;\n newDst[ 3] = c * m03 + s * m13;\n newDst[ 4] = c * m10 - s * m00;\n newDst[ 5] = c * m11 - s * m01;\n newDst[ 6] = c * m12 - s * m02;\n newDst[ 7] = c * m13 - s * m03;\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n newDst[11] = m[11];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\nfunction axisRotation(axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n\n newDst[ 0] = xx + (1 - xx) * c;\n newDst[ 1] = x * y * oneMinusCosine + z * s;\n newDst[ 2] = x * z * oneMinusCosine - y * s;\n newDst[ 3] = 0;\n newDst[ 4] = x * y * oneMinusCosine - z * s;\n newDst[ 5] = yy + (1 - yy) * c;\n newDst[ 6] = y * z * oneMinusCosine + x * s;\n newDst[ 7] = 0;\n newDst[ 8] = x * z * oneMinusCosine + y * s;\n newDst[ 9] = y * z * oneMinusCosine - x * s;\n newDst[10] = zz + (1 - zz) * c;\n newDst[11] = 0;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = 0;\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle. (same as axisRotation)\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\nconst rotation = axisRotation;\n\n/**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle.\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction axisRotate(m: Mat4Arg, axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n\n const r00 = xx + (1 - xx) * c;\n const r01 = x * y * oneMinusCosine + z * s;\n const r02 = x * z * oneMinusCosine - y * s;\n const r10 = x * y * oneMinusCosine - z * s;\n const r11 = yy + (1 - yy) * c;\n const r12 = y * z * oneMinusCosine + x * s;\n const r20 = x * z * oneMinusCosine + y * s;\n const r21 = y * z * oneMinusCosine - x * s;\n const r22 = zz + (1 - zz) * c;\n\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n\n newDst[ 0] = r00 * m00 + r01 * m10 + r02 * m20;\n newDst[ 1] = r00 * m01 + r01 * m11 + r02 * m21;\n newDst[ 2] = r00 * m02 + r01 * m12 + r02 * m22;\n newDst[ 3] = r00 * m03 + r01 * m13 + r02 * m23;\n newDst[ 4] = r10 * m00 + r11 * m10 + r12 * m20;\n newDst[ 5] = r10 * m01 + r11 * m11 + r12 * m21;\n newDst[ 6] = r10 * m02 + r11 * m12 + r12 * m22;\n newDst[ 7] = r10 * m03 + r11 * m13 + r12 * m23;\n newDst[ 8] = r20 * m00 + r21 * m10 + r22 * m20;\n newDst[ 9] = r20 * m01 + r21 * m11 + r22 * m21;\n newDst[10] = r20 * m02 + r21 * m12 + r22 * m22;\n newDst[11] = r20 * m03 + r21 * m13 + r22 * m23;\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle. (same as rotate)\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nconst rotate = axisRotate;\n\n/**\n * Creates a 4-by-4 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * three entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = v[2]; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 4-by-4 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of three entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale(m: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n newDst[ 3] = v0 * m[0 * 4 + 3];\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n newDst[ 7] = v1 * m[1 * 4 + 3];\n newDst[ 8] = v2 * m[2 * 4 + 0];\n newDst[ 9] = v2 * m[2 * 4 + 1];\n newDst[10] = v2 * m[2 * 4 + 2];\n newDst[11] = v2 * m[2 * 4 + 3];\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which scales a uniform amount in each dimension.\n * @param s - the amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = s; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 4-by-4 matrix in each dimension by a uniform scale.\n * @param m - The matrix to be modified.\n * @param s - The amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale(m: Mat4Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n newDst[ 3] = s * m[0 * 4 + 3];\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n newDst[ 7] = s * m[1 * 4 + 3];\n newDst[ 8] = s * m[2 * 4 + 0];\n newDst[ 9] = s * m[2 * 4 + 1];\n newDst[10] = s * m[2 * 4 + 2];\n newDst[11] = s * m[2 * 4 + 3];\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\nreturn {\n create,\n set,\n fromMat3,\n fromQuat,\n negate,\n copy,\n clone,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n determinant,\n invert,\n multiply,\n mul,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n perspective,\n perspectiveReverseZ,\n ortho,\n frustum,\n frustumReverseZ,\n aim,\n cameraAim,\n lookAt,\n translation,\n translate,\n rotationX,\n rotateX,\n rotationY,\n rotateY,\n rotationZ,\n rotateZ,\n axisRotation,\n rotation,\n axisRotate,\n rotate,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n};\n\n}\n\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Mat4Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { QuatArg, QuatType } from './quat';\nimport { Mat3Arg } from './mat3.js';\nimport { Mat4Arg } from './mat4.js';\nimport { Vec3Arg } from './vec3.js';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\n\nexport { QuatArg, QuatType };\n\ntype QuatCtor = new (n: number) => T;\n\nexport type RotationOrder = 'xyz' | 'xzy' | 'yxz' | 'yzx' | 'zxy' | 'zyx';\n\n/**\n * Generates am typed API for Qud\n * */\nfunction getAPIImpl(Ctor: QuatCtor) {\n const vec3 = getVec3API(Ctor);\n\n/**\n * Creates a quat4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number, w?: number) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a Quat; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Quat\n * Also see {@link quat.create} and {@link quat.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, w: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n\n return newDst;\n}\n\n/**\n * Sets a quaternion from the given angle and axis,\n * then returns it.\n *\n * @param axis - the axis to rotate around\n * @param angleInRadians - the angle\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The quaternion that represents the given axis and angle\n **/\nfunction fromAxisAngle(axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n const s = Math.sin(halfAngle);\n\n newDst[0] = s * axis[0];\n newDst[1] = s * axis[1];\n newDst[2] = s * axis[2];\n newDst[3] = Math.cos(halfAngle);\n\n return newDst;\n}\n\n/**\n * Gets the rotation axis and angle\n * @param q - quaternion to compute from\n * @param dst - Vec3 to hold result. If not passed in a new one is created.\n * @return angle and axis\n */\nfunction toAxisAngle(q: QuatArg, dst?: T): { angle: number, axis: T } {\n const newDst = (dst ?? vec3.create(3)) as T;\n\n const angle = Math.acos(q[3]) * 2;\n const s = Math.sin(angle * 0.5);\n if (s > utils.EPSILON) {\n newDst[0] = q[0] / s;\n newDst[1] = q[1] / s;\n newDst[2] = q[2] / s;\n } else {\n newDst[0] = 1;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n\n return { angle, axis: newDst };\n}\n\n/**\n * Returns the angle in degrees between two rotations a and b.\n * @param a - quaternion a\n * @param b - quaternion b\n * @return angle in radians between the two quaternions\n */\nfunction angle(a: QuatArg, b: QuatArg) {\n const d = dot(a, b);\n return Math.acos(2 * d * d - 1);\n}\n\n/**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction multiply(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const bw = b[3];\n\n newDst[0] = ax * bw + aw * bx + ay * bz - az * by;\n newDst[1] = ay * bw + aw * by + az * bx - ax * bz;\n newDst[2] = az * bw + aw * bz + ax * by - ay * bx;\n newDst[3] = aw * bw - ax * bx - ay * by - az * bz;\n\n return newDst;\n}\n\n/**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nconst mul = multiply;\n\n/**\n * Rotates the given quaternion around the X axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateX(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const bx = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw + qw * bx;\n newDst[1] = qy * bw + qz * bx;\n newDst[2] = qz * bw - qy * bx;\n newDst[3] = qw * bw - qx * bx;\n\n return newDst;\n}\n\n/**\n * Rotates the given quaternion around the Y axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateY(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const by = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw - qz * by;\n newDst[1] = qy * bw + qw * by;\n newDst[2] = qz * bw + qx * by;\n newDst[3] = qw * bw - qy * by;\n\n return newDst;\n}\n\n/**\n * Rotates the given quaternion around the Z axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateZ(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const bz = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw + qy * bz;\n newDst[1] = qy * bw - qx * bz;\n newDst[2] = qz * bw + qw * bz;\n newDst[3] = qw * bw - qz * bz;\n\n return newDst;\n}\n\n/**\n * Spherically linear interpolate between two quaternions\n *\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction slerp(a: QuatArg, b: QuatArg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n\n let bx = b[0];\n let by = b[1];\n let bz = b[2];\n let bw = b[3];\n\n let cosOmega = ax * bx + ay * by + az * bz + aw * bw;\n\n if (cosOmega < 0) {\n cosOmega = -cosOmega;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n\n let scale0;\n let scale1;\n\n if (1.0 - cosOmega > utils.EPSILON) {\n const omega = Math.acos(cosOmega);\n const sinOmega = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinOmega;\n scale1 = Math.sin(t * omega) / sinOmega;\n } else {\n scale0 = 1.0 - t;\n scale1 = t;\n }\n\n newDst[0] = scale0 * ax + scale1 * bx;\n newDst[1] = scale0 * ay + scale1 * by;\n newDst[2] = scale0 * az + scale1 * bz;\n newDst[3] = scale0 * aw + scale1 * bw;\n\n return newDst;\n}\n\n/**\n * Compute the inverse of a quaternion\n *\n * @param q - quaternion to compute the inverse of\n * @returns A quaternion that is the result of a * b\n */\nfunction inverse(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const a0 = q[0];\n const a1 = q[1];\n const a2 = q[2];\n const a3 = q[3];\n\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n\n newDst[0] = -a0 * invDot;\n newDst[1] = -a1 * invDot;\n newDst[2] = -a2 * invDot;\n newDst[3] = a3 * invDot;\n\n return newDst;\n}\n\n/**\n * Compute the conjugate of a quaternion\n * For quaternions with a magnitude of 1 (a unit quaternion)\n * this returns the same as the inverse but is faster to calculate.\n *\n * @param q - quaternion to compute the conjugate of.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The conjugate of q\n */\nfunction conjugate(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = -q[0];\n newDst[1] = -q[1];\n newDst[2] = -q[2];\n newDst[3] = q[3];\n\n return newDst;\n}\n\n/**\n * Creates a quaternion from the given rotation matrix.\n *\n * The created quaternion is not normalized.\n *\n * @param m - rotation matrix\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\nfunction fromMat(m: Mat3Arg | Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n /*\n 0 1 2\n 3 4 5\n 6 7 8\n\n 0 1 2\n 4 5 6\n 8 9 10\n */\n\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n const trace = m[0] + m[5] + m[10];\n\n if (trace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n const root = Math.sqrt(trace + 1); // 2w\n newDst[3] = 0.5 * root;\n const invRoot = 0.5 / root; // 1/(4w)\n\n newDst[0] = (m[6] - m[9]) * invRoot;\n newDst[1] = (m[8] - m[2]) * invRoot;\n newDst[2] = (m[1] - m[4]) * invRoot;\n } else {\n // |w| <= 1/2\n let i = 0;\n\n if (m[5] > m[0]) {\n i = 1;\n }\n if (m[10] > m[i * 4 + i]) {\n i = 2;\n }\n\n const j = (i + 1) % 3;\n const k = (i + 2) % 3;\n\n const root = Math.sqrt(m[i * 4 + i] - m[j * 4 + j] - m[k * 4 + k] + 1.0);\n newDst[i] = 0.5 * root;\n\n const invRoot = 0.5 / root;\n\n newDst[3] = (m[j * 4 + k] - m[k * 4 + j]) * invRoot;\n newDst[j] = (m[j * 4 + i] + m[i * 4 + j]) * invRoot;\n newDst[k] = (m[k * 4 + i] + m[i * 4 + k]) * invRoot;\n }\n\n return newDst;\n}\n\n/**\n * Creates a quaternion from the given euler angle x, y, z using the provided intrinsic order for the conversion.\n *\n * @param xAngleInRadians - angle to rotate around X axis in radians.\n * @param yAngleInRadians - angle to rotate around Y axis in radians.\n * @param zAngleInRadians - angle to rotate around Z axis in radians.\n * @param order - order to apply euler angles\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion representing the same rotation as the euler angles applied in the given order\n */\nfunction fromEuler(\n xAngleInRadians: number,\n yAngleInRadians: number,\n zAngleInRadians: number,\n order: RotationOrder,\n dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const xHalfAngle = xAngleInRadians * 0.5;\n const yHalfAngle = yAngleInRadians * 0.5;\n const zHalfAngle = zAngleInRadians * 0.5;\n\n const sx = Math.sin(xHalfAngle);\n const cx = Math.cos(xHalfAngle);\n const sy = Math.sin(yHalfAngle);\n const cy = Math.cos(yHalfAngle);\n const sz = Math.sin(zHalfAngle);\n const cz = Math.cos(zHalfAngle);\n\n switch (order) {\n case 'xyz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'xzy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n case 'yxz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n case 'yzx':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'zxy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'zyx':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n default:\n throw new Error(`Unknown rotation order: ${order}`);\n }\n\n return newDst;\n}\n\n/**\n * Copies a quaternion. (same as {@link quat.clone})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is a copy of q\n */\nfunction copy(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = q[0];\n newDst[1] = q[1];\n newDst[2] = q[2];\n newDst[3] = q[3];\n\n return newDst;\n}\n\n/**\n * Clones a quaternion. (same as {@link quat.copy})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A copy of q.\n */\nconst clone = copy;\n\n/**\n * Adds two quaternions; assumes a and b have the same dimension.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the sum of a and b.\n */\nfunction add(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\nfunction subtract(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Multiplies a quaternion by a scalar.\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nfunction mulScalar(v: QuatArg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a quaternion by a scalar. (same as mulScalar)\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nfunction divScalar(v: QuatArg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two quaternions\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns dot product\n */\nfunction dot(a: QuatArg, b: QuatArg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n}\n\n/**\n * Performs linear interpolation on two quaternions.\n * Given quaternions a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param t - Interpolation coefficient.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: QuatArg, b: QuatArg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Computes the length of quaternion\n * @param v - quaternion.\n * @returns length of quaternion.\n */\nfunction length(v: QuatArg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n}\n\n/**\n * Computes the length of quaternion (same as length)\n * @param v - quaternion.\n * @returns length of quaternion.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of quaternion\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\nfunction lengthSq(v: QuatArg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n}\n\n/**\n * Computes the square of the length of quaternion (same as lengthSq)\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\nconst lenSq = lengthSq;\n\n/**\n * Divides a quaternion by its Euclidean length and returns the quotient.\n * @param v - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The normalized quaternion.\n */\nfunction normalize(v: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n }\n\n return newDst;\n}\n\n/**\n * Check if 2 quaternions are approximately equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are approximately equal\n */\nfunction equalsApproximately(a: QuatArg, b: QuatArg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON &&\n Math.abs(a[3] - b[3]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 quaternions are exactly equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are exactly equal\n */\nfunction equals(a: QuatArg, b: QuatArg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Creates an identity quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns an identity quaternion\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n\n return newDst;\n}\n\nconst tempVec3 = vec3.create();\nconst xUnitVec3 = vec3.create();\nconst yUnitVec3 = vec3.create();\n\n/**\n * Computes a quaternion to represent the shortest rotation from one vector to another.\n *\n * @param aUnit - the start vector\n * @param bUnit - the end vector\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\nfunction rotationTo(aUnit: Vec3Arg, bUnit: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const dot = vec3.dot(aUnit, bUnit);\n if (dot < -0.999999) {\n vec3.cross(xUnitVec3, aUnit, tempVec3);\n if (vec3.len(tempVec3) < 0.000001) {\n vec3.cross(yUnitVec3, aUnit, tempVec3);\n }\n\n vec3.normalize(tempVec3, tempVec3);\n fromAxisAngle(tempVec3, Math.PI, newDst);\n\n return newDst;\n } else if (dot > 0.999999) {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n\n return newDst;\n } else {\n vec3.cross(aUnit, bUnit, tempVec3);\n\n newDst[0] = tempVec3[0];\n newDst[1] = tempVec3[1];\n newDst[2] = tempVec3[2];\n newDst[3] = 1 + dot;\n\n return normalize(newDst, newDst);\n }\n}\n\nconst tempQuat1 = new Ctor(4);\nconst tempQuat2 = new Ctor(4);\n\n/**\n * Performs a spherical linear interpolation with two control points\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param c - the third quaternion\n * @param d - the fourth quaternion\n * @param t - Interpolation coefficient 0 to 1\n * @returns result\n */\nfunction sqlerp(\n a: QuatArg,\n b: QuatArg,\n c: QuatArg,\n d: QuatArg,\n t: number,\n dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n slerp(a, d, t, tempQuat1);\n slerp(b, c, t, tempQuat2);\n slerp(tempQuat1, tempQuat2, 2 * t * (1 - t), newDst);\n\n return newDst;\n}\n\nreturn {\n create,\n fromValues,\n set,\n fromAxisAngle,\n toAxisAngle,\n angle,\n multiply,\n mul,\n rotateX,\n rotateY,\n rotateZ,\n slerp,\n inverse,\n conjugate,\n fromMat,\n fromEuler,\n copy,\n clone,\n add,\n subtract,\n sub,\n mulScalar,\n scale,\n divScalar,\n dot,\n lerp,\n length,\n len,\n lengthSq,\n lenSq,\n normalize,\n equalsApproximately,\n equals,\n identity,\n rotationTo,\n sqlerp,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\n/**\n *\n * Quat4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Quat4`. In other words you can do this\n *\n * const v = quat4.cross(v1, v2); // Creates a new Quat4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = quat4.create();\n * quat4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * quat4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nexport function getAPI(Ctor: QuatCtor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Vec4Arg, Vec4Type } from './vec4';\nimport { Mat4Arg } from './mat4';\nimport { BaseArgType } from './types';\n\nexport { Vec4Arg, Vec4Type };\n\ntype Vec4Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec4\n * */\nfunction getAPIImpl(Ctor: Vec4Ctor) {\n\n/**\n * Creates a vec4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number, w?: number) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a vec4; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec4\n * Also see {@link vec4.create} and {@link vec4.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, w: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n newDst[3] = Math.ceil(v[3]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n newDst[3] = Math.floor(v[3]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n newDst[3] = Math.round(v[3]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec4Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n newDst[3] = Math.min(max, Math.max(min, v[3]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec4Arg, b: Vec4Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n newDst[3] = a[3] + b[3] * scale;\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec4Arg, b: Vec4Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON &&\n Math.abs(a[3] - b[3]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec4Arg, b: Vec4Arg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec4Arg, b: Vec4Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec4Arg, b: Vec4Arg, t: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n newDst[3] = a[3] + t[3] * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n newDst[3] = Math.max(a[3], b[3]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n newDst[3] = Math.min(a[3], b[3]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec4Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec4Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n newDst[3] = 1 / v[3];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the dot product of two vectors\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec4Arg, b: Vec4Arg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec4Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec4Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec4Arg, b: Vec4Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec4Arg, b: Vec4Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return dx * dx + dy * dy + dz * dz + dw * dw;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n }\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n newDst[3] = -v[3];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec4.clone})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n newDst[3] = v[3];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec4.copy})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n newDst[3] = a[3] * b[3];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n newDst[3] = a[3] / b[3];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform vec4 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec4 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec4Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = v[3];\n\n newDst[0] = m[0] * x + m[4] * y + m[ 8] * z + m[12] * w;\n newDst[1] = m[1] * x + m[5] * y + m[ 9] * z + m[13] * w;\n newDst[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n newDst[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n\n return newDst;\n}\n\n\n/**\n * Treat a 4D vector as a direction and set it's length\n *\n * @param a The vec4 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec4Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec4 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec4Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n zero,\n transformMat4,\n setLength,\n truncate,\n midpoint,\n};\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\n/**\n *\n * Vec4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Vec4`. In other words you can do this\n *\n * const v = vec4.cross(v1, v2); // Creates a new Vec4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = vec4.create();\n * vec4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * vec4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nexport function getAPI(Ctor: Vec4Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n\n","/**\n * Some docs\n * @namespace wgpu-matrix\n */\nimport {MutableNumberArray, 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 MutableNumberArray,\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":";;;;;;;IAiBA,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;;IC7BvE;;;;;;;;;;;;;;;;;;;;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,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAChB,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,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.map b/dist/3.x/wgpu-matrix.min.js.map index 047e293..94dd1ee 100644 --- a/dist/3.x/wgpu-matrix.min.js.map +++ b/dist/3.x/wgpu-matrix.min.js.map @@ -1 +1 @@ -{"version":3,"file":"wgpu-matrix.min.js","sources":["../../../src/types.ts","../../../src/utils.ts","../../../src/vec2-impl.ts","../../../src/vec3-impl.ts","../../../src/mat3-impl.ts","../../../src/mat4-impl.ts","../../../src/quat-impl.ts","../../../src/vec4-impl.ts","../../../src/wgpu-matrix.ts"],"sourcesContent":["/**\n * The types you can pass to most functions that take an\n * array of numbers.\n */\nexport type BaseArgType = Float32Array | Float64Array | number[];\n\nfunction wrapConstructor any>(\n OriginalConstructor: T,\n modifier: (instance: InstanceType) => void\n): T {\n return class extends OriginalConstructor {\n constructor(...args: any[]) {\n super(...args);\n modifier(this as InstanceType);\n }\n } as T; // Type assertion is necessary here\n}\n\nexport const ZeroArray = wrapConstructor(Array, a => a.fill(0));\n\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nexport let EPSILON = 0.000001;\n\n/**\n * Set the value for EPSILON for various checks\n * @param v - Value to use for EPSILON.\n * @returns previous value of EPSILON;\n */\nexport function setEpsilon(v: number): number {\n const old = EPSILON;\n EPSILON = v;\n return old;\n}\n\n/**\n * Convert degrees to radians\n * @param degrees - Angle in degrees\n * @returns angle converted to radians\n */\nexport function degToRad(degrees: number): number {\n return degrees * Math.PI / 180;\n}\n\n/**\n * Convert radians to degrees\n * @param radians - Angle in radians\n * @returns angle converted to degrees\n */\nexport function radToDeg(radians: number): number {\n return radians * 180 / Math.PI;\n}\n\n/**\n * Lerps between a and b via t\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @returns a + (b - a) * t\n */\nexport function lerp(a: number, b: number, t: number): number {\n return a + (b - a) * t;\n}\n\n/**\n * Compute the opposite of lerp. Given a and b and a value between\n * a and b returns a value between 0 and 1. 0 if a, 1 if b.\n * Note: no clamping is done.\n * @param a - start value\n * @param b - end value\n * @param v - value between a and b\n * @returns (v - a) / (b - a)\n */\nexport function inverseLerp(a: number, b: number, v: number): number {\n const d = b - a;\n return (Math.abs(b - a) < EPSILON)\n ? a\n : (v - a) / d;\n}\n\n/**\n * Compute the euclidean modulo\n *\n * ```\n * // table for n / 3\n * -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 <- n\n * ------------------------------------\n * -2 -1 -0 -2 -1 0, 1, 2, 0, 1, 2 <- n % 3\n * 1 2 0 1 2 0, 1, 2, 0, 1, 2 <- euclideanModule(n, 3)\n * ```\n *\n * @param n - dividend\n * @param m - divisor\n * @returns the euclidean modulo of n / m\n */\nexport function euclideanModulo(n: number, m: number) {\n return ((n % m) + m) % m;\n}","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Mat3Arg } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { Vec2Arg, Vec2Type } from './vec2';\nimport { Vec3Arg } from './vec3';\nimport { BaseArgType } from './types';\n\nexport { Vec2Arg, Vec2Type };\n\ntype Vec2Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec3\n */\nfunction getAPIImpl(Ctor: Vec2Ctor) {\n\n/**\n * Creates a Vec2; may be called with x, y, z to set initial values.\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Vec2's specified type\n * it would be faster to use\n *\n * ```\n * const v = vec2.clone(someJSArray);\n * ```\n *\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\nfunction create(x = 0, y = 0) {\n const newDst = new Ctor(2);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n }\n }\n return newDst;\n}\n\n/**\n * Creates a Vec2; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec2\n * Also see {@link vec2.create} and {@link vec2.copy}\n *\n * @param x first value\n * @param y second value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec2Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec2Arg, b: Vec2Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n\n return newDst;\n}\n\n/**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\nfunction angle(a: Vec2Arg, b: Vec2Arg): number {\n const ax = a[0];\n const ay = a[1];\n const bx = b[0];\n const by = b[1];\n const mag1 = Math.sqrt(ax * ax + ay * ay);\n const mag2 = Math.sqrt(bx * bx + by * by);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec2Arg, b: Vec2Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec2Arg, b: Vec2Arg): boolean {\n return a[0] === b[0] && a[1] === b[1];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec2Arg, b: Vec2Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec2Arg, b: Vec2Arg, t: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec2Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec2Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\nfunction cross(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const z = a[0] * b[1] - a[1] * b[0];\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = z;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec2Arg, b: Vec2Arg): number {\n return a[0] * b[0] + a[1] * b[1];\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec2Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n return Math.sqrt(v0 * v0 + v1 * v1);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec2Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n return v0 * v0 + v1 * v1;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec2Arg, b: Vec2Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return Math.sqrt(dx * dx + dy * dy);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec2Arg, b: Vec2Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return dx * dx + dy * dy;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const len = Math.sqrt(v0 * v0 + v1 * v1);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n }\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec2.clone})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec2.copy})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Creates a random unit vector * scale\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\nfunction random(scale = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const angle = Math.random() * 2 * Math.PI;\n newDst[0] = Math.cos(angle) * scale;\n newDst[1] = Math.sin(angle) * scale;\n\n return newDst;\n}\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform Vec2 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec2Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const x = v[0];\n const y = v[1];\n\n newDst[0] = x * m[0] + y * m[4] + m[12];\n newDst[1] = x * m[1] + y * m[5] + m[13];\n\n return newDst;\n}\n\n/**\n * Transforms vec4 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat3(v: Vec2Arg, m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const x = v[0];\n const y = v[1];\n\n newDst[0] = m[0] * x + m[4] * y + m[8];\n newDst[1] = m[1] * x + m[5] * y + m[9];\n\n return newDst;\n}\n\n/**\n * Rotate a 2D vector\n *\n * @param a The vec2 point to rotate\n * @param b The origin of the rotation\n * @param rad The angle of rotation in radians\n * @returns the rotated vector\n */\nfunction rotate(a: Vec2Arg, b: Vec2Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n // Translate point to the origin\n const p0 = a[0] - b[0];\n const p1 = a[1] - b[1];\n const sinC = Math.sin(rad);\n const cosC = Math.cos(rad);\n\n //perform rotation and translate to correct position\n newDst[0] = p0 * cosC - p1 * sinC + b[0];\n newDst[1] = p0 * sinC + p1 * cosC + b[1];\n\n return newDst;\n}\n\n/**\n * Treat a 2D vector as a direction and set it's length\n *\n * @param a The vec2 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec2Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec2 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec2Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat3,\n rotate,\n setLength,\n truncate,\n midpoint,\n};\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Vec2Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Vec3Arg, Vec3Type } from './vec3';\nimport { Mat3Arg } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { QuatArg } from './quat';\nimport { BaseArgType } from './types';\n\nexport { Vec3Arg, Vec3Type };\n\ntype Vec3Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec3\n * */\nfunction getAPIImpl(Ctor: Vec3Ctor) {\n\n/**\n * Creates a vec3; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number) {\n const newDst = new Ctor(3);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a vec3; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec3\n * Also see {@link vec3.create} and {@link vec3.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec3Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec3Arg, b: Vec3Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n\n return newDst;\n}\n\n/**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\nfunction angle(a: Vec3Arg, b: Vec3Arg): number {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const mag1 = Math.sqrt(ax * ax + ay * ay + az * az);\n const mag2 = Math.sqrt(bx * bx + by * by + bz * bz);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec3Arg, b: Vec3Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec3Arg, b: Vec3Arg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec3Arg, b: Vec3Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec3Arg, b: Vec3Arg, t: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec3Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec3Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\nfunction cross(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const t1 = a[2] * b[0] - a[0] * b[2];\n const t2 = a[0] * b[1] - a[1] * b[0];\n newDst[0] = a[1] * b[2] - a[2] * b[1];\n newDst[1] = t1;\n newDst[2] = t2;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec3Arg, b: Vec3Arg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]);\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec3Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec3Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return v0 * v0 + v1 * v1 + v2 * v2;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec3Arg, b: Vec3Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return Math.sqrt(dx * dx + dy * dy + dz * dz);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec3Arg, b: Vec3Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return dx * dx + dy * dy + dz * dz;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec3.clone})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec3.copy})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Creates a random vector\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\nfunction random(scale = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const angle = Math.random() * 2 * Math.PI;\n const z = Math.random() * 2 - 1;\n const zScale = Math.sqrt(1 - z * z) * scale;\n newDst[0] = Math.cos(angle) * zScale;\n newDst[1] = Math.sin(angle) * zScale;\n newDst[2] = z * scale;\n\n return newDst;\n}\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform vec3 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec3Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1;\n\n newDst[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n newDst[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n newDst[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n\n return newDst;\n}\n\n/**\n * Transform vec3 by upper 3x3 matrix inside 4x4 matrix.\n * @param v - The direction.\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns The transformed vector.\n */\nfunction transformMat4Upper3x3(v: Vec3Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[0] = v0 * m[0 * 4 + 0] + v1 * m[1 * 4 + 0] + v2 * m[2 * 4 + 0];\n newDst[1] = v0 * m[0 * 4 + 1] + v1 * m[1 * 4 + 1] + v2 * m[2 * 4 + 1];\n newDst[2] = v0 * m[0 * 4 + 2] + v1 * m[1 * 4 + 2] + v2 * m[2 * 4 + 2];\n\n return newDst;\n}\n\n/**\n * Transforms vec3 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat3(v: Vec3Arg, m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n\n newDst[0] = x * m[0] + y * m[4] + z * m[8];\n newDst[1] = x * m[1] + y * m[5] + z * m[9];\n newDst[2] = x * m[2] + y * m[6] + z * m[10];\n\n return newDst;\n}\n\n/**\n * Transforms vec3 by Quaternion\n * @param v - the vector to transform\n * @param q - the quaternion to transform by\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed\n */\nfunction transformQuat(v: Vec3Arg, q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n\n const uvX = qy * z - qz * y;\n const uvY = qz * x - qx * z;\n const uvZ = qx * y - qy * x;\n\n newDst[0] = x + uvX * w2 + (qy * uvZ - qz * uvY) * 2;\n newDst[1] = y + uvY * w2 + (qz * uvX - qx * uvZ) * 2;\n newDst[2] = z + uvZ * w2 + (qx * uvY - qy * uvX) * 2;\n\n return newDst;\n}\n\n/**\n * Returns the translation component of a 4-by-4 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\nfunction getTranslation(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n}\n/**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat4Arg, axis: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n}\n/**\n * Returns the scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the x-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\nfunction rotateX(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n //Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n //perform rotation\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad);\n\n //translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the y-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\nfunction rotateY(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n // perform rotation\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad);\n\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the z-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns {vec3} out\n */\nfunction rotateZ(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n // perform rotation\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2];\n\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Treat a 3D vector as a direction and set it's length\n *\n * @param a The vec3 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec3Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec3 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec3Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat4Upper3x3,\n transformMat3,\n transformQuat,\n getTranslation,\n getAxis,\n getScaling,\n rotateX,\n rotateY,\n rotateZ,\n setLength,\n truncate,\n midpoint,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Vec3Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nimport * as utils from './utils.js';\nimport { QuatArg } from './quat';\nimport { Mat3Arg, Mat3Type } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { Vec2Arg } from './vec2';\nimport { Vec3Arg } from './vec3';\nimport { getAPI as getVec2API } from './vec2-impl';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\n\nexport { Mat3Arg, Mat3Type };\n\ntype Mat3Ctor = new (n: number) => T;\n\n/**\n * Generates a typed API for Mat3\n * */\nfunction getAPIImpl(Ctor: Mat3Ctor) {\n const vec2 = getVec2API(Ctor);\n const vec3 = getVec3API(Ctor);\n\n/**\n * Create a Mat3 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat3's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat3.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @returns matrix created from values.\n */\nfunction create(\n v0?: number, v1?: number, v2?: number,\n v3?: number, v4?: number, v5?: number,\n v6?: number, v7?: number, v8?: number) {\n const newDst = new Ctor(12);\n // to make the array homogenous\n newDst[3] = 0;\n newDst[7] = 0;\n newDst[11] = 0;\n\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[4] = v3;\n if (v4 !== undefined) {\n newDst[5] = v4;\n if (v5 !== undefined) {\n newDst[6] = v5;\n if (v6 !== undefined) {\n newDst[8] = v6;\n if (v7 !== undefined) {\n newDst[9] = v7;\n if (v8 !== undefined) {\n newDst[10] = v8;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n\n return newDst;\n}\n\n/**\n * Sets the values of a Mat3\n * Also see {@link mat3.create} and {@link mat3.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 set from values.\n */\nfunction set(\n v0: number, v1: number, v2: number,\n v3: number, v4: number, v5: number,\n v6: number, v7: number, v8: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[0] = v0; newDst[1] = v1; newDst[ 2] = v2; newDst[ 3] = 0;\n newDst[4] = v3; newDst[5] = v4; newDst[ 6] = v5; newDst[ 7] = 0;\n newDst[8] = v6; newDst[9] = v7; newDst[10] = v8; newDst[11] = 0;\n\n return newDst;\n}\n\n/**\n * Creates a Mat3 from the upper left 3x3 part of a Mat4\n * @param m4 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from m4\n */\nfunction fromMat4(m4: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n newDst[0] = m4[0]; newDst[1] = m4[1]; newDst[ 2] = m4[ 2]; newDst[ 3] = 0;\n newDst[4] = m4[4]; newDst[5] = m4[5]; newDst[ 6] = m4[ 6]; newDst[ 7] = 0;\n newDst[8] = m4[8]; newDst[9] = m4[9]; newDst[10] = m4[10]; newDst[11] = 0;\n return newDst;\n}\n\n/**\n * Creates a Mat3 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from q\n */\nfunction fromQuat(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3];\n const x2 = x + x; const y2 = y + y; const z2 = z + z;\n\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n newDst[ 0] = 1 - yy - zz; newDst[ 1] = yx + wz; newDst[ 2] = zx - wy; newDst[ 3] = 0;\n newDst[ 4] = yx - wz; newDst[ 5] = 1 - xx - zz; newDst[ 6] = zy + wx; newDst[ 7] = 0;\n newDst[ 8] = zx + wy; newDst[ 9] = zy - wx; newDst[10] = 1 - xx - yy; newDst[11] = 0;\n\n return newDst;\n}\n\n/**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\nfunction negate(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = -m[ 0]; newDst[ 1] = -m[ 1]; newDst[ 2] = -m[ 2];\n newDst[ 4] = -m[ 4]; newDst[ 5] = -m[ 5]; newDst[ 6] = -m[ 6];\n newDst[ 8] = -m[ 8]; newDst[ 9] = -m[ 9]; newDst[10] = -m[10];\n\n return newDst;\n}\n\n/**\n * Copies a matrix. (same as {@link mat3.clone})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nfunction copy(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = m[ 0]; newDst[ 1] = m[ 1]; newDst[ 2] = m[ 2];\n newDst[ 4] = m[ 4]; newDst[ 5] = m[ 5]; newDst[ 6] = m[ 6];\n newDst[ 8] = m[ 8]; newDst[ 9] = m[ 9]; newDst[10] = m[10];\n\n return newDst;\n}\n\n/**\n * Copies a matrix (same as {@link mat3.copy})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nconst clone = copy;\n\n/**\n * Check if 2 matrices are approximately equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are approximately equal\n */\nfunction equalsApproximately(a: Mat3Arg, b: Mat3Arg): boolean {\n return Math.abs(a[ 0] - b[ 0]) < utils.EPSILON &&\n Math.abs(a[ 1] - b[ 1]) < utils.EPSILON &&\n Math.abs(a[ 2] - b[ 2]) < utils.EPSILON &&\n Math.abs(a[ 4] - b[ 4]) < utils.EPSILON &&\n Math.abs(a[ 5] - b[ 5]) < utils.EPSILON &&\n Math.abs(a[ 6] - b[ 6]) < utils.EPSILON &&\n Math.abs(a[ 8] - b[ 8]) < utils.EPSILON &&\n Math.abs(a[ 9] - b[ 9]) < utils.EPSILON &&\n Math.abs(a[10] - b[10]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 matrices are exactly equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are exactly equal\n */\nfunction equals(a: Mat3Arg, b: Mat3Arg): boolean {\n return a[ 0] === b[ 0] &&\n a[ 1] === b[ 1] &&\n a[ 2] === b[ 2] &&\n a[ 4] === b[ 4] &&\n a[ 5] === b[ 5] &&\n a[ 6] === b[ 6] &&\n a[ 8] === b[ 8] &&\n a[ 9] === b[ 9] &&\n a[10] === b[10];\n}\n\n/**\n * Creates a 3-by-3 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 3-by-3 identity matrix.\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\nfunction transpose(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n if (newDst === m) {\n let t: number;\n\n // 0 1 2\n // 4 5 6\n // 8 9 10\n\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n\n return newDst;\n }\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n newDst[ 0] = m00; newDst[ 1] = m10; newDst[ 2] = m20;\n newDst[ 4] = m01; newDst[ 5] = m11; newDst[ 6] = m21;\n newDst[ 8] = m02; newDst[ 9] = m12; newDst[10] = m22;\n\n return newDst;\n}\n\n/**\n * Computes the inverse of a 3-by-3 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nfunction inverse(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n const b01 = m22 * m11 - m12 * m21;\n const b11 = -m22 * m10 + m12 * m20;\n const b21 = m21 * m10 - m11 * m20;\n\n const invDet = 1 / (m00 * b01 + m01 * b11 + m02 * b21);\n\n newDst[ 0] = b01 * invDet;\n newDst[ 1] = (-m22 * m01 + m02 * m21) * invDet;\n newDst[ 2] = ( m12 * m01 - m02 * m11) * invDet;\n newDst[ 4] = b11 * invDet;\n newDst[ 5] = ( m22 * m00 - m02 * m20) * invDet;\n newDst[ 6] = (-m12 * m00 + m02 * m10) * invDet;\n newDst[ 8] = b21 * invDet;\n newDst[ 9] = (-m21 * m00 + m01 * m20) * invDet;\n newDst[10] = ( m11 * m00 - m01 * m10) * invDet;\n\n return newDst;\n}\n\n/**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\nfunction determinant(m: Mat3Arg): number {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n return m00 * (m11 * m22 - m21 * m12) -\n m10 * (m01 * m22 - m21 * m02) +\n m20 * (m01 * m12 - m11 * m02);\n}\n\n/**\n * Computes the inverse of a 3-by-3 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nconst invert = inverse;\n\n/**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nfunction multiply(a: Mat3Arg, b: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[ 4 + 0];\n const a11 = a[ 4 + 1];\n const a12 = a[ 4 + 2];\n const a20 = a[ 8 + 0];\n const a21 = a[ 8 + 1];\n const a22 = a[ 8 + 2];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b10 = b[ 4 + 0];\n const b11 = b[ 4 + 1];\n const b12 = b[ 4 + 2];\n const b20 = b[ 8 + 0];\n const b21 = b[ 8 + 1];\n const b22 = b[ 8 + 2];\n\n newDst[ 0] = a00 * b00 + a10 * b01 + a20 * b02;\n newDst[ 1] = a01 * b00 + a11 * b01 + a21 * b02;\n newDst[ 2] = a02 * b00 + a12 * b01 + a22 * b02;\n newDst[ 4] = a00 * b10 + a10 * b11 + a20 * b12;\n newDst[ 5] = a01 * b10 + a11 * b11 + a21 * b12;\n newDst[ 6] = a02 * b10 + a12 * b11 + a22 * b12;\n newDst[ 8] = a00 * b20 + a10 * b21 + a20 * b22;\n newDst[ 9] = a01 * b20 + a11 * b21 + a21 * b22;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22;\n\n return newDst;\n}\n\n/**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nconst mul = multiply;\n\n/**\n * Sets the translation component of a 3-by-3 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\nfunction setTranslation(a: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? identity()) as T;\n if (a !== newDst) {\n newDst[ 0] = a[ 0];\n newDst[ 1] = a[ 1];\n newDst[ 2] = a[ 2];\n newDst[ 4] = a[ 4];\n newDst[ 5] = a[ 5];\n newDst[ 6] = a[ 6];\n }\n newDst[ 8] = v[0];\n newDst[ 9] = v[1];\n newDst[10] = 1;\n return newDst;\n}\n\n/**\n * Returns the translation component of a 3-by-3 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\nfunction getTranslation(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec2.create()) as T;\n newDst[0] = m[8];\n newDst[1] = m[9];\n return newDst;\n}\n\n/**\n * Returns an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y,\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat3Arg, axis: number, dst?: T) {\n const newDst = (dst ?? vec2.create()) as T;\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n return newDst;\n}\n\n/**\n * Sets an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\nfunction setAxis(m: Mat3Arg, v: Vec2Arg, axis: number, dst?: T) {\n const newDst = (dst === m ? m : copy(m, dst)) as T;\n\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n return newDst;\n}\n\n/**\n * Returns the \"2d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec2.create());\n\n const xx = m[0];\n const xy = m[1];\n const yx = m[4];\n const yy = m[5];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy);\n newDst[1] = Math.sqrt(yx * yx + yy * yy);\n\n return newDst;\n}\n\n\n/**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction get3DScaling(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec3.create());\n\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which translates by the given vector v.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\nfunction translation(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = v[0]; newDst[ 9] = v[1]; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Translates the given 3-by-3 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\nfunction translate(m: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 0] = m00;\n newDst[ 1] = m01;\n newDst[ 2] = m02;\n newDst[ 4] = m10;\n newDst[ 5] = m11;\n newDst[ 6] = m12;\n }\n\n newDst[ 8] = m00 * v0 + m10 * v1 + m20;\n newDst[ 9] = m01 * v0 + m11 * v1 + m21;\n newDst[10] = m02 * v0 + m12 * v1 + m22;\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotation(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = s; newDst[ 2] = 0;\n newDst[ 4] = -s; newDst[ 5] = c; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix by the given angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotate(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 + s * m10;\n newDst[ 1] = c * m01 + s * m11;\n newDst[ 2] = c * m02 + s * m12;\n\n newDst[ 4] = c * m10 - s * m00;\n newDst[ 5] = c * m11 - s * m01;\n newDst[ 6] = c * m12 - s * m02;\n\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the x-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationX(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = c; newDst[ 6] = s;\n newDst[ 8] = 0; newDst[ 9] = -s; newDst[10] = c;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix around the x-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateX(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[4] = c * m10 + s * m20;\n newDst[5] = c * m11 + s * m21;\n newDst[6] = c * m12 + s * m22;\n newDst[8] = c * m20 - s * m10;\n newDst[9] = c * m21 - s * m11;\n newDst[10] = c * m22 - s * m12;\n\n if (m !== newDst) {\n newDst[ 0] = m[ 0];\n newDst[ 1] = m[ 1];\n newDst[ 2] = m[ 2];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the y-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationY(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = 0; newDst[ 2] = -s;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = s; newDst[ 9] = 0; newDst[10] = c;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix around the y-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateY(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 - s * m20;\n newDst[ 1] = c * m01 - s * m21;\n newDst[ 2] = c * m02 - s * m22;\n newDst[ 8] = c * m20 + s * m00;\n newDst[ 9] = c * m21 + s * m01;\n newDst[10] = c * m22 + s * m02;\n\n if (m !== newDst) {\n newDst[ 4] = m[ 4];\n newDst[ 5] = m[ 5];\n newDst[ 6] = m[ 6];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the z-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nconst rotationZ = rotation;\n\n/**\n * Rotates the given 3-by-3 matrix around the z-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nconst rotateZ = rotate;\n\n/**\n * Creates a 3-by-3 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has two\n * entries.\n * @param v - A vector of\n * 2 entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * two entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of 2 entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale(m: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * 3 entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling3D(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = v[2];\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of 3 entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale3D(m: Mat3Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n\n newDst[ 8] = v2 * m[2 * 4 + 0];\n newDst[ 9] = v2 * m[2 * 4 + 1];\n newDst[10] = v2 * m[2 * 4 + 2];\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales uniformly in the X and Y dimensions\n * @param s - Amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in the X and Y dimension by an amount\n * given.\n * @param m - The matrix to be modified.\n * @param s - Amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale(m: Mat3Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales uniformly in each dimension\n * @param s - Amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling3D(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = s;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given.\n * @param m - The matrix to be modified.\n * @param s - Amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale3D(m: Mat3Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n\n newDst[ 8] = s * m[2 * 4 + 0];\n newDst[ 9] = s * m[2 * 4 + 1];\n newDst[10] = s * m[2 * 4 + 2];\n\n return newDst;\n}\n\nreturn {\n clone,\n create,\n set,\n fromMat4,\n fromQuat,\n negate,\n copy,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n invert,\n determinant,\n mul,\n multiply,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n get3DScaling,\n translation,\n translate,\n rotation,\n rotate,\n rotationX,\n rotateX,\n rotationY,\n rotateY,\n rotationZ,\n rotateZ,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n scaling3D,\n scale3D,\n uniformScaling3D,\n uniformScale3D,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Mat3Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","import { Mat4Arg, Mat4Type } from './mat4';\nimport { Mat3Arg } from './mat3';\nimport { QuatArg } from './quat';\nimport { Vec3Arg } from './vec3';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\nimport * as utils from './utils';\n\nexport { Mat4Arg, Mat4Type };\n\ntype Mat4Ctor = new (n: number) => T;\n\n/**\n * Generates a typed API for Mat4\n * */\nfunction getAPIImpl(Ctor: Mat4Ctor) {\n const vec3 = getVec3API(Ctor);\n\n/**\n * 4x4 Matrix math math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new matrix. In other words you can do this\n *\n * const mat = mat4.translation([1, 2, 3]); // Creates a new translation matrix\n *\n * or\n *\n * const mat = mat4.create();\n * mat4.translation([1, 2, 3], mat); // Puts translation matrix in mat.\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always save to pass any matrix as the destination. So for example\n *\n * const mat = mat4.identity();\n * const trans = mat4.translation([1, 2, 3]);\n * mat4.multiply(mat, trans, mat); // Multiplies mat * trans and puts result in mat.\n *\n */\n\n\n/**\n * Create a Mat4 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat4's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat4.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @returns created from values.\n */\nfunction create(\n v0?: number, v1?: number, v2?: number, v3?: number,\n v4?: number, v5?: number, v6?: number, v7?: number,\n v8?: number, v9?: number, v10?: number, v11?: number,\n v12?: number, v13?: number, v14?: number, v15?: number) {\n const newDst = new Ctor(16);\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[3] = v3;\n if (v4 !== undefined) {\n newDst[4] = v4;\n if (v5 !== undefined) {\n newDst[5] = v5;\n if (v6 !== undefined) {\n newDst[6] = v6;\n if (v7 !== undefined) {\n newDst[7] = v7;\n if (v8 !== undefined) {\n newDst[8] = v8;\n if (v9 !== undefined) {\n newDst[9] = v9;\n if (v10 !== undefined) {\n newDst[10] = v10;\n if (v11 !== undefined) {\n newDst[11] = v11;\n if (v12 !== undefined) {\n newDst[12] = v12;\n if (v13 !== undefined) {\n newDst[13] = v13;\n if (v14 !== undefined) {\n newDst[14] = v14;\n if (v15 !== undefined) {\n newDst[15] = v15;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Sets the values of a Mat4\n * Also see {@link mat4.create} and {@link mat4.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 created from values.\n */\nfunction set(\n v0: number, v1: number, v2: number, v3: number,\n v4: number, v5: number, v6: number, v7: number,\n v8: number, v9: number, v10: number, v11: number,\n v12: number, v13: number, v14: number, v15: number,\n dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = v0; newDst[ 1] = v1; newDst[ 2] = v2; newDst[ 3] = v3;\n newDst[ 4] = v4; newDst[ 5] = v5; newDst[ 6] = v6; newDst[ 7] = v7;\n newDst[ 8] = v8; newDst[ 9] = v9; newDst[10] = v10; newDst[11] = v11;\n newDst[12] = v12; newDst[13] = v13; newDst[14] = v14; newDst[15] = v15;\n\n return newDst;\n}\n\n/**\n * Creates a Mat4 from a Mat3\n * @param m3 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from m3\n */\nfunction fromMat3(m3: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = m3[0]; newDst[ 1] = m3[1]; newDst[ 2] = m3[ 2]; newDst[ 3] = 0;\n newDst[ 4] = m3[4]; newDst[ 5] = m3[5]; newDst[ 6] = m3[ 6]; newDst[ 7] = 0;\n newDst[ 8] = m3[8]; newDst[ 9] = m3[9]; newDst[10] = m3[10]; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a Mat4 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from q\n */\nfunction fromQuat(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3];\n const x2 = x + x; const y2 = y + y; const z2 = z + z;\n\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n newDst[ 0] = 1 - yy - zz; newDst[ 1] = yx + wz; newDst[ 2] = zx - wy; newDst[ 3] = 0;\n newDst[ 4] = yx - wz; newDst[ 5] = 1 - xx - zz; newDst[ 6] = zy + wx; newDst[ 7] = 0;\n newDst[ 8] = zx + wy; newDst[ 9] = zy - wx; newDst[10] = 1 - xx - yy; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\nfunction negate(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = -m[ 0]; newDst[ 1] = -m[ 1]; newDst[ 2] = -m[ 2]; newDst[ 3] = -m[ 3];\n newDst[ 4] = -m[ 4]; newDst[ 5] = -m[ 5]; newDst[ 6] = -m[ 6]; newDst[ 7] = -m[ 7];\n newDst[ 8] = -m[ 8]; newDst[ 9] = -m[ 9]; newDst[10] = -m[10]; newDst[11] = -m[11];\n newDst[12] = -m[12]; newDst[13] = -m[13]; newDst[14] = -m[14]; newDst[15] = -m[15];\n\n return newDst;\n}\n\n/**\n * Copies a matrix. (same as {@link mat4.clone})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nfunction copy(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = m[ 0]; newDst[ 1] = m[ 1]; newDst[ 2] = m[ 2]; newDst[ 3] = m[ 3];\n newDst[ 4] = m[ 4]; newDst[ 5] = m[ 5]; newDst[ 6] = m[ 6]; newDst[ 7] = m[ 7];\n newDst[ 8] = m[ 8]; newDst[ 9] = m[ 9]; newDst[10] = m[10]; newDst[11] = m[11];\n newDst[12] = m[12]; newDst[13] = m[13]; newDst[14] = m[14]; newDst[15] = m[15];\n\n return newDst;\n}\n\n/**\n * Copies a matrix (same as {@link mat4.copy})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nconst clone = copy;\n\n/**\n * Check if 2 matrices are approximately equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are approximately equal\n */\nfunction equalsApproximately(a: Mat4Arg, b: Mat4Arg): boolean {\n return Math.abs(a[ 0] - b[ 0]) < utils.EPSILON &&\n Math.abs(a[ 1] - b[ 1]) < utils.EPSILON &&\n Math.abs(a[ 2] - b[ 2]) < utils.EPSILON &&\n Math.abs(a[ 3] - b[ 3]) < utils.EPSILON &&\n Math.abs(a[ 4] - b[ 4]) < utils.EPSILON &&\n Math.abs(a[ 5] - b[ 5]) < utils.EPSILON &&\n Math.abs(a[ 6] - b[ 6]) < utils.EPSILON &&\n Math.abs(a[ 7] - b[ 7]) < utils.EPSILON &&\n Math.abs(a[ 8] - b[ 8]) < utils.EPSILON &&\n Math.abs(a[ 9] - b[ 9]) < utils.EPSILON &&\n Math.abs(a[10] - b[10]) < utils.EPSILON &&\n Math.abs(a[11] - b[11]) < utils.EPSILON &&\n Math.abs(a[12] - b[12]) < utils.EPSILON &&\n Math.abs(a[13] - b[13]) < utils.EPSILON &&\n Math.abs(a[14] - b[14]) < utils.EPSILON &&\n Math.abs(a[15] - b[15]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 matrices are exactly equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are exactly equal\n */\nfunction equals(a: Mat4Arg, b: Mat4Arg): boolean {\n return a[ 0] === b[ 0] &&\n a[ 1] === b[ 1] &&\n a[ 2] === b[ 2] &&\n a[ 3] === b[ 3] &&\n a[ 4] === b[ 4] &&\n a[ 5] === b[ 5] &&\n a[ 6] === b[ 6] &&\n a[ 7] === b[ 7] &&\n a[ 8] === b[ 8] &&\n a[ 9] === b[ 9] &&\n a[10] === b[10] &&\n a[11] === b[11] &&\n a[12] === b[12] &&\n a[13] === b[13] &&\n a[14] === b[14] &&\n a[15] === b[15];\n}\n\n/**\n * Creates a 4-by-4 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 4-by-4 identity matrix.\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\nfunction transpose(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n if (newDst === m) {\n let t;\n\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n\n t = m[3];\n m[3] = m[12];\n m[12] = t;\n\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n\n t = m[7];\n m[7] = m[13];\n m[13] = t;\n\n t = m[11];\n m[11] = m[14];\n m[14] = t;\n return newDst;\n }\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n newDst[ 0] = m00; newDst[ 1] = m10; newDst[ 2] = m20; newDst[ 3] = m30;\n newDst[ 4] = m01; newDst[ 5] = m11; newDst[ 6] = m21; newDst[ 7] = m31;\n newDst[ 8] = m02; newDst[ 9] = m12; newDst[10] = m22; newDst[11] = m32;\n newDst[12] = m03; newDst[13] = m13; newDst[14] = m23; newDst[15] = m33;\n\n return newDst;\n}\n\n/**\n * Computes the inverse of a 4-by-4 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nfunction inverse(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n const tmp12 = m20 * m31;\n const tmp13 = m30 * m21;\n const tmp14 = m10 * m31;\n const tmp15 = m30 * m11;\n const tmp16 = m10 * m21;\n const tmp17 = m20 * m11;\n const tmp18 = m00 * m31;\n const tmp19 = m30 * m01;\n const tmp20 = m00 * m21;\n const tmp21 = m20 * m01;\n const tmp22 = m00 * m11;\n const tmp23 = m10 * m01;\n\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n\n const d = 1 / (m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3);\n\n newDst[ 0] = d * t0;\n newDst[ 1] = d * t1;\n newDst[ 2] = d * t2;\n newDst[ 3] = d * t3;\n newDst[ 4] = d * ((tmp1 * m10 + tmp2 * m20 + tmp5 * m30) -\n (tmp0 * m10 + tmp3 * m20 + tmp4 * m30));\n newDst[ 5] = d * ((tmp0 * m00 + tmp7 * m20 + tmp8 * m30) -\n (tmp1 * m00 + tmp6 * m20 + tmp9 * m30));\n newDst[ 6] = d * ((tmp3 * m00 + tmp6 * m10 + tmp11 * m30) -\n (tmp2 * m00 + tmp7 * m10 + tmp10 * m30));\n newDst[ 7] = d * ((tmp4 * m00 + tmp9 * m10 + tmp10 * m20) -\n (tmp5 * m00 + tmp8 * m10 + tmp11 * m20));\n newDst[ 8] = d * ((tmp12 * m13 + tmp15 * m23 + tmp16 * m33) -\n (tmp13 * m13 + tmp14 * m23 + tmp17 * m33));\n newDst[ 9] = d * ((tmp13 * m03 + tmp18 * m23 + tmp21 * m33) -\n (tmp12 * m03 + tmp19 * m23 + tmp20 * m33));\n newDst[10] = d * ((tmp14 * m03 + tmp19 * m13 + tmp22 * m33) -\n (tmp15 * m03 + tmp18 * m13 + tmp23 * m33));\n newDst[11] = d * ((tmp17 * m03 + tmp20 * m13 + tmp23 * m23) -\n (tmp16 * m03 + tmp21 * m13 + tmp22 * m23));\n newDst[12] = d * ((tmp14 * m22 + tmp17 * m32 + tmp13 * m12) -\n (tmp16 * m32 + tmp12 * m12 + tmp15 * m22));\n newDst[13] = d * ((tmp20 * m32 + tmp12 * m02 + tmp19 * m22) -\n (tmp18 * m22 + tmp21 * m32 + tmp13 * m02));\n newDst[14] = d * ((tmp18 * m12 + tmp23 * m32 + tmp15 * m02) -\n (tmp22 * m32 + tmp14 * m02 + tmp19 * m12));\n newDst[15] = d * ((tmp22 * m22 + tmp16 * m02 + tmp21 * m12) -\n (tmp20 * m12 + tmp23 * m22 + tmp17 * m02));\n\n return newDst;\n}\n\n/**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\nfunction determinant(m: Mat4Arg): number {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n\n return m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3;\n}\n\n/**\n * Computes the inverse of a 4-by-4 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nconst invert = inverse;\n\n/**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nfunction multiply(a: Mat4Arg, b: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[ 4 + 0];\n const a11 = a[ 4 + 1];\n const a12 = a[ 4 + 2];\n const a13 = a[ 4 + 3];\n const a20 = a[ 8 + 0];\n const a21 = a[ 8 + 1];\n const a22 = a[ 8 + 2];\n const a23 = a[ 8 + 3];\n const a30 = a[12 + 0];\n const a31 = a[12 + 1];\n const a32 = a[12 + 2];\n const a33 = a[12 + 3];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b03 = b[3];\n const b10 = b[ 4 + 0];\n const b11 = b[ 4 + 1];\n const b12 = b[ 4 + 2];\n const b13 = b[ 4 + 3];\n const b20 = b[ 8 + 0];\n const b21 = b[ 8 + 1];\n const b22 = b[ 8 + 2];\n const b23 = b[ 8 + 3];\n const b30 = b[12 + 0];\n const b31 = b[12 + 1];\n const b32 = b[12 + 2];\n const b33 = b[12 + 3];\n\n newDst[ 0] = a00 * b00 + a10 * b01 + a20 * b02 + a30 * b03;\n newDst[ 1] = a01 * b00 + a11 * b01 + a21 * b02 + a31 * b03;\n newDst[ 2] = a02 * b00 + a12 * b01 + a22 * b02 + a32 * b03;\n newDst[ 3] = a03 * b00 + a13 * b01 + a23 * b02 + a33 * b03;\n newDst[ 4] = a00 * b10 + a10 * b11 + a20 * b12 + a30 * b13;\n newDst[ 5] = a01 * b10 + a11 * b11 + a21 * b12 + a31 * b13;\n newDst[ 6] = a02 * b10 + a12 * b11 + a22 * b12 + a32 * b13;\n newDst[ 7] = a03 * b10 + a13 * b11 + a23 * b12 + a33 * b13;\n newDst[ 8] = a00 * b20 + a10 * b21 + a20 * b22 + a30 * b23;\n newDst[ 9] = a01 * b20 + a11 * b21 + a21 * b22 + a31 * b23;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22 + a32 * b23;\n newDst[11] = a03 * b20 + a13 * b21 + a23 * b22 + a33 * b23;\n newDst[12] = a00 * b30 + a10 * b31 + a20 * b32 + a30 * b33;\n newDst[13] = a01 * b30 + a11 * b31 + a21 * b32 + a31 * b33;\n newDst[14] = a02 * b30 + a12 * b31 + a22 * b32 + a32 * b33;\n newDst[15] = a03 * b30 + a13 * b31 + a23 * b32 + a33 * b33;\n\n return newDst;\n}\n\n/**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nconst mul = multiply;\n\n/**\n * Sets the translation component of a 4-by-4 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\nfunction setTranslation(a: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? identity()) as T;\n if (a !== newDst) {\n newDst[ 0] = a[ 0];\n newDst[ 1] = a[ 1];\n newDst[ 2] = a[ 2];\n newDst[ 3] = a[ 3];\n newDst[ 4] = a[ 4];\n newDst[ 5] = a[ 5];\n newDst[ 6] = a[ 6];\n newDst[ 7] = a[ 7];\n newDst[ 8] = a[ 8];\n newDst[ 9] = a[ 9];\n newDst[10] = a[10];\n newDst[11] = a[11];\n }\n newDst[12] = v[0];\n newDst[13] = v[1];\n newDst[14] = v[2];\n newDst[15] = 1;\n return newDst;\n}\n\n///**\n// * Returns the translation component of a 4-by-4 matrix as a vector with 3\n// * entries.\n// * @param m - The matrix.\n// * @param dst - vector to hold result. If not passed a new one is created.\n// * @returns The translation component of m.\n// */\nfunction getTranslation(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? vec3.create()) as T;\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n}\n\n/**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat4Arg, axis: number, dst?: T) {\n const newDst = (dst ?? vec3.create());\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n}\n\n/**\n * Sets an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\nfunction setAxis(m: Mat4Arg, v: Vec3Arg, axis: number, dst: T) {\n const newDst = (dst === m) ? dst : copy(m, dst);\n\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n newDst[off + 2] = v[2];\n return newDst;\n}\n\n/**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? vec3.create()) as T;\n\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 0 to 1 in the z dimension.\n *\n * Note: If you pass `Infinity` for zFar then it will produce a projection matrix\n * returns -Infinity for Z when transforming coordinates with Z <= 0 and +Infinity for Z\n * otherwise.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */\nfunction perspective(fieldOfViewYInRadians: number, aspect: number, zNear: number, zFar: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const f = Math.tan(Math.PI * 0.5 - 0.5 * fieldOfViewYInRadians);\n\n newDst[0] = f / aspect;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n newDst[4] = 0;\n newDst[5] = f;\n newDst[6] = 0;\n newDst[7] = 0;\n\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[11] = -1;\n\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (Number.isFinite(zFar)) {\n const rangeInv = 1 / (zNear - zFar);\n newDst[10] = zFar * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n } else {\n newDst[10] = -1;\n newDst[14] = -zNear;\n }\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 1 (at -zNear) to 0 (at -zFar) in the z dimension.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane. (default = Infinity)\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */function perspectiveReverseZ(fieldOfViewYInRadians: number, aspect: number, zNear: number, zFar = Infinity, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const f = 1 / Math.tan(fieldOfViewYInRadians * 0.5);\n\n newDst[ 0] = f / aspect;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n\n newDst[ 4] = 0;\n newDst[ 5] = f;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n\n newDst[ 8] = 0;\n newDst[ 9] = 0;\n newDst[11] = -1;\n\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (zFar === Infinity) {\n newDst[10] = 0;\n newDst[14] = zNear;\n } else {\n const rangeInv = 1 / (zFar - zNear);\n newDst[10] = zNear * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n }\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 orthogonal transformation matrix that transforms from\n * the given the left, right, bottom, and top dimensions to -1 +1 in x, and y\n * and 0 to +1 in z.\n * @param left - Left side of the near clipping plane viewport.\n * @param right - Right side of the near clipping plane viewport.\n * @param bottom - Bottom of the near clipping plane viewport.\n * @param top - Top of the near clipping plane viewport.\n * @param near - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param far - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The orthographic projection matrix.\n */\nfunction ortho(left: number, right: number, bottom: number, top: number, near: number, far: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[0] = 2 / (right - left);\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n newDst[4] = 0;\n newDst[5] = 2 / (top - bottom);\n newDst[6] = 0;\n newDst[7] = 0;\n\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[10] = 1 / (near - far);\n newDst[11] = 0;\n\n newDst[12] = (right + left) / (left - right);\n newDst[13] = (top + bottom) / (bottom - top);\n newDst[14] = near / (near - far);\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 0 to 1 in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\nfunction frustum(left: number, right: number, bottom: number, top: number, near: number, far: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const dx = (right - left);\n const dy = (top - bottom);\n const dz = (near - far);\n\n newDst[ 0] = 2 * near / dx;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n newDst[ 4] = 0;\n newDst[ 5] = 2 * near / dy;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n newDst[ 8] = (left + right) / dx;\n newDst[ 9] = (top + bottom) / dy;\n newDst[10] = far / dz;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = near * far / dz;\n newDst[15] = 0;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 1 (-near) to 0 (-far) in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\nfunction frustumReverseZ(left: number, right: number, bottom: number, top: number, near: number, far = Infinity, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const dx = (right - left);\n const dy = (top - bottom);\n\n newDst[ 0] = 2 * near / dx;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n newDst[ 4] = 0;\n newDst[ 5] = 2 * near / dy;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n newDst[ 8] = (left + right) / dx;\n newDst[ 9] = (top + bottom) / dy;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (far === Infinity) {\n newDst[10] = 0;\n newDst[14] = near;\n } else {\n const rangeInv = 1 / (far - near);\n newDst[10] = near * rangeInv;\n newDst[14] = far * near * rangeInv;\n }\n\n return newDst;\n}\n\nconst xAxis = vec3.create();\nconst yAxis = vec3.create();\nconst zAxis = vec3.create();\n\n/**\n * Computes a 4-by-4 aim transformation.\n *\n * This is a matrix which positions an object aiming down positive Z.\n * toward the target.\n *\n * Note: this is **NOT** the inverse of lookAt as lookAt looks at negative Z.\n *\n * @param position - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\nfunction aim(position: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(target, position, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = xAxis[1]; newDst[ 2] = xAxis[2]; newDst[ 3] = 0;\n newDst[ 4] = yAxis[0]; newDst[ 5] = yAxis[1]; newDst[ 6] = yAxis[2]; newDst[ 7] = 0;\n newDst[ 8] = zAxis[0]; newDst[ 9] = zAxis[1]; newDst[10] = zAxis[2]; newDst[11] = 0;\n newDst[12] = position[0]; newDst[13] = position[1]; newDst[14] = position[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 camera aim transformation.\n *\n * This is a matrix which positions an object aiming down negative Z.\n * toward the target.\n *\n * Note: this is the inverse of `lookAt`\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\nfunction cameraAim(eye: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = xAxis[1]; newDst[ 2] = xAxis[2]; newDst[ 3] = 0;\n newDst[ 4] = yAxis[0]; newDst[ 5] = yAxis[1]; newDst[ 6] = yAxis[2]; newDst[ 7] = 0;\n newDst[ 8] = zAxis[0]; newDst[ 9] = zAxis[1]; newDst[10] = zAxis[2]; newDst[11] = 0;\n newDst[12] = eye[0]; newDst[13] = eye[1]; newDst[14] = eye[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 view transformation.\n *\n * This is a view matrix which transforms all other objects\n * to be in the space of the view defined by the parameters.\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The look-at matrix.\n */\nfunction lookAt(eye: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = yAxis[0]; newDst[ 2] = zAxis[0]; newDst[ 3] = 0;\n newDst[ 4] = xAxis[1]; newDst[ 5] = yAxis[1]; newDst[ 6] = zAxis[1]; newDst[ 7] = 0;\n newDst[ 8] = xAxis[2]; newDst[ 9] = yAxis[2]; newDst[10] = zAxis[2]; newDst[11] = 0;\n\n newDst[12] = -(xAxis[0] * eye[0] + xAxis[1] * eye[1] + xAxis[2] * eye[2]);\n newDst[13] = -(yAxis[0] * eye[0] + yAxis[1] * eye[1] + yAxis[2] * eye[2]);\n newDst[14] = -(zAxis[0] * eye[0] + zAxis[1] * eye[1] + zAxis[2] * eye[2]);\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which translates by the given vector v.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\nfunction translation(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = v[0]; newDst[13] = v[1]; newDst[14] = v[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Translates the given 4-by-4 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\nfunction translate(m: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n if (m !== newDst) {\n newDst[ 0] = m00;\n newDst[ 1] = m01;\n newDst[ 2] = m02;\n newDst[ 3] = m03;\n newDst[ 4] = m10;\n newDst[ 5] = m11;\n newDst[ 6] = m12;\n newDst[ 7] = m13;\n newDst[ 8] = m20;\n newDst[ 9] = m21;\n newDst[10] = m22;\n newDst[11] = m23;\n }\n\n newDst[12] = m00 * v0 + m10 * v1 + m20 * v2 + m30;\n newDst[13] = m01 * v0 + m11 * v1 + m21 * v2 + m31;\n newDst[14] = m02 * v0 + m12 * v1 + m22 * v2 + m32;\n newDst[15] = m03 * v0 + m13 * v1 + m23 * v2 + m33;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the x-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationX(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = c; newDst[ 6] = s; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = -s; newDst[10] = c; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the x-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateX(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[4] = c * m10 + s * m20;\n newDst[5] = c * m11 + s * m21;\n newDst[6] = c * m12 + s * m22;\n newDst[7] = c * m13 + s * m23;\n newDst[8] = c * m20 - s * m10;\n newDst[9] = c * m21 - s * m11;\n newDst[10] = c * m22 - s * m12;\n newDst[11] = c * m23 - s * m13;\n\n if (m !== newDst) {\n newDst[ 0] = m[ 0];\n newDst[ 1] = m[ 1];\n newDst[ 2] = m[ 2];\n newDst[ 3] = m[ 3];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the y-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationY(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = 0; newDst[ 2] = -s; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = s; newDst[ 9] = 0; newDst[10] = c; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the y-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateY(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 - s * m20;\n newDst[ 1] = c * m01 - s * m21;\n newDst[ 2] = c * m02 - s * m22;\n newDst[ 3] = c * m03 - s * m23;\n newDst[ 8] = c * m20 + s * m00;\n newDst[ 9] = c * m21 + s * m01;\n newDst[10] = c * m22 + s * m02;\n newDst[11] = c * m23 + s * m03;\n\n if (m !== newDst) {\n newDst[ 4] = m[ 4];\n newDst[ 5] = m[ 5];\n newDst[ 6] = m[ 6];\n newDst[ 7] = m[ 7];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the z-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationZ(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = s; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = -s; newDst[ 5] = c; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the z-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateZ(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 + s * m10;\n newDst[ 1] = c * m01 + s * m11;\n newDst[ 2] = c * m02 + s * m12;\n newDst[ 3] = c * m03 + s * m13;\n newDst[ 4] = c * m10 - s * m00;\n newDst[ 5] = c * m11 - s * m01;\n newDst[ 6] = c * m12 - s * m02;\n newDst[ 7] = c * m13 - s * m03;\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n newDst[11] = m[11];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\nfunction axisRotation(axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n\n newDst[ 0] = xx + (1 - xx) * c;\n newDst[ 1] = x * y * oneMinusCosine + z * s;\n newDst[ 2] = x * z * oneMinusCosine - y * s;\n newDst[ 3] = 0;\n newDst[ 4] = x * y * oneMinusCosine - z * s;\n newDst[ 5] = yy + (1 - yy) * c;\n newDst[ 6] = y * z * oneMinusCosine + x * s;\n newDst[ 7] = 0;\n newDst[ 8] = x * z * oneMinusCosine + y * s;\n newDst[ 9] = y * z * oneMinusCosine - x * s;\n newDst[10] = zz + (1 - zz) * c;\n newDst[11] = 0;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = 0;\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle. (same as axisRotation)\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\nconst rotation = axisRotation;\n\n/**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle.\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction axisRotate(m: Mat4Arg, axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n\n const r00 = xx + (1 - xx) * c;\n const r01 = x * y * oneMinusCosine + z * s;\n const r02 = x * z * oneMinusCosine - y * s;\n const r10 = x * y * oneMinusCosine - z * s;\n const r11 = yy + (1 - yy) * c;\n const r12 = y * z * oneMinusCosine + x * s;\n const r20 = x * z * oneMinusCosine + y * s;\n const r21 = y * z * oneMinusCosine - x * s;\n const r22 = zz + (1 - zz) * c;\n\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n\n newDst[ 0] = r00 * m00 + r01 * m10 + r02 * m20;\n newDst[ 1] = r00 * m01 + r01 * m11 + r02 * m21;\n newDst[ 2] = r00 * m02 + r01 * m12 + r02 * m22;\n newDst[ 3] = r00 * m03 + r01 * m13 + r02 * m23;\n newDst[ 4] = r10 * m00 + r11 * m10 + r12 * m20;\n newDst[ 5] = r10 * m01 + r11 * m11 + r12 * m21;\n newDst[ 6] = r10 * m02 + r11 * m12 + r12 * m22;\n newDst[ 7] = r10 * m03 + r11 * m13 + r12 * m23;\n newDst[ 8] = r20 * m00 + r21 * m10 + r22 * m20;\n newDst[ 9] = r20 * m01 + r21 * m11 + r22 * m21;\n newDst[10] = r20 * m02 + r21 * m12 + r22 * m22;\n newDst[11] = r20 * m03 + r21 * m13 + r22 * m23;\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle. (same as rotate)\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nconst rotate = axisRotate;\n\n/**\n * Creates a 4-by-4 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * three entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = v[2]; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 4-by-4 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of three entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale(m: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n newDst[ 3] = v0 * m[0 * 4 + 3];\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n newDst[ 7] = v1 * m[1 * 4 + 3];\n newDst[ 8] = v2 * m[2 * 4 + 0];\n newDst[ 9] = v2 * m[2 * 4 + 1];\n newDst[10] = v2 * m[2 * 4 + 2];\n newDst[11] = v2 * m[2 * 4 + 3];\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which scales a uniform amount in each dimension.\n * @param s - the amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = s; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 4-by-4 matrix in each dimension by a uniform scale.\n * @param m - The matrix to be modified.\n * @param s - The amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale(m: Mat4Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n newDst[ 3] = s * m[0 * 4 + 3];\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n newDst[ 7] = s * m[1 * 4 + 3];\n newDst[ 8] = s * m[2 * 4 + 0];\n newDst[ 9] = s * m[2 * 4 + 1];\n newDst[10] = s * m[2 * 4 + 2];\n newDst[11] = s * m[2 * 4 + 3];\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\nreturn {\n create,\n set,\n fromMat3,\n fromQuat,\n negate,\n copy,\n clone,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n determinant,\n invert,\n multiply,\n mul,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n perspective,\n perspectiveReverseZ,\n ortho,\n frustum,\n frustumReverseZ,\n aim,\n cameraAim,\n lookAt,\n translation,\n translate,\n rotationX,\n rotateX,\n rotationY,\n rotateY,\n rotationZ,\n rotateZ,\n axisRotation,\n rotation,\n axisRotate,\n rotate,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n};\n\n}\n\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Mat4Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { QuatArg, QuatType } from './quat';\nimport { Mat3Arg } from './mat3.js';\nimport { Mat4Arg } from './mat4.js';\nimport { Vec3Arg } from './vec3.js';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\n\nexport { QuatArg, QuatType };\n\ntype QuatCtor = new (n: number) => T;\n\nexport type RotationOrder = 'xyz' | 'xzy' | 'yxz' | 'yzx' | 'zxy' | 'zyx';\n\n/**\n * Generates am typed API for Qud\n * */\nfunction getAPIImpl(Ctor: QuatCtor) {\n const vec3 = getVec3API(Ctor);\n\n/**\n * Creates a quat4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number, w?: number) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a Quat; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Quat\n * Also see {@link quat.create} and {@link quat.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, w: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n\n return newDst;\n}\n\n/**\n * Sets a quaternion from the given angle and axis,\n * then returns it.\n *\n * @param axis - the axis to rotate around\n * @param angleInRadians - the angle\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The quaternion that represents the given axis and angle\n **/\nfunction fromAxisAngle(axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n const s = Math.sin(halfAngle);\n\n newDst[0] = s * axis[0];\n newDst[1] = s * axis[1];\n newDst[2] = s * axis[2];\n newDst[3] = Math.cos(halfAngle);\n\n return newDst;\n}\n\n/**\n * Gets the rotation axis and angle\n * @param q - quaternion to compute from\n * @param dst - Vec3 to hold result. If not passed in a new one is created.\n * @return angle and axis\n */\nfunction toAxisAngle(q: QuatArg, dst?: T): { angle: number, axis: T } {\n const newDst = (dst ?? vec3.create(3)) as T;\n\n const angle = Math.acos(q[3]) * 2;\n const s = Math.sin(angle * 0.5);\n if (s > utils.EPSILON) {\n newDst[0] = q[0] / s;\n newDst[1] = q[1] / s;\n newDst[2] = q[2] / s;\n } else {\n newDst[0] = 1;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n\n return { angle, axis: newDst };\n}\n\n/**\n * Returns the angle in degrees between two rotations a and b.\n * @param a - quaternion a\n * @param b - quaternion b\n * @return angle in radians between the two quaternions\n */\nfunction angle(a: QuatArg, b: QuatArg) {\n const d = dot(a, b);\n return Math.acos(2 * d * d - 1);\n}\n\n/**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction multiply(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const bw = b[3];\n\n newDst[0] = ax * bw + aw * bx + ay * bz - az * by;\n newDst[1] = ay * bw + aw * by + az * bx - ax * bz;\n newDst[2] = az * bw + aw * bz + ax * by - ay * bx;\n newDst[3] = aw * bw - ax * bx - ay * by - az * bz;\n\n return newDst;\n}\n\n/**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nconst mul = multiply;\n\n/**\n * Rotates the given quaternion around the X axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateX(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const bx = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw + qw * bx;\n newDst[1] = qy * bw + qz * bx;\n newDst[2] = qz * bw - qy * bx;\n newDst[3] = qw * bw - qx * bx;\n\n return newDst;\n}\n\n/**\n * Rotates the given quaternion around the Y axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateY(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const by = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw - qz * by;\n newDst[1] = qy * bw + qw * by;\n newDst[2] = qz * bw + qx * by;\n newDst[3] = qw * bw - qy * by;\n\n return newDst;\n}\n\n/**\n * Rotates the given quaternion around the Z axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateZ(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const bz = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw + qy * bz;\n newDst[1] = qy * bw - qx * bz;\n newDst[2] = qz * bw + qw * bz;\n newDst[3] = qw * bw - qz * bz;\n\n return newDst;\n}\n\n/**\n * Spherically linear interpolate between two quaternions\n *\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction slerp(a: QuatArg, b: QuatArg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n\n let bx = b[0];\n let by = b[1];\n let bz = b[2];\n let bw = b[3];\n\n let cosOmega = ax * bx + ay * by + az * bz + aw * bw;\n\n if (cosOmega < 0) {\n cosOmega = -cosOmega;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n\n let scale0;\n let scale1;\n\n if (1.0 - cosOmega > utils.EPSILON) {\n const omega = Math.acos(cosOmega);\n const sinOmega = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinOmega;\n scale1 = Math.sin(t * omega) / sinOmega;\n } else {\n scale0 = 1.0 - t;\n scale1 = t;\n }\n\n newDst[0] = scale0 * ax + scale1 * bx;\n newDst[1] = scale0 * ay + scale1 * by;\n newDst[2] = scale0 * az + scale1 * bz;\n newDst[3] = scale0 * aw + scale1 * bw;\n\n return newDst;\n}\n\n/**\n * Compute the inverse of a quaternion\n *\n * @param q - quaternion to compute the inverse of\n * @returns A quaternion that is the result of a * b\n */\nfunction inverse(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const a0 = q[0];\n const a1 = q[1];\n const a2 = q[2];\n const a3 = q[3];\n\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n\n newDst[0] = -a0 * invDot;\n newDst[1] = -a1 * invDot;\n newDst[2] = -a2 * invDot;\n newDst[3] = a3 * invDot;\n\n return newDst;\n}\n\n/**\n * Compute the conjugate of a quaternion\n * For quaternions with a magnitude of 1 (a unit quaternion)\n * this returns the same as the inverse but is faster to calculate.\n *\n * @param q - quaternion to compute the conjugate of.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The conjugate of q\n */\nfunction conjugate(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = -q[0];\n newDst[1] = -q[1];\n newDst[2] = -q[2];\n newDst[3] = q[3];\n\n return newDst;\n}\n\n/**\n * Creates a quaternion from the given rotation matrix.\n *\n * The created quaternion is not normalized.\n *\n * @param m - rotation matrix\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\nfunction fromMat(m: Mat3Arg | Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n /*\n 0 1 2\n 3 4 5\n 6 7 8\n\n 0 1 2\n 4 5 6\n 8 9 10\n */\n\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n const trace = m[0] + m[5] + m[10];\n\n if (trace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n const root = Math.sqrt(trace + 1); // 2w\n newDst[3] = 0.5 * root;\n const invRoot = 0.5 / root; // 1/(4w)\n\n newDst[0] = (m[6] - m[9]) * invRoot;\n newDst[1] = (m[8] - m[2]) * invRoot;\n newDst[2] = (m[1] - m[4]) * invRoot;\n } else {\n // |w| <= 1/2\n let i = 0;\n\n if (m[5] > m[0]) {\n i = 1;\n }\n if (m[10] > m[i * 4 + i]) {\n i = 2;\n }\n\n const j = (i + 1) % 3;\n const k = (i + 2) % 3;\n\n const root = Math.sqrt(m[i * 4 + i] - m[j * 4 + j] - m[k * 4 + k] + 1.0);\n newDst[i] = 0.5 * root;\n\n const invRoot = 0.5 / root;\n\n newDst[3] = (m[j * 4 + k] - m[k * 4 + j]) * invRoot;\n newDst[j] = (m[j * 4 + i] + m[i * 4 + j]) * invRoot;\n newDst[k] = (m[k * 4 + i] + m[i * 4 + k]) * invRoot;\n }\n\n return newDst;\n}\n\n/**\n * Creates a quaternion from the given euler angle x, y, z using the provided intrinsic order for the conversion.\n *\n * @param xAngleInRadians - angle to rotate around X axis in radians.\n * @param yAngleInRadians - angle to rotate around Y axis in radians.\n * @param zAngleInRadians - angle to rotate around Z axis in radians.\n * @param order - order to apply euler angles\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion representing the same rotation as the euler angles applied in the given order\n */\nfunction fromEuler(\n xAngleInRadians: number,\n yAngleInRadians: number,\n zAngleInRadians: number,\n order: RotationOrder,\n dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const xHalfAngle = xAngleInRadians * 0.5;\n const yHalfAngle = yAngleInRadians * 0.5;\n const zHalfAngle = zAngleInRadians * 0.5;\n\n const sx = Math.sin(xHalfAngle);\n const cx = Math.cos(xHalfAngle);\n const sy = Math.sin(yHalfAngle);\n const cy = Math.cos(yHalfAngle);\n const sz = Math.sin(zHalfAngle);\n const cz = Math.cos(zHalfAngle);\n\n switch (order) {\n case 'xyz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'xzy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n case 'yxz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n case 'yzx':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'zxy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'zyx':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n default:\n throw new Error(`Unknown rotation order: ${order}`);\n }\n\n return newDst;\n}\n\n/**\n * Copies a quaternion. (same as {@link quat.clone})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is a copy of q\n */\nfunction copy(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = q[0];\n newDst[1] = q[1];\n newDst[2] = q[2];\n newDst[3] = q[3];\n\n return newDst;\n}\n\n/**\n * Clones a quaternion. (same as {@link quat.copy})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A copy of q.\n */\nconst clone = copy;\n\n/**\n * Adds two quaternions; assumes a and b have the same dimension.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the sum of a and b.\n */\nfunction add(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\nfunction subtract(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Multiplies a quaternion by a scalar.\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nfunction mulScalar(v: QuatArg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a quaternion by a scalar. (same as mulScalar)\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nfunction divScalar(v: QuatArg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two quaternions\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns dot product\n */\nfunction dot(a: QuatArg, b: QuatArg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n}\n\n/**\n * Performs linear interpolation on two quaternions.\n * Given quaternions a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param t - Interpolation coefficient.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: QuatArg, b: QuatArg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Computes the length of quaternion\n * @param v - quaternion.\n * @returns length of quaternion.\n */\nfunction length(v: QuatArg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n}\n\n/**\n * Computes the length of quaternion (same as length)\n * @param v - quaternion.\n * @returns length of quaternion.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of quaternion\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\nfunction lengthSq(v: QuatArg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n}\n\n/**\n * Computes the square of the length of quaternion (same as lengthSq)\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\nconst lenSq = lengthSq;\n\n/**\n * Divides a quaternion by its Euclidean length and returns the quotient.\n * @param v - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The normalized quaternion.\n */\nfunction normalize(v: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n }\n\n return newDst;\n}\n\n/**\n * Check if 2 quaternions are approximately equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are approximately equal\n */\nfunction equalsApproximately(a: QuatArg, b: QuatArg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON &&\n Math.abs(a[3] - b[3]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 quaternions are exactly equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are exactly equal\n */\nfunction equals(a: QuatArg, b: QuatArg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Creates an identity quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns an identity quaternion\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n\n return newDst;\n}\n\nconst tempVec3 = vec3.create();\nconst xUnitVec3 = vec3.create();\nconst yUnitVec3 = vec3.create();\n\n/**\n * Computes a quaternion to represent the shortest rotation from one vector to another.\n *\n * @param aUnit - the start vector\n * @param bUnit - the end vector\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\nfunction rotationTo(aUnit: Vec3Arg, bUnit: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const dot = vec3.dot(aUnit, bUnit);\n if (dot < -0.999999) {\n vec3.cross(xUnitVec3, aUnit, tempVec3);\n if (vec3.len(tempVec3) < 0.000001) {\n vec3.cross(yUnitVec3, aUnit, tempVec3);\n }\n\n vec3.normalize(tempVec3, tempVec3);\n fromAxisAngle(tempVec3, Math.PI, newDst);\n\n return newDst;\n } else if (dot > 0.999999) {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n\n return newDst;\n } else {\n vec3.cross(aUnit, bUnit, tempVec3);\n\n newDst[0] = tempVec3[0];\n newDst[1] = tempVec3[1];\n newDst[2] = tempVec3[2];\n newDst[3] = 1 + dot;\n\n return normalize(newDst, newDst);\n }\n}\n\nconst tempQuat1 = new Ctor(4);\nconst tempQuat2 = new Ctor(4);\n\n/**\n * Performs a spherical linear interpolation with two control points\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param c - the third quaternion\n * @param d - the fourth quaternion\n * @param t - Interpolation coefficient 0 to 1\n * @returns result\n */\nfunction sqlerp(\n a: QuatArg,\n b: QuatArg,\n c: QuatArg,\n d: QuatArg,\n t: number,\n dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n slerp(a, d, t, tempQuat1);\n slerp(b, c, t, tempQuat2);\n slerp(tempQuat1, tempQuat2, 2 * t * (1 - t), newDst);\n\n return newDst;\n}\n\nreturn {\n create,\n fromValues,\n set,\n fromAxisAngle,\n toAxisAngle,\n angle,\n multiply,\n mul,\n rotateX,\n rotateY,\n rotateZ,\n slerp,\n inverse,\n conjugate,\n fromMat,\n fromEuler,\n copy,\n clone,\n add,\n subtract,\n sub,\n mulScalar,\n scale,\n divScalar,\n dot,\n lerp,\n length,\n len,\n lengthSq,\n lenSq,\n normalize,\n equalsApproximately,\n equals,\n identity,\n rotationTo,\n sqlerp,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\n/**\n *\n * Quat4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Quat4`. In other words you can do this\n *\n * const v = quat4.cross(v1, v2); // Creates a new Quat4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = quat4.create();\n * quat4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * quat4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nexport function getAPI(Ctor: QuatCtor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Vec4Arg, Vec4Type } from './vec4';\nimport { Mat4Arg } from './mat4';\nimport { BaseArgType } from './types';\n\nexport { Vec4Arg, Vec4Type };\n\ntype Vec4Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec4\n * */\nfunction getAPIImpl(Ctor: Vec4Ctor) {\n\n/**\n * Creates a vec4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number, w?: number) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a vec4; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec4\n * Also see {@link vec4.create} and {@link vec4.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, w: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n newDst[3] = Math.ceil(v[3]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n newDst[3] = Math.floor(v[3]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n newDst[3] = Math.round(v[3]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec4Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n newDst[3] = Math.min(max, Math.max(min, v[3]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec4Arg, b: Vec4Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n newDst[3] = a[3] + b[3] * scale;\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec4Arg, b: Vec4Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON &&\n Math.abs(a[3] - b[3]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec4Arg, b: Vec4Arg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec4Arg, b: Vec4Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec4Arg, b: Vec4Arg, t: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n newDst[3] = a[3] + t[3] * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n newDst[3] = Math.max(a[3], b[3]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n newDst[3] = Math.min(a[3], b[3]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec4Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec4Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n newDst[3] = 1 / v[3];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the dot product of two vectors\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec4Arg, b: Vec4Arg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec4Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec4Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec4Arg, b: Vec4Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec4Arg, b: Vec4Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return dx * dx + dy * dy + dz * dz + dw * dw;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n }\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n newDst[3] = -v[3];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec4.clone})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n newDst[3] = v[3];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec4.copy})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n newDst[3] = a[3] * b[3];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n newDst[3] = a[3] / b[3];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform vec4 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec4 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec4Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = v[3];\n\n newDst[0] = m[0] * x + m[4] * y + m[ 8] * z + m[12] * w;\n newDst[1] = m[1] * x + m[5] * y + m[ 9] * z + m[13] * w;\n newDst[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n newDst[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n\n return newDst;\n}\n\n\n/**\n * Treat a 4D vector as a direction and set it's length\n *\n * @param a The vec4 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec4Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec4 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec4Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n zero,\n transformMat4,\n setLength,\n truncate,\n midpoint,\n};\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\n/**\n *\n * Vec4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Vec4`. In other words you can do this\n *\n * const v = vec4.cross(v1, v2); // Creates a new Vec4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = vec4.create();\n * vec4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * vec4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nexport function getAPI(Ctor: Vec4Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n\n","/**\n * Some docs\n * @namespace wgpu-matrix\n */\nimport {BaseArgType, ZeroArray} from './types';\nimport {Mat3Arg, Mat3Type, getAPI as getMat3API} from './mat3-impl';\nimport {Mat4Arg, Mat4Type, getAPI as getMat4API} from './mat4-impl';\nimport {QuatArg, QuatType, getAPI as getQuatAPI, RotationOrder} from './quat-impl';\nimport {Vec2Arg, Vec2Type, getAPI as getVec2API} from './vec2-impl';\nimport {Vec3Arg, Vec3Type, getAPI as getVec3API} from './vec3-impl';\nimport {Vec4Arg, Vec4Type, getAPI as getVec4API} from './vec4-impl';\nimport * as utils from './utils';\n\nexport {\n RotationOrder,\n utils,\n\n BaseArgType,\n\n Mat3Arg,\n Mat4Arg,\n QuatArg,\n Vec2Arg,\n Vec3Arg,\n Vec4Arg,\n\n Mat3Type,\n Mat4Type,\n QuatType,\n Vec2Type,\n Vec3Type,\n Vec4Type,\n};\n\nexport type BaseCtor = new (n: number) => T;\n\nexport type Mat3 = Mat3Type;\nexport type Mat4 = Mat4Type;\nexport type Quat = QuatType;\nexport type Vec2 = Vec2Type;\nexport type Vec3 = Vec3Type;\nexport type Vec4 = Vec4Type;\n\nexport type Mat3d = Mat3Type;\nexport type Mat4d = Mat4Type;\nexport type Quatd = QuatType;\nexport type Vec2d = Vec2Type;\nexport type Vec3d = Vec3Type;\nexport type Vec4d = Vec4Type;\n\nexport type Mat3n = Mat3Type;\nexport type Mat4n = Mat4Type;\nexport type Quatn = QuatType;\nexport type Vec2n = Vec2Type;\nexport type Vec3n = Vec3Type;\nexport type Vec4n = Vec4Type;\n\n/**\n * Generate wgpu-matrix API for type\n */\nfunction wgpuMatrixAPI<\n Mat3 extends BaseArgType,\n Mat4 extends BaseArgType,\n Quat extends BaseArgType,\n Vec2 extends BaseArgType,\n Vec3 extends BaseArgType,\n Vec4 extends BaseArgType,\n>(\n Mat3Ctor: BaseCtor,\n Mat4Ctor: BaseCtor,\n QuatCtor: BaseCtor,\n Vec2Ctor: BaseCtor,\n Vec3Ctor: BaseCtor,\n Vec4Ctor: BaseCtor,\n) {\n return {\n /** @namespace mat3 */\n mat3: getMat3API(Mat3Ctor),\n /** @namespace mat4 */\n mat4: getMat4API(Mat4Ctor),\n /** @namespace quat */\n quat: getQuatAPI(QuatCtor),\n /** @namespace vec2 */\n vec2: getVec2API(Vec2Ctor),\n /** @namespace vec3 */\n vec3: getVec3API(Vec3Ctor),\n /** @namespace vec4 */\n vec4: getVec4API(Vec4Ctor),\n };\n}\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat3,\n /**\n * 4x4 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat4,\n /**\n * Quaternion functions that default to returning `Float32Array`\n * @namespace\n */\n quat,\n /**\n * Vec2 functions that default to returning `Float32Array`\n * @namespace\n */\n vec2,\n /**\n * Vec3 functions that default to returning `Float32Array`\n * @namespace\n */\n vec3,\n /**\n * Vec3 functions that default to returning `Float32Array`\n * @namespace\n */\n vec4,\n} = wgpuMatrixAPI<\n Mat3, Mat4, Quat, Vec2, Vec3, Vec4>(\n Float32Array, Float32Array, Float32Array, Float32Array, Float32Array, Float32Array);\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat3: mat3d,\n /**\n * 4x4 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat4: mat4d,\n /**\n * Quaternion functions that default to returning `Float64Array`\n * @namespace\n */\n quat: quatd,\n /**\n * Vec2 functions that default to returning `Float64Array`\n * @namespace\n */\n vec2: vec2d,\n /**\n * Vec3 functions that default to returning `Float64Array`\n * @namespace\n */\n vec3: vec3d,\n /**\n * Vec3 functions that default to returning `Float64Array`\n * @namespace\n */\n vec4: vec4d,\n} = wgpuMatrixAPI<\n Mat3d, Mat4d, Quatd, Vec2d, Vec3d, Vec4d>(\n Float64Array, Float64Array, Float64Array, Float64Array, Float64Array, Float64Array);\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat3: mat3n,\n /**\n * 4x4 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat4: mat4n,\n /**\n * Quaternion functions that default to returning `number[]`\n * @namespace\n */\n quat: quatn,\n /**\n * Vec2 functions that default to returning `number[]`\n * @namespace\n */\n vec2: vec2n,\n /**\n * Vec3 functions that default to returning `number[]`\n * @namespace\n */\n vec3: vec3n,\n /**\n * Vec3 functions that default to returning `number[]`\n * @namespace\n */\n vec4: vec4n,\n} = wgpuMatrixAPI<\n Mat3n, Mat4n, Quatn, Vec2n, Vec3n, Vec4n>(\n ZeroArray, Array, Array, Array, Array, Array);\n"],"names":["ZeroArray","OriginalConstructor","modifier","a","fill","constructor","args","super","this","EPSILON","degrees","Math","PI","n","m","b","v","d","abs","t","radians","old","cache","Map","getAPI","Ctor","api","get","create","x","y","newDst","undefined","subtract","dst","lerp","mulScalar","k","inverse","dot","length","v0","v1","sqrt","lengthSq","distance","dx","dy","distanceSq","normalize","len","copy","multiply","divide","setLength","fromValues","set","ceil","floor","round","clamp","min","max","add","addScaled","scale","angle","ax","ay","bx","by","mag","cosine","acos","sub","equalsApproximately","utils.EPSILON","equals","lerpV","divScalar","invert","cross","z","lenSq","dist","distSq","negate","clone","mul","div","random","cos","sin","zero","transformMat4","transformMat3","rotate","rad","p0","p1","sinC","cosC","truncate","maxLen","midpoint","getAPIImpl","v2","dz","az","bz","t1","t2","zScale","w","transformMat4Upper3x3","transformQuat","q","qx","qy","qz","w2","uvX","uvY","uvZ","getTranslation","getAxis","axis","off","getScaling","xx","xy","xz","yx","yy","yz","zx","zy","zz","rotateX","p","r","rotateY","rotateZ","vec2","getVec2API","vec3","getVec3API","identity","m00","m01","m02","m10","m11","m12","m20","m21","m22","b01","b11","b21","invDet","a00","a01","a02","a10","a11","a12","a20","a21","a22","b00","b02","b10","b12","b20","b22","rotation","angleInRadians","c","s","v3","v4","v5","v6","v7","v8","fromMat4","m4","fromQuat","x2","y2","z2","wx","wy","wz","transpose","determinant","setTranslation","setAxis","get3DScaling","translation","translate","rotationX","rotationY","rotationZ","scaling","uniformScaling","uniformScale","scaling3D","scale3D","uniformScaling3D","uniformScale3D","m03","m13","m23","m30","m31","m32","m33","tmp0","tmp1","tmp2","tmp3","tmp4","tmp5","tmp6","tmp7","tmp8","tmp9","tmp10","tmp11","tmp12","tmp13","tmp14","tmp15","tmp16","tmp17","tmp18","tmp19","tmp20","tmp21","tmp22","tmp23","t0","t3","a03","a13","a23","a30","a31","a32","a33","b03","b13","b23","b30","b31","b32","b33","xAxis","yAxis","zAxis","axisRotation","oneMinusCosine","axisRotate","r00","r01","r02","r10","r11","r12","r20","r21","r22","v9","v10","v11","v12","v13","v14","v15","fromMat3","m3","perspective","fieldOfViewYInRadians","aspect","zNear","zFar","f","tan","Number","isFinite","rangeInv","perspectiveReverseZ","Infinity","ortho","left","right","bottom","top","near","far","frustum","frustumReverseZ","aim","position","target","up","cameraAim","eye","lookAt","fromAxisAngle","halfAngle","aw","bw","slerp","scale0","scale1","cosOmega","omega","sinOmega","tempVec3","xUnitVec3","yUnitVec3","tempQuat1","tempQuat2","toAxisAngle","qw","a0","a1","a2","a3","invDot","conjugate","fromMat","trace","root","invRoot","i","j","fromEuler","xAngleInRadians","yAngleInRadians","zAngleInRadians","order","xHalfAngle","yHalfAngle","zHalfAngle","sx","cx","sy","cy","sz","cz","Error","rotationTo","aUnit","bUnit","sqlerp","dw","wgpuMatrixAPI","Mat3Ctor","Mat4Ctor","QuatCtor","Vec2Ctor","Vec3Ctor","Vec4Ctor","mat3","getMat3API","mat4","getMat4API","quat","getQuatAPI","vec4","getVec4API","Float32Array","mat3d","mat4d","quatd","vec2d","vec3d","vec4d","Float64Array","mat3n","mat4n","quatn","vec2n","vec3n","vec4n","Array"],"mappings":"kPAkBO,MAAMA,GAXXC,EAWsC,MAVtCC,EAUsDC,GAAKA,EAAEC,KAAK,GAR3D,cAAcH,EACnB,WAAAI,IAAeC,GACbC,SAASD,GACTJ,EAASM,KACV,IARL,IACEP,EACAC,ECcK,IAAIO,EAAU,4DAkBf,SAAmBC,GACvB,OAAOA,EAAUC,KAAKC,GAAK,GAC7B,kBAqDgB,SAAgBC,EAAWC,GACzC,OAASD,EAAIC,EAAKA,GAAKA,CACzB,uBAxB4BX,EAAWY,EAAWC,GAChD,MAAMC,EAAIF,EAAIZ,EACd,OAAQQ,KAAKO,IAAIH,EAAIZ,GAAKM,EACrBN,GACCa,EAAIb,GAAKc,CACjB,gBAlBqBd,EAAWY,EAAWI,GACzC,OAAOhB,GAAKY,EAAIZ,GAAKgB,CACvB,WAbM,SAAmBC,GACvB,OAAiB,IAAVA,EAAgBT,KAAKC,EAC9B,aAtBM,SAAqBI,GACzB,MAAMK,EAAMZ,EAEZ,OADAA,EAAUO,EACHK,CACT,GCgwBA,MAAMC,EAAQ,IAAIC,IAEZ,SAAUC,EAAyCC,GACvD,IAAIC,EAAMJ,EAAMK,IAAIF,GAKpB,OAJKC,IACHA,EAnwBJ,SAA4DD,GAkB5D,SAASG,EAAOC,EAAI,EAAGC,EAAI,GACzB,MAAMC,EAAS,IAAIN,EAAK,GAOxB,YANUO,IAANH,IACFE,EAAO,GAAKF,OACFG,IAANF,IACFC,EAAO,GAAKD,IAGTC,CACR,CAoJD,SAASE,EAAsC9B,EAAYY,EAAYmB,GACrE,MAAMH,EAAU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AAKjB,EAAE,GAAKe,EAAIf,EAAE,GAAKgB,EAAIhB,EAAE,IAAMoE,EAAIpE,EAAE,IAAMmG,EAE/ClF,CACR,EAuFCuB,YACAgD,SAjEF,SAA+CnG,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,SAAS8U,EAQLC,EACAC,EACAC,EACAC,EACAC,EACAC,GAEF,MAAO,CAELC,KAAMC,EAAiBP,GAEvBQ,KAAMC,EAAiBR,GAEvBS,KAAMC,EAAiBT,GAEvB5N,KAAMC,EAAiB4N,GAEvB3N,KAAMC,EAAiB2N,GAEvBQ,KAAMC,EAAiBR,GAE3B,CAEa,MAAAC,KAKXA,EAAIE,KAKJA,EAAIE,KAKJA,EAAIpO,KAKJA,EAAIE,KAKJA,EAAIoO,KAKJA,GACEb,EAEAe,aAAcA,aAAcA,aAAcA,aAAcA,aAAcA,eAOxER,KAAMS,EAKNP,KAAMQ,EAKNN,KAAMO,EAKN3O,KAAM4O,EAKN1O,KAAM2O,EAKNP,KAAMQ,GACJrB,EAEAsB,aAAcA,aAAcA,aAAcA,aAAcA,aAAcA,eAOxEf,KAAMgB,EAKNd,KAAMe,EAKNb,KAAMc,EAKNlP,KAAMmP,EAKNjP,KAAMkP,EAKNd,KAAMe,GACJ5B,EAEAxW,EAAWqY,MAAOA,MAAOA,MAAOA,MAAOA"} \ No newline at end of file +{"version":3,"file":"wgpu-matrix.min.js","sources":["../../../src/types.ts","../../../src/utils.ts","../../../src/vec2-impl.ts","../../../src/vec3-impl.ts","../../../src/mat3-impl.ts","../../../src/mat4-impl.ts","../../../src/quat-impl.ts","../../../src/vec4-impl.ts","../../../src/wgpu-matrix.ts"],"sourcesContent":["/**\n * A type wider than `number[]`, omitting any instance functions\n * unused by the API, e.g., map, sort. This allows the math\n * functions to operate on a wider range of array-like\n * values.\n */\nexport interface MutableNumberArray {\n readonly length: number;\n [n: number]: number;\n}\n\n/**\n * The types you can pass to most functions that take an\n * array of numbers.\n */\nexport type BaseArgType = Float32Array | Float64Array | MutableNumberArray;\n\nfunction wrapConstructor any>(\n OriginalConstructor: T,\n modifier: (instance: InstanceType) => void\n): T {\n return class extends OriginalConstructor {\n constructor(...args: any[]) {\n super(...args);\n modifier(this as InstanceType);\n }\n } as T; // Type assertion is necessary here\n}\n\nexport const ZeroArray = wrapConstructor(Array, a => a.fill(0));\n\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nexport let EPSILON = 0.000001;\n\n/**\n * Set the value for EPSILON for various checks\n * @param v - Value to use for EPSILON.\n * @returns previous value of EPSILON;\n */\nexport function setEpsilon(v: number): number {\n const old = EPSILON;\n EPSILON = v;\n return old;\n}\n\n/**\n * Convert degrees to radians\n * @param degrees - Angle in degrees\n * @returns angle converted to radians\n */\nexport function degToRad(degrees: number): number {\n return degrees * Math.PI / 180;\n}\n\n/**\n * Convert radians to degrees\n * @param radians - Angle in radians\n * @returns angle converted to degrees\n */\nexport function radToDeg(radians: number): number {\n return radians * 180 / Math.PI;\n}\n\n/**\n * Lerps between a and b via t\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @returns a + (b - a) * t\n */\nexport function lerp(a: number, b: number, t: number): number {\n return a + (b - a) * t;\n}\n\n/**\n * Compute the opposite of lerp. Given a and b and a value between\n * a and b returns a value between 0 and 1. 0 if a, 1 if b.\n * Note: no clamping is done.\n * @param a - start value\n * @param b - end value\n * @param v - value between a and b\n * @returns (v - a) / (b - a)\n */\nexport function inverseLerp(a: number, b: number, v: number): number {\n const d = b - a;\n return (Math.abs(b - a) < EPSILON)\n ? a\n : (v - a) / d;\n}\n\n/**\n * Compute the euclidean modulo\n *\n * ```\n * // table for n / 3\n * -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 <- n\n * ------------------------------------\n * -2 -1 -0 -2 -1 0, 1, 2, 0, 1, 2 <- n % 3\n * 1 2 0 1 2 0, 1, 2, 0, 1, 2 <- euclideanModule(n, 3)\n * ```\n *\n * @param n - dividend\n * @param m - divisor\n * @returns the euclidean modulo of n / m\n */\nexport function euclideanModulo(n: number, m: number) {\n return ((n % m) + m) % m;\n}","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Mat3Arg } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { Vec2Arg, Vec2Type } from './vec2';\nimport { Vec3Arg } from './vec3';\nimport { BaseArgType } from './types';\n\nexport { Vec2Arg, Vec2Type };\n\ntype Vec2Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec3\n */\nfunction getAPIImpl(Ctor: Vec2Ctor) {\n\n/**\n * Creates a Vec2; may be called with x, y, z to set initial values.\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Vec2's specified type\n * it would be faster to use\n *\n * ```\n * const v = vec2.clone(someJSArray);\n * ```\n *\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\nfunction create(x = 0, y = 0) {\n const newDst = new Ctor(2);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n }\n }\n return newDst;\n}\n\n/**\n * Creates a Vec2; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec2\n * Also see {@link vec2.create} and {@link vec2.copy}\n *\n * @param x first value\n * @param y second value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec2Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec2Arg, b: Vec2Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n\n return newDst;\n}\n\n/**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\nfunction angle(a: Vec2Arg, b: Vec2Arg): number {\n const ax = a[0];\n const ay = a[1];\n const bx = b[0];\n const by = b[1];\n const mag1 = Math.sqrt(ax * ax + ay * ay);\n const mag2 = Math.sqrt(bx * bx + by * by);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec2Arg, b: Vec2Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec2Arg, b: Vec2Arg): boolean {\n return a[0] === b[0] && a[1] === b[1];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec2Arg, b: Vec2Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec2Arg, b: Vec2Arg, t: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec2Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec2Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\nfunction cross(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const z = a[0] * b[1] - a[1] * b[0];\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = z;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec2Arg, b: Vec2Arg): number {\n return a[0] * b[0] + a[1] * b[1];\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec2Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n return Math.sqrt(v0 * v0 + v1 * v1);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec2Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n return v0 * v0 + v1 * v1;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec2Arg, b: Vec2Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return Math.sqrt(dx * dx + dy * dy);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec2Arg, b: Vec2Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return dx * dx + dy * dy;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const len = Math.sqrt(v0 * v0 + v1 * v1);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n }\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec2.clone})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec2.copy})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Creates a random unit vector * scale\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\nfunction random(scale = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const angle = Math.random() * 2 * Math.PI;\n newDst[0] = Math.cos(angle) * scale;\n newDst[1] = Math.sin(angle) * scale;\n\n return newDst;\n}\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform Vec2 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec2Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const x = v[0];\n const y = v[1];\n\n newDst[0] = x * m[0] + y * m[4] + m[12];\n newDst[1] = x * m[1] + y * m[5] + m[13];\n\n return newDst;\n}\n\n/**\n * Transforms vec4 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat3(v: Vec2Arg, m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const x = v[0];\n const y = v[1];\n\n newDst[0] = m[0] * x + m[4] * y + m[8];\n newDst[1] = m[1] * x + m[5] * y + m[9];\n\n return newDst;\n}\n\n/**\n * Rotate a 2D vector\n *\n * @param a The vec2 point to rotate\n * @param b The origin of the rotation\n * @param rad The angle of rotation in radians\n * @returns the rotated vector\n */\nfunction rotate(a: Vec2Arg, b: Vec2Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n // Translate point to the origin\n const p0 = a[0] - b[0];\n const p1 = a[1] - b[1];\n const sinC = Math.sin(rad);\n const cosC = Math.cos(rad);\n\n //perform rotation and translate to correct position\n newDst[0] = p0 * cosC - p1 * sinC + b[0];\n newDst[1] = p0 * sinC + p1 * cosC + b[1];\n\n return newDst;\n}\n\n/**\n * Treat a 2D vector as a direction and set it's length\n *\n * @param a The vec2 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec2Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec2 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec2Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat3,\n rotate,\n setLength,\n truncate,\n midpoint,\n};\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Vec2Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Vec3Arg, Vec3Type } from './vec3';\nimport { Mat3Arg } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { QuatArg } from './quat';\nimport { BaseArgType } from './types';\n\nexport { Vec3Arg, Vec3Type };\n\ntype Vec3Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec3\n * */\nfunction getAPIImpl(Ctor: Vec3Ctor) {\n\n/**\n * Creates a vec3; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number) {\n const newDst = new Ctor(3);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a vec3; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec3\n * Also see {@link vec3.create} and {@link vec3.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec3Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec3Arg, b: Vec3Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n\n return newDst;\n}\n\n/**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\nfunction angle(a: Vec3Arg, b: Vec3Arg): number {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const mag1 = Math.sqrt(ax * ax + ay * ay + az * az);\n const mag2 = Math.sqrt(bx * bx + by * by + bz * bz);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec3Arg, b: Vec3Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec3Arg, b: Vec3Arg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec3Arg, b: Vec3Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec3Arg, b: Vec3Arg, t: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec3Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec3Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\nfunction cross(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const t1 = a[2] * b[0] - a[0] * b[2];\n const t2 = a[0] * b[1] - a[1] * b[0];\n newDst[0] = a[1] * b[2] - a[2] * b[1];\n newDst[1] = t1;\n newDst[2] = t2;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec3Arg, b: Vec3Arg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]);\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec3Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec3Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return v0 * v0 + v1 * v1 + v2 * v2;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec3Arg, b: Vec3Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return Math.sqrt(dx * dx + dy * dy + dz * dz);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec3Arg, b: Vec3Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return dx * dx + dy * dy + dz * dz;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec3.clone})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec3.copy})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Creates a random vector\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\nfunction random(scale = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const angle = Math.random() * 2 * Math.PI;\n const z = Math.random() * 2 - 1;\n const zScale = Math.sqrt(1 - z * z) * scale;\n newDst[0] = Math.cos(angle) * zScale;\n newDst[1] = Math.sin(angle) * zScale;\n newDst[2] = z * scale;\n\n return newDst;\n}\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform vec3 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec3Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1;\n\n newDst[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n newDst[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n newDst[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n\n return newDst;\n}\n\n/**\n * Transform vec3 by upper 3x3 matrix inside 4x4 matrix.\n * @param v - The direction.\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns The transformed vector.\n */\nfunction transformMat4Upper3x3(v: Vec3Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[0] = v0 * m[0 * 4 + 0] + v1 * m[1 * 4 + 0] + v2 * m[2 * 4 + 0];\n newDst[1] = v0 * m[0 * 4 + 1] + v1 * m[1 * 4 + 1] + v2 * m[2 * 4 + 1];\n newDst[2] = v0 * m[0 * 4 + 2] + v1 * m[1 * 4 + 2] + v2 * m[2 * 4 + 2];\n\n return newDst;\n}\n\n/**\n * Transforms vec3 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat3(v: Vec3Arg, m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n\n newDst[0] = x * m[0] + y * m[4] + z * m[8];\n newDst[1] = x * m[1] + y * m[5] + z * m[9];\n newDst[2] = x * m[2] + y * m[6] + z * m[10];\n\n return newDst;\n}\n\n/**\n * Transforms vec3 by Quaternion\n * @param v - the vector to transform\n * @param q - the quaternion to transform by\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed\n */\nfunction transformQuat(v: Vec3Arg, q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n\n const uvX = qy * z - qz * y;\n const uvY = qz * x - qx * z;\n const uvZ = qx * y - qy * x;\n\n newDst[0] = x + uvX * w2 + (qy * uvZ - qz * uvY) * 2;\n newDst[1] = y + uvY * w2 + (qz * uvX - qx * uvZ) * 2;\n newDst[2] = z + uvZ * w2 + (qx * uvY - qy * uvX) * 2;\n\n return newDst;\n}\n\n/**\n * Returns the translation component of a 4-by-4 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\nfunction getTranslation(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n}\n/**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat4Arg, axis: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n}\n/**\n * Returns the scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the x-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\nfunction rotateX(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n //Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n //perform rotation\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad);\n\n //translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the y-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\nfunction rotateY(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n // perform rotation\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad);\n\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the z-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns {vec3} out\n */\nfunction rotateZ(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n // perform rotation\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2];\n\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Treat a 3D vector as a direction and set it's length\n *\n * @param a The vec3 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec3Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec3 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec3Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat4Upper3x3,\n transformMat3,\n transformQuat,\n getTranslation,\n getAxis,\n getScaling,\n rotateX,\n rotateY,\n rotateZ,\n setLength,\n truncate,\n midpoint,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Vec3Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nimport * as utils from './utils.js';\nimport { QuatArg } from './quat';\nimport { Mat3Arg, Mat3Type } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { Vec2Arg } from './vec2';\nimport { Vec3Arg } from './vec3';\nimport { getAPI as getVec2API } from './vec2-impl';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\n\nexport { Mat3Arg, Mat3Type };\n\ntype Mat3Ctor = new (n: number) => T;\n\n/**\n * Generates a typed API for Mat3\n * */\nfunction getAPIImpl(Ctor: Mat3Ctor) {\n const vec2 = getVec2API(Ctor);\n const vec3 = getVec3API(Ctor);\n\n/**\n * Create a Mat3 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat3's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat3.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @returns matrix created from values.\n */\nfunction create(\n v0?: number, v1?: number, v2?: number,\n v3?: number, v4?: number, v5?: number,\n v6?: number, v7?: number, v8?: number) {\n const newDst = new Ctor(12);\n // to make the array homogenous\n newDst[3] = 0;\n newDst[7] = 0;\n newDst[11] = 0;\n\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[4] = v3;\n if (v4 !== undefined) {\n newDst[5] = v4;\n if (v5 !== undefined) {\n newDst[6] = v5;\n if (v6 !== undefined) {\n newDst[8] = v6;\n if (v7 !== undefined) {\n newDst[9] = v7;\n if (v8 !== undefined) {\n newDst[10] = v8;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n\n return newDst;\n}\n\n/**\n * Sets the values of a Mat3\n * Also see {@link mat3.create} and {@link mat3.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 set from values.\n */\nfunction set(\n v0: number, v1: number, v2: number,\n v3: number, v4: number, v5: number,\n v6: number, v7: number, v8: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[0] = v0; newDst[1] = v1; newDst[ 2] = v2; newDst[ 3] = 0;\n newDst[4] = v3; newDst[5] = v4; newDst[ 6] = v5; newDst[ 7] = 0;\n newDst[8] = v6; newDst[9] = v7; newDst[10] = v8; newDst[11] = 0;\n\n return newDst;\n}\n\n/**\n * Creates a Mat3 from the upper left 3x3 part of a Mat4\n * @param m4 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from m4\n */\nfunction fromMat4(m4: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n newDst[0] = m4[0]; newDst[1] = m4[1]; newDst[ 2] = m4[ 2]; newDst[ 3] = 0;\n newDst[4] = m4[4]; newDst[5] = m4[5]; newDst[ 6] = m4[ 6]; newDst[ 7] = 0;\n newDst[8] = m4[8]; newDst[9] = m4[9]; newDst[10] = m4[10]; newDst[11] = 0;\n return newDst;\n}\n\n/**\n * Creates a Mat3 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from q\n */\nfunction fromQuat(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3];\n const x2 = x + x; const y2 = y + y; const z2 = z + z;\n\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n newDst[ 0] = 1 - yy - zz; newDst[ 1] = yx + wz; newDst[ 2] = zx - wy; newDst[ 3] = 0;\n newDst[ 4] = yx - wz; newDst[ 5] = 1 - xx - zz; newDst[ 6] = zy + wx; newDst[ 7] = 0;\n newDst[ 8] = zx + wy; newDst[ 9] = zy - wx; newDst[10] = 1 - xx - yy; newDst[11] = 0;\n\n return newDst;\n}\n\n/**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\nfunction negate(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = -m[ 0]; newDst[ 1] = -m[ 1]; newDst[ 2] = -m[ 2];\n newDst[ 4] = -m[ 4]; newDst[ 5] = -m[ 5]; newDst[ 6] = -m[ 6];\n newDst[ 8] = -m[ 8]; newDst[ 9] = -m[ 9]; newDst[10] = -m[10];\n\n return newDst;\n}\n\n/**\n * Copies a matrix. (same as {@link mat3.clone})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nfunction copy(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = m[ 0]; newDst[ 1] = m[ 1]; newDst[ 2] = m[ 2];\n newDst[ 4] = m[ 4]; newDst[ 5] = m[ 5]; newDst[ 6] = m[ 6];\n newDst[ 8] = m[ 8]; newDst[ 9] = m[ 9]; newDst[10] = m[10];\n\n return newDst;\n}\n\n/**\n * Copies a matrix (same as {@link mat3.copy})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nconst clone = copy;\n\n/**\n * Check if 2 matrices are approximately equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are approximately equal\n */\nfunction equalsApproximately(a: Mat3Arg, b: Mat3Arg): boolean {\n return Math.abs(a[ 0] - b[ 0]) < utils.EPSILON &&\n Math.abs(a[ 1] - b[ 1]) < utils.EPSILON &&\n Math.abs(a[ 2] - b[ 2]) < utils.EPSILON &&\n Math.abs(a[ 4] - b[ 4]) < utils.EPSILON &&\n Math.abs(a[ 5] - b[ 5]) < utils.EPSILON &&\n Math.abs(a[ 6] - b[ 6]) < utils.EPSILON &&\n Math.abs(a[ 8] - b[ 8]) < utils.EPSILON &&\n Math.abs(a[ 9] - b[ 9]) < utils.EPSILON &&\n Math.abs(a[10] - b[10]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 matrices are exactly equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are exactly equal\n */\nfunction equals(a: Mat3Arg, b: Mat3Arg): boolean {\n return a[ 0] === b[ 0] &&\n a[ 1] === b[ 1] &&\n a[ 2] === b[ 2] &&\n a[ 4] === b[ 4] &&\n a[ 5] === b[ 5] &&\n a[ 6] === b[ 6] &&\n a[ 8] === b[ 8] &&\n a[ 9] === b[ 9] &&\n a[10] === b[10];\n}\n\n/**\n * Creates a 3-by-3 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 3-by-3 identity matrix.\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\nfunction transpose(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n if (newDst === m) {\n let t: number;\n\n // 0 1 2\n // 4 5 6\n // 8 9 10\n\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n\n return newDst;\n }\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n newDst[ 0] = m00; newDst[ 1] = m10; newDst[ 2] = m20;\n newDst[ 4] = m01; newDst[ 5] = m11; newDst[ 6] = m21;\n newDst[ 8] = m02; newDst[ 9] = m12; newDst[10] = m22;\n\n return newDst;\n}\n\n/**\n * Computes the inverse of a 3-by-3 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nfunction inverse(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n const b01 = m22 * m11 - m12 * m21;\n const b11 = -m22 * m10 + m12 * m20;\n const b21 = m21 * m10 - m11 * m20;\n\n const invDet = 1 / (m00 * b01 + m01 * b11 + m02 * b21);\n\n newDst[ 0] = b01 * invDet;\n newDst[ 1] = (-m22 * m01 + m02 * m21) * invDet;\n newDst[ 2] = ( m12 * m01 - m02 * m11) * invDet;\n newDst[ 4] = b11 * invDet;\n newDst[ 5] = ( m22 * m00 - m02 * m20) * invDet;\n newDst[ 6] = (-m12 * m00 + m02 * m10) * invDet;\n newDst[ 8] = b21 * invDet;\n newDst[ 9] = (-m21 * m00 + m01 * m20) * invDet;\n newDst[10] = ( m11 * m00 - m01 * m10) * invDet;\n\n return newDst;\n}\n\n/**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\nfunction determinant(m: Mat3Arg): number {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n return m00 * (m11 * m22 - m21 * m12) -\n m10 * (m01 * m22 - m21 * m02) +\n m20 * (m01 * m12 - m11 * m02);\n}\n\n/**\n * Computes the inverse of a 3-by-3 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nconst invert = inverse;\n\n/**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nfunction multiply(a: Mat3Arg, b: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[ 4 + 0];\n const a11 = a[ 4 + 1];\n const a12 = a[ 4 + 2];\n const a20 = a[ 8 + 0];\n const a21 = a[ 8 + 1];\n const a22 = a[ 8 + 2];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b10 = b[ 4 + 0];\n const b11 = b[ 4 + 1];\n const b12 = b[ 4 + 2];\n const b20 = b[ 8 + 0];\n const b21 = b[ 8 + 1];\n const b22 = b[ 8 + 2];\n\n newDst[ 0] = a00 * b00 + a10 * b01 + a20 * b02;\n newDst[ 1] = a01 * b00 + a11 * b01 + a21 * b02;\n newDst[ 2] = a02 * b00 + a12 * b01 + a22 * b02;\n newDst[ 4] = a00 * b10 + a10 * b11 + a20 * b12;\n newDst[ 5] = a01 * b10 + a11 * b11 + a21 * b12;\n newDst[ 6] = a02 * b10 + a12 * b11 + a22 * b12;\n newDst[ 8] = a00 * b20 + a10 * b21 + a20 * b22;\n newDst[ 9] = a01 * b20 + a11 * b21 + a21 * b22;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22;\n\n return newDst;\n}\n\n/**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nconst mul = multiply;\n\n/**\n * Sets the translation component of a 3-by-3 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\nfunction setTranslation(a: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? identity()) as T;\n if (a !== newDst) {\n newDst[ 0] = a[ 0];\n newDst[ 1] = a[ 1];\n newDst[ 2] = a[ 2];\n newDst[ 4] = a[ 4];\n newDst[ 5] = a[ 5];\n newDst[ 6] = a[ 6];\n }\n newDst[ 8] = v[0];\n newDst[ 9] = v[1];\n newDst[10] = 1;\n return newDst;\n}\n\n/**\n * Returns the translation component of a 3-by-3 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\nfunction getTranslation(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec2.create()) as T;\n newDst[0] = m[8];\n newDst[1] = m[9];\n return newDst;\n}\n\n/**\n * Returns an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y,\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat3Arg, axis: number, dst?: T) {\n const newDst = (dst ?? vec2.create()) as T;\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n return newDst;\n}\n\n/**\n * Sets an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\nfunction setAxis(m: Mat3Arg, v: Vec2Arg, axis: number, dst?: T) {\n const newDst = (dst === m ? m : copy(m, dst)) as T;\n\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n return newDst;\n}\n\n/**\n * Returns the \"2d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec2.create());\n\n const xx = m[0];\n const xy = m[1];\n const yx = m[4];\n const yy = m[5];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy);\n newDst[1] = Math.sqrt(yx * yx + yy * yy);\n\n return newDst;\n}\n\n\n/**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction get3DScaling(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec3.create());\n\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which translates by the given vector v.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\nfunction translation(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = v[0]; newDst[ 9] = v[1]; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Translates the given 3-by-3 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\nfunction translate(m: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 0] = m00;\n newDst[ 1] = m01;\n newDst[ 2] = m02;\n newDst[ 4] = m10;\n newDst[ 5] = m11;\n newDst[ 6] = m12;\n }\n\n newDst[ 8] = m00 * v0 + m10 * v1 + m20;\n newDst[ 9] = m01 * v0 + m11 * v1 + m21;\n newDst[10] = m02 * v0 + m12 * v1 + m22;\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotation(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = s; newDst[ 2] = 0;\n newDst[ 4] = -s; newDst[ 5] = c; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix by the given angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotate(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 + s * m10;\n newDst[ 1] = c * m01 + s * m11;\n newDst[ 2] = c * m02 + s * m12;\n\n newDst[ 4] = c * m10 - s * m00;\n newDst[ 5] = c * m11 - s * m01;\n newDst[ 6] = c * m12 - s * m02;\n\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the x-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationX(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = c; newDst[ 6] = s;\n newDst[ 8] = 0; newDst[ 9] = -s; newDst[10] = c;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix around the x-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateX(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[4] = c * m10 + s * m20;\n newDst[5] = c * m11 + s * m21;\n newDst[6] = c * m12 + s * m22;\n newDst[8] = c * m20 - s * m10;\n newDst[9] = c * m21 - s * m11;\n newDst[10] = c * m22 - s * m12;\n\n if (m !== newDst) {\n newDst[ 0] = m[ 0];\n newDst[ 1] = m[ 1];\n newDst[ 2] = m[ 2];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the y-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationY(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = 0; newDst[ 2] = -s;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = s; newDst[ 9] = 0; newDst[10] = c;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix around the y-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateY(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 - s * m20;\n newDst[ 1] = c * m01 - s * m21;\n newDst[ 2] = c * m02 - s * m22;\n newDst[ 8] = c * m20 + s * m00;\n newDst[ 9] = c * m21 + s * m01;\n newDst[10] = c * m22 + s * m02;\n\n if (m !== newDst) {\n newDst[ 4] = m[ 4];\n newDst[ 5] = m[ 5];\n newDst[ 6] = m[ 6];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the z-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nconst rotationZ = rotation;\n\n/**\n * Rotates the given 3-by-3 matrix around the z-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nconst rotateZ = rotate;\n\n/**\n * Creates a 3-by-3 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has two\n * entries.\n * @param v - A vector of\n * 2 entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * two entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of 2 entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale(m: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * 3 entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling3D(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = v[2];\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of 3 entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale3D(m: Mat3Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n\n newDst[ 8] = v2 * m[2 * 4 + 0];\n newDst[ 9] = v2 * m[2 * 4 + 1];\n newDst[10] = v2 * m[2 * 4 + 2];\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales uniformly in the X and Y dimensions\n * @param s - Amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in the X and Y dimension by an amount\n * given.\n * @param m - The matrix to be modified.\n * @param s - Amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale(m: Mat3Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales uniformly in each dimension\n * @param s - Amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling3D(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = s;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given.\n * @param m - The matrix to be modified.\n * @param s - Amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale3D(m: Mat3Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n\n newDst[ 8] = s * m[2 * 4 + 0];\n newDst[ 9] = s * m[2 * 4 + 1];\n newDst[10] = s * m[2 * 4 + 2];\n\n return newDst;\n}\n\nreturn {\n clone,\n create,\n set,\n fromMat4,\n fromQuat,\n negate,\n copy,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n invert,\n determinant,\n mul,\n multiply,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n get3DScaling,\n translation,\n translate,\n rotation,\n rotate,\n rotationX,\n rotateX,\n rotationY,\n rotateY,\n rotationZ,\n rotateZ,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n scaling3D,\n scale3D,\n uniformScaling3D,\n uniformScale3D,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Mat3Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","import { Mat4Arg, Mat4Type } from './mat4';\nimport { Mat3Arg } from './mat3';\nimport { QuatArg } from './quat';\nimport { Vec3Arg } from './vec3';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\nimport * as utils from './utils';\n\nexport { Mat4Arg, Mat4Type };\n\ntype Mat4Ctor = new (n: number) => T;\n\n/**\n * Generates a typed API for Mat4\n * */\nfunction getAPIImpl(Ctor: Mat4Ctor) {\n const vec3 = getVec3API(Ctor);\n\n/**\n * 4x4 Matrix math math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new matrix. In other words you can do this\n *\n * const mat = mat4.translation([1, 2, 3]); // Creates a new translation matrix\n *\n * or\n *\n * const mat = mat4.create();\n * mat4.translation([1, 2, 3], mat); // Puts translation matrix in mat.\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always save to pass any matrix as the destination. So for example\n *\n * const mat = mat4.identity();\n * const trans = mat4.translation([1, 2, 3]);\n * mat4.multiply(mat, trans, mat); // Multiplies mat * trans and puts result in mat.\n *\n */\n\n\n/**\n * Create a Mat4 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat4's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat4.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @returns created from values.\n */\nfunction create(\n v0?: number, v1?: number, v2?: number, v3?: number,\n v4?: number, v5?: number, v6?: number, v7?: number,\n v8?: number, v9?: number, v10?: number, v11?: number,\n v12?: number, v13?: number, v14?: number, v15?: number) {\n const newDst = new Ctor(16);\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[3] = v3;\n if (v4 !== undefined) {\n newDst[4] = v4;\n if (v5 !== undefined) {\n newDst[5] = v5;\n if (v6 !== undefined) {\n newDst[6] = v6;\n if (v7 !== undefined) {\n newDst[7] = v7;\n if (v8 !== undefined) {\n newDst[8] = v8;\n if (v9 !== undefined) {\n newDst[9] = v9;\n if (v10 !== undefined) {\n newDst[10] = v10;\n if (v11 !== undefined) {\n newDst[11] = v11;\n if (v12 !== undefined) {\n newDst[12] = v12;\n if (v13 !== undefined) {\n newDst[13] = v13;\n if (v14 !== undefined) {\n newDst[14] = v14;\n if (v15 !== undefined) {\n newDst[15] = v15;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Sets the values of a Mat4\n * Also see {@link mat4.create} and {@link mat4.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 created from values.\n */\nfunction set(\n v0: number, v1: number, v2: number, v3: number,\n v4: number, v5: number, v6: number, v7: number,\n v8: number, v9: number, v10: number, v11: number,\n v12: number, v13: number, v14: number, v15: number,\n dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = v0; newDst[ 1] = v1; newDst[ 2] = v2; newDst[ 3] = v3;\n newDst[ 4] = v4; newDst[ 5] = v5; newDst[ 6] = v6; newDst[ 7] = v7;\n newDst[ 8] = v8; newDst[ 9] = v9; newDst[10] = v10; newDst[11] = v11;\n newDst[12] = v12; newDst[13] = v13; newDst[14] = v14; newDst[15] = v15;\n\n return newDst;\n}\n\n/**\n * Creates a Mat4 from a Mat3\n * @param m3 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from m3\n */\nfunction fromMat3(m3: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = m3[0]; newDst[ 1] = m3[1]; newDst[ 2] = m3[ 2]; newDst[ 3] = 0;\n newDst[ 4] = m3[4]; newDst[ 5] = m3[5]; newDst[ 6] = m3[ 6]; newDst[ 7] = 0;\n newDst[ 8] = m3[8]; newDst[ 9] = m3[9]; newDst[10] = m3[10]; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a Mat4 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from q\n */\nfunction fromQuat(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3];\n const x2 = x + x; const y2 = y + y; const z2 = z + z;\n\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n newDst[ 0] = 1 - yy - zz; newDst[ 1] = yx + wz; newDst[ 2] = zx - wy; newDst[ 3] = 0;\n newDst[ 4] = yx - wz; newDst[ 5] = 1 - xx - zz; newDst[ 6] = zy + wx; newDst[ 7] = 0;\n newDst[ 8] = zx + wy; newDst[ 9] = zy - wx; newDst[10] = 1 - xx - yy; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\nfunction negate(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = -m[ 0]; newDst[ 1] = -m[ 1]; newDst[ 2] = -m[ 2]; newDst[ 3] = -m[ 3];\n newDst[ 4] = -m[ 4]; newDst[ 5] = -m[ 5]; newDst[ 6] = -m[ 6]; newDst[ 7] = -m[ 7];\n newDst[ 8] = -m[ 8]; newDst[ 9] = -m[ 9]; newDst[10] = -m[10]; newDst[11] = -m[11];\n newDst[12] = -m[12]; newDst[13] = -m[13]; newDst[14] = -m[14]; newDst[15] = -m[15];\n\n return newDst;\n}\n\n/**\n * Copies a matrix. (same as {@link mat4.clone})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nfunction copy(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = m[ 0]; newDst[ 1] = m[ 1]; newDst[ 2] = m[ 2]; newDst[ 3] = m[ 3];\n newDst[ 4] = m[ 4]; newDst[ 5] = m[ 5]; newDst[ 6] = m[ 6]; newDst[ 7] = m[ 7];\n newDst[ 8] = m[ 8]; newDst[ 9] = m[ 9]; newDst[10] = m[10]; newDst[11] = m[11];\n newDst[12] = m[12]; newDst[13] = m[13]; newDst[14] = m[14]; newDst[15] = m[15];\n\n return newDst;\n}\n\n/**\n * Copies a matrix (same as {@link mat4.copy})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nconst clone = copy;\n\n/**\n * Check if 2 matrices are approximately equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are approximately equal\n */\nfunction equalsApproximately(a: Mat4Arg, b: Mat4Arg): boolean {\n return Math.abs(a[ 0] - b[ 0]) < utils.EPSILON &&\n Math.abs(a[ 1] - b[ 1]) < utils.EPSILON &&\n Math.abs(a[ 2] - b[ 2]) < utils.EPSILON &&\n Math.abs(a[ 3] - b[ 3]) < utils.EPSILON &&\n Math.abs(a[ 4] - b[ 4]) < utils.EPSILON &&\n Math.abs(a[ 5] - b[ 5]) < utils.EPSILON &&\n Math.abs(a[ 6] - b[ 6]) < utils.EPSILON &&\n Math.abs(a[ 7] - b[ 7]) < utils.EPSILON &&\n Math.abs(a[ 8] - b[ 8]) < utils.EPSILON &&\n Math.abs(a[ 9] - b[ 9]) < utils.EPSILON &&\n Math.abs(a[10] - b[10]) < utils.EPSILON &&\n Math.abs(a[11] - b[11]) < utils.EPSILON &&\n Math.abs(a[12] - b[12]) < utils.EPSILON &&\n Math.abs(a[13] - b[13]) < utils.EPSILON &&\n Math.abs(a[14] - b[14]) < utils.EPSILON &&\n Math.abs(a[15] - b[15]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 matrices are exactly equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are exactly equal\n */\nfunction equals(a: Mat4Arg, b: Mat4Arg): boolean {\n return a[ 0] === b[ 0] &&\n a[ 1] === b[ 1] &&\n a[ 2] === b[ 2] &&\n a[ 3] === b[ 3] &&\n a[ 4] === b[ 4] &&\n a[ 5] === b[ 5] &&\n a[ 6] === b[ 6] &&\n a[ 7] === b[ 7] &&\n a[ 8] === b[ 8] &&\n a[ 9] === b[ 9] &&\n a[10] === b[10] &&\n a[11] === b[11] &&\n a[12] === b[12] &&\n a[13] === b[13] &&\n a[14] === b[14] &&\n a[15] === b[15];\n}\n\n/**\n * Creates a 4-by-4 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 4-by-4 identity matrix.\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\nfunction transpose(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n if (newDst === m) {\n let t;\n\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n\n t = m[3];\n m[3] = m[12];\n m[12] = t;\n\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n\n t = m[7];\n m[7] = m[13];\n m[13] = t;\n\n t = m[11];\n m[11] = m[14];\n m[14] = t;\n return newDst;\n }\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n newDst[ 0] = m00; newDst[ 1] = m10; newDst[ 2] = m20; newDst[ 3] = m30;\n newDst[ 4] = m01; newDst[ 5] = m11; newDst[ 6] = m21; newDst[ 7] = m31;\n newDst[ 8] = m02; newDst[ 9] = m12; newDst[10] = m22; newDst[11] = m32;\n newDst[12] = m03; newDst[13] = m13; newDst[14] = m23; newDst[15] = m33;\n\n return newDst;\n}\n\n/**\n * Computes the inverse of a 4-by-4 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nfunction inverse(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n const tmp12 = m20 * m31;\n const tmp13 = m30 * m21;\n const tmp14 = m10 * m31;\n const tmp15 = m30 * m11;\n const tmp16 = m10 * m21;\n const tmp17 = m20 * m11;\n const tmp18 = m00 * m31;\n const tmp19 = m30 * m01;\n const tmp20 = m00 * m21;\n const tmp21 = m20 * m01;\n const tmp22 = m00 * m11;\n const tmp23 = m10 * m01;\n\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n\n const d = 1 / (m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3);\n\n newDst[ 0] = d * t0;\n newDst[ 1] = d * t1;\n newDst[ 2] = d * t2;\n newDst[ 3] = d * t3;\n newDst[ 4] = d * ((tmp1 * m10 + tmp2 * m20 + tmp5 * m30) -\n (tmp0 * m10 + tmp3 * m20 + tmp4 * m30));\n newDst[ 5] = d * ((tmp0 * m00 + tmp7 * m20 + tmp8 * m30) -\n (tmp1 * m00 + tmp6 * m20 + tmp9 * m30));\n newDst[ 6] = d * ((tmp3 * m00 + tmp6 * m10 + tmp11 * m30) -\n (tmp2 * m00 + tmp7 * m10 + tmp10 * m30));\n newDst[ 7] = d * ((tmp4 * m00 + tmp9 * m10 + tmp10 * m20) -\n (tmp5 * m00 + tmp8 * m10 + tmp11 * m20));\n newDst[ 8] = d * ((tmp12 * m13 + tmp15 * m23 + tmp16 * m33) -\n (tmp13 * m13 + tmp14 * m23 + tmp17 * m33));\n newDst[ 9] = d * ((tmp13 * m03 + tmp18 * m23 + tmp21 * m33) -\n (tmp12 * m03 + tmp19 * m23 + tmp20 * m33));\n newDst[10] = d * ((tmp14 * m03 + tmp19 * m13 + tmp22 * m33) -\n (tmp15 * m03 + tmp18 * m13 + tmp23 * m33));\n newDst[11] = d * ((tmp17 * m03 + tmp20 * m13 + tmp23 * m23) -\n (tmp16 * m03 + tmp21 * m13 + tmp22 * m23));\n newDst[12] = d * ((tmp14 * m22 + tmp17 * m32 + tmp13 * m12) -\n (tmp16 * m32 + tmp12 * m12 + tmp15 * m22));\n newDst[13] = d * ((tmp20 * m32 + tmp12 * m02 + tmp19 * m22) -\n (tmp18 * m22 + tmp21 * m32 + tmp13 * m02));\n newDst[14] = d * ((tmp18 * m12 + tmp23 * m32 + tmp15 * m02) -\n (tmp22 * m32 + tmp14 * m02 + tmp19 * m12));\n newDst[15] = d * ((tmp22 * m22 + tmp16 * m02 + tmp21 * m12) -\n (tmp20 * m12 + tmp23 * m22 + tmp17 * m02));\n\n return newDst;\n}\n\n/**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\nfunction determinant(m: Mat4Arg): number {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n\n return m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3;\n}\n\n/**\n * Computes the inverse of a 4-by-4 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nconst invert = inverse;\n\n/**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nfunction multiply(a: Mat4Arg, b: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[ 4 + 0];\n const a11 = a[ 4 + 1];\n const a12 = a[ 4 + 2];\n const a13 = a[ 4 + 3];\n const a20 = a[ 8 + 0];\n const a21 = a[ 8 + 1];\n const a22 = a[ 8 + 2];\n const a23 = a[ 8 + 3];\n const a30 = a[12 + 0];\n const a31 = a[12 + 1];\n const a32 = a[12 + 2];\n const a33 = a[12 + 3];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b03 = b[3];\n const b10 = b[ 4 + 0];\n const b11 = b[ 4 + 1];\n const b12 = b[ 4 + 2];\n const b13 = b[ 4 + 3];\n const b20 = b[ 8 + 0];\n const b21 = b[ 8 + 1];\n const b22 = b[ 8 + 2];\n const b23 = b[ 8 + 3];\n const b30 = b[12 + 0];\n const b31 = b[12 + 1];\n const b32 = b[12 + 2];\n const b33 = b[12 + 3];\n\n newDst[ 0] = a00 * b00 + a10 * b01 + a20 * b02 + a30 * b03;\n newDst[ 1] = a01 * b00 + a11 * b01 + a21 * b02 + a31 * b03;\n newDst[ 2] = a02 * b00 + a12 * b01 + a22 * b02 + a32 * b03;\n newDst[ 3] = a03 * b00 + a13 * b01 + a23 * b02 + a33 * b03;\n newDst[ 4] = a00 * b10 + a10 * b11 + a20 * b12 + a30 * b13;\n newDst[ 5] = a01 * b10 + a11 * b11 + a21 * b12 + a31 * b13;\n newDst[ 6] = a02 * b10 + a12 * b11 + a22 * b12 + a32 * b13;\n newDst[ 7] = a03 * b10 + a13 * b11 + a23 * b12 + a33 * b13;\n newDst[ 8] = a00 * b20 + a10 * b21 + a20 * b22 + a30 * b23;\n newDst[ 9] = a01 * b20 + a11 * b21 + a21 * b22 + a31 * b23;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22 + a32 * b23;\n newDst[11] = a03 * b20 + a13 * b21 + a23 * b22 + a33 * b23;\n newDst[12] = a00 * b30 + a10 * b31 + a20 * b32 + a30 * b33;\n newDst[13] = a01 * b30 + a11 * b31 + a21 * b32 + a31 * b33;\n newDst[14] = a02 * b30 + a12 * b31 + a22 * b32 + a32 * b33;\n newDst[15] = a03 * b30 + a13 * b31 + a23 * b32 + a33 * b33;\n\n return newDst;\n}\n\n/**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nconst mul = multiply;\n\n/**\n * Sets the translation component of a 4-by-4 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\nfunction setTranslation(a: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? identity()) as T;\n if (a !== newDst) {\n newDst[ 0] = a[ 0];\n newDst[ 1] = a[ 1];\n newDst[ 2] = a[ 2];\n newDst[ 3] = a[ 3];\n newDst[ 4] = a[ 4];\n newDst[ 5] = a[ 5];\n newDst[ 6] = a[ 6];\n newDst[ 7] = a[ 7];\n newDst[ 8] = a[ 8];\n newDst[ 9] = a[ 9];\n newDst[10] = a[10];\n newDst[11] = a[11];\n }\n newDst[12] = v[0];\n newDst[13] = v[1];\n newDst[14] = v[2];\n newDst[15] = 1;\n return newDst;\n}\n\n///**\n// * Returns the translation component of a 4-by-4 matrix as a vector with 3\n// * entries.\n// * @param m - The matrix.\n// * @param dst - vector to hold result. If not passed a new one is created.\n// * @returns The translation component of m.\n// */\nfunction getTranslation(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? vec3.create()) as T;\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n}\n\n/**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat4Arg, axis: number, dst?: T) {\n const newDst = (dst ?? vec3.create());\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n}\n\n/**\n * Sets an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\nfunction setAxis(m: Mat4Arg, v: Vec3Arg, axis: number, dst: T) {\n const newDst = (dst === m) ? dst : copy(m, dst);\n\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n newDst[off + 2] = v[2];\n return newDst;\n}\n\n/**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? vec3.create()) as T;\n\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 0 to 1 in the z dimension.\n *\n * Note: If you pass `Infinity` for zFar then it will produce a projection matrix\n * returns -Infinity for Z when transforming coordinates with Z <= 0 and +Infinity for Z\n * otherwise.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */\nfunction perspective(fieldOfViewYInRadians: number, aspect: number, zNear: number, zFar: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const f = Math.tan(Math.PI * 0.5 - 0.5 * fieldOfViewYInRadians);\n\n newDst[0] = f / aspect;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n newDst[4] = 0;\n newDst[5] = f;\n newDst[6] = 0;\n newDst[7] = 0;\n\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[11] = -1;\n\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (Number.isFinite(zFar)) {\n const rangeInv = 1 / (zNear - zFar);\n newDst[10] = zFar * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n } else {\n newDst[10] = -1;\n newDst[14] = -zNear;\n }\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 1 (at -zNear) to 0 (at -zFar) in the z dimension.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane. (default = Infinity)\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */function perspectiveReverseZ(fieldOfViewYInRadians: number, aspect: number, zNear: number, zFar = Infinity, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const f = 1 / Math.tan(fieldOfViewYInRadians * 0.5);\n\n newDst[ 0] = f / aspect;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n\n newDst[ 4] = 0;\n newDst[ 5] = f;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n\n newDst[ 8] = 0;\n newDst[ 9] = 0;\n newDst[11] = -1;\n\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (zFar === Infinity) {\n newDst[10] = 0;\n newDst[14] = zNear;\n } else {\n const rangeInv = 1 / (zFar - zNear);\n newDst[10] = zNear * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n }\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 orthogonal transformation matrix that transforms from\n * the given the left, right, bottom, and top dimensions to -1 +1 in x, and y\n * and 0 to +1 in z.\n * @param left - Left side of the near clipping plane viewport.\n * @param right - Right side of the near clipping plane viewport.\n * @param bottom - Bottom of the near clipping plane viewport.\n * @param top - Top of the near clipping plane viewport.\n * @param near - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param far - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The orthographic projection matrix.\n */\nfunction ortho(left: number, right: number, bottom: number, top: number, near: number, far: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[0] = 2 / (right - left);\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n newDst[4] = 0;\n newDst[5] = 2 / (top - bottom);\n newDst[6] = 0;\n newDst[7] = 0;\n\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[10] = 1 / (near - far);\n newDst[11] = 0;\n\n newDst[12] = (right + left) / (left - right);\n newDst[13] = (top + bottom) / (bottom - top);\n newDst[14] = near / (near - far);\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 0 to 1 in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\nfunction frustum(left: number, right: number, bottom: number, top: number, near: number, far: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const dx = (right - left);\n const dy = (top - bottom);\n const dz = (near - far);\n\n newDst[ 0] = 2 * near / dx;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n newDst[ 4] = 0;\n newDst[ 5] = 2 * near / dy;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n newDst[ 8] = (left + right) / dx;\n newDst[ 9] = (top + bottom) / dy;\n newDst[10] = far / dz;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = near * far / dz;\n newDst[15] = 0;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 1 (-near) to 0 (-far) in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\nfunction frustumReverseZ(left: number, right: number, bottom: number, top: number, near: number, far = Infinity, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const dx = (right - left);\n const dy = (top - bottom);\n\n newDst[ 0] = 2 * near / dx;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n newDst[ 4] = 0;\n newDst[ 5] = 2 * near / dy;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n newDst[ 8] = (left + right) / dx;\n newDst[ 9] = (top + bottom) / dy;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (far === Infinity) {\n newDst[10] = 0;\n newDst[14] = near;\n } else {\n const rangeInv = 1 / (far - near);\n newDst[10] = near * rangeInv;\n newDst[14] = far * near * rangeInv;\n }\n\n return newDst;\n}\n\nconst xAxis = vec3.create();\nconst yAxis = vec3.create();\nconst zAxis = vec3.create();\n\n/**\n * Computes a 4-by-4 aim transformation.\n *\n * This is a matrix which positions an object aiming down positive Z.\n * toward the target.\n *\n * Note: this is **NOT** the inverse of lookAt as lookAt looks at negative Z.\n *\n * @param position - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\nfunction aim(position: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(target, position, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = xAxis[1]; newDst[ 2] = xAxis[2]; newDst[ 3] = 0;\n newDst[ 4] = yAxis[0]; newDst[ 5] = yAxis[1]; newDst[ 6] = yAxis[2]; newDst[ 7] = 0;\n newDst[ 8] = zAxis[0]; newDst[ 9] = zAxis[1]; newDst[10] = zAxis[2]; newDst[11] = 0;\n newDst[12] = position[0]; newDst[13] = position[1]; newDst[14] = position[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 camera aim transformation.\n *\n * This is a matrix which positions an object aiming down negative Z.\n * toward the target.\n *\n * Note: this is the inverse of `lookAt`\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\nfunction cameraAim(eye: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = xAxis[1]; newDst[ 2] = xAxis[2]; newDst[ 3] = 0;\n newDst[ 4] = yAxis[0]; newDst[ 5] = yAxis[1]; newDst[ 6] = yAxis[2]; newDst[ 7] = 0;\n newDst[ 8] = zAxis[0]; newDst[ 9] = zAxis[1]; newDst[10] = zAxis[2]; newDst[11] = 0;\n newDst[12] = eye[0]; newDst[13] = eye[1]; newDst[14] = eye[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 view transformation.\n *\n * This is a view matrix which transforms all other objects\n * to be in the space of the view defined by the parameters.\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The look-at matrix.\n */\nfunction lookAt(eye: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = yAxis[0]; newDst[ 2] = zAxis[0]; newDst[ 3] = 0;\n newDst[ 4] = xAxis[1]; newDst[ 5] = yAxis[1]; newDst[ 6] = zAxis[1]; newDst[ 7] = 0;\n newDst[ 8] = xAxis[2]; newDst[ 9] = yAxis[2]; newDst[10] = zAxis[2]; newDst[11] = 0;\n\n newDst[12] = -(xAxis[0] * eye[0] + xAxis[1] * eye[1] + xAxis[2] * eye[2]);\n newDst[13] = -(yAxis[0] * eye[0] + yAxis[1] * eye[1] + yAxis[2] * eye[2]);\n newDst[14] = -(zAxis[0] * eye[0] + zAxis[1] * eye[1] + zAxis[2] * eye[2]);\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which translates by the given vector v.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\nfunction translation(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = v[0]; newDst[13] = v[1]; newDst[14] = v[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Translates the given 4-by-4 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\nfunction translate(m: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n if (m !== newDst) {\n newDst[ 0] = m00;\n newDst[ 1] = m01;\n newDst[ 2] = m02;\n newDst[ 3] = m03;\n newDst[ 4] = m10;\n newDst[ 5] = m11;\n newDst[ 6] = m12;\n newDst[ 7] = m13;\n newDst[ 8] = m20;\n newDst[ 9] = m21;\n newDst[10] = m22;\n newDst[11] = m23;\n }\n\n newDst[12] = m00 * v0 + m10 * v1 + m20 * v2 + m30;\n newDst[13] = m01 * v0 + m11 * v1 + m21 * v2 + m31;\n newDst[14] = m02 * v0 + m12 * v1 + m22 * v2 + m32;\n newDst[15] = m03 * v0 + m13 * v1 + m23 * v2 + m33;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the x-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationX(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = c; newDst[ 6] = s; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = -s; newDst[10] = c; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the x-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateX(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[4] = c * m10 + s * m20;\n newDst[5] = c * m11 + s * m21;\n newDst[6] = c * m12 + s * m22;\n newDst[7] = c * m13 + s * m23;\n newDst[8] = c * m20 - s * m10;\n newDst[9] = c * m21 - s * m11;\n newDst[10] = c * m22 - s * m12;\n newDst[11] = c * m23 - s * m13;\n\n if (m !== newDst) {\n newDst[ 0] = m[ 0];\n newDst[ 1] = m[ 1];\n newDst[ 2] = m[ 2];\n newDst[ 3] = m[ 3];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the y-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationY(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = 0; newDst[ 2] = -s; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = s; newDst[ 9] = 0; newDst[10] = c; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the y-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateY(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 - s * m20;\n newDst[ 1] = c * m01 - s * m21;\n newDst[ 2] = c * m02 - s * m22;\n newDst[ 3] = c * m03 - s * m23;\n newDst[ 8] = c * m20 + s * m00;\n newDst[ 9] = c * m21 + s * m01;\n newDst[10] = c * m22 + s * m02;\n newDst[11] = c * m23 + s * m03;\n\n if (m !== newDst) {\n newDst[ 4] = m[ 4];\n newDst[ 5] = m[ 5];\n newDst[ 6] = m[ 6];\n newDst[ 7] = m[ 7];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the z-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationZ(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = s; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = -s; newDst[ 5] = c; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the z-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateZ(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 + s * m10;\n newDst[ 1] = c * m01 + s * m11;\n newDst[ 2] = c * m02 + s * m12;\n newDst[ 3] = c * m03 + s * m13;\n newDst[ 4] = c * m10 - s * m00;\n newDst[ 5] = c * m11 - s * m01;\n newDst[ 6] = c * m12 - s * m02;\n newDst[ 7] = c * m13 - s * m03;\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n newDst[11] = m[11];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\nfunction axisRotation(axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n\n newDst[ 0] = xx + (1 - xx) * c;\n newDst[ 1] = x * y * oneMinusCosine + z * s;\n newDst[ 2] = x * z * oneMinusCosine - y * s;\n newDst[ 3] = 0;\n newDst[ 4] = x * y * oneMinusCosine - z * s;\n newDst[ 5] = yy + (1 - yy) * c;\n newDst[ 6] = y * z * oneMinusCosine + x * s;\n newDst[ 7] = 0;\n newDst[ 8] = x * z * oneMinusCosine + y * s;\n newDst[ 9] = y * z * oneMinusCosine - x * s;\n newDst[10] = zz + (1 - zz) * c;\n newDst[11] = 0;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = 0;\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle. (same as axisRotation)\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\nconst rotation = axisRotation;\n\n/**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle.\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction axisRotate(m: Mat4Arg, axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n\n const r00 = xx + (1 - xx) * c;\n const r01 = x * y * oneMinusCosine + z * s;\n const r02 = x * z * oneMinusCosine - y * s;\n const r10 = x * y * oneMinusCosine - z * s;\n const r11 = yy + (1 - yy) * c;\n const r12 = y * z * oneMinusCosine + x * s;\n const r20 = x * z * oneMinusCosine + y * s;\n const r21 = y * z * oneMinusCosine - x * s;\n const r22 = zz + (1 - zz) * c;\n\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n\n newDst[ 0] = r00 * m00 + r01 * m10 + r02 * m20;\n newDst[ 1] = r00 * m01 + r01 * m11 + r02 * m21;\n newDst[ 2] = r00 * m02 + r01 * m12 + r02 * m22;\n newDst[ 3] = r00 * m03 + r01 * m13 + r02 * m23;\n newDst[ 4] = r10 * m00 + r11 * m10 + r12 * m20;\n newDst[ 5] = r10 * m01 + r11 * m11 + r12 * m21;\n newDst[ 6] = r10 * m02 + r11 * m12 + r12 * m22;\n newDst[ 7] = r10 * m03 + r11 * m13 + r12 * m23;\n newDst[ 8] = r20 * m00 + r21 * m10 + r22 * m20;\n newDst[ 9] = r20 * m01 + r21 * m11 + r22 * m21;\n newDst[10] = r20 * m02 + r21 * m12 + r22 * m22;\n newDst[11] = r20 * m03 + r21 * m13 + r22 * m23;\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle. (same as rotate)\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nconst rotate = axisRotate;\n\n/**\n * Creates a 4-by-4 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * three entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = v[2]; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 4-by-4 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of three entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale(m: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n newDst[ 3] = v0 * m[0 * 4 + 3];\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n newDst[ 7] = v1 * m[1 * 4 + 3];\n newDst[ 8] = v2 * m[2 * 4 + 0];\n newDst[ 9] = v2 * m[2 * 4 + 1];\n newDst[10] = v2 * m[2 * 4 + 2];\n newDst[11] = v2 * m[2 * 4 + 3];\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which scales a uniform amount in each dimension.\n * @param s - the amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = s; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 4-by-4 matrix in each dimension by a uniform scale.\n * @param m - The matrix to be modified.\n * @param s - The amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale(m: Mat4Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n newDst[ 3] = s * m[0 * 4 + 3];\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n newDst[ 7] = s * m[1 * 4 + 3];\n newDst[ 8] = s * m[2 * 4 + 0];\n newDst[ 9] = s * m[2 * 4 + 1];\n newDst[10] = s * m[2 * 4 + 2];\n newDst[11] = s * m[2 * 4 + 3];\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\nreturn {\n create,\n set,\n fromMat3,\n fromQuat,\n negate,\n copy,\n clone,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n determinant,\n invert,\n multiply,\n mul,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n perspective,\n perspectiveReverseZ,\n ortho,\n frustum,\n frustumReverseZ,\n aim,\n cameraAim,\n lookAt,\n translation,\n translate,\n rotationX,\n rotateX,\n rotationY,\n rotateY,\n rotationZ,\n rotateZ,\n axisRotation,\n rotation,\n axisRotate,\n rotate,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n};\n\n}\n\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Mat4Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { QuatArg, QuatType } from './quat';\nimport { Mat3Arg } from './mat3.js';\nimport { Mat4Arg } from './mat4.js';\nimport { Vec3Arg } from './vec3.js';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\n\nexport { QuatArg, QuatType };\n\ntype QuatCtor = new (n: number) => T;\n\nexport type RotationOrder = 'xyz' | 'xzy' | 'yxz' | 'yzx' | 'zxy' | 'zyx';\n\n/**\n * Generates am typed API for Qud\n * */\nfunction getAPIImpl(Ctor: QuatCtor) {\n const vec3 = getVec3API(Ctor);\n\n/**\n * Creates a quat4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number, w?: number) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a Quat; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Quat\n * Also see {@link quat.create} and {@link quat.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, w: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n\n return newDst;\n}\n\n/**\n * Sets a quaternion from the given angle and axis,\n * then returns it.\n *\n * @param axis - the axis to rotate around\n * @param angleInRadians - the angle\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The quaternion that represents the given axis and angle\n **/\nfunction fromAxisAngle(axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n const s = Math.sin(halfAngle);\n\n newDst[0] = s * axis[0];\n newDst[1] = s * axis[1];\n newDst[2] = s * axis[2];\n newDst[3] = Math.cos(halfAngle);\n\n return newDst;\n}\n\n/**\n * Gets the rotation axis and angle\n * @param q - quaternion to compute from\n * @param dst - Vec3 to hold result. If not passed in a new one is created.\n * @return angle and axis\n */\nfunction toAxisAngle(q: QuatArg, dst?: T): { angle: number, axis: T } {\n const newDst = (dst ?? vec3.create(3)) as T;\n\n const angle = Math.acos(q[3]) * 2;\n const s = Math.sin(angle * 0.5);\n if (s > utils.EPSILON) {\n newDst[0] = q[0] / s;\n newDst[1] = q[1] / s;\n newDst[2] = q[2] / s;\n } else {\n newDst[0] = 1;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n\n return { angle, axis: newDst };\n}\n\n/**\n * Returns the angle in degrees between two rotations a and b.\n * @param a - quaternion a\n * @param b - quaternion b\n * @return angle in radians between the two quaternions\n */\nfunction angle(a: QuatArg, b: QuatArg) {\n const d = dot(a, b);\n return Math.acos(2 * d * d - 1);\n}\n\n/**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction multiply(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const bw = b[3];\n\n newDst[0] = ax * bw + aw * bx + ay * bz - az * by;\n newDst[1] = ay * bw + aw * by + az * bx - ax * bz;\n newDst[2] = az * bw + aw * bz + ax * by - ay * bx;\n newDst[3] = aw * bw - ax * bx - ay * by - az * bz;\n\n return newDst;\n}\n\n/**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nconst mul = multiply;\n\n/**\n * Rotates the given quaternion around the X axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateX(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const bx = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw + qw * bx;\n newDst[1] = qy * bw + qz * bx;\n newDst[2] = qz * bw - qy * bx;\n newDst[3] = qw * bw - qx * bx;\n\n return newDst;\n}\n\n/**\n * Rotates the given quaternion around the Y axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateY(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const by = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw - qz * by;\n newDst[1] = qy * bw + qw * by;\n newDst[2] = qz * bw + qx * by;\n newDst[3] = qw * bw - qy * by;\n\n return newDst;\n}\n\n/**\n * Rotates the given quaternion around the Z axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateZ(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const bz = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw + qy * bz;\n newDst[1] = qy * bw - qx * bz;\n newDst[2] = qz * bw + qw * bz;\n newDst[3] = qw * bw - qz * bz;\n\n return newDst;\n}\n\n/**\n * Spherically linear interpolate between two quaternions\n *\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction slerp(a: QuatArg, b: QuatArg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n\n let bx = b[0];\n let by = b[1];\n let bz = b[2];\n let bw = b[3];\n\n let cosOmega = ax * bx + ay * by + az * bz + aw * bw;\n\n if (cosOmega < 0) {\n cosOmega = -cosOmega;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n\n let scale0;\n let scale1;\n\n if (1.0 - cosOmega > utils.EPSILON) {\n const omega = Math.acos(cosOmega);\n const sinOmega = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinOmega;\n scale1 = Math.sin(t * omega) / sinOmega;\n } else {\n scale0 = 1.0 - t;\n scale1 = t;\n }\n\n newDst[0] = scale0 * ax + scale1 * bx;\n newDst[1] = scale0 * ay + scale1 * by;\n newDst[2] = scale0 * az + scale1 * bz;\n newDst[3] = scale0 * aw + scale1 * bw;\n\n return newDst;\n}\n\n/**\n * Compute the inverse of a quaternion\n *\n * @param q - quaternion to compute the inverse of\n * @returns A quaternion that is the result of a * b\n */\nfunction inverse(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const a0 = q[0];\n const a1 = q[1];\n const a2 = q[2];\n const a3 = q[3];\n\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n\n newDst[0] = -a0 * invDot;\n newDst[1] = -a1 * invDot;\n newDst[2] = -a2 * invDot;\n newDst[3] = a3 * invDot;\n\n return newDst;\n}\n\n/**\n * Compute the conjugate of a quaternion\n * For quaternions with a magnitude of 1 (a unit quaternion)\n * this returns the same as the inverse but is faster to calculate.\n *\n * @param q - quaternion to compute the conjugate of.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The conjugate of q\n */\nfunction conjugate(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = -q[0];\n newDst[1] = -q[1];\n newDst[2] = -q[2];\n newDst[3] = q[3];\n\n return newDst;\n}\n\n/**\n * Creates a quaternion from the given rotation matrix.\n *\n * The created quaternion is not normalized.\n *\n * @param m - rotation matrix\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\nfunction fromMat(m: Mat3Arg | Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n /*\n 0 1 2\n 3 4 5\n 6 7 8\n\n 0 1 2\n 4 5 6\n 8 9 10\n */\n\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n const trace = m[0] + m[5] + m[10];\n\n if (trace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n const root = Math.sqrt(trace + 1); // 2w\n newDst[3] = 0.5 * root;\n const invRoot = 0.5 / root; // 1/(4w)\n\n newDst[0] = (m[6] - m[9]) * invRoot;\n newDst[1] = (m[8] - m[2]) * invRoot;\n newDst[2] = (m[1] - m[4]) * invRoot;\n } else {\n // |w| <= 1/2\n let i = 0;\n\n if (m[5] > m[0]) {\n i = 1;\n }\n if (m[10] > m[i * 4 + i]) {\n i = 2;\n }\n\n const j = (i + 1) % 3;\n const k = (i + 2) % 3;\n\n const root = Math.sqrt(m[i * 4 + i] - m[j * 4 + j] - m[k * 4 + k] + 1.0);\n newDst[i] = 0.5 * root;\n\n const invRoot = 0.5 / root;\n\n newDst[3] = (m[j * 4 + k] - m[k * 4 + j]) * invRoot;\n newDst[j] = (m[j * 4 + i] + m[i * 4 + j]) * invRoot;\n newDst[k] = (m[k * 4 + i] + m[i * 4 + k]) * invRoot;\n }\n\n return newDst;\n}\n\n/**\n * Creates a quaternion from the given euler angle x, y, z using the provided intrinsic order for the conversion.\n *\n * @param xAngleInRadians - angle to rotate around X axis in radians.\n * @param yAngleInRadians - angle to rotate around Y axis in radians.\n * @param zAngleInRadians - angle to rotate around Z axis in radians.\n * @param order - order to apply euler angles\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion representing the same rotation as the euler angles applied in the given order\n */\nfunction fromEuler(\n xAngleInRadians: number,\n yAngleInRadians: number,\n zAngleInRadians: number,\n order: RotationOrder,\n dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const xHalfAngle = xAngleInRadians * 0.5;\n const yHalfAngle = yAngleInRadians * 0.5;\n const zHalfAngle = zAngleInRadians * 0.5;\n\n const sx = Math.sin(xHalfAngle);\n const cx = Math.cos(xHalfAngle);\n const sy = Math.sin(yHalfAngle);\n const cy = Math.cos(yHalfAngle);\n const sz = Math.sin(zHalfAngle);\n const cz = Math.cos(zHalfAngle);\n\n switch (order) {\n case 'xyz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'xzy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n case 'yxz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n case 'yzx':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'zxy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'zyx':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n default:\n throw new Error(`Unknown rotation order: ${order}`);\n }\n\n return newDst;\n}\n\n/**\n * Copies a quaternion. (same as {@link quat.clone})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is a copy of q\n */\nfunction copy(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = q[0];\n newDst[1] = q[1];\n newDst[2] = q[2];\n newDst[3] = q[3];\n\n return newDst;\n}\n\n/**\n * Clones a quaternion. (same as {@link quat.copy})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A copy of q.\n */\nconst clone = copy;\n\n/**\n * Adds two quaternions; assumes a and b have the same dimension.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the sum of a and b.\n */\nfunction add(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\nfunction subtract(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Multiplies a quaternion by a scalar.\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nfunction mulScalar(v: QuatArg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a quaternion by a scalar. (same as mulScalar)\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nfunction divScalar(v: QuatArg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two quaternions\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns dot product\n */\nfunction dot(a: QuatArg, b: QuatArg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n}\n\n/**\n * Performs linear interpolation on two quaternions.\n * Given quaternions a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param t - Interpolation coefficient.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: QuatArg, b: QuatArg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Computes the length of quaternion\n * @param v - quaternion.\n * @returns length of quaternion.\n */\nfunction length(v: QuatArg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n}\n\n/**\n * Computes the length of quaternion (same as length)\n * @param v - quaternion.\n * @returns length of quaternion.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of quaternion\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\nfunction lengthSq(v: QuatArg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n}\n\n/**\n * Computes the square of the length of quaternion (same as lengthSq)\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\nconst lenSq = lengthSq;\n\n/**\n * Divides a quaternion by its Euclidean length and returns the quotient.\n * @param v - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The normalized quaternion.\n */\nfunction normalize(v: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n }\n\n return newDst;\n}\n\n/**\n * Check if 2 quaternions are approximately equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are approximately equal\n */\nfunction equalsApproximately(a: QuatArg, b: QuatArg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON &&\n Math.abs(a[3] - b[3]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 quaternions are exactly equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are exactly equal\n */\nfunction equals(a: QuatArg, b: QuatArg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Creates an identity quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns an identity quaternion\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n\n return newDst;\n}\n\nconst tempVec3 = vec3.create();\nconst xUnitVec3 = vec3.create();\nconst yUnitVec3 = vec3.create();\n\n/**\n * Computes a quaternion to represent the shortest rotation from one vector to another.\n *\n * @param aUnit - the start vector\n * @param bUnit - the end vector\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\nfunction rotationTo(aUnit: Vec3Arg, bUnit: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const dot = vec3.dot(aUnit, bUnit);\n if (dot < -0.999999) {\n vec3.cross(xUnitVec3, aUnit, tempVec3);\n if (vec3.len(tempVec3) < 0.000001) {\n vec3.cross(yUnitVec3, aUnit, tempVec3);\n }\n\n vec3.normalize(tempVec3, tempVec3);\n fromAxisAngle(tempVec3, Math.PI, newDst);\n\n return newDst;\n } else if (dot > 0.999999) {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n\n return newDst;\n } else {\n vec3.cross(aUnit, bUnit, tempVec3);\n\n newDst[0] = tempVec3[0];\n newDst[1] = tempVec3[1];\n newDst[2] = tempVec3[2];\n newDst[3] = 1 + dot;\n\n return normalize(newDst, newDst);\n }\n}\n\nconst tempQuat1 = new Ctor(4);\nconst tempQuat2 = new Ctor(4);\n\n/**\n * Performs a spherical linear interpolation with two control points\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param c - the third quaternion\n * @param d - the fourth quaternion\n * @param t - Interpolation coefficient 0 to 1\n * @returns result\n */\nfunction sqlerp(\n a: QuatArg,\n b: QuatArg,\n c: QuatArg,\n d: QuatArg,\n t: number,\n dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n slerp(a, d, t, tempQuat1);\n slerp(b, c, t, tempQuat2);\n slerp(tempQuat1, tempQuat2, 2 * t * (1 - t), newDst);\n\n return newDst;\n}\n\nreturn {\n create,\n fromValues,\n set,\n fromAxisAngle,\n toAxisAngle,\n angle,\n multiply,\n mul,\n rotateX,\n rotateY,\n rotateZ,\n slerp,\n inverse,\n conjugate,\n fromMat,\n fromEuler,\n copy,\n clone,\n add,\n subtract,\n sub,\n mulScalar,\n scale,\n divScalar,\n dot,\n lerp,\n length,\n len,\n lengthSq,\n lenSq,\n normalize,\n equalsApproximately,\n equals,\n identity,\n rotationTo,\n sqlerp,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\n/**\n *\n * Quat4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Quat4`. In other words you can do this\n *\n * const v = quat4.cross(v1, v2); // Creates a new Quat4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = quat4.create();\n * quat4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * quat4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nexport function getAPI(Ctor: QuatCtor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Vec4Arg, Vec4Type } from './vec4';\nimport { Mat4Arg } from './mat4';\nimport { BaseArgType } from './types';\n\nexport { Vec4Arg, Vec4Type };\n\ntype Vec4Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec4\n * */\nfunction getAPIImpl(Ctor: Vec4Ctor) {\n\n/**\n * Creates a vec4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number, w?: number) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a vec4; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec4\n * Also see {@link vec4.create} and {@link vec4.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, w: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n newDst[3] = Math.ceil(v[3]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n newDst[3] = Math.floor(v[3]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n newDst[3] = Math.round(v[3]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec4Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n newDst[3] = Math.min(max, Math.max(min, v[3]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec4Arg, b: Vec4Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n newDst[3] = a[3] + b[3] * scale;\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec4Arg, b: Vec4Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON &&\n Math.abs(a[3] - b[3]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec4Arg, b: Vec4Arg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec4Arg, b: Vec4Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec4Arg, b: Vec4Arg, t: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n newDst[3] = a[3] + t[3] * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n newDst[3] = Math.max(a[3], b[3]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n newDst[3] = Math.min(a[3], b[3]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec4Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec4Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n newDst[3] = 1 / v[3];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the dot product of two vectors\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec4Arg, b: Vec4Arg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec4Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec4Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec4Arg, b: Vec4Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec4Arg, b: Vec4Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return dx * dx + dy * dy + dz * dz + dw * dw;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n }\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n newDst[3] = -v[3];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec4.clone})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n newDst[3] = v[3];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec4.copy})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n newDst[3] = a[3] * b[3];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n newDst[3] = a[3] / b[3];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform vec4 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec4 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec4Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = v[3];\n\n newDst[0] = m[0] * x + m[4] * y + m[ 8] * z + m[12] * w;\n newDst[1] = m[1] * x + m[5] * y + m[ 9] * z + m[13] * w;\n newDst[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n newDst[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n\n return newDst;\n}\n\n\n/**\n * Treat a 4D vector as a direction and set it's length\n *\n * @param a The vec4 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec4Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec4 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec4Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n zero,\n transformMat4,\n setLength,\n truncate,\n midpoint,\n};\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\n/**\n *\n * Vec4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Vec4`. In other words you can do this\n *\n * const v = vec4.cross(v1, v2); // Creates a new Vec4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = vec4.create();\n * vec4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * vec4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nexport function getAPI(Ctor: Vec4Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n\n","/**\n * Some docs\n * @namespace wgpu-matrix\n */\nimport {MutableNumberArray, 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 MutableNumberArray,\n BaseArgType,\n\n Mat3Arg,\n Mat4Arg,\n QuatArg,\n Vec2Arg,\n Vec3Arg,\n Vec4Arg,\n\n Mat3Type,\n Mat4Type,\n QuatType,\n Vec2Type,\n Vec3Type,\n Vec4Type,\n};\n\nexport type BaseCtor = new (n: number) => T;\n\nexport type Mat3 = Mat3Type;\nexport type Mat4 = Mat4Type;\nexport type Quat = QuatType;\nexport type Vec2 = Vec2Type;\nexport type Vec3 = Vec3Type;\nexport type Vec4 = Vec4Type;\n\nexport type Mat3d = Mat3Type;\nexport type Mat4d = Mat4Type;\nexport type Quatd = QuatType;\nexport type Vec2d = Vec2Type;\nexport type Vec3d = Vec3Type;\nexport type Vec4d = Vec4Type;\n\nexport type Mat3n = Mat3Type;\nexport type Mat4n = Mat4Type;\nexport type Quatn = QuatType;\nexport type Vec2n = Vec2Type;\nexport type Vec3n = Vec3Type;\nexport type Vec4n = Vec4Type;\n\n/**\n * Generate wgpu-matrix API for type\n */\nfunction wgpuMatrixAPI<\n Mat3 extends BaseArgType,\n Mat4 extends BaseArgType,\n Quat extends BaseArgType,\n Vec2 extends BaseArgType,\n Vec3 extends BaseArgType,\n Vec4 extends BaseArgType,\n>(\n Mat3Ctor: BaseCtor,\n Mat4Ctor: BaseCtor,\n QuatCtor: BaseCtor,\n Vec2Ctor: BaseCtor,\n Vec3Ctor: BaseCtor,\n Vec4Ctor: BaseCtor,\n) {\n return {\n /** @namespace mat3 */\n mat3: getMat3API(Mat3Ctor),\n /** @namespace mat4 */\n mat4: getMat4API(Mat4Ctor),\n /** @namespace quat */\n quat: getQuatAPI(QuatCtor),\n /** @namespace vec2 */\n vec2: getVec2API(Vec2Ctor),\n /** @namespace vec3 */\n vec3: getVec3API(Vec3Ctor),\n /** @namespace vec4 */\n vec4: getVec4API(Vec4Ctor),\n };\n}\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat3,\n /**\n * 4x4 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat4,\n /**\n * Quaternion functions that default to returning `Float32Array`\n * @namespace\n */\n quat,\n /**\n * Vec2 functions that default to returning `Float32Array`\n * @namespace\n */\n vec2,\n /**\n * Vec3 functions that default to returning `Float32Array`\n * @namespace\n */\n vec3,\n /**\n * Vec3 functions that default to returning `Float32Array`\n * @namespace\n */\n vec4,\n} = wgpuMatrixAPI<\n Mat3, Mat4, Quat, Vec2, Vec3, Vec4>(\n Float32Array, Float32Array, Float32Array, Float32Array, Float32Array, Float32Array);\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat3: mat3d,\n /**\n * 4x4 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat4: mat4d,\n /**\n * Quaternion functions that default to returning `Float64Array`\n * @namespace\n */\n quat: quatd,\n /**\n * Vec2 functions that default to returning `Float64Array`\n * @namespace\n */\n vec2: vec2d,\n /**\n * Vec3 functions that default to returning `Float64Array`\n * @namespace\n */\n vec3: vec3d,\n /**\n * Vec3 functions that default to returning `Float64Array`\n * @namespace\n */\n vec4: vec4d,\n} = wgpuMatrixAPI<\n Mat3d, Mat4d, Quatd, Vec2d, Vec3d, Vec4d>(\n Float64Array, Float64Array, Float64Array, Float64Array, Float64Array, Float64Array);\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat3: mat3n,\n /**\n * 4x4 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat4: mat4n,\n /**\n * Quaternion functions that default to returning `number[]`\n * @namespace\n */\n quat: quatn,\n /**\n * Vec2 functions that default to returning `number[]`\n * @namespace\n */\n vec2: vec2n,\n /**\n * Vec3 functions that default to returning `number[]`\n * @namespace\n */\n vec3: vec3n,\n /**\n * Vec3 functions that default to returning `number[]`\n * @namespace\n */\n vec4: vec4n,\n} = wgpuMatrixAPI<\n Mat3n, Mat4n, Quatn, Vec2n, Vec3n, Vec4n>(\n ZeroArray, Array, Array, Array, Array, Array);\n"],"names":["ZeroArray","OriginalConstructor","modifier","a","fill","constructor","args","super","this","EPSILON","degrees","Math","PI","n","m","b","v","d","abs","t","radians","old","cache","Map","getAPI","Ctor","api","get","create","x","y","newDst","undefined","subtract","dst","lerp","mulScalar","k","inverse","dot","length","v0","v1","sqrt","lengthSq","distance","dx","dy","distanceSq","normalize","len","copy","multiply","divide","setLength","fromValues","set","ceil","floor","round","clamp","min","max","add","addScaled","scale","angle","ax","ay","bx","by","mag","cosine","acos","sub","equalsApproximately","utils.EPSILON","equals","lerpV","divScalar","invert","cross","z","lenSq","dist","distSq","negate","clone","mul","div","random","cos","sin","zero","transformMat4","transformMat3","rotate","rad","p0","p1","sinC","cosC","truncate","maxLen","midpoint","getAPIImpl","v2","dz","az","bz","t1","t2","zScale","w","transformMat4Upper3x3","transformQuat","q","qx","qy","qz","w2","uvX","uvY","uvZ","getTranslation","getAxis","axis","off","getScaling","xx","xy","xz","yx","yy","yz","zx","zy","zz","rotateX","p","r","rotateY","rotateZ","vec2","getVec2API","vec3","getVec3API","identity","m00","m01","m02","m10","m11","m12","m20","m21","m22","b01","b11","b21","invDet","a00","a01","a02","a10","a11","a12","a20","a21","a22","b00","b02","b10","b12","b20","b22","rotation","angleInRadians","c","s","v3","v4","v5","v6","v7","v8","fromMat4","m4","fromQuat","x2","y2","z2","wx","wy","wz","transpose","determinant","setTranslation","setAxis","get3DScaling","translation","translate","rotationX","rotationY","rotationZ","scaling","uniformScaling","uniformScale","scaling3D","scale3D","uniformScaling3D","uniformScale3D","m03","m13","m23","m30","m31","m32","m33","tmp0","tmp1","tmp2","tmp3","tmp4","tmp5","tmp6","tmp7","tmp8","tmp9","tmp10","tmp11","tmp12","tmp13","tmp14","tmp15","tmp16","tmp17","tmp18","tmp19","tmp20","tmp21","tmp22","tmp23","t0","t3","a03","a13","a23","a30","a31","a32","a33","b03","b13","b23","b30","b31","b32","b33","xAxis","yAxis","zAxis","axisRotation","oneMinusCosine","axisRotate","r00","r01","r02","r10","r11","r12","r20","r21","r22","v9","v10","v11","v12","v13","v14","v15","fromMat3","m3","perspective","fieldOfViewYInRadians","aspect","zNear","zFar","f","tan","Number","isFinite","rangeInv","perspectiveReverseZ","Infinity","ortho","left","right","bottom","top","near","far","frustum","frustumReverseZ","aim","position","target","up","cameraAim","eye","lookAt","fromAxisAngle","halfAngle","aw","bw","slerp","scale0","scale1","cosOmega","omega","sinOmega","tempVec3","xUnitVec3","yUnitVec3","tempQuat1","tempQuat2","toAxisAngle","qw","a0","a1","a2","a3","invDot","conjugate","fromMat","trace","root","invRoot","i","j","fromEuler","xAngleInRadians","yAngleInRadians","zAngleInRadians","order","xHalfAngle","yHalfAngle","zHalfAngle","sx","cx","sy","cy","sz","cz","Error","rotationTo","aUnit","bUnit","sqlerp","dw","wgpuMatrixAPI","Mat3Ctor","Mat4Ctor","QuatCtor","Vec2Ctor","Vec3Ctor","Vec4Ctor","mat3","getMat3API","mat4","getMat4API","quat","getQuatAPI","vec4","getVec4API","Float32Array","mat3d","mat4d","quatd","vec2d","vec3d","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C,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,CC1tBA,SAAS8U,EAQLC,EACAC,EACAC,EACAC,EACAC,EACAC,GAEF,MAAO,CAELC,KAAMC,EAAiBP,GAEvBQ,KAAMC,EAAiBR,GAEvBS,KAAMC,EAAiBT,GAEvB5N,KAAMC,EAAiB4N,GAEvB3N,KAAMC,EAAiB2N,GAEvBQ,KAAMC,EAAiBR,GAE3B,CAEa,MAAAC,KAKXA,EAAIE,KAKJA,EAAIE,KAKJA,EAAIpO,KAKJA,EAAIE,KAKJA,EAAIoO,KAKJA,GACEb,EAEAe,aAAcA,aAAcA,aAAcA,aAAcA,aAAcA,eAOxER,KAAMS,EAKNP,KAAMQ,EAKNN,KAAMO,EAKN3O,KAAM4O,EAKN1O,KAAM2O,EAKNP,KAAMQ,GACJrB,EAEAsB,aAAcA,aAAcA,aAAcA,aAAcA,aAAcA,eAOxEf,KAAMgB,EAKNd,KAAMe,EAKNb,KAAMc,EAKNlP,KAAMmP,EAKNjP,KAAMkP,EAKNd,KAAMe,GACJ5B,EAEAxW,EAAWqY,MAAOA,MAAOA,MAAOA,MAAOA"} \ No newline at end of file diff --git a/dist/3.x/wgpu-matrix.module.js b/dist/3.x/wgpu-matrix.module.js index 36e4e92..32ea039 100644 --- a/dist/3.x/wgpu-matrix.module.js +++ b/dist/3.x/wgpu-matrix.module.js @@ -1,4 +1,4 @@ -/* wgpu-matrix@3.2.0, license MIT */ +/* wgpu-matrix@3.3.0, license MIT */ function wrapConstructor(OriginalConstructor, modifier) { return class extends OriginalConstructor { constructor(...args) { diff --git a/dist/3.x/wgpu-matrix.module.js.map b/dist/3.x/wgpu-matrix.module.js.map index f9545e0..79569ba 100644 --- a/dist/3.x/wgpu-matrix.module.js.map +++ b/dist/3.x/wgpu-matrix.module.js.map @@ -1 +1 @@ -{"version":3,"file":"wgpu-matrix.module.js","sources":["../../../src/types.ts","../../../src/utils.ts","../../../src/vec2-impl.ts","../../../src/vec3-impl.ts","../../../src/mat3-impl.ts","../../../src/mat4-impl.ts","../../../src/quat-impl.ts","../../../src/vec4-impl.ts","../../../src/wgpu-matrix.ts"],"sourcesContent":["/**\n * The types you can pass to most functions that take an\n * array of numbers.\n */\nexport type BaseArgType = Float32Array | Float64Array | number[];\n\nfunction wrapConstructor any>(\n OriginalConstructor: T,\n modifier: (instance: InstanceType) => void\n): T {\n return class extends OriginalConstructor {\n constructor(...args: any[]) {\n super(...args);\n modifier(this as InstanceType);\n }\n } as T; // Type assertion is necessary here\n}\n\nexport const ZeroArray = wrapConstructor(Array, a => a.fill(0));\n\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nexport let EPSILON = 0.000001;\n\n/**\n * Set the value for EPSILON for various checks\n * @param v - Value to use for EPSILON.\n * @returns previous value of EPSILON;\n */\nexport function setEpsilon(v: number): number {\n const old = EPSILON;\n EPSILON = v;\n return old;\n}\n\n/**\n * Convert degrees to radians\n * @param degrees - Angle in degrees\n * @returns angle converted to radians\n */\nexport function degToRad(degrees: number): number {\n return degrees * Math.PI / 180;\n}\n\n/**\n * Convert radians to degrees\n * @param radians - Angle in radians\n * @returns angle converted to degrees\n */\nexport function radToDeg(radians: number): number {\n return radians * 180 / Math.PI;\n}\n\n/**\n * Lerps between a and b via t\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @returns a + (b - a) * t\n */\nexport function lerp(a: number, b: number, t: number): number {\n return a + (b - a) * t;\n}\n\n/**\n * Compute the opposite of lerp. Given a and b and a value between\n * a and b returns a value between 0 and 1. 0 if a, 1 if b.\n * Note: no clamping is done.\n * @param a - start value\n * @param b - end value\n * @param v - value between a and b\n * @returns (v - a) / (b - a)\n */\nexport function inverseLerp(a: number, b: number, v: number): number {\n const d = b - a;\n return (Math.abs(b - a) < EPSILON)\n ? a\n : (v - a) / d;\n}\n\n/**\n * Compute the euclidean modulo\n *\n * ```\n * // table for n / 3\n * -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 <- n\n * ------------------------------------\n * -2 -1 -0 -2 -1 0, 1, 2, 0, 1, 2 <- n % 3\n * 1 2 0 1 2 0, 1, 2, 0, 1, 2 <- euclideanModule(n, 3)\n * ```\n *\n * @param n - dividend\n * @param m - divisor\n * @returns the euclidean modulo of n / m\n */\nexport function euclideanModulo(n: number, m: number) {\n return ((n % m) + m) % m;\n}","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Mat3Arg } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { Vec2Arg, Vec2Type } from './vec2';\nimport { Vec3Arg } from './vec3';\nimport { BaseArgType } from './types';\n\nexport { Vec2Arg, Vec2Type };\n\ntype Vec2Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec3\n */\nfunction getAPIImpl(Ctor: Vec2Ctor) {\n\n/**\n * Creates a Vec2; may be called with x, y, z to set initial values.\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Vec2's specified type\n * it would be faster to use\n *\n * ```\n * const v = vec2.clone(someJSArray);\n * ```\n *\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\nfunction create(x = 0, y = 0) {\n const newDst = new Ctor(2);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n }\n }\n return newDst;\n}\n\n/**\n * Creates a Vec2; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec2\n * Also see {@link vec2.create} and {@link vec2.copy}\n *\n * @param x first value\n * @param y second value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec2Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec2Arg, b: Vec2Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n\n return newDst;\n}\n\n/**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\nfunction angle(a: Vec2Arg, b: Vec2Arg): number {\n const ax = a[0];\n const ay = a[1];\n const bx = b[0];\n const by = b[1];\n const mag1 = Math.sqrt(ax * ax + ay * ay);\n const mag2 = Math.sqrt(bx * bx + by * by);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec2Arg, b: Vec2Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec2Arg, b: Vec2Arg): boolean {\n return a[0] === b[0] && a[1] === b[1];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec2Arg, b: Vec2Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec2Arg, b: Vec2Arg, t: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec2Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec2Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\nfunction cross(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const z = a[0] * b[1] - a[1] * b[0];\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = z;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec2Arg, b: Vec2Arg): number {\n return a[0] * b[0] + a[1] * b[1];\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec2Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n return Math.sqrt(v0 * v0 + v1 * v1);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec2Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n return v0 * v0 + v1 * v1;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec2Arg, b: Vec2Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return Math.sqrt(dx * dx + dy * dy);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec2Arg, b: Vec2Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return dx * dx + dy * dy;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const len = Math.sqrt(v0 * v0 + v1 * v1);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n }\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec2.clone})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec2.copy})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Creates a random unit vector * scale\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\nfunction random(scale = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const angle = Math.random() * 2 * Math.PI;\n newDst[0] = Math.cos(angle) * scale;\n newDst[1] = Math.sin(angle) * scale;\n\n return newDst;\n}\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform Vec2 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec2Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const x = v[0];\n const y = v[1];\n\n newDst[0] = x * m[0] + y * m[4] + m[12];\n newDst[1] = x * m[1] + y * m[5] + m[13];\n\n return newDst;\n}\n\n/**\n * Transforms vec4 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat3(v: Vec2Arg, m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const x = v[0];\n const y = v[1];\n\n newDst[0] = m[0] * x + m[4] * y + m[8];\n newDst[1] = m[1] * x + m[5] * y + m[9];\n\n return newDst;\n}\n\n/**\n * Rotate a 2D vector\n *\n * @param a The vec2 point to rotate\n * @param b The origin of the rotation\n * @param rad The angle of rotation in radians\n * @returns the rotated vector\n */\nfunction rotate(a: Vec2Arg, b: Vec2Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n // Translate point to the origin\n const p0 = a[0] - b[0];\n const p1 = a[1] - b[1];\n const sinC = Math.sin(rad);\n const cosC = Math.cos(rad);\n\n //perform rotation and translate to correct position\n newDst[0] = p0 * cosC - p1 * sinC + b[0];\n newDst[1] = p0 * sinC + p1 * cosC + b[1];\n\n return newDst;\n}\n\n/**\n * Treat a 2D vector as a direction and set it's length\n *\n * @param a The vec2 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec2Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec2 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec2Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat3,\n rotate,\n setLength,\n truncate,\n midpoint,\n};\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Vec2Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Vec3Arg, Vec3Type } from './vec3';\nimport { Mat3Arg } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { QuatArg } from './quat';\nimport { BaseArgType } from './types';\n\nexport { Vec3Arg, Vec3Type };\n\ntype Vec3Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec3\n * */\nfunction getAPIImpl(Ctor: Vec3Ctor) {\n\n/**\n * Creates a vec3; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number) {\n const newDst = new Ctor(3);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a vec3; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec3\n * Also see {@link vec3.create} and {@link vec3.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec3Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec3Arg, b: Vec3Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n\n return newDst;\n}\n\n/**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\nfunction angle(a: Vec3Arg, b: Vec3Arg): number {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const mag1 = Math.sqrt(ax * ax + ay * ay + az * az);\n const mag2 = Math.sqrt(bx * bx + by * by + bz * bz);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec3Arg, b: Vec3Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec3Arg, b: Vec3Arg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec3Arg, b: Vec3Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec3Arg, b: Vec3Arg, t: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec3Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec3Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\nfunction cross(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const t1 = a[2] * b[0] - a[0] * b[2];\n const t2 = a[0] * b[1] - a[1] * b[0];\n newDst[0] = a[1] * b[2] - a[2] * b[1];\n newDst[1] = t1;\n newDst[2] = t2;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec3Arg, b: Vec3Arg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]);\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec3Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec3Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return v0 * v0 + v1 * v1 + v2 * v2;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec3Arg, b: Vec3Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return Math.sqrt(dx * dx + dy * dy + dz * dz);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec3Arg, b: Vec3Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return dx * dx + dy * dy + dz * dz;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec3.clone})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec3.copy})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Creates a random vector\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\nfunction random(scale = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const angle = Math.random() * 2 * Math.PI;\n const z = Math.random() * 2 - 1;\n const zScale = Math.sqrt(1 - z * z) * scale;\n newDst[0] = Math.cos(angle) * zScale;\n newDst[1] = Math.sin(angle) * zScale;\n newDst[2] = z * scale;\n\n return newDst;\n}\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform vec3 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec3Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1;\n\n newDst[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n newDst[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n newDst[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n\n return newDst;\n}\n\n/**\n * Transform vec3 by upper 3x3 matrix inside 4x4 matrix.\n * @param v - The direction.\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns The transformed vector.\n */\nfunction transformMat4Upper3x3(v: Vec3Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[0] = v0 * m[0 * 4 + 0] + v1 * m[1 * 4 + 0] + v2 * m[2 * 4 + 0];\n newDst[1] = v0 * m[0 * 4 + 1] + v1 * m[1 * 4 + 1] + v2 * m[2 * 4 + 1];\n newDst[2] = v0 * m[0 * 4 + 2] + v1 * m[1 * 4 + 2] + v2 * m[2 * 4 + 2];\n\n return newDst;\n}\n\n/**\n * Transforms vec3 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat3(v: Vec3Arg, m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n\n newDst[0] = x * m[0] + y * m[4] + z * m[8];\n newDst[1] = x * m[1] + y * m[5] + z * m[9];\n newDst[2] = x * m[2] + y * m[6] + z * m[10];\n\n return newDst;\n}\n\n/**\n * Transforms vec3 by Quaternion\n * @param v - the vector to transform\n * @param q - the quaternion to transform by\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed\n */\nfunction transformQuat(v: Vec3Arg, q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n\n const uvX = qy * z - qz * y;\n const uvY = qz * x - qx * z;\n const uvZ = qx * y - qy * x;\n\n newDst[0] = x + uvX * w2 + (qy * uvZ - qz * uvY) * 2;\n newDst[1] = y + uvY * w2 + (qz * uvX - qx * uvZ) * 2;\n newDst[2] = z + uvZ * w2 + (qx * uvY - qy * uvX) * 2;\n\n return newDst;\n}\n\n/**\n * Returns the translation component of a 4-by-4 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\nfunction getTranslation(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n}\n/**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat4Arg, axis: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n}\n/**\n * Returns the scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the x-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\nfunction rotateX(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n //Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n //perform rotation\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad);\n\n //translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the y-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\nfunction rotateY(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n // perform rotation\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad);\n\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the z-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns {vec3} out\n */\nfunction rotateZ(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n // perform rotation\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2];\n\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Treat a 3D vector as a direction and set it's length\n *\n * @param a The vec3 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec3Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec3 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec3Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat4Upper3x3,\n transformMat3,\n transformQuat,\n getTranslation,\n getAxis,\n getScaling,\n rotateX,\n rotateY,\n rotateZ,\n setLength,\n truncate,\n midpoint,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Vec3Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nimport * as utils from './utils.js';\nimport { QuatArg } from './quat';\nimport { Mat3Arg, Mat3Type } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { Vec2Arg } from './vec2';\nimport { Vec3Arg } from './vec3';\nimport { getAPI as getVec2API } from './vec2-impl';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\n\nexport { Mat3Arg, Mat3Type };\n\ntype Mat3Ctor = new (n: number) => T;\n\n/**\n * Generates a typed API for Mat3\n * */\nfunction getAPIImpl(Ctor: Mat3Ctor) {\n const vec2 = getVec2API(Ctor);\n const vec3 = getVec3API(Ctor);\n\n/**\n * Create a Mat3 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat3's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat3.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @returns matrix created from values.\n */\nfunction create(\n v0?: number, v1?: number, v2?: number,\n v3?: number, v4?: number, v5?: number,\n v6?: number, v7?: number, v8?: number) {\n const newDst = new Ctor(12);\n // to make the array homogenous\n newDst[3] = 0;\n newDst[7] = 0;\n newDst[11] = 0;\n\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[4] = v3;\n if (v4 !== undefined) {\n newDst[5] = v4;\n if (v5 !== undefined) {\n newDst[6] = v5;\n if (v6 !== undefined) {\n newDst[8] = v6;\n if (v7 !== undefined) {\n newDst[9] = v7;\n if (v8 !== undefined) {\n newDst[10] = v8;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n\n return newDst;\n}\n\n/**\n * Sets the values of a Mat3\n * Also see {@link mat3.create} and {@link mat3.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 set from values.\n */\nfunction set(\n v0: number, v1: number, v2: number,\n v3: number, v4: number, v5: number,\n v6: number, v7: number, v8: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[0] = v0; newDst[1] = v1; newDst[ 2] = v2; newDst[ 3] = 0;\n newDst[4] = v3; newDst[5] = v4; newDst[ 6] = v5; newDst[ 7] = 0;\n newDst[8] = v6; newDst[9] = v7; newDst[10] = v8; newDst[11] = 0;\n\n return newDst;\n}\n\n/**\n * Creates a Mat3 from the upper left 3x3 part of a Mat4\n * @param m4 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from m4\n */\nfunction fromMat4(m4: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n newDst[0] = m4[0]; newDst[1] = m4[1]; newDst[ 2] = m4[ 2]; newDst[ 3] = 0;\n newDst[4] = m4[4]; newDst[5] = m4[5]; newDst[ 6] = m4[ 6]; newDst[ 7] = 0;\n newDst[8] = m4[8]; newDst[9] = m4[9]; newDst[10] = m4[10]; newDst[11] = 0;\n return newDst;\n}\n\n/**\n * Creates a Mat3 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from q\n */\nfunction fromQuat(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3];\n const x2 = x + x; const y2 = y + y; const z2 = z + z;\n\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n newDst[ 0] = 1 - yy - zz; newDst[ 1] = yx + wz; newDst[ 2] = zx - wy; newDst[ 3] = 0;\n newDst[ 4] = yx - wz; newDst[ 5] = 1 - xx - zz; newDst[ 6] = zy + wx; newDst[ 7] = 0;\n newDst[ 8] = zx + wy; newDst[ 9] = zy - wx; newDst[10] = 1 - xx - yy; newDst[11] = 0;\n\n return newDst;\n}\n\n/**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\nfunction negate(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = -m[ 0]; newDst[ 1] = -m[ 1]; newDst[ 2] = -m[ 2];\n newDst[ 4] = -m[ 4]; newDst[ 5] = -m[ 5]; newDst[ 6] = -m[ 6];\n newDst[ 8] = -m[ 8]; newDst[ 9] = -m[ 9]; newDst[10] = -m[10];\n\n return newDst;\n}\n\n/**\n * Copies a matrix. (same as {@link mat3.clone})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nfunction copy(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = m[ 0]; newDst[ 1] = m[ 1]; newDst[ 2] = m[ 2];\n newDst[ 4] = m[ 4]; newDst[ 5] = m[ 5]; newDst[ 6] = m[ 6];\n newDst[ 8] = m[ 8]; newDst[ 9] = m[ 9]; newDst[10] = m[10];\n\n return newDst;\n}\n\n/**\n * Copies a matrix (same as {@link mat3.copy})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nconst clone = copy;\n\n/**\n * Check if 2 matrices are approximately equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are approximately equal\n */\nfunction equalsApproximately(a: Mat3Arg, b: Mat3Arg): boolean {\n return Math.abs(a[ 0] - b[ 0]) < utils.EPSILON &&\n Math.abs(a[ 1] - b[ 1]) < utils.EPSILON &&\n Math.abs(a[ 2] - b[ 2]) < utils.EPSILON &&\n Math.abs(a[ 4] - b[ 4]) < utils.EPSILON &&\n Math.abs(a[ 5] - b[ 5]) < utils.EPSILON &&\n Math.abs(a[ 6] - b[ 6]) < utils.EPSILON &&\n Math.abs(a[ 8] - b[ 8]) < utils.EPSILON &&\n Math.abs(a[ 9] - b[ 9]) < utils.EPSILON &&\n Math.abs(a[10] - b[10]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 matrices are exactly equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are exactly equal\n */\nfunction equals(a: Mat3Arg, b: Mat3Arg): boolean {\n return a[ 0] === b[ 0] &&\n a[ 1] === b[ 1] &&\n a[ 2] === b[ 2] &&\n a[ 4] === b[ 4] &&\n a[ 5] === b[ 5] &&\n a[ 6] === b[ 6] &&\n a[ 8] === b[ 8] &&\n a[ 9] === b[ 9] &&\n a[10] === b[10];\n}\n\n/**\n * Creates a 3-by-3 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 3-by-3 identity matrix.\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\nfunction transpose(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n if (newDst === m) {\n let t: number;\n\n // 0 1 2\n // 4 5 6\n // 8 9 10\n\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n\n return newDst;\n }\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n newDst[ 0] = m00; newDst[ 1] = m10; newDst[ 2] = m20;\n newDst[ 4] = m01; newDst[ 5] = m11; newDst[ 6] = m21;\n newDst[ 8] = m02; newDst[ 9] = m12; newDst[10] = m22;\n\n return newDst;\n}\n\n/**\n * Computes the inverse of a 3-by-3 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nfunction inverse(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n const b01 = m22 * m11 - m12 * m21;\n const b11 = -m22 * m10 + m12 * m20;\n const b21 = m21 * m10 - m11 * m20;\n\n const invDet = 1 / (m00 * b01 + m01 * b11 + m02 * b21);\n\n newDst[ 0] = b01 * invDet;\n newDst[ 1] = (-m22 * m01 + m02 * m21) * invDet;\n newDst[ 2] = ( m12 * m01 - m02 * m11) * invDet;\n newDst[ 4] = b11 * invDet;\n newDst[ 5] = ( m22 * m00 - m02 * m20) * invDet;\n newDst[ 6] = (-m12 * m00 + m02 * m10) * invDet;\n newDst[ 8] = b21 * invDet;\n newDst[ 9] = (-m21 * m00 + m01 * m20) * invDet;\n newDst[10] = ( m11 * m00 - m01 * m10) * invDet;\n\n return newDst;\n}\n\n/**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\nfunction determinant(m: Mat3Arg): number {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n return m00 * (m11 * m22 - m21 * m12) -\n m10 * (m01 * m22 - m21 * m02) +\n m20 * (m01 * m12 - m11 * m02);\n}\n\n/**\n * Computes the inverse of a 3-by-3 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nconst invert = inverse;\n\n/**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nfunction multiply(a: Mat3Arg, b: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[ 4 + 0];\n const a11 = a[ 4 + 1];\n const a12 = a[ 4 + 2];\n const a20 = a[ 8 + 0];\n const a21 = a[ 8 + 1];\n const a22 = a[ 8 + 2];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b10 = b[ 4 + 0];\n const b11 = b[ 4 + 1];\n const b12 = b[ 4 + 2];\n const b20 = b[ 8 + 0];\n const b21 = b[ 8 + 1];\n const b22 = b[ 8 + 2];\n\n newDst[ 0] = a00 * b00 + a10 * b01 + a20 * b02;\n newDst[ 1] = a01 * b00 + a11 * b01 + a21 * b02;\n newDst[ 2] = a02 * b00 + a12 * b01 + a22 * b02;\n newDst[ 4] = a00 * b10 + a10 * b11 + a20 * b12;\n newDst[ 5] = a01 * b10 + a11 * b11 + a21 * b12;\n newDst[ 6] = a02 * b10 + a12 * b11 + a22 * b12;\n newDst[ 8] = a00 * b20 + a10 * b21 + a20 * b22;\n newDst[ 9] = a01 * b20 + a11 * b21 + a21 * b22;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22;\n\n return newDst;\n}\n\n/**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nconst mul = multiply;\n\n/**\n * Sets the translation component of a 3-by-3 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\nfunction setTranslation(a: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? identity()) as T;\n if (a !== newDst) {\n newDst[ 0] = a[ 0];\n newDst[ 1] = a[ 1];\n newDst[ 2] = a[ 2];\n newDst[ 4] = a[ 4];\n newDst[ 5] = a[ 5];\n newDst[ 6] = a[ 6];\n }\n newDst[ 8] = v[0];\n newDst[ 9] = v[1];\n newDst[10] = 1;\n return newDst;\n}\n\n/**\n * Returns the translation component of a 3-by-3 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\nfunction getTranslation(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec2.create()) as T;\n newDst[0] = m[8];\n newDst[1] = m[9];\n return newDst;\n}\n\n/**\n * Returns an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y,\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat3Arg, axis: number, dst?: T) {\n const newDst = (dst ?? vec2.create()) as T;\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n return newDst;\n}\n\n/**\n * Sets an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\nfunction setAxis(m: Mat3Arg, v: Vec2Arg, axis: number, dst?: T) {\n const newDst = (dst === m ? m : copy(m, dst)) as T;\n\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n return newDst;\n}\n\n/**\n * Returns the \"2d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec2.create());\n\n const xx = m[0];\n const xy = m[1];\n const yx = m[4];\n const yy = m[5];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy);\n newDst[1] = Math.sqrt(yx * yx + yy * yy);\n\n return newDst;\n}\n\n\n/**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction get3DScaling(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec3.create());\n\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which translates by the given vector v.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\nfunction translation(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = v[0]; newDst[ 9] = v[1]; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Translates the given 3-by-3 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\nfunction translate(m: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 0] = m00;\n newDst[ 1] = m01;\n newDst[ 2] = m02;\n newDst[ 4] = m10;\n newDst[ 5] = m11;\n newDst[ 6] = m12;\n }\n\n newDst[ 8] = m00 * v0 + m10 * v1 + m20;\n newDst[ 9] = m01 * v0 + m11 * v1 + m21;\n newDst[10] = m02 * v0 + m12 * v1 + m22;\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotation(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = s; newDst[ 2] = 0;\n newDst[ 4] = -s; newDst[ 5] = c; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix by the given angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotate(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 + s * m10;\n newDst[ 1] = c * m01 + s * m11;\n newDst[ 2] = c * m02 + s * m12;\n\n newDst[ 4] = c * m10 - s * m00;\n newDst[ 5] = c * m11 - s * m01;\n newDst[ 6] = c * m12 - s * m02;\n\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the x-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationX(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = c; newDst[ 6] = s;\n newDst[ 8] = 0; newDst[ 9] = -s; newDst[10] = c;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix around the x-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateX(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[4] = c * m10 + s * m20;\n newDst[5] = c * m11 + s * m21;\n newDst[6] = c * m12 + s * m22;\n newDst[8] = c * m20 - s * m10;\n newDst[9] = c * m21 - s * m11;\n newDst[10] = c * m22 - s * m12;\n\n if (m !== newDst) {\n newDst[ 0] = m[ 0];\n newDst[ 1] = m[ 1];\n newDst[ 2] = m[ 2];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the y-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationY(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = 0; newDst[ 2] = -s;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = s; newDst[ 9] = 0; newDst[10] = c;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix around the y-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateY(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 - s * m20;\n newDst[ 1] = c * m01 - s * m21;\n newDst[ 2] = c * m02 - s * m22;\n newDst[ 8] = c * m20 + s * m00;\n newDst[ 9] = c * m21 + s * m01;\n newDst[10] = c * m22 + s * m02;\n\n if (m !== newDst) {\n newDst[ 4] = m[ 4];\n newDst[ 5] = m[ 5];\n newDst[ 6] = m[ 6];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the z-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nconst rotationZ = rotation;\n\n/**\n * Rotates the given 3-by-3 matrix around the z-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nconst rotateZ = rotate;\n\n/**\n * Creates a 3-by-3 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has two\n * entries.\n * @param v - A vector of\n * 2 entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * two entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of 2 entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale(m: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * 3 entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling3D(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = v[2];\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of 3 entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale3D(m: Mat3Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n\n newDst[ 8] = v2 * m[2 * 4 + 0];\n newDst[ 9] = v2 * m[2 * 4 + 1];\n newDst[10] = v2 * m[2 * 4 + 2];\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales uniformly in the X and Y dimensions\n * @param s - Amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in the X and Y dimension by an amount\n * given.\n * @param m - The matrix to be modified.\n * @param s - Amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale(m: Mat3Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales uniformly in each dimension\n * @param s - Amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling3D(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = s;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given.\n * @param m - The matrix to be modified.\n * @param s - Amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale3D(m: Mat3Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n\n newDst[ 8] = s * m[2 * 4 + 0];\n newDst[ 9] = s * m[2 * 4 + 1];\n newDst[10] = s * m[2 * 4 + 2];\n\n return newDst;\n}\n\nreturn {\n clone,\n create,\n set,\n fromMat4,\n fromQuat,\n negate,\n copy,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n invert,\n determinant,\n mul,\n multiply,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n get3DScaling,\n translation,\n translate,\n rotation,\n rotate,\n rotationX,\n rotateX,\n rotationY,\n rotateY,\n rotationZ,\n rotateZ,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n scaling3D,\n scale3D,\n uniformScaling3D,\n uniformScale3D,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Mat3Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","import { Mat4Arg, Mat4Type } from './mat4';\nimport { Mat3Arg } from './mat3';\nimport { QuatArg } from './quat';\nimport { Vec3Arg } from './vec3';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\nimport * as utils from './utils';\n\nexport { Mat4Arg, Mat4Type };\n\ntype Mat4Ctor = new (n: number) => T;\n\n/**\n * Generates a typed API for Mat4\n * */\nfunction getAPIImpl(Ctor: Mat4Ctor) {\n const vec3 = getVec3API(Ctor);\n\n/**\n * 4x4 Matrix math math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new matrix. In other words you can do this\n *\n * const mat = mat4.translation([1, 2, 3]); // Creates a new translation matrix\n *\n * or\n *\n * const mat = mat4.create();\n * mat4.translation([1, 2, 3], mat); // Puts translation matrix in mat.\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always save to pass any matrix as the destination. So for example\n *\n * const mat = mat4.identity();\n * const trans = mat4.translation([1, 2, 3]);\n * mat4.multiply(mat, trans, mat); // Multiplies mat * trans and puts result in mat.\n *\n */\n\n\n/**\n * Create a Mat4 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat4's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat4.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @returns created from values.\n */\nfunction create(\n v0?: number, v1?: number, v2?: number, v3?: number,\n v4?: number, v5?: number, v6?: number, v7?: number,\n v8?: number, v9?: number, v10?: number, v11?: number,\n v12?: number, v13?: number, v14?: number, v15?: number) {\n const newDst = new Ctor(16);\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[3] = v3;\n if (v4 !== undefined) {\n newDst[4] = v4;\n if (v5 !== undefined) {\n newDst[5] = v5;\n if (v6 !== undefined) {\n newDst[6] = v6;\n if (v7 !== undefined) {\n newDst[7] = v7;\n if (v8 !== undefined) {\n newDst[8] = v8;\n if (v9 !== undefined) {\n newDst[9] = v9;\n if (v10 !== undefined) {\n newDst[10] = v10;\n if (v11 !== undefined) {\n newDst[11] = v11;\n if (v12 !== undefined) {\n newDst[12] = v12;\n if (v13 !== undefined) {\n newDst[13] = v13;\n if (v14 !== undefined) {\n newDst[14] = v14;\n if (v15 !== undefined) {\n newDst[15] = v15;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Sets the values of a Mat4\n * Also see {@link mat4.create} and {@link mat4.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 created from values.\n */\nfunction set(\n v0: number, v1: number, v2: number, v3: number,\n v4: number, v5: number, v6: number, v7: number,\n v8: number, v9: number, v10: number, v11: number,\n v12: number, v13: number, v14: number, v15: number,\n dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = v0; newDst[ 1] = v1; newDst[ 2] = v2; newDst[ 3] = v3;\n newDst[ 4] = v4; newDst[ 5] = v5; newDst[ 6] = v6; newDst[ 7] = v7;\n newDst[ 8] = v8; newDst[ 9] = v9; newDst[10] = v10; newDst[11] = v11;\n newDst[12] = v12; newDst[13] = v13; newDst[14] = v14; newDst[15] = v15;\n\n return newDst;\n}\n\n/**\n * Creates a Mat4 from a Mat3\n * @param m3 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from m3\n */\nfunction fromMat3(m3: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = m3[0]; newDst[ 1] = m3[1]; newDst[ 2] = m3[ 2]; newDst[ 3] = 0;\n newDst[ 4] = m3[4]; newDst[ 5] = m3[5]; newDst[ 6] = m3[ 6]; newDst[ 7] = 0;\n newDst[ 8] = m3[8]; newDst[ 9] = m3[9]; newDst[10] = m3[10]; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a Mat4 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from q\n */\nfunction fromQuat(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3];\n const x2 = x + x; const y2 = y + y; const z2 = z + z;\n\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n newDst[ 0] = 1 - yy - zz; newDst[ 1] = yx + wz; newDst[ 2] = zx - wy; newDst[ 3] = 0;\n newDst[ 4] = yx - wz; newDst[ 5] = 1 - xx - zz; newDst[ 6] = zy + wx; newDst[ 7] = 0;\n newDst[ 8] = zx + wy; newDst[ 9] = zy - wx; newDst[10] = 1 - xx - yy; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\nfunction negate(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = -m[ 0]; newDst[ 1] = -m[ 1]; newDst[ 2] = -m[ 2]; newDst[ 3] = -m[ 3];\n newDst[ 4] = -m[ 4]; newDst[ 5] = -m[ 5]; newDst[ 6] = -m[ 6]; newDst[ 7] = -m[ 7];\n newDst[ 8] = -m[ 8]; newDst[ 9] = -m[ 9]; newDst[10] = -m[10]; newDst[11] = -m[11];\n newDst[12] = -m[12]; newDst[13] = -m[13]; newDst[14] = -m[14]; newDst[15] = -m[15];\n\n return newDst;\n}\n\n/**\n * Copies a matrix. (same as {@link mat4.clone})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nfunction copy(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = m[ 0]; newDst[ 1] = m[ 1]; newDst[ 2] = m[ 2]; newDst[ 3] = m[ 3];\n newDst[ 4] = m[ 4]; newDst[ 5] = m[ 5]; newDst[ 6] = m[ 6]; newDst[ 7] = m[ 7];\n newDst[ 8] = m[ 8]; newDst[ 9] = m[ 9]; newDst[10] = m[10]; newDst[11] = m[11];\n newDst[12] = m[12]; newDst[13] = m[13]; newDst[14] = m[14]; newDst[15] = m[15];\n\n return newDst;\n}\n\n/**\n * Copies a matrix (same as {@link mat4.copy})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nconst clone = copy;\n\n/**\n * Check if 2 matrices are approximately equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are approximately equal\n */\nfunction equalsApproximately(a: Mat4Arg, b: Mat4Arg): boolean {\n return Math.abs(a[ 0] - b[ 0]) < utils.EPSILON &&\n Math.abs(a[ 1] - b[ 1]) < utils.EPSILON &&\n Math.abs(a[ 2] - b[ 2]) < utils.EPSILON &&\n Math.abs(a[ 3] - b[ 3]) < utils.EPSILON &&\n Math.abs(a[ 4] - b[ 4]) < utils.EPSILON &&\n Math.abs(a[ 5] - b[ 5]) < utils.EPSILON &&\n Math.abs(a[ 6] - b[ 6]) < utils.EPSILON &&\n Math.abs(a[ 7] - b[ 7]) < utils.EPSILON &&\n Math.abs(a[ 8] - b[ 8]) < utils.EPSILON &&\n Math.abs(a[ 9] - b[ 9]) < utils.EPSILON &&\n Math.abs(a[10] - b[10]) < utils.EPSILON &&\n Math.abs(a[11] - b[11]) < utils.EPSILON &&\n Math.abs(a[12] - b[12]) < utils.EPSILON &&\n Math.abs(a[13] - b[13]) < utils.EPSILON &&\n Math.abs(a[14] - b[14]) < utils.EPSILON &&\n Math.abs(a[15] - b[15]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 matrices are exactly equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are exactly equal\n */\nfunction equals(a: Mat4Arg, b: Mat4Arg): boolean {\n return a[ 0] === b[ 0] &&\n a[ 1] === b[ 1] &&\n a[ 2] === b[ 2] &&\n a[ 3] === b[ 3] &&\n a[ 4] === b[ 4] &&\n a[ 5] === b[ 5] &&\n a[ 6] === b[ 6] &&\n a[ 7] === b[ 7] &&\n a[ 8] === b[ 8] &&\n a[ 9] === b[ 9] &&\n a[10] === b[10] &&\n a[11] === b[11] &&\n a[12] === b[12] &&\n a[13] === b[13] &&\n a[14] === b[14] &&\n a[15] === b[15];\n}\n\n/**\n * Creates a 4-by-4 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 4-by-4 identity matrix.\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\nfunction transpose(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n if (newDst === m) {\n let t;\n\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n\n t = m[3];\n m[3] = m[12];\n m[12] = t;\n\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n\n t = m[7];\n m[7] = m[13];\n m[13] = t;\n\n t = m[11];\n m[11] = m[14];\n m[14] = t;\n return newDst;\n }\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n newDst[ 0] = m00; newDst[ 1] = m10; newDst[ 2] = m20; newDst[ 3] = m30;\n newDst[ 4] = m01; newDst[ 5] = m11; newDst[ 6] = m21; newDst[ 7] = m31;\n newDst[ 8] = m02; newDst[ 9] = m12; newDst[10] = m22; newDst[11] = m32;\n newDst[12] = m03; newDst[13] = m13; newDst[14] = m23; newDst[15] = m33;\n\n return newDst;\n}\n\n/**\n * Computes the inverse of a 4-by-4 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nfunction inverse(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n const tmp12 = m20 * m31;\n const tmp13 = m30 * m21;\n const tmp14 = m10 * m31;\n const tmp15 = m30 * m11;\n const tmp16 = m10 * m21;\n const tmp17 = m20 * m11;\n const tmp18 = m00 * m31;\n const tmp19 = m30 * m01;\n const tmp20 = m00 * m21;\n const tmp21 = m20 * m01;\n const tmp22 = m00 * m11;\n const tmp23 = m10 * m01;\n\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n\n const d = 1 / (m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3);\n\n newDst[ 0] = d * t0;\n newDst[ 1] = d * t1;\n newDst[ 2] = d * t2;\n newDst[ 3] = d * t3;\n newDst[ 4] = d * ((tmp1 * m10 + tmp2 * m20 + tmp5 * m30) -\n (tmp0 * m10 + tmp3 * m20 + tmp4 * m30));\n newDst[ 5] = d * ((tmp0 * m00 + tmp7 * m20 + tmp8 * m30) -\n (tmp1 * m00 + tmp6 * m20 + tmp9 * m30));\n newDst[ 6] = d * ((tmp3 * m00 + tmp6 * m10 + tmp11 * m30) -\n (tmp2 * m00 + tmp7 * m10 + tmp10 * m30));\n newDst[ 7] = d * ((tmp4 * m00 + tmp9 * m10 + tmp10 * m20) -\n (tmp5 * m00 + tmp8 * m10 + tmp11 * m20));\n newDst[ 8] = d * ((tmp12 * m13 + tmp15 * m23 + tmp16 * m33) -\n (tmp13 * m13 + tmp14 * m23 + tmp17 * m33));\n newDst[ 9] = d * ((tmp13 * m03 + tmp18 * m23 + tmp21 * m33) -\n (tmp12 * m03 + tmp19 * m23 + tmp20 * m33));\n newDst[10] = d * ((tmp14 * m03 + tmp19 * m13 + tmp22 * m33) -\n (tmp15 * m03 + tmp18 * m13 + tmp23 * m33));\n newDst[11] = d * ((tmp17 * m03 + tmp20 * m13 + tmp23 * m23) -\n (tmp16 * m03 + tmp21 * m13 + tmp22 * m23));\n newDst[12] = d * ((tmp14 * m22 + tmp17 * m32 + tmp13 * m12) -\n (tmp16 * m32 + tmp12 * m12 + tmp15 * m22));\n newDst[13] = d * ((tmp20 * m32 + tmp12 * m02 + tmp19 * m22) -\n (tmp18 * m22 + tmp21 * m32 + tmp13 * m02));\n newDst[14] = d * ((tmp18 * m12 + tmp23 * m32 + tmp15 * m02) -\n (tmp22 * m32 + tmp14 * m02 + tmp19 * m12));\n newDst[15] = d * ((tmp22 * m22 + tmp16 * m02 + tmp21 * m12) -\n (tmp20 * m12 + tmp23 * m22 + tmp17 * m02));\n\n return newDst;\n}\n\n/**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\nfunction determinant(m: Mat4Arg): number {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n\n return m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3;\n}\n\n/**\n * Computes the inverse of a 4-by-4 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nconst invert = inverse;\n\n/**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nfunction multiply(a: Mat4Arg, b: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[ 4 + 0];\n const a11 = a[ 4 + 1];\n const a12 = a[ 4 + 2];\n const a13 = a[ 4 + 3];\n const a20 = a[ 8 + 0];\n const a21 = a[ 8 + 1];\n const a22 = a[ 8 + 2];\n const a23 = a[ 8 + 3];\n const a30 = a[12 + 0];\n const a31 = a[12 + 1];\n const a32 = a[12 + 2];\n const a33 = a[12 + 3];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b03 = b[3];\n const b10 = b[ 4 + 0];\n const b11 = b[ 4 + 1];\n const b12 = b[ 4 + 2];\n const b13 = b[ 4 + 3];\n const b20 = b[ 8 + 0];\n const b21 = b[ 8 + 1];\n const b22 = b[ 8 + 2];\n const b23 = b[ 8 + 3];\n const b30 = b[12 + 0];\n const b31 = b[12 + 1];\n const b32 = b[12 + 2];\n const b33 = b[12 + 3];\n\n newDst[ 0] = a00 * b00 + a10 * b01 + a20 * b02 + a30 * b03;\n newDst[ 1] = a01 * b00 + a11 * b01 + a21 * b02 + a31 * b03;\n newDst[ 2] = a02 * b00 + a12 * b01 + a22 * b02 + a32 * b03;\n newDst[ 3] = a03 * b00 + a13 * b01 + a23 * b02 + a33 * b03;\n newDst[ 4] = a00 * b10 + a10 * b11 + a20 * b12 + a30 * b13;\n newDst[ 5] = a01 * b10 + a11 * b11 + a21 * b12 + a31 * b13;\n newDst[ 6] = a02 * b10 + a12 * b11 + a22 * b12 + a32 * b13;\n newDst[ 7] = a03 * b10 + a13 * b11 + a23 * b12 + a33 * b13;\n newDst[ 8] = a00 * b20 + a10 * b21 + a20 * b22 + a30 * b23;\n newDst[ 9] = a01 * b20 + a11 * b21 + a21 * b22 + a31 * b23;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22 + a32 * b23;\n newDst[11] = a03 * b20 + a13 * b21 + a23 * b22 + a33 * b23;\n newDst[12] = a00 * b30 + a10 * b31 + a20 * b32 + a30 * b33;\n newDst[13] = a01 * b30 + a11 * b31 + a21 * b32 + a31 * b33;\n newDst[14] = a02 * b30 + a12 * b31 + a22 * b32 + a32 * b33;\n newDst[15] = a03 * b30 + a13 * b31 + a23 * b32 + a33 * b33;\n\n return newDst;\n}\n\n/**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nconst mul = multiply;\n\n/**\n * Sets the translation component of a 4-by-4 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\nfunction setTranslation(a: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? identity()) as T;\n if (a !== newDst) {\n newDst[ 0] = a[ 0];\n newDst[ 1] = a[ 1];\n newDst[ 2] = a[ 2];\n newDst[ 3] = a[ 3];\n newDst[ 4] = a[ 4];\n newDst[ 5] = a[ 5];\n newDst[ 6] = a[ 6];\n newDst[ 7] = a[ 7];\n newDst[ 8] = a[ 8];\n newDst[ 9] = a[ 9];\n newDst[10] = a[10];\n newDst[11] = a[11];\n }\n newDst[12] = v[0];\n newDst[13] = v[1];\n newDst[14] = v[2];\n newDst[15] = 1;\n return newDst;\n}\n\n///**\n// * Returns the translation component of a 4-by-4 matrix as a vector with 3\n// * entries.\n// * @param m - The matrix.\n// * @param dst - vector to hold result. If not passed a new one is created.\n// * @returns The translation component of m.\n// */\nfunction getTranslation(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? vec3.create()) as T;\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n}\n\n/**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat4Arg, axis: number, dst?: T) {\n const newDst = (dst ?? vec3.create());\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n}\n\n/**\n * Sets an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\nfunction setAxis(m: Mat4Arg, v: Vec3Arg, axis: number, dst: T) {\n const newDst = (dst === m) ? dst : copy(m, dst);\n\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n newDst[off + 2] = v[2];\n return newDst;\n}\n\n/**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? vec3.create()) as T;\n\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 0 to 1 in the z dimension.\n *\n * Note: If you pass `Infinity` for zFar then it will produce a projection matrix\n * returns -Infinity for Z when transforming coordinates with Z <= 0 and +Infinity for Z\n * otherwise.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */\nfunction perspective(fieldOfViewYInRadians: number, aspect: number, zNear: number, zFar: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const f = Math.tan(Math.PI * 0.5 - 0.5 * fieldOfViewYInRadians);\n\n newDst[0] = f / aspect;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n newDst[4] = 0;\n newDst[5] = f;\n newDst[6] = 0;\n newDst[7] = 0;\n\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[11] = -1;\n\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (Number.isFinite(zFar)) {\n const rangeInv = 1 / (zNear - zFar);\n newDst[10] = zFar * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n } else {\n newDst[10] = -1;\n newDst[14] = -zNear;\n }\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 1 (at -zNear) to 0 (at -zFar) in the z dimension.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane. (default = Infinity)\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */function perspectiveReverseZ(fieldOfViewYInRadians: number, aspect: number, zNear: number, zFar = Infinity, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const f = 1 / Math.tan(fieldOfViewYInRadians * 0.5);\n\n newDst[ 0] = f / aspect;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n\n newDst[ 4] = 0;\n newDst[ 5] = f;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n\n newDst[ 8] = 0;\n newDst[ 9] = 0;\n newDst[11] = -1;\n\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (zFar === Infinity) {\n newDst[10] = 0;\n newDst[14] = zNear;\n } else {\n const rangeInv = 1 / (zFar - zNear);\n newDst[10] = zNear * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n }\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 orthogonal transformation matrix that transforms from\n * the given the left, right, bottom, and top dimensions to -1 +1 in x, and y\n * and 0 to +1 in z.\n * @param left - Left side of the near clipping plane viewport.\n * @param right - Right side of the near clipping plane viewport.\n * @param bottom - Bottom of the near clipping plane viewport.\n * @param top - Top of the near clipping plane viewport.\n * @param near - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param far - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The orthographic projection matrix.\n */\nfunction ortho(left: number, right: number, bottom: number, top: number, near: number, far: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[0] = 2 / (right - left);\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n newDst[4] = 0;\n newDst[5] = 2 / (top - bottom);\n newDst[6] = 0;\n newDst[7] = 0;\n\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[10] = 1 / (near - far);\n newDst[11] = 0;\n\n newDst[12] = (right + left) / (left - right);\n newDst[13] = (top + bottom) / (bottom - top);\n newDst[14] = near / (near - far);\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 0 to 1 in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\nfunction frustum(left: number, right: number, bottom: number, top: number, near: number, far: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const dx = (right - left);\n const dy = (top - bottom);\n const dz = (near - far);\n\n newDst[ 0] = 2 * near / dx;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n newDst[ 4] = 0;\n newDst[ 5] = 2 * near / dy;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n newDst[ 8] = (left + right) / dx;\n newDst[ 9] = (top + bottom) / dy;\n newDst[10] = far / dz;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = near * far / dz;\n newDst[15] = 0;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 1 (-near) to 0 (-far) in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\nfunction frustumReverseZ(left: number, right: number, bottom: number, top: number, near: number, far = Infinity, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const dx = (right - left);\n const dy = (top - bottom);\n\n newDst[ 0] = 2 * near / dx;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n newDst[ 4] = 0;\n newDst[ 5] = 2 * near / dy;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n newDst[ 8] = (left + right) / dx;\n newDst[ 9] = (top + bottom) / dy;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (far === Infinity) {\n newDst[10] = 0;\n newDst[14] = near;\n } else {\n const rangeInv = 1 / (far - near);\n newDst[10] = near * rangeInv;\n newDst[14] = far * near * rangeInv;\n }\n\n return newDst;\n}\n\nconst xAxis = vec3.create();\nconst yAxis = vec3.create();\nconst zAxis = vec3.create();\n\n/**\n * Computes a 4-by-4 aim transformation.\n *\n * This is a matrix which positions an object aiming down positive Z.\n * toward the target.\n *\n * Note: this is **NOT** the inverse of lookAt as lookAt looks at negative Z.\n *\n * @param position - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\nfunction aim(position: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(target, position, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = xAxis[1]; newDst[ 2] = xAxis[2]; newDst[ 3] = 0;\n newDst[ 4] = yAxis[0]; newDst[ 5] = yAxis[1]; newDst[ 6] = yAxis[2]; newDst[ 7] = 0;\n newDst[ 8] = zAxis[0]; newDst[ 9] = zAxis[1]; newDst[10] = zAxis[2]; newDst[11] = 0;\n newDst[12] = position[0]; newDst[13] = position[1]; newDst[14] = position[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 camera aim transformation.\n *\n * This is a matrix which positions an object aiming down negative Z.\n * toward the target.\n *\n * Note: this is the inverse of `lookAt`\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\nfunction cameraAim(eye: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = xAxis[1]; newDst[ 2] = xAxis[2]; newDst[ 3] = 0;\n newDst[ 4] = yAxis[0]; newDst[ 5] = yAxis[1]; newDst[ 6] = yAxis[2]; newDst[ 7] = 0;\n newDst[ 8] = zAxis[0]; newDst[ 9] = zAxis[1]; newDst[10] = zAxis[2]; newDst[11] = 0;\n newDst[12] = eye[0]; newDst[13] = eye[1]; newDst[14] = eye[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 view transformation.\n *\n * This is a view matrix which transforms all other objects\n * to be in the space of the view defined by the parameters.\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The look-at matrix.\n */\nfunction lookAt(eye: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = yAxis[0]; newDst[ 2] = zAxis[0]; newDst[ 3] = 0;\n newDst[ 4] = xAxis[1]; newDst[ 5] = yAxis[1]; newDst[ 6] = zAxis[1]; newDst[ 7] = 0;\n newDst[ 8] = xAxis[2]; newDst[ 9] = yAxis[2]; newDst[10] = zAxis[2]; newDst[11] = 0;\n\n newDst[12] = -(xAxis[0] * eye[0] + xAxis[1] * eye[1] + xAxis[2] * eye[2]);\n newDst[13] = -(yAxis[0] * eye[0] + yAxis[1] * eye[1] + yAxis[2] * eye[2]);\n newDst[14] = -(zAxis[0] * eye[0] + zAxis[1] * eye[1] + zAxis[2] * eye[2]);\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which translates by the given vector v.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\nfunction translation(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = v[0]; newDst[13] = v[1]; newDst[14] = v[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Translates the given 4-by-4 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\nfunction translate(m: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n if (m !== newDst) {\n newDst[ 0] = m00;\n newDst[ 1] = m01;\n newDst[ 2] = m02;\n newDst[ 3] = m03;\n newDst[ 4] = m10;\n newDst[ 5] = m11;\n newDst[ 6] = m12;\n newDst[ 7] = m13;\n newDst[ 8] = m20;\n newDst[ 9] = m21;\n newDst[10] = m22;\n newDst[11] = m23;\n }\n\n newDst[12] = m00 * v0 + m10 * v1 + m20 * v2 + m30;\n newDst[13] = m01 * v0 + m11 * v1 + m21 * v2 + m31;\n newDst[14] = m02 * v0 + m12 * v1 + m22 * v2 + m32;\n newDst[15] = m03 * v0 + m13 * v1 + m23 * v2 + m33;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the x-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationX(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = c; newDst[ 6] = s; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = -s; newDst[10] = c; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the x-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateX(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[4] = c * m10 + s * m20;\n newDst[5] = c * m11 + s * m21;\n newDst[6] = c * m12 + s * m22;\n newDst[7] = c * m13 + s * m23;\n newDst[8] = c * m20 - s * m10;\n newDst[9] = c * m21 - s * m11;\n newDst[10] = c * m22 - s * m12;\n newDst[11] = c * m23 - s * m13;\n\n if (m !== newDst) {\n newDst[ 0] = m[ 0];\n newDst[ 1] = m[ 1];\n newDst[ 2] = m[ 2];\n newDst[ 3] = m[ 3];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the y-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationY(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = 0; newDst[ 2] = -s; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = s; newDst[ 9] = 0; newDst[10] = c; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the y-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateY(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 - s * m20;\n newDst[ 1] = c * m01 - s * m21;\n newDst[ 2] = c * m02 - s * m22;\n newDst[ 3] = c * m03 - s * m23;\n newDst[ 8] = c * m20 + s * m00;\n newDst[ 9] = c * m21 + s * m01;\n newDst[10] = c * m22 + s * m02;\n newDst[11] = c * m23 + s * m03;\n\n if (m !== newDst) {\n newDst[ 4] = m[ 4];\n newDst[ 5] = m[ 5];\n newDst[ 6] = m[ 6];\n newDst[ 7] = m[ 7];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the z-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationZ(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = s; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = -s; newDst[ 5] = c; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the z-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateZ(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 + s * m10;\n newDst[ 1] = c * m01 + s * m11;\n newDst[ 2] = c * m02 + s * m12;\n newDst[ 3] = c * m03 + s * m13;\n newDst[ 4] = c * m10 - s * m00;\n newDst[ 5] = c * m11 - s * m01;\n newDst[ 6] = c * m12 - s * m02;\n newDst[ 7] = c * m13 - s * m03;\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n newDst[11] = m[11];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\nfunction axisRotation(axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n\n newDst[ 0] = xx + (1 - xx) * c;\n newDst[ 1] = x * y * oneMinusCosine + z * s;\n newDst[ 2] = x * z * oneMinusCosine - y * s;\n newDst[ 3] = 0;\n newDst[ 4] = x * y * oneMinusCosine - z * s;\n newDst[ 5] = yy + (1 - yy) * c;\n newDst[ 6] = y * z * oneMinusCosine + x * s;\n newDst[ 7] = 0;\n newDst[ 8] = x * z * oneMinusCosine + y * s;\n newDst[ 9] = y * z * oneMinusCosine - x * s;\n newDst[10] = zz + (1 - zz) * c;\n newDst[11] = 0;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = 0;\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle. (same as axisRotation)\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\nconst rotation = axisRotation;\n\n/**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle.\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction axisRotate(m: Mat4Arg, axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n\n const r00 = xx + (1 - xx) * c;\n const r01 = x * y * oneMinusCosine + z * s;\n const r02 = x * z * oneMinusCosine - y * s;\n const r10 = x * y * oneMinusCosine - z * s;\n const r11 = yy + (1 - yy) * c;\n const r12 = y * z * oneMinusCosine + x * s;\n const r20 = x * z * oneMinusCosine + y * s;\n const r21 = y * z * oneMinusCosine - x * s;\n const r22 = zz + (1 - zz) * c;\n\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n\n newDst[ 0] = r00 * m00 + r01 * m10 + r02 * m20;\n newDst[ 1] = r00 * m01 + r01 * m11 + r02 * m21;\n newDst[ 2] = r00 * m02 + r01 * m12 + r02 * m22;\n newDst[ 3] = r00 * m03 + r01 * m13 + r02 * m23;\n newDst[ 4] = r10 * m00 + r11 * m10 + r12 * m20;\n newDst[ 5] = r10 * m01 + r11 * m11 + r12 * m21;\n newDst[ 6] = r10 * m02 + r11 * m12 + r12 * m22;\n newDst[ 7] = r10 * m03 + r11 * m13 + r12 * m23;\n newDst[ 8] = r20 * m00 + r21 * m10 + r22 * m20;\n newDst[ 9] = r20 * m01 + r21 * m11 + r22 * m21;\n newDst[10] = r20 * m02 + r21 * m12 + r22 * m22;\n newDst[11] = r20 * m03 + r21 * m13 + r22 * m23;\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle. (same as rotate)\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nconst rotate = axisRotate;\n\n/**\n * Creates a 4-by-4 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * three entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = v[2]; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 4-by-4 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of three entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale(m: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n newDst[ 3] = v0 * m[0 * 4 + 3];\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n newDst[ 7] = v1 * m[1 * 4 + 3];\n newDst[ 8] = v2 * m[2 * 4 + 0];\n newDst[ 9] = v2 * m[2 * 4 + 1];\n newDst[10] = v2 * m[2 * 4 + 2];\n newDst[11] = v2 * m[2 * 4 + 3];\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which scales a uniform amount in each dimension.\n * @param s - the amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = s; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 4-by-4 matrix in each dimension by a uniform scale.\n * @param m - The matrix to be modified.\n * @param s - The amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale(m: Mat4Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n newDst[ 3] = s * m[0 * 4 + 3];\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n newDst[ 7] = s * m[1 * 4 + 3];\n newDst[ 8] = s * m[2 * 4 + 0];\n newDst[ 9] = s * m[2 * 4 + 1];\n newDst[10] = s * m[2 * 4 + 2];\n newDst[11] = s * m[2 * 4 + 3];\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\nreturn {\n create,\n set,\n fromMat3,\n fromQuat,\n negate,\n copy,\n clone,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n determinant,\n invert,\n multiply,\n mul,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n perspective,\n perspectiveReverseZ,\n ortho,\n frustum,\n frustumReverseZ,\n aim,\n cameraAim,\n lookAt,\n translation,\n translate,\n rotationX,\n rotateX,\n rotationY,\n rotateY,\n rotationZ,\n rotateZ,\n axisRotation,\n rotation,\n axisRotate,\n rotate,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n};\n\n}\n\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Mat4Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { QuatArg, QuatType } from './quat';\nimport { Mat3Arg } from './mat3.js';\nimport { Mat4Arg } from './mat4.js';\nimport { Vec3Arg } from './vec3.js';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\n\nexport { QuatArg, QuatType };\n\ntype QuatCtor = new (n: number) => T;\n\nexport type RotationOrder = 'xyz' | 'xzy' | 'yxz' | 'yzx' | 'zxy' | 'zyx';\n\n/**\n * Generates am typed API for Qud\n * */\nfunction getAPIImpl(Ctor: QuatCtor) {\n const vec3 = getVec3API(Ctor);\n\n/**\n * Creates a quat4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number, w?: number) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a Quat; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Quat\n * Also see {@link quat.create} and {@link quat.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, w: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n\n return newDst;\n}\n\n/**\n * Sets a quaternion from the given angle and axis,\n * then returns it.\n *\n * @param axis - the axis to rotate around\n * @param angleInRadians - the angle\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The quaternion that represents the given axis and angle\n **/\nfunction fromAxisAngle(axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n const s = Math.sin(halfAngle);\n\n newDst[0] = s * axis[0];\n newDst[1] = s * axis[1];\n newDst[2] = s * axis[2];\n newDst[3] = Math.cos(halfAngle);\n\n return newDst;\n}\n\n/**\n * Gets the rotation axis and angle\n * @param q - quaternion to compute from\n * @param dst - Vec3 to hold result. If not passed in a new one is created.\n * @return angle and axis\n */\nfunction toAxisAngle(q: QuatArg, dst?: T): { angle: number, axis: T } {\n const newDst = (dst ?? vec3.create(3)) as T;\n\n const angle = Math.acos(q[3]) * 2;\n const s = Math.sin(angle * 0.5);\n if (s > utils.EPSILON) {\n newDst[0] = q[0] / s;\n newDst[1] = q[1] / s;\n newDst[2] = q[2] / s;\n } else {\n newDst[0] = 1;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n\n return { angle, axis: newDst };\n}\n\n/**\n * Returns the angle in degrees between two rotations a and b.\n * @param a - quaternion a\n * @param b - quaternion b\n * @return angle in radians between the two quaternions\n */\nfunction angle(a: QuatArg, b: QuatArg) {\n const d = dot(a, b);\n return Math.acos(2 * d * d - 1);\n}\n\n/**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction multiply(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const bw = b[3];\n\n newDst[0] = ax * bw + aw * bx + ay * bz - az * by;\n newDst[1] = ay * bw + aw * by + az * bx - ax * bz;\n newDst[2] = az * bw + aw * bz + ax * by - ay * bx;\n newDst[3] = aw * bw - ax * bx - ay * by - az * bz;\n\n return newDst;\n}\n\n/**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nconst mul = multiply;\n\n/**\n * Rotates the given quaternion around the X axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateX(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const bx = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw + qw * bx;\n newDst[1] = qy * bw + qz * bx;\n newDst[2] = qz * bw - qy * bx;\n newDst[3] = qw * bw - qx * bx;\n\n return newDst;\n}\n\n/**\n * Rotates the given quaternion around the Y axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateY(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const by = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw - qz * by;\n newDst[1] = qy * bw + qw * by;\n newDst[2] = qz * bw + qx * by;\n newDst[3] = qw * bw - qy * by;\n\n return newDst;\n}\n\n/**\n * Rotates the given quaternion around the Z axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateZ(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const bz = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw + qy * bz;\n newDst[1] = qy * bw - qx * bz;\n newDst[2] = qz * bw + qw * bz;\n newDst[3] = qw * bw - qz * bz;\n\n return newDst;\n}\n\n/**\n * Spherically linear interpolate between two quaternions\n *\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction slerp(a: QuatArg, b: QuatArg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n\n let bx = b[0];\n let by = b[1];\n let bz = b[2];\n let bw = b[3];\n\n let cosOmega = ax * bx + ay * by + az * bz + aw * bw;\n\n if (cosOmega < 0) {\n cosOmega = -cosOmega;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n\n let scale0;\n let scale1;\n\n if (1.0 - cosOmega > utils.EPSILON) {\n const omega = Math.acos(cosOmega);\n const sinOmega = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinOmega;\n scale1 = Math.sin(t * omega) / sinOmega;\n } else {\n scale0 = 1.0 - t;\n scale1 = t;\n }\n\n newDst[0] = scale0 * ax + scale1 * bx;\n newDst[1] = scale0 * ay + scale1 * by;\n newDst[2] = scale0 * az + scale1 * bz;\n newDst[3] = scale0 * aw + scale1 * bw;\n\n return newDst;\n}\n\n/**\n * Compute the inverse of a quaternion\n *\n * @param q - quaternion to compute the inverse of\n * @returns A quaternion that is the result of a * b\n */\nfunction inverse(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const a0 = q[0];\n const a1 = q[1];\n const a2 = q[2];\n const a3 = q[3];\n\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n\n newDst[0] = -a0 * invDot;\n newDst[1] = -a1 * invDot;\n newDst[2] = -a2 * invDot;\n newDst[3] = a3 * invDot;\n\n return newDst;\n}\n\n/**\n * Compute the conjugate of a quaternion\n * For quaternions with a magnitude of 1 (a unit quaternion)\n * this returns the same as the inverse but is faster to calculate.\n *\n * @param q - quaternion to compute the conjugate of.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The conjugate of q\n */\nfunction conjugate(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = -q[0];\n newDst[1] = -q[1];\n newDst[2] = -q[2];\n newDst[3] = q[3];\n\n return newDst;\n}\n\n/**\n * Creates a quaternion from the given rotation matrix.\n *\n * The created quaternion is not normalized.\n *\n * @param m - rotation matrix\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\nfunction fromMat(m: Mat3Arg | Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n /*\n 0 1 2\n 3 4 5\n 6 7 8\n\n 0 1 2\n 4 5 6\n 8 9 10\n */\n\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n const trace = m[0] + m[5] + m[10];\n\n if (trace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n const root = Math.sqrt(trace + 1); // 2w\n newDst[3] = 0.5 * root;\n const invRoot = 0.5 / root; // 1/(4w)\n\n newDst[0] = (m[6] - m[9]) * invRoot;\n newDst[1] = (m[8] - m[2]) * invRoot;\n newDst[2] = (m[1] - m[4]) * invRoot;\n } else {\n // |w| <= 1/2\n let i = 0;\n\n if (m[5] > m[0]) {\n i = 1;\n }\n if (m[10] > m[i * 4 + i]) {\n i = 2;\n }\n\n const j = (i + 1) % 3;\n const k = (i + 2) % 3;\n\n const root = Math.sqrt(m[i * 4 + i] - m[j * 4 + j] - m[k * 4 + k] + 1.0);\n newDst[i] = 0.5 * root;\n\n const invRoot = 0.5 / root;\n\n newDst[3] = (m[j * 4 + k] - m[k * 4 + j]) * invRoot;\n newDst[j] = (m[j * 4 + i] + m[i * 4 + j]) * invRoot;\n newDst[k] = (m[k * 4 + i] + m[i * 4 + k]) * invRoot;\n }\n\n return newDst;\n}\n\n/**\n * Creates a quaternion from the given euler angle x, y, z using the provided intrinsic order for the conversion.\n *\n * @param xAngleInRadians - angle to rotate around X axis in radians.\n * @param yAngleInRadians - angle to rotate around Y axis in radians.\n * @param zAngleInRadians - angle to rotate around Z axis in radians.\n * @param order - order to apply euler angles\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion representing the same rotation as the euler angles applied in the given order\n */\nfunction fromEuler(\n xAngleInRadians: number,\n yAngleInRadians: number,\n zAngleInRadians: number,\n order: RotationOrder,\n dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const xHalfAngle = xAngleInRadians * 0.5;\n const yHalfAngle = yAngleInRadians * 0.5;\n const zHalfAngle = zAngleInRadians * 0.5;\n\n const sx = Math.sin(xHalfAngle);\n const cx = Math.cos(xHalfAngle);\n const sy = Math.sin(yHalfAngle);\n const cy = Math.cos(yHalfAngle);\n const sz = Math.sin(zHalfAngle);\n const cz = Math.cos(zHalfAngle);\n\n switch (order) {\n case 'xyz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'xzy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n case 'yxz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n case 'yzx':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'zxy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'zyx':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n default:\n throw new Error(`Unknown rotation order: ${order}`);\n }\n\n return newDst;\n}\n\n/**\n * Copies a quaternion. (same as {@link quat.clone})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is a copy of q\n */\nfunction copy(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = q[0];\n newDst[1] = q[1];\n newDst[2] = q[2];\n newDst[3] = q[3];\n\n return newDst;\n}\n\n/**\n * Clones a quaternion. (same as {@link quat.copy})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A copy of q.\n */\nconst clone = copy;\n\n/**\n * Adds two quaternions; assumes a and b have the same dimension.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the sum of a and b.\n */\nfunction add(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\nfunction subtract(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Multiplies a quaternion by a scalar.\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nfunction mulScalar(v: QuatArg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a quaternion by a scalar. (same as mulScalar)\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nfunction divScalar(v: QuatArg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two quaternions\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns dot product\n */\nfunction dot(a: QuatArg, b: QuatArg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n}\n\n/**\n * Performs linear interpolation on two quaternions.\n * Given quaternions a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param t - Interpolation coefficient.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: QuatArg, b: QuatArg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Computes the length of quaternion\n * @param v - quaternion.\n * @returns length of quaternion.\n */\nfunction length(v: QuatArg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n}\n\n/**\n * Computes the length of quaternion (same as length)\n * @param v - quaternion.\n * @returns length of quaternion.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of quaternion\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\nfunction lengthSq(v: QuatArg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n}\n\n/**\n * Computes the square of the length of quaternion (same as lengthSq)\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\nconst lenSq = lengthSq;\n\n/**\n * Divides a quaternion by its Euclidean length and returns the quotient.\n * @param v - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The normalized quaternion.\n */\nfunction normalize(v: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n }\n\n return newDst;\n}\n\n/**\n * Check if 2 quaternions are approximately equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are approximately equal\n */\nfunction equalsApproximately(a: QuatArg, b: QuatArg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON &&\n Math.abs(a[3] - b[3]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 quaternions are exactly equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are exactly equal\n */\nfunction equals(a: QuatArg, b: QuatArg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Creates an identity quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns an identity quaternion\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n\n return newDst;\n}\n\nconst tempVec3 = vec3.create();\nconst xUnitVec3 = vec3.create();\nconst yUnitVec3 = vec3.create();\n\n/**\n * Computes a quaternion to represent the shortest rotation from one vector to another.\n *\n * @param aUnit - the start vector\n * @param bUnit - the end vector\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\nfunction rotationTo(aUnit: Vec3Arg, bUnit: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const dot = vec3.dot(aUnit, bUnit);\n if (dot < -0.999999) {\n vec3.cross(xUnitVec3, aUnit, tempVec3);\n if (vec3.len(tempVec3) < 0.000001) {\n vec3.cross(yUnitVec3, aUnit, tempVec3);\n }\n\n vec3.normalize(tempVec3, tempVec3);\n fromAxisAngle(tempVec3, Math.PI, newDst);\n\n return newDst;\n } else if (dot > 0.999999) {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n\n return newDst;\n } else {\n vec3.cross(aUnit, bUnit, tempVec3);\n\n newDst[0] = tempVec3[0];\n newDst[1] = tempVec3[1];\n newDst[2] = tempVec3[2];\n newDst[3] = 1 + dot;\n\n return normalize(newDst, newDst);\n }\n}\n\nconst tempQuat1 = new Ctor(4);\nconst tempQuat2 = new Ctor(4);\n\n/**\n * Performs a spherical linear interpolation with two control points\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param c - the third quaternion\n * @param d - the fourth quaternion\n * @param t - Interpolation coefficient 0 to 1\n * @returns result\n */\nfunction sqlerp(\n a: QuatArg,\n b: QuatArg,\n c: QuatArg,\n d: QuatArg,\n t: number,\n dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n slerp(a, d, t, tempQuat1);\n slerp(b, c, t, tempQuat2);\n slerp(tempQuat1, tempQuat2, 2 * t * (1 - t), newDst);\n\n return newDst;\n}\n\nreturn {\n create,\n fromValues,\n set,\n fromAxisAngle,\n toAxisAngle,\n angle,\n multiply,\n mul,\n rotateX,\n rotateY,\n rotateZ,\n slerp,\n inverse,\n conjugate,\n fromMat,\n fromEuler,\n copy,\n clone,\n add,\n subtract,\n sub,\n mulScalar,\n scale,\n divScalar,\n dot,\n lerp,\n length,\n len,\n lengthSq,\n lenSq,\n normalize,\n equalsApproximately,\n equals,\n identity,\n rotationTo,\n sqlerp,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\n/**\n *\n * Quat4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Quat4`. In other words you can do this\n *\n * const v = quat4.cross(v1, v2); // Creates a new Quat4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = quat4.create();\n * quat4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * quat4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nexport function getAPI(Ctor: QuatCtor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Vec4Arg, Vec4Type } from './vec4';\nimport { Mat4Arg } from './mat4';\nimport { BaseArgType } from './types';\n\nexport { Vec4Arg, Vec4Type };\n\ntype Vec4Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec4\n * */\nfunction getAPIImpl(Ctor: Vec4Ctor) {\n\n/**\n * Creates a vec4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number, w?: number) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a vec4; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec4\n * Also see {@link vec4.create} and {@link vec4.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, w: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n newDst[3] = Math.ceil(v[3]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n newDst[3] = Math.floor(v[3]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n newDst[3] = Math.round(v[3]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec4Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n newDst[3] = Math.min(max, Math.max(min, v[3]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec4Arg, b: Vec4Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n newDst[3] = a[3] + b[3] * scale;\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec4Arg, b: Vec4Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON &&\n Math.abs(a[3] - b[3]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec4Arg, b: Vec4Arg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec4Arg, b: Vec4Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec4Arg, b: Vec4Arg, t: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n newDst[3] = a[3] + t[3] * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n newDst[3] = Math.max(a[3], b[3]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n newDst[3] = Math.min(a[3], b[3]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec4Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec4Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n newDst[3] = 1 / v[3];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the dot product of two vectors\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec4Arg, b: Vec4Arg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec4Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec4Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec4Arg, b: Vec4Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec4Arg, b: Vec4Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return dx * dx + dy * dy + dz * dz + dw * dw;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n }\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n newDst[3] = -v[3];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec4.clone})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n newDst[3] = v[3];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec4.copy})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n newDst[3] = a[3] * b[3];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n newDst[3] = a[3] / b[3];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform vec4 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec4 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec4Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = v[3];\n\n newDst[0] = m[0] * x + m[4] * y + m[ 8] * z + m[12] * w;\n newDst[1] = m[1] * x + m[5] * y + m[ 9] * z + m[13] * w;\n newDst[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n newDst[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n\n return newDst;\n}\n\n\n/**\n * Treat a 4D vector as a direction and set it's length\n *\n * @param a The vec4 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec4Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec4 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec4Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n zero,\n transformMat4,\n setLength,\n truncate,\n midpoint,\n};\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\n/**\n *\n * Vec4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Vec4`. In other words you can do this\n *\n * const v = vec4.cross(v1, v2); // Creates a new Vec4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = vec4.create();\n * vec4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * vec4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nexport function getAPI(Ctor: Vec4Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n\n","/**\n * Some docs\n * @namespace wgpu-matrix\n */\nimport {BaseArgType, ZeroArray} from './types';\nimport {Mat3Arg, Mat3Type, getAPI as getMat3API} from './mat3-impl';\nimport {Mat4Arg, Mat4Type, getAPI as getMat4API} from './mat4-impl';\nimport {QuatArg, QuatType, getAPI as getQuatAPI, RotationOrder} from './quat-impl';\nimport {Vec2Arg, Vec2Type, getAPI as getVec2API} from './vec2-impl';\nimport {Vec3Arg, Vec3Type, getAPI as getVec3API} from './vec3-impl';\nimport {Vec4Arg, Vec4Type, getAPI as getVec4API} from './vec4-impl';\nimport * as utils from './utils';\n\nexport {\n RotationOrder,\n utils,\n\n BaseArgType,\n\n Mat3Arg,\n Mat4Arg,\n QuatArg,\n Vec2Arg,\n Vec3Arg,\n Vec4Arg,\n\n Mat3Type,\n Mat4Type,\n QuatType,\n Vec2Type,\n Vec3Type,\n Vec4Type,\n};\n\nexport type BaseCtor = new (n: number) => T;\n\nexport type Mat3 = Mat3Type;\nexport type Mat4 = Mat4Type;\nexport type Quat = QuatType;\nexport type Vec2 = Vec2Type;\nexport type Vec3 = Vec3Type;\nexport type Vec4 = Vec4Type;\n\nexport type Mat3d = Mat3Type;\nexport type Mat4d = Mat4Type;\nexport type Quatd = QuatType;\nexport type Vec2d = Vec2Type;\nexport type Vec3d = Vec3Type;\nexport type Vec4d = Vec4Type;\n\nexport type Mat3n = Mat3Type;\nexport type Mat4n = Mat4Type;\nexport type Quatn = QuatType;\nexport type Vec2n = Vec2Type;\nexport type Vec3n = Vec3Type;\nexport type Vec4n = Vec4Type;\n\n/**\n * Generate wgpu-matrix API for type\n */\nfunction wgpuMatrixAPI<\n Mat3 extends BaseArgType,\n Mat4 extends BaseArgType,\n Quat extends BaseArgType,\n Vec2 extends BaseArgType,\n Vec3 extends BaseArgType,\n Vec4 extends BaseArgType,\n>(\n Mat3Ctor: BaseCtor,\n Mat4Ctor: BaseCtor,\n QuatCtor: BaseCtor,\n Vec2Ctor: BaseCtor,\n Vec3Ctor: BaseCtor,\n Vec4Ctor: BaseCtor,\n) {\n return {\n /** @namespace mat3 */\n mat3: getMat3API(Mat3Ctor),\n /** @namespace mat4 */\n mat4: getMat4API(Mat4Ctor),\n /** @namespace quat */\n quat: getQuatAPI(QuatCtor),\n /** @namespace vec2 */\n vec2: getVec2API(Vec2Ctor),\n /** @namespace vec3 */\n vec3: getVec3API(Vec3Ctor),\n /** @namespace vec4 */\n vec4: getVec4API(Vec4Ctor),\n };\n}\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat3,\n /**\n * 4x4 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat4,\n /**\n * Quaternion functions that default to returning `Float32Array`\n * @namespace\n */\n quat,\n /**\n * Vec2 functions that default to returning `Float32Array`\n * @namespace\n */\n vec2,\n /**\n * Vec3 functions that default to returning `Float32Array`\n * @namespace\n */\n vec3,\n /**\n * Vec3 functions that default to returning `Float32Array`\n * @namespace\n */\n vec4,\n} = wgpuMatrixAPI<\n Mat3, Mat4, Quat, Vec2, Vec3, Vec4>(\n Float32Array, Float32Array, Float32Array, Float32Array, Float32Array, Float32Array);\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat3: mat3d,\n /**\n * 4x4 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat4: mat4d,\n /**\n * Quaternion functions that default to returning `Float64Array`\n * @namespace\n */\n quat: quatd,\n /**\n * Vec2 functions that default to returning `Float64Array`\n * @namespace\n */\n vec2: vec2d,\n /**\n * Vec3 functions that default to returning `Float64Array`\n * @namespace\n */\n vec3: vec3d,\n /**\n * Vec3 functions that default to returning `Float64Array`\n * @namespace\n */\n vec4: vec4d,\n} = wgpuMatrixAPI<\n Mat3d, Mat4d, Quatd, Vec2d, Vec3d, Vec4d>(\n Float64Array, Float64Array, Float64Array, Float64Array, Float64Array, Float64Array);\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat3: mat3n,\n /**\n * 4x4 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat4: mat4n,\n /**\n * Quaternion functions that default to returning `number[]`\n * @namespace\n */\n quat: quatn,\n /**\n * Vec2 functions that default to returning `number[]`\n * @namespace\n */\n vec2: vec2n,\n /**\n * Vec3 functions that default to returning `number[]`\n * @namespace\n */\n vec3: vec3n,\n /**\n * Vec3 functions that default to returning `number[]`\n * @namespace\n */\n vec4: vec4n,\n} = wgpuMatrixAPI<\n Mat3n, Mat4n, Quatn, Vec2n, Vec3n, Vec4n>(\n ZeroArray, Array, Array, Array, Array, Array);\n"],"names":["getAPIImpl","utils.EPSILON","cache","getAPI","getVec2API","getVec3API","getMat3API","getMat4API","getQuatAPI","getVec4API"],"mappings":";AAMA,SAAS,eAAe,CACtB,mBAAsB,EACtB,QAA6C,EAAA;IAE7C,OAAO,cAAc,mBAAmB,CAAA;AACtC,QAAA,WAAA,CAAY,GAAG,IAAW,EAAA;AACxB,YAAA,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;YACf,QAAQ,CAAC,IAAuB,CAAC,CAAC;SACnC;AACG,KAAA,CAAC;AACT,CAAC;AAEM,MAAM,SAAS,GAAG,eAAe,EAAC,KAAa,GAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;;AClBvE;;;;;;;;;;;;;;;;;;;;AAoBG;AAEI,IAAI,OAAO,GAAG,QAAQ,CAAC;AAE9B;;;;AAIG;AACG,SAAU,UAAU,CAAC,CAAS,EAAA;IAClC,MAAM,GAAG,GAAG,OAAO,CAAC;IACp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,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/vec3-impl.ts","../../../src/mat3-impl.ts","../../../src/mat4-impl.ts","../../../src/quat-impl.ts","../../../src/vec4-impl.ts","../../../src/wgpu-matrix.ts"],"sourcesContent":["/**\n * A type wider than `number[]`, omitting any instance functions\n * unused by the API, e.g., map, sort. This allows the math\n * functions to operate on a wider range of array-like\n * values.\n */\nexport interface MutableNumberArray {\n readonly length: number;\n [n: number]: number;\n}\n\n/**\n * The types you can pass to most functions that take an\n * array of numbers.\n */\nexport type BaseArgType = Float32Array | Float64Array | MutableNumberArray;\n\nfunction wrapConstructor any>(\n OriginalConstructor: T,\n modifier: (instance: InstanceType) => void\n): T {\n return class extends OriginalConstructor {\n constructor(...args: any[]) {\n super(...args);\n modifier(this as InstanceType);\n }\n } as T; // Type assertion is necessary here\n}\n\nexport const ZeroArray = wrapConstructor(Array, a => a.fill(0));\n\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nexport let EPSILON = 0.000001;\n\n/**\n * Set the value for EPSILON for various checks\n * @param v - Value to use for EPSILON.\n * @returns previous value of EPSILON;\n */\nexport function setEpsilon(v: number): number {\n const old = EPSILON;\n EPSILON = v;\n return old;\n}\n\n/**\n * Convert degrees to radians\n * @param degrees - Angle in degrees\n * @returns angle converted to radians\n */\nexport function degToRad(degrees: number): number {\n return degrees * Math.PI / 180;\n}\n\n/**\n * Convert radians to degrees\n * @param radians - Angle in radians\n * @returns angle converted to degrees\n */\nexport function radToDeg(radians: number): number {\n return radians * 180 / Math.PI;\n}\n\n/**\n * Lerps between a and b via t\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @returns a + (b - a) * t\n */\nexport function lerp(a: number, b: number, t: number): number {\n return a + (b - a) * t;\n}\n\n/**\n * Compute the opposite of lerp. Given a and b and a value between\n * a and b returns a value between 0 and 1. 0 if a, 1 if b.\n * Note: no clamping is done.\n * @param a - start value\n * @param b - end value\n * @param v - value between a and b\n * @returns (v - a) / (b - a)\n */\nexport function inverseLerp(a: number, b: number, v: number): number {\n const d = b - a;\n return (Math.abs(b - a) < EPSILON)\n ? a\n : (v - a) / d;\n}\n\n/**\n * Compute the euclidean modulo\n *\n * ```\n * // table for n / 3\n * -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 <- n\n * ------------------------------------\n * -2 -1 -0 -2 -1 0, 1, 2, 0, 1, 2 <- n % 3\n * 1 2 0 1 2 0, 1, 2, 0, 1, 2 <- euclideanModule(n, 3)\n * ```\n *\n * @param n - dividend\n * @param m - divisor\n * @returns the euclidean modulo of n / m\n */\nexport function euclideanModulo(n: number, m: number) {\n return ((n % m) + m) % m;\n}","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Mat3Arg } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { Vec2Arg, Vec2Type } from './vec2';\nimport { Vec3Arg } from './vec3';\nimport { BaseArgType } from './types';\n\nexport { Vec2Arg, Vec2Type };\n\ntype Vec2Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec3\n */\nfunction getAPIImpl(Ctor: Vec2Ctor) {\n\n/**\n * Creates a Vec2; may be called with x, y, z to set initial values.\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Vec2's specified type\n * it would be faster to use\n *\n * ```\n * const v = vec2.clone(someJSArray);\n * ```\n *\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\nfunction create(x = 0, y = 0) {\n const newDst = new Ctor(2);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n }\n }\n return newDst;\n}\n\n/**\n * Creates a Vec2; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec2\n * Also see {@link vec2.create} and {@link vec2.copy}\n *\n * @param x first value\n * @param y second value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec2Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec2Arg, b: Vec2Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n\n return newDst;\n}\n\n/**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\nfunction angle(a: Vec2Arg, b: Vec2Arg): number {\n const ax = a[0];\n const ay = a[1];\n const bx = b[0];\n const by = b[1];\n const mag1 = Math.sqrt(ax * ax + ay * ay);\n const mag2 = Math.sqrt(bx * bx + by * by);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec2Arg, b: Vec2Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec2Arg, b: Vec2Arg): boolean {\n return a[0] === b[0] && a[1] === b[1];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec2Arg, b: Vec2Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec2Arg, b: Vec2Arg, t: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec2Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec2Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\nfunction cross(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const z = a[0] * b[1] - a[1] * b[0];\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = z;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec2Arg, b: Vec2Arg): number {\n return a[0] * b[0] + a[1] * b[1];\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec2Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n return Math.sqrt(v0 * v0 + v1 * v1);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec2Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n return v0 * v0 + v1 * v1;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec2Arg, b: Vec2Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return Math.sqrt(dx * dx + dy * dy);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec2Arg, b: Vec2Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return dx * dx + dy * dy;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const len = Math.sqrt(v0 * v0 + v1 * v1);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n }\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec2.clone})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec2.copy})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Creates a random unit vector * scale\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\nfunction random(scale = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const angle = Math.random() * 2 * Math.PI;\n newDst[0] = Math.cos(angle) * scale;\n newDst[1] = Math.sin(angle) * scale;\n\n return newDst;\n}\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform Vec2 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec2Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const x = v[0];\n const y = v[1];\n\n newDst[0] = x * m[0] + y * m[4] + m[12];\n newDst[1] = x * m[1] + y * m[5] + m[13];\n\n return newDst;\n}\n\n/**\n * Transforms vec4 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat3(v: Vec2Arg, m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const x = v[0];\n const y = v[1];\n\n newDst[0] = m[0] * x + m[4] * y + m[8];\n newDst[1] = m[1] * x + m[5] * y + m[9];\n\n return newDst;\n}\n\n/**\n * Rotate a 2D vector\n *\n * @param a The vec2 point to rotate\n * @param b The origin of the rotation\n * @param rad The angle of rotation in radians\n * @returns the rotated vector\n */\nfunction rotate(a: Vec2Arg, b: Vec2Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n // Translate point to the origin\n const p0 = a[0] - b[0];\n const p1 = a[1] - b[1];\n const sinC = Math.sin(rad);\n const cosC = Math.cos(rad);\n\n //perform rotation and translate to correct position\n newDst[0] = p0 * cosC - p1 * sinC + b[0];\n newDst[1] = p0 * sinC + p1 * cosC + b[1];\n\n return newDst;\n}\n\n/**\n * Treat a 2D vector as a direction and set it's length\n *\n * @param a The vec2 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec2Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec2 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec2Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat3,\n rotate,\n setLength,\n truncate,\n midpoint,\n};\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Vec2Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Vec3Arg, Vec3Type } from './vec3';\nimport { Mat3Arg } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { QuatArg } from './quat';\nimport { BaseArgType } from './types';\n\nexport { Vec3Arg, Vec3Type };\n\ntype Vec3Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec3\n * */\nfunction getAPIImpl(Ctor: Vec3Ctor) {\n\n/**\n * Creates a vec3; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number) {\n const newDst = new Ctor(3);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a vec3; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec3\n * Also see {@link vec3.create} and {@link vec3.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec3Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec3Arg, b: Vec3Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n\n return newDst;\n}\n\n/**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\nfunction angle(a: Vec3Arg, b: Vec3Arg): number {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const mag1 = Math.sqrt(ax * ax + ay * ay + az * az);\n const mag2 = Math.sqrt(bx * bx + by * by + bz * bz);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec3Arg, b: Vec3Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec3Arg, b: Vec3Arg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec3Arg, b: Vec3Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec3Arg, b: Vec3Arg, t: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec3Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec3Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\nfunction cross(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const t1 = a[2] * b[0] - a[0] * b[2];\n const t2 = a[0] * b[1] - a[1] * b[0];\n newDst[0] = a[1] * b[2] - a[2] * b[1];\n newDst[1] = t1;\n newDst[2] = t2;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec3Arg, b: Vec3Arg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]);\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec3Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec3Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return v0 * v0 + v1 * v1 + v2 * v2;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec3Arg, b: Vec3Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return Math.sqrt(dx * dx + dy * dy + dz * dz);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec3Arg, b: Vec3Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return dx * dx + dy * dy + dz * dz;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec3.clone})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec3.copy})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Creates a random vector\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\nfunction random(scale = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const angle = Math.random() * 2 * Math.PI;\n const z = Math.random() * 2 - 1;\n const zScale = Math.sqrt(1 - z * z) * scale;\n newDst[0] = Math.cos(angle) * zScale;\n newDst[1] = Math.sin(angle) * zScale;\n newDst[2] = z * scale;\n\n return newDst;\n}\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform vec3 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec3Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1;\n\n newDst[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n newDst[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n newDst[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n\n return newDst;\n}\n\n/**\n * Transform vec3 by upper 3x3 matrix inside 4x4 matrix.\n * @param v - The direction.\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns The transformed vector.\n */\nfunction transformMat4Upper3x3(v: Vec3Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[0] = v0 * m[0 * 4 + 0] + v1 * m[1 * 4 + 0] + v2 * m[2 * 4 + 0];\n newDst[1] = v0 * m[0 * 4 + 1] + v1 * m[1 * 4 + 1] + v2 * m[2 * 4 + 1];\n newDst[2] = v0 * m[0 * 4 + 2] + v1 * m[1 * 4 + 2] + v2 * m[2 * 4 + 2];\n\n return newDst;\n}\n\n/**\n * Transforms vec3 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat3(v: Vec3Arg, m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n\n newDst[0] = x * m[0] + y * m[4] + z * m[8];\n newDst[1] = x * m[1] + y * m[5] + z * m[9];\n newDst[2] = x * m[2] + y * m[6] + z * m[10];\n\n return newDst;\n}\n\n/**\n * Transforms vec3 by Quaternion\n * @param v - the vector to transform\n * @param q - the quaternion to transform by\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed\n */\nfunction transformQuat(v: Vec3Arg, q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n\n const uvX = qy * z - qz * y;\n const uvY = qz * x - qx * z;\n const uvZ = qx * y - qy * x;\n\n newDst[0] = x + uvX * w2 + (qy * uvZ - qz * uvY) * 2;\n newDst[1] = y + uvY * w2 + (qz * uvX - qx * uvZ) * 2;\n newDst[2] = z + uvZ * w2 + (qx * uvY - qy * uvX) * 2;\n\n return newDst;\n}\n\n/**\n * Returns the translation component of a 4-by-4 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\nfunction getTranslation(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n}\n/**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat4Arg, axis: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n}\n/**\n * Returns the scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the x-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\nfunction rotateX(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n //Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n //perform rotation\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad);\n\n //translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the y-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\nfunction rotateY(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n // perform rotation\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad);\n\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the z-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns {vec3} out\n */\nfunction rotateZ(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n // perform rotation\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2];\n\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Treat a 3D vector as a direction and set it's length\n *\n * @param a The vec3 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec3Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec3 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec3Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat4Upper3x3,\n transformMat3,\n transformQuat,\n getTranslation,\n getAxis,\n getScaling,\n rotateX,\n rotateY,\n rotateZ,\n setLength,\n truncate,\n midpoint,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Vec3Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nimport * as utils from './utils.js';\nimport { QuatArg } from './quat';\nimport { Mat3Arg, Mat3Type } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { Vec2Arg } from './vec2';\nimport { Vec3Arg } from './vec3';\nimport { getAPI as getVec2API } from './vec2-impl';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\n\nexport { Mat3Arg, Mat3Type };\n\ntype Mat3Ctor = new (n: number) => T;\n\n/**\n * Generates a typed API for Mat3\n * */\nfunction getAPIImpl(Ctor: Mat3Ctor) {\n const vec2 = getVec2API(Ctor);\n const vec3 = getVec3API(Ctor);\n\n/**\n * Create a Mat3 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat3's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat3.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @returns matrix created from values.\n */\nfunction create(\n v0?: number, v1?: number, v2?: number,\n v3?: number, v4?: number, v5?: number,\n v6?: number, v7?: number, v8?: number) {\n const newDst = new Ctor(12);\n // to make the array homogenous\n newDst[3] = 0;\n newDst[7] = 0;\n newDst[11] = 0;\n\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[4] = v3;\n if (v4 !== undefined) {\n newDst[5] = v4;\n if (v5 !== undefined) {\n newDst[6] = v5;\n if (v6 !== undefined) {\n newDst[8] = v6;\n if (v7 !== undefined) {\n newDst[9] = v7;\n if (v8 !== undefined) {\n newDst[10] = v8;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n\n return newDst;\n}\n\n/**\n * Sets the values of a Mat3\n * Also see {@link mat3.create} and {@link mat3.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 set from values.\n */\nfunction set(\n v0: number, v1: number, v2: number,\n v3: number, v4: number, v5: number,\n v6: number, v7: number, v8: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[0] = v0; newDst[1] = v1; newDst[ 2] = v2; newDst[ 3] = 0;\n newDst[4] = v3; newDst[5] = v4; newDst[ 6] = v5; newDst[ 7] = 0;\n newDst[8] = v6; newDst[9] = v7; newDst[10] = v8; newDst[11] = 0;\n\n return newDst;\n}\n\n/**\n * Creates a Mat3 from the upper left 3x3 part of a Mat4\n * @param m4 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from m4\n */\nfunction fromMat4(m4: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n newDst[0] = m4[0]; newDst[1] = m4[1]; newDst[ 2] = m4[ 2]; newDst[ 3] = 0;\n newDst[4] = m4[4]; newDst[5] = m4[5]; newDst[ 6] = m4[ 6]; newDst[ 7] = 0;\n newDst[8] = m4[8]; newDst[9] = m4[9]; newDst[10] = m4[10]; newDst[11] = 0;\n return newDst;\n}\n\n/**\n * Creates a Mat3 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from q\n */\nfunction fromQuat(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3];\n const x2 = x + x; const y2 = y + y; const z2 = z + z;\n\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n newDst[ 0] = 1 - yy - zz; newDst[ 1] = yx + wz; newDst[ 2] = zx - wy; newDst[ 3] = 0;\n newDst[ 4] = yx - wz; newDst[ 5] = 1 - xx - zz; newDst[ 6] = zy + wx; newDst[ 7] = 0;\n newDst[ 8] = zx + wy; newDst[ 9] = zy - wx; newDst[10] = 1 - xx - yy; newDst[11] = 0;\n\n return newDst;\n}\n\n/**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\nfunction negate(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = -m[ 0]; newDst[ 1] = -m[ 1]; newDst[ 2] = -m[ 2];\n newDst[ 4] = -m[ 4]; newDst[ 5] = -m[ 5]; newDst[ 6] = -m[ 6];\n newDst[ 8] = -m[ 8]; newDst[ 9] = -m[ 9]; newDst[10] = -m[10];\n\n return newDst;\n}\n\n/**\n * Copies a matrix. (same as {@link mat3.clone})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nfunction copy(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = m[ 0]; newDst[ 1] = m[ 1]; newDst[ 2] = m[ 2];\n newDst[ 4] = m[ 4]; newDst[ 5] = m[ 5]; newDst[ 6] = m[ 6];\n newDst[ 8] = m[ 8]; newDst[ 9] = m[ 9]; newDst[10] = m[10];\n\n return newDst;\n}\n\n/**\n * Copies a matrix (same as {@link mat3.copy})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nconst clone = copy;\n\n/**\n * Check if 2 matrices are approximately equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are approximately equal\n */\nfunction equalsApproximately(a: Mat3Arg, b: Mat3Arg): boolean {\n return Math.abs(a[ 0] - b[ 0]) < utils.EPSILON &&\n Math.abs(a[ 1] - b[ 1]) < utils.EPSILON &&\n Math.abs(a[ 2] - b[ 2]) < utils.EPSILON &&\n Math.abs(a[ 4] - b[ 4]) < utils.EPSILON &&\n Math.abs(a[ 5] - b[ 5]) < utils.EPSILON &&\n Math.abs(a[ 6] - b[ 6]) < utils.EPSILON &&\n Math.abs(a[ 8] - b[ 8]) < utils.EPSILON &&\n Math.abs(a[ 9] - b[ 9]) < utils.EPSILON &&\n Math.abs(a[10] - b[10]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 matrices are exactly equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are exactly equal\n */\nfunction equals(a: Mat3Arg, b: Mat3Arg): boolean {\n return a[ 0] === b[ 0] &&\n a[ 1] === b[ 1] &&\n a[ 2] === b[ 2] &&\n a[ 4] === b[ 4] &&\n a[ 5] === b[ 5] &&\n a[ 6] === b[ 6] &&\n a[ 8] === b[ 8] &&\n a[ 9] === b[ 9] &&\n a[10] === b[10];\n}\n\n/**\n * Creates a 3-by-3 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 3-by-3 identity matrix.\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\nfunction transpose(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n if (newDst === m) {\n let t: number;\n\n // 0 1 2\n // 4 5 6\n // 8 9 10\n\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n\n return newDst;\n }\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n newDst[ 0] = m00; newDst[ 1] = m10; newDst[ 2] = m20;\n newDst[ 4] = m01; newDst[ 5] = m11; newDst[ 6] = m21;\n newDst[ 8] = m02; newDst[ 9] = m12; newDst[10] = m22;\n\n return newDst;\n}\n\n/**\n * Computes the inverse of a 3-by-3 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nfunction inverse(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n const b01 = m22 * m11 - m12 * m21;\n const b11 = -m22 * m10 + m12 * m20;\n const b21 = m21 * m10 - m11 * m20;\n\n const invDet = 1 / (m00 * b01 + m01 * b11 + m02 * b21);\n\n newDst[ 0] = b01 * invDet;\n newDst[ 1] = (-m22 * m01 + m02 * m21) * invDet;\n newDst[ 2] = ( m12 * m01 - m02 * m11) * invDet;\n newDst[ 4] = b11 * invDet;\n newDst[ 5] = ( m22 * m00 - m02 * m20) * invDet;\n newDst[ 6] = (-m12 * m00 + m02 * m10) * invDet;\n newDst[ 8] = b21 * invDet;\n newDst[ 9] = (-m21 * m00 + m01 * m20) * invDet;\n newDst[10] = ( m11 * m00 - m01 * m10) * invDet;\n\n return newDst;\n}\n\n/**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\nfunction determinant(m: Mat3Arg): number {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n return m00 * (m11 * m22 - m21 * m12) -\n m10 * (m01 * m22 - m21 * m02) +\n m20 * (m01 * m12 - m11 * m02);\n}\n\n/**\n * Computes the inverse of a 3-by-3 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nconst invert = inverse;\n\n/**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nfunction multiply(a: Mat3Arg, b: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[ 4 + 0];\n const a11 = a[ 4 + 1];\n const a12 = a[ 4 + 2];\n const a20 = a[ 8 + 0];\n const a21 = a[ 8 + 1];\n const a22 = a[ 8 + 2];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b10 = b[ 4 + 0];\n const b11 = b[ 4 + 1];\n const b12 = b[ 4 + 2];\n const b20 = b[ 8 + 0];\n const b21 = b[ 8 + 1];\n const b22 = b[ 8 + 2];\n\n newDst[ 0] = a00 * b00 + a10 * b01 + a20 * b02;\n newDst[ 1] = a01 * b00 + a11 * b01 + a21 * b02;\n newDst[ 2] = a02 * b00 + a12 * b01 + a22 * b02;\n newDst[ 4] = a00 * b10 + a10 * b11 + a20 * b12;\n newDst[ 5] = a01 * b10 + a11 * b11 + a21 * b12;\n newDst[ 6] = a02 * b10 + a12 * b11 + a22 * b12;\n newDst[ 8] = a00 * b20 + a10 * b21 + a20 * b22;\n newDst[ 9] = a01 * b20 + a11 * b21 + a21 * b22;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22;\n\n return newDst;\n}\n\n/**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nconst mul = multiply;\n\n/**\n * Sets the translation component of a 3-by-3 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\nfunction setTranslation(a: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? identity()) as T;\n if (a !== newDst) {\n newDst[ 0] = a[ 0];\n newDst[ 1] = a[ 1];\n newDst[ 2] = a[ 2];\n newDst[ 4] = a[ 4];\n newDst[ 5] = a[ 5];\n newDst[ 6] = a[ 6];\n }\n newDst[ 8] = v[0];\n newDst[ 9] = v[1];\n newDst[10] = 1;\n return newDst;\n}\n\n/**\n * Returns the translation component of a 3-by-3 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\nfunction getTranslation(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec2.create()) as T;\n newDst[0] = m[8];\n newDst[1] = m[9];\n return newDst;\n}\n\n/**\n * Returns an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y,\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat3Arg, axis: number, dst?: T) {\n const newDst = (dst ?? vec2.create()) as T;\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n return newDst;\n}\n\n/**\n * Sets an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\nfunction setAxis(m: Mat3Arg, v: Vec2Arg, axis: number, dst?: T) {\n const newDst = (dst === m ? m : copy(m, dst)) as T;\n\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n return newDst;\n}\n\n/**\n * Returns the \"2d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec2.create());\n\n const xx = m[0];\n const xy = m[1];\n const yx = m[4];\n const yy = m[5];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy);\n newDst[1] = Math.sqrt(yx * yx + yy * yy);\n\n return newDst;\n}\n\n\n/**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction get3DScaling(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec3.create());\n\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which translates by the given vector v.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\nfunction translation(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = v[0]; newDst[ 9] = v[1]; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Translates the given 3-by-3 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\nfunction translate(m: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 0] = m00;\n newDst[ 1] = m01;\n newDst[ 2] = m02;\n newDst[ 4] = m10;\n newDst[ 5] = m11;\n newDst[ 6] = m12;\n }\n\n newDst[ 8] = m00 * v0 + m10 * v1 + m20;\n newDst[ 9] = m01 * v0 + m11 * v1 + m21;\n newDst[10] = m02 * v0 + m12 * v1 + m22;\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotation(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = s; newDst[ 2] = 0;\n newDst[ 4] = -s; newDst[ 5] = c; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix by the given angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotate(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 + s * m10;\n newDst[ 1] = c * m01 + s * m11;\n newDst[ 2] = c * m02 + s * m12;\n\n newDst[ 4] = c * m10 - s * m00;\n newDst[ 5] = c * m11 - s * m01;\n newDst[ 6] = c * m12 - s * m02;\n\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the x-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationX(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = c; newDst[ 6] = s;\n newDst[ 8] = 0; newDst[ 9] = -s; newDst[10] = c;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix around the x-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateX(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[4] = c * m10 + s * m20;\n newDst[5] = c * m11 + s * m21;\n newDst[6] = c * m12 + s * m22;\n newDst[8] = c * m20 - s * m10;\n newDst[9] = c * m21 - s * m11;\n newDst[10] = c * m22 - s * m12;\n\n if (m !== newDst) {\n newDst[ 0] = m[ 0];\n newDst[ 1] = m[ 1];\n newDst[ 2] = m[ 2];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the y-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationY(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = 0; newDst[ 2] = -s;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = s; newDst[ 9] = 0; newDst[10] = c;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix around the y-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateY(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 - s * m20;\n newDst[ 1] = c * m01 - s * m21;\n newDst[ 2] = c * m02 - s * m22;\n newDst[ 8] = c * m20 + s * m00;\n newDst[ 9] = c * m21 + s * m01;\n newDst[10] = c * m22 + s * m02;\n\n if (m !== newDst) {\n newDst[ 4] = m[ 4];\n newDst[ 5] = m[ 5];\n newDst[ 6] = m[ 6];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the z-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nconst rotationZ = rotation;\n\n/**\n * Rotates the given 3-by-3 matrix around the z-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nconst rotateZ = rotate;\n\n/**\n * Creates a 3-by-3 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has two\n * entries.\n * @param v - A vector of\n * 2 entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * two entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of 2 entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale(m: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * 3 entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling3D(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = v[2];\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of 3 entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale3D(m: Mat3Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n\n newDst[ 8] = v2 * m[2 * 4 + 0];\n newDst[ 9] = v2 * m[2 * 4 + 1];\n newDst[10] = v2 * m[2 * 4 + 2];\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales uniformly in the X and Y dimensions\n * @param s - Amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in the X and Y dimension by an amount\n * given.\n * @param m - The matrix to be modified.\n * @param s - Amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale(m: Mat3Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales uniformly in each dimension\n * @param s - Amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling3D(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = s;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given.\n * @param m - The matrix to be modified.\n * @param s - Amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale3D(m: Mat3Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n\n newDst[ 8] = s * m[2 * 4 + 0];\n newDst[ 9] = s * m[2 * 4 + 1];\n newDst[10] = s * m[2 * 4 + 2];\n\n return newDst;\n}\n\nreturn {\n clone,\n create,\n set,\n fromMat4,\n fromQuat,\n negate,\n copy,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n invert,\n determinant,\n mul,\n multiply,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n get3DScaling,\n translation,\n translate,\n rotation,\n rotate,\n rotationX,\n rotateX,\n rotationY,\n rotateY,\n rotationZ,\n rotateZ,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n scaling3D,\n scale3D,\n uniformScaling3D,\n uniformScale3D,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Mat3Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","import { Mat4Arg, Mat4Type } from './mat4';\nimport { Mat3Arg } from './mat3';\nimport { QuatArg } from './quat';\nimport { Vec3Arg } from './vec3';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\nimport * as utils from './utils';\n\nexport { Mat4Arg, Mat4Type };\n\ntype Mat4Ctor = new (n: number) => T;\n\n/**\n * Generates a typed API for Mat4\n * */\nfunction getAPIImpl(Ctor: Mat4Ctor) {\n const vec3 = getVec3API(Ctor);\n\n/**\n * 4x4 Matrix math math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new matrix. In other words you can do this\n *\n * const mat = mat4.translation([1, 2, 3]); // Creates a new translation matrix\n *\n * or\n *\n * const mat = mat4.create();\n * mat4.translation([1, 2, 3], mat); // Puts translation matrix in mat.\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always save to pass any matrix as the destination. So for example\n *\n * const mat = mat4.identity();\n * const trans = mat4.translation([1, 2, 3]);\n * mat4.multiply(mat, trans, mat); // Multiplies mat * trans and puts result in mat.\n *\n */\n\n\n/**\n * Create a Mat4 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat4's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat4.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @returns created from values.\n */\nfunction create(\n v0?: number, v1?: number, v2?: number, v3?: number,\n v4?: number, v5?: number, v6?: number, v7?: number,\n v8?: number, v9?: number, v10?: number, v11?: number,\n v12?: number, v13?: number, v14?: number, v15?: number) {\n const newDst = new Ctor(16);\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[3] = v3;\n if (v4 !== undefined) {\n newDst[4] = v4;\n if (v5 !== undefined) {\n newDst[5] = v5;\n if (v6 !== undefined) {\n newDst[6] = v6;\n if (v7 !== undefined) {\n newDst[7] = v7;\n if (v8 !== undefined) {\n newDst[8] = v8;\n if (v9 !== undefined) {\n newDst[9] = v9;\n if (v10 !== undefined) {\n newDst[10] = v10;\n if (v11 !== undefined) {\n newDst[11] = v11;\n if (v12 !== undefined) {\n newDst[12] = v12;\n if (v13 !== undefined) {\n newDst[13] = v13;\n if (v14 !== undefined) {\n newDst[14] = v14;\n if (v15 !== undefined) {\n newDst[15] = v15;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Sets the values of a Mat4\n * Also see {@link mat4.create} and {@link mat4.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 created from values.\n */\nfunction set(\n v0: number, v1: number, v2: number, v3: number,\n v4: number, v5: number, v6: number, v7: number,\n v8: number, v9: number, v10: number, v11: number,\n v12: number, v13: number, v14: number, v15: number,\n dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = v0; newDst[ 1] = v1; newDst[ 2] = v2; newDst[ 3] = v3;\n newDst[ 4] = v4; newDst[ 5] = v5; newDst[ 6] = v6; newDst[ 7] = v7;\n newDst[ 8] = v8; newDst[ 9] = v9; newDst[10] = v10; newDst[11] = v11;\n newDst[12] = v12; newDst[13] = v13; newDst[14] = v14; newDst[15] = v15;\n\n return newDst;\n}\n\n/**\n * Creates a Mat4 from a Mat3\n * @param m3 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from m3\n */\nfunction fromMat3(m3: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = m3[0]; newDst[ 1] = m3[1]; newDst[ 2] = m3[ 2]; newDst[ 3] = 0;\n newDst[ 4] = m3[4]; newDst[ 5] = m3[5]; newDst[ 6] = m3[ 6]; newDst[ 7] = 0;\n newDst[ 8] = m3[8]; newDst[ 9] = m3[9]; newDst[10] = m3[10]; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a Mat4 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from q\n */\nfunction fromQuat(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3];\n const x2 = x + x; const y2 = y + y; const z2 = z + z;\n\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n newDst[ 0] = 1 - yy - zz; newDst[ 1] = yx + wz; newDst[ 2] = zx - wy; newDst[ 3] = 0;\n newDst[ 4] = yx - wz; newDst[ 5] = 1 - xx - zz; newDst[ 6] = zy + wx; newDst[ 7] = 0;\n newDst[ 8] = zx + wy; newDst[ 9] = zy - wx; newDst[10] = 1 - xx - yy; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\nfunction negate(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = -m[ 0]; newDst[ 1] = -m[ 1]; newDst[ 2] = -m[ 2]; newDst[ 3] = -m[ 3];\n newDst[ 4] = -m[ 4]; newDst[ 5] = -m[ 5]; newDst[ 6] = -m[ 6]; newDst[ 7] = -m[ 7];\n newDst[ 8] = -m[ 8]; newDst[ 9] = -m[ 9]; newDst[10] = -m[10]; newDst[11] = -m[11];\n newDst[12] = -m[12]; newDst[13] = -m[13]; newDst[14] = -m[14]; newDst[15] = -m[15];\n\n return newDst;\n}\n\n/**\n * Copies a matrix. (same as {@link mat4.clone})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nfunction copy(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = m[ 0]; newDst[ 1] = m[ 1]; newDst[ 2] = m[ 2]; newDst[ 3] = m[ 3];\n newDst[ 4] = m[ 4]; newDst[ 5] = m[ 5]; newDst[ 6] = m[ 6]; newDst[ 7] = m[ 7];\n newDst[ 8] = m[ 8]; newDst[ 9] = m[ 9]; newDst[10] = m[10]; newDst[11] = m[11];\n newDst[12] = m[12]; newDst[13] = m[13]; newDst[14] = m[14]; newDst[15] = m[15];\n\n return newDst;\n}\n\n/**\n * Copies a matrix (same as {@link mat4.copy})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nconst clone = copy;\n\n/**\n * Check if 2 matrices are approximately equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are approximately equal\n */\nfunction equalsApproximately(a: Mat4Arg, b: Mat4Arg): boolean {\n return Math.abs(a[ 0] - b[ 0]) < utils.EPSILON &&\n Math.abs(a[ 1] - b[ 1]) < utils.EPSILON &&\n Math.abs(a[ 2] - b[ 2]) < utils.EPSILON &&\n Math.abs(a[ 3] - b[ 3]) < utils.EPSILON &&\n Math.abs(a[ 4] - b[ 4]) < utils.EPSILON &&\n Math.abs(a[ 5] - b[ 5]) < utils.EPSILON &&\n Math.abs(a[ 6] - b[ 6]) < utils.EPSILON &&\n Math.abs(a[ 7] - b[ 7]) < utils.EPSILON &&\n Math.abs(a[ 8] - b[ 8]) < utils.EPSILON &&\n Math.abs(a[ 9] - b[ 9]) < utils.EPSILON &&\n Math.abs(a[10] - b[10]) < utils.EPSILON &&\n Math.abs(a[11] - b[11]) < utils.EPSILON &&\n Math.abs(a[12] - b[12]) < utils.EPSILON &&\n Math.abs(a[13] - b[13]) < utils.EPSILON &&\n Math.abs(a[14] - b[14]) < utils.EPSILON &&\n Math.abs(a[15] - b[15]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 matrices are exactly equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are exactly equal\n */\nfunction equals(a: Mat4Arg, b: Mat4Arg): boolean {\n return a[ 0] === b[ 0] &&\n a[ 1] === b[ 1] &&\n a[ 2] === b[ 2] &&\n a[ 3] === b[ 3] &&\n a[ 4] === b[ 4] &&\n a[ 5] === b[ 5] &&\n a[ 6] === b[ 6] &&\n a[ 7] === b[ 7] &&\n a[ 8] === b[ 8] &&\n a[ 9] === b[ 9] &&\n a[10] === b[10] &&\n a[11] === b[11] &&\n a[12] === b[12] &&\n a[13] === b[13] &&\n a[14] === b[14] &&\n a[15] === b[15];\n}\n\n/**\n * Creates a 4-by-4 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 4-by-4 identity matrix.\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\nfunction transpose(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n if (newDst === m) {\n let t;\n\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n\n t = m[3];\n m[3] = m[12];\n m[12] = t;\n\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n\n t = m[7];\n m[7] = m[13];\n m[13] = t;\n\n t = m[11];\n m[11] = m[14];\n m[14] = t;\n return newDst;\n }\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n newDst[ 0] = m00; newDst[ 1] = m10; newDst[ 2] = m20; newDst[ 3] = m30;\n newDst[ 4] = m01; newDst[ 5] = m11; newDst[ 6] = m21; newDst[ 7] = m31;\n newDst[ 8] = m02; newDst[ 9] = m12; newDst[10] = m22; newDst[11] = m32;\n newDst[12] = m03; newDst[13] = m13; newDst[14] = m23; newDst[15] = m33;\n\n return newDst;\n}\n\n/**\n * Computes the inverse of a 4-by-4 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nfunction inverse(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n const tmp12 = m20 * m31;\n const tmp13 = m30 * m21;\n const tmp14 = m10 * m31;\n const tmp15 = m30 * m11;\n const tmp16 = m10 * m21;\n const tmp17 = m20 * m11;\n const tmp18 = m00 * m31;\n const tmp19 = m30 * m01;\n const tmp20 = m00 * m21;\n const tmp21 = m20 * m01;\n const tmp22 = m00 * m11;\n const tmp23 = m10 * m01;\n\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n\n const d = 1 / (m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3);\n\n newDst[ 0] = d * t0;\n newDst[ 1] = d * t1;\n newDst[ 2] = d * t2;\n newDst[ 3] = d * t3;\n newDst[ 4] = d * ((tmp1 * m10 + tmp2 * m20 + tmp5 * m30) -\n (tmp0 * m10 + tmp3 * m20 + tmp4 * m30));\n newDst[ 5] = d * ((tmp0 * m00 + tmp7 * m20 + tmp8 * m30) -\n (tmp1 * m00 + tmp6 * m20 + tmp9 * m30));\n newDst[ 6] = d * ((tmp3 * m00 + tmp6 * m10 + tmp11 * m30) -\n (tmp2 * m00 + tmp7 * m10 + tmp10 * m30));\n newDst[ 7] = d * ((tmp4 * m00 + tmp9 * m10 + tmp10 * m20) -\n (tmp5 * m00 + tmp8 * m10 + tmp11 * m20));\n newDst[ 8] = d * ((tmp12 * m13 + tmp15 * m23 + tmp16 * m33) -\n (tmp13 * m13 + tmp14 * m23 + tmp17 * m33));\n newDst[ 9] = d * ((tmp13 * m03 + tmp18 * m23 + tmp21 * m33) -\n (tmp12 * m03 + tmp19 * m23 + tmp20 * m33));\n newDst[10] = d * ((tmp14 * m03 + tmp19 * m13 + tmp22 * m33) -\n (tmp15 * m03 + tmp18 * m13 + tmp23 * m33));\n newDst[11] = d * ((tmp17 * m03 + tmp20 * m13 + tmp23 * m23) -\n (tmp16 * m03 + tmp21 * m13 + tmp22 * m23));\n newDst[12] = d * ((tmp14 * m22 + tmp17 * m32 + tmp13 * m12) -\n (tmp16 * m32 + tmp12 * m12 + tmp15 * m22));\n newDst[13] = d * ((tmp20 * m32 + tmp12 * m02 + tmp19 * m22) -\n (tmp18 * m22 + tmp21 * m32 + tmp13 * m02));\n newDst[14] = d * ((tmp18 * m12 + tmp23 * m32 + tmp15 * m02) -\n (tmp22 * m32 + tmp14 * m02 + tmp19 * m12));\n newDst[15] = d * ((tmp22 * m22 + tmp16 * m02 + tmp21 * m12) -\n (tmp20 * m12 + tmp23 * m22 + tmp17 * m02));\n\n return newDst;\n}\n\n/**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\nfunction determinant(m: Mat4Arg): number {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n\n return m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3;\n}\n\n/**\n * Computes the inverse of a 4-by-4 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nconst invert = inverse;\n\n/**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nfunction multiply(a: Mat4Arg, b: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[ 4 + 0];\n const a11 = a[ 4 + 1];\n const a12 = a[ 4 + 2];\n const a13 = a[ 4 + 3];\n const a20 = a[ 8 + 0];\n const a21 = a[ 8 + 1];\n const a22 = a[ 8 + 2];\n const a23 = a[ 8 + 3];\n const a30 = a[12 + 0];\n const a31 = a[12 + 1];\n const a32 = a[12 + 2];\n const a33 = a[12 + 3];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b03 = b[3];\n const b10 = b[ 4 + 0];\n const b11 = b[ 4 + 1];\n const b12 = b[ 4 + 2];\n const b13 = b[ 4 + 3];\n const b20 = b[ 8 + 0];\n const b21 = b[ 8 + 1];\n const b22 = b[ 8 + 2];\n const b23 = b[ 8 + 3];\n const b30 = b[12 + 0];\n const b31 = b[12 + 1];\n const b32 = b[12 + 2];\n const b33 = b[12 + 3];\n\n newDst[ 0] = a00 * b00 + a10 * b01 + a20 * b02 + a30 * b03;\n newDst[ 1] = a01 * b00 + a11 * b01 + a21 * b02 + a31 * b03;\n newDst[ 2] = a02 * b00 + a12 * b01 + a22 * b02 + a32 * b03;\n newDst[ 3] = a03 * b00 + a13 * b01 + a23 * b02 + a33 * b03;\n newDst[ 4] = a00 * b10 + a10 * b11 + a20 * b12 + a30 * b13;\n newDst[ 5] = a01 * b10 + a11 * b11 + a21 * b12 + a31 * b13;\n newDst[ 6] = a02 * b10 + a12 * b11 + a22 * b12 + a32 * b13;\n newDst[ 7] = a03 * b10 + a13 * b11 + a23 * b12 + a33 * b13;\n newDst[ 8] = a00 * b20 + a10 * b21 + a20 * b22 + a30 * b23;\n newDst[ 9] = a01 * b20 + a11 * b21 + a21 * b22 + a31 * b23;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22 + a32 * b23;\n newDst[11] = a03 * b20 + a13 * b21 + a23 * b22 + a33 * b23;\n newDst[12] = a00 * b30 + a10 * b31 + a20 * b32 + a30 * b33;\n newDst[13] = a01 * b30 + a11 * b31 + a21 * b32 + a31 * b33;\n newDst[14] = a02 * b30 + a12 * b31 + a22 * b32 + a32 * b33;\n newDst[15] = a03 * b30 + a13 * b31 + a23 * b32 + a33 * b33;\n\n return newDst;\n}\n\n/**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nconst mul = multiply;\n\n/**\n * Sets the translation component of a 4-by-4 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\nfunction setTranslation(a: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? identity()) as T;\n if (a !== newDst) {\n newDst[ 0] = a[ 0];\n newDst[ 1] = a[ 1];\n newDst[ 2] = a[ 2];\n newDst[ 3] = a[ 3];\n newDst[ 4] = a[ 4];\n newDst[ 5] = a[ 5];\n newDst[ 6] = a[ 6];\n newDst[ 7] = a[ 7];\n newDst[ 8] = a[ 8];\n newDst[ 9] = a[ 9];\n newDst[10] = a[10];\n newDst[11] = a[11];\n }\n newDst[12] = v[0];\n newDst[13] = v[1];\n newDst[14] = v[2];\n newDst[15] = 1;\n return newDst;\n}\n\n///**\n// * Returns the translation component of a 4-by-4 matrix as a vector with 3\n// * entries.\n// * @param m - The matrix.\n// * @param dst - vector to hold result. If not passed a new one is created.\n// * @returns The translation component of m.\n// */\nfunction getTranslation(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? vec3.create()) as T;\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n}\n\n/**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat4Arg, axis: number, dst?: T) {\n const newDst = (dst ?? vec3.create());\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n}\n\n/**\n * Sets an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\nfunction setAxis(m: Mat4Arg, v: Vec3Arg, axis: number, dst: T) {\n const newDst = (dst === m) ? dst : copy(m, dst);\n\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n newDst[off + 2] = v[2];\n return newDst;\n}\n\n/**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? vec3.create()) as T;\n\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 0 to 1 in the z dimension.\n *\n * Note: If you pass `Infinity` for zFar then it will produce a projection matrix\n * returns -Infinity for Z when transforming coordinates with Z <= 0 and +Infinity for Z\n * otherwise.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */\nfunction perspective(fieldOfViewYInRadians: number, aspect: number, zNear: number, zFar: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const f = Math.tan(Math.PI * 0.5 - 0.5 * fieldOfViewYInRadians);\n\n newDst[0] = f / aspect;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n newDst[4] = 0;\n newDst[5] = f;\n newDst[6] = 0;\n newDst[7] = 0;\n\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[11] = -1;\n\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (Number.isFinite(zFar)) {\n const rangeInv = 1 / (zNear - zFar);\n newDst[10] = zFar * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n } else {\n newDst[10] = -1;\n newDst[14] = -zNear;\n }\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 1 (at -zNear) to 0 (at -zFar) in the z dimension.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane. (default = Infinity)\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */function perspectiveReverseZ(fieldOfViewYInRadians: number, aspect: number, zNear: number, zFar = Infinity, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const f = 1 / Math.tan(fieldOfViewYInRadians * 0.5);\n\n newDst[ 0] = f / aspect;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n\n newDst[ 4] = 0;\n newDst[ 5] = f;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n\n newDst[ 8] = 0;\n newDst[ 9] = 0;\n newDst[11] = -1;\n\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (zFar === Infinity) {\n newDst[10] = 0;\n newDst[14] = zNear;\n } else {\n const rangeInv = 1 / (zFar - zNear);\n newDst[10] = zNear * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n }\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 orthogonal transformation matrix that transforms from\n * the given the left, right, bottom, and top dimensions to -1 +1 in x, and y\n * and 0 to +1 in z.\n * @param left - Left side of the near clipping plane viewport.\n * @param right - Right side of the near clipping plane viewport.\n * @param bottom - Bottom of the near clipping plane viewport.\n * @param top - Top of the near clipping plane viewport.\n * @param near - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param far - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The orthographic projection matrix.\n */\nfunction ortho(left: number, right: number, bottom: number, top: number, near: number, far: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[0] = 2 / (right - left);\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n newDst[4] = 0;\n newDst[5] = 2 / (top - bottom);\n newDst[6] = 0;\n newDst[7] = 0;\n\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[10] = 1 / (near - far);\n newDst[11] = 0;\n\n newDst[12] = (right + left) / (left - right);\n newDst[13] = (top + bottom) / (bottom - top);\n newDst[14] = near / (near - far);\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 0 to 1 in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\nfunction frustum(left: number, right: number, bottom: number, top: number, near: number, far: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const dx = (right - left);\n const dy = (top - bottom);\n const dz = (near - far);\n\n newDst[ 0] = 2 * near / dx;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n newDst[ 4] = 0;\n newDst[ 5] = 2 * near / dy;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n newDst[ 8] = (left + right) / dx;\n newDst[ 9] = (top + bottom) / dy;\n newDst[10] = far / dz;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = near * far / dz;\n newDst[15] = 0;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 1 (-near) to 0 (-far) in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\nfunction frustumReverseZ(left: number, right: number, bottom: number, top: number, near: number, far = Infinity, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const dx = (right - left);\n const dy = (top - bottom);\n\n newDst[ 0] = 2 * near / dx;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n newDst[ 4] = 0;\n newDst[ 5] = 2 * near / dy;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n newDst[ 8] = (left + right) / dx;\n newDst[ 9] = (top + bottom) / dy;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (far === Infinity) {\n newDst[10] = 0;\n newDst[14] = near;\n } else {\n const rangeInv = 1 / (far - near);\n newDst[10] = near * rangeInv;\n newDst[14] = far * near * rangeInv;\n }\n\n return newDst;\n}\n\nconst xAxis = vec3.create();\nconst yAxis = vec3.create();\nconst zAxis = vec3.create();\n\n/**\n * Computes a 4-by-4 aim transformation.\n *\n * This is a matrix which positions an object aiming down positive Z.\n * toward the target.\n *\n * Note: this is **NOT** the inverse of lookAt as lookAt looks at negative Z.\n *\n * @param position - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\nfunction aim(position: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(target, position, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = xAxis[1]; newDst[ 2] = xAxis[2]; newDst[ 3] = 0;\n newDst[ 4] = yAxis[0]; newDst[ 5] = yAxis[1]; newDst[ 6] = yAxis[2]; newDst[ 7] = 0;\n newDst[ 8] = zAxis[0]; newDst[ 9] = zAxis[1]; newDst[10] = zAxis[2]; newDst[11] = 0;\n newDst[12] = position[0]; newDst[13] = position[1]; newDst[14] = position[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 camera aim transformation.\n *\n * This is a matrix which positions an object aiming down negative Z.\n * toward the target.\n *\n * Note: this is the inverse of `lookAt`\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\nfunction cameraAim(eye: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = xAxis[1]; newDst[ 2] = xAxis[2]; newDst[ 3] = 0;\n newDst[ 4] = yAxis[0]; newDst[ 5] = yAxis[1]; newDst[ 6] = yAxis[2]; newDst[ 7] = 0;\n newDst[ 8] = zAxis[0]; newDst[ 9] = zAxis[1]; newDst[10] = zAxis[2]; newDst[11] = 0;\n newDst[12] = eye[0]; newDst[13] = eye[1]; newDst[14] = eye[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 view transformation.\n *\n * This is a view matrix which transforms all other objects\n * to be in the space of the view defined by the parameters.\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The look-at matrix.\n */\nfunction lookAt(eye: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = yAxis[0]; newDst[ 2] = zAxis[0]; newDst[ 3] = 0;\n newDst[ 4] = xAxis[1]; newDst[ 5] = yAxis[1]; newDst[ 6] = zAxis[1]; newDst[ 7] = 0;\n newDst[ 8] = xAxis[2]; newDst[ 9] = yAxis[2]; newDst[10] = zAxis[2]; newDst[11] = 0;\n\n newDst[12] = -(xAxis[0] * eye[0] + xAxis[1] * eye[1] + xAxis[2] * eye[2]);\n newDst[13] = -(yAxis[0] * eye[0] + yAxis[1] * eye[1] + yAxis[2] * eye[2]);\n newDst[14] = -(zAxis[0] * eye[0] + zAxis[1] * eye[1] + zAxis[2] * eye[2]);\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which translates by the given vector v.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\nfunction translation(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = v[0]; newDst[13] = v[1]; newDst[14] = v[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Translates the given 4-by-4 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\nfunction translate(m: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n if (m !== newDst) {\n newDst[ 0] = m00;\n newDst[ 1] = m01;\n newDst[ 2] = m02;\n newDst[ 3] = m03;\n newDst[ 4] = m10;\n newDst[ 5] = m11;\n newDst[ 6] = m12;\n newDst[ 7] = m13;\n newDst[ 8] = m20;\n newDst[ 9] = m21;\n newDst[10] = m22;\n newDst[11] = m23;\n }\n\n newDst[12] = m00 * v0 + m10 * v1 + m20 * v2 + m30;\n newDst[13] = m01 * v0 + m11 * v1 + m21 * v2 + m31;\n newDst[14] = m02 * v0 + m12 * v1 + m22 * v2 + m32;\n newDst[15] = m03 * v0 + m13 * v1 + m23 * v2 + m33;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the x-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationX(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = c; newDst[ 6] = s; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = -s; newDst[10] = c; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the x-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateX(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[4] = c * m10 + s * m20;\n newDst[5] = c * m11 + s * m21;\n newDst[6] = c * m12 + s * m22;\n newDst[7] = c * m13 + s * m23;\n newDst[8] = c * m20 - s * m10;\n newDst[9] = c * m21 - s * m11;\n newDst[10] = c * m22 - s * m12;\n newDst[11] = c * m23 - s * m13;\n\n if (m !== newDst) {\n newDst[ 0] = m[ 0];\n newDst[ 1] = m[ 1];\n newDst[ 2] = m[ 2];\n newDst[ 3] = m[ 3];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the y-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationY(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = 0; newDst[ 2] = -s; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = s; newDst[ 9] = 0; newDst[10] = c; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the y-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateY(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 - s * m20;\n newDst[ 1] = c * m01 - s * m21;\n newDst[ 2] = c * m02 - s * m22;\n newDst[ 3] = c * m03 - s * m23;\n newDst[ 8] = c * m20 + s * m00;\n newDst[ 9] = c * m21 + s * m01;\n newDst[10] = c * m22 + s * m02;\n newDst[11] = c * m23 + s * m03;\n\n if (m !== newDst) {\n newDst[ 4] = m[ 4];\n newDst[ 5] = m[ 5];\n newDst[ 6] = m[ 6];\n newDst[ 7] = m[ 7];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the z-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationZ(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = s; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = -s; newDst[ 5] = c; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the z-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateZ(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 + s * m10;\n newDst[ 1] = c * m01 + s * m11;\n newDst[ 2] = c * m02 + s * m12;\n newDst[ 3] = c * m03 + s * m13;\n newDst[ 4] = c * m10 - s * m00;\n newDst[ 5] = c * m11 - s * m01;\n newDst[ 6] = c * m12 - s * m02;\n newDst[ 7] = c * m13 - s * m03;\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n newDst[11] = m[11];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\nfunction axisRotation(axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n\n newDst[ 0] = xx + (1 - xx) * c;\n newDst[ 1] = x * y * oneMinusCosine + z * s;\n newDst[ 2] = x * z * oneMinusCosine - y * s;\n newDst[ 3] = 0;\n newDst[ 4] = x * y * oneMinusCosine - z * s;\n newDst[ 5] = yy + (1 - yy) * c;\n newDst[ 6] = y * z * oneMinusCosine + x * s;\n newDst[ 7] = 0;\n newDst[ 8] = x * z * oneMinusCosine + y * s;\n newDst[ 9] = y * z * oneMinusCosine - x * s;\n newDst[10] = zz + (1 - zz) * c;\n newDst[11] = 0;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = 0;\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle. (same as axisRotation)\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\nconst rotation = axisRotation;\n\n/**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle.\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction axisRotate(m: Mat4Arg, axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n\n const r00 = xx + (1 - xx) * c;\n const r01 = x * y * oneMinusCosine + z * s;\n const r02 = x * z * oneMinusCosine - y * s;\n const r10 = x * y * oneMinusCosine - z * s;\n const r11 = yy + (1 - yy) * c;\n const r12 = y * z * oneMinusCosine + x * s;\n const r20 = x * z * oneMinusCosine + y * s;\n const r21 = y * z * oneMinusCosine - x * s;\n const r22 = zz + (1 - zz) * c;\n\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n\n newDst[ 0] = r00 * m00 + r01 * m10 + r02 * m20;\n newDst[ 1] = r00 * m01 + r01 * m11 + r02 * m21;\n newDst[ 2] = r00 * m02 + r01 * m12 + r02 * m22;\n newDst[ 3] = r00 * m03 + r01 * m13 + r02 * m23;\n newDst[ 4] = r10 * m00 + r11 * m10 + r12 * m20;\n newDst[ 5] = r10 * m01 + r11 * m11 + r12 * m21;\n newDst[ 6] = r10 * m02 + r11 * m12 + r12 * m22;\n newDst[ 7] = r10 * m03 + r11 * m13 + r12 * m23;\n newDst[ 8] = r20 * m00 + r21 * m10 + r22 * m20;\n newDst[ 9] = r20 * m01 + r21 * m11 + r22 * m21;\n newDst[10] = r20 * m02 + r21 * m12 + r22 * m22;\n newDst[11] = r20 * m03 + r21 * m13 + r22 * m23;\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle. (same as rotate)\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nconst rotate = axisRotate;\n\n/**\n * Creates a 4-by-4 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * three entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = v[2]; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 4-by-4 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of three entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale(m: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n newDst[ 3] = v0 * m[0 * 4 + 3];\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n newDst[ 7] = v1 * m[1 * 4 + 3];\n newDst[ 8] = v2 * m[2 * 4 + 0];\n newDst[ 9] = v2 * m[2 * 4 + 1];\n newDst[10] = v2 * m[2 * 4 + 2];\n newDst[11] = v2 * m[2 * 4 + 3];\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which scales a uniform amount in each dimension.\n * @param s - the amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = s; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 4-by-4 matrix in each dimension by a uniform scale.\n * @param m - The matrix to be modified.\n * @param s - The amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale(m: Mat4Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n newDst[ 3] = s * m[0 * 4 + 3];\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n newDst[ 7] = s * m[1 * 4 + 3];\n newDst[ 8] = s * m[2 * 4 + 0];\n newDst[ 9] = s * m[2 * 4 + 1];\n newDst[10] = s * m[2 * 4 + 2];\n newDst[11] = s * m[2 * 4 + 3];\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\nreturn {\n create,\n set,\n fromMat3,\n fromQuat,\n negate,\n copy,\n clone,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n determinant,\n invert,\n multiply,\n mul,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n perspective,\n perspectiveReverseZ,\n ortho,\n frustum,\n frustumReverseZ,\n aim,\n cameraAim,\n lookAt,\n translation,\n translate,\n rotationX,\n rotateX,\n rotationY,\n rotateY,\n rotationZ,\n rotateZ,\n axisRotation,\n rotation,\n axisRotate,\n rotate,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n};\n\n}\n\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Mat4Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { QuatArg, QuatType } from './quat';\nimport { Mat3Arg } from './mat3.js';\nimport { Mat4Arg } from './mat4.js';\nimport { Vec3Arg } from './vec3.js';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\n\nexport { QuatArg, QuatType };\n\ntype QuatCtor = new (n: number) => T;\n\nexport type RotationOrder = 'xyz' | 'xzy' | 'yxz' | 'yzx' | 'zxy' | 'zyx';\n\n/**\n * Generates am typed API for Qud\n * */\nfunction getAPIImpl(Ctor: QuatCtor) {\n const vec3 = getVec3API(Ctor);\n\n/**\n * Creates a quat4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number, w?: number) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a Quat; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Quat\n * Also see {@link quat.create} and {@link quat.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, w: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n\n return newDst;\n}\n\n/**\n * Sets a quaternion from the given angle and axis,\n * then returns it.\n *\n * @param axis - the axis to rotate around\n * @param angleInRadians - the angle\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The quaternion that represents the given axis and angle\n **/\nfunction fromAxisAngle(axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n const s = Math.sin(halfAngle);\n\n newDst[0] = s * axis[0];\n newDst[1] = s * axis[1];\n newDst[2] = s * axis[2];\n newDst[3] = Math.cos(halfAngle);\n\n return newDst;\n}\n\n/**\n * Gets the rotation axis and angle\n * @param q - quaternion to compute from\n * @param dst - Vec3 to hold result. If not passed in a new one is created.\n * @return angle and axis\n */\nfunction toAxisAngle(q: QuatArg, dst?: T): { angle: number, axis: T } {\n const newDst = (dst ?? vec3.create(3)) as T;\n\n const angle = Math.acos(q[3]) * 2;\n const s = Math.sin(angle * 0.5);\n if (s > utils.EPSILON) {\n newDst[0] = q[0] / s;\n newDst[1] = q[1] / s;\n newDst[2] = q[2] / s;\n } else {\n newDst[0] = 1;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n\n return { angle, axis: newDst };\n}\n\n/**\n * Returns the angle in degrees between two rotations a and b.\n * @param a - quaternion a\n * @param b - quaternion b\n * @return angle in radians between the two quaternions\n */\nfunction angle(a: QuatArg, b: QuatArg) {\n const d = dot(a, b);\n return Math.acos(2 * d * d - 1);\n}\n\n/**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction multiply(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const bw = b[3];\n\n newDst[0] = ax * bw + aw * bx + ay * bz - az * by;\n newDst[1] = ay * bw + aw * by + az * bx - ax * bz;\n newDst[2] = az * bw + aw * bz + ax * by - ay * bx;\n newDst[3] = aw * bw - ax * bx - ay * by - az * bz;\n\n return newDst;\n}\n\n/**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nconst mul = multiply;\n\n/**\n * Rotates the given quaternion around the X axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateX(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const bx = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw + qw * bx;\n newDst[1] = qy * bw + qz * bx;\n newDst[2] = qz * bw - qy * bx;\n newDst[3] = qw * bw - qx * bx;\n\n return newDst;\n}\n\n/**\n * Rotates the given quaternion around the Y axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateY(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const by = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw - qz * by;\n newDst[1] = qy * bw + qw * by;\n newDst[2] = qz * bw + qx * by;\n newDst[3] = qw * bw - qy * by;\n\n return newDst;\n}\n\n/**\n * Rotates the given quaternion around the Z axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateZ(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const bz = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw + qy * bz;\n newDst[1] = qy * bw - qx * bz;\n newDst[2] = qz * bw + qw * bz;\n newDst[3] = qw * bw - qz * bz;\n\n return newDst;\n}\n\n/**\n * Spherically linear interpolate between two quaternions\n *\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction slerp(a: QuatArg, b: QuatArg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n\n let bx = b[0];\n let by = b[1];\n let bz = b[2];\n let bw = b[3];\n\n let cosOmega = ax * bx + ay * by + az * bz + aw * bw;\n\n if (cosOmega < 0) {\n cosOmega = -cosOmega;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n\n let scale0;\n let scale1;\n\n if (1.0 - cosOmega > utils.EPSILON) {\n const omega = Math.acos(cosOmega);\n const sinOmega = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinOmega;\n scale1 = Math.sin(t * omega) / sinOmega;\n } else {\n scale0 = 1.0 - t;\n scale1 = t;\n }\n\n newDst[0] = scale0 * ax + scale1 * bx;\n newDst[1] = scale0 * ay + scale1 * by;\n newDst[2] = scale0 * az + scale1 * bz;\n newDst[3] = scale0 * aw + scale1 * bw;\n\n return newDst;\n}\n\n/**\n * Compute the inverse of a quaternion\n *\n * @param q - quaternion to compute the inverse of\n * @returns A quaternion that is the result of a * b\n */\nfunction inverse(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const a0 = q[0];\n const a1 = q[1];\n const a2 = q[2];\n const a3 = q[3];\n\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n\n newDst[0] = -a0 * invDot;\n newDst[1] = -a1 * invDot;\n newDst[2] = -a2 * invDot;\n newDst[3] = a3 * invDot;\n\n return newDst;\n}\n\n/**\n * Compute the conjugate of a quaternion\n * For quaternions with a magnitude of 1 (a unit quaternion)\n * this returns the same as the inverse but is faster to calculate.\n *\n * @param q - quaternion to compute the conjugate of.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The conjugate of q\n */\nfunction conjugate(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = -q[0];\n newDst[1] = -q[1];\n newDst[2] = -q[2];\n newDst[3] = q[3];\n\n return newDst;\n}\n\n/**\n * Creates a quaternion from the given rotation matrix.\n *\n * The created quaternion is not normalized.\n *\n * @param m - rotation matrix\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\nfunction fromMat(m: Mat3Arg | Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n /*\n 0 1 2\n 3 4 5\n 6 7 8\n\n 0 1 2\n 4 5 6\n 8 9 10\n */\n\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n const trace = m[0] + m[5] + m[10];\n\n if (trace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n const root = Math.sqrt(trace + 1); // 2w\n newDst[3] = 0.5 * root;\n const invRoot = 0.5 / root; // 1/(4w)\n\n newDst[0] = (m[6] - m[9]) * invRoot;\n newDst[1] = (m[8] - m[2]) * invRoot;\n newDst[2] = (m[1] - m[4]) * invRoot;\n } else {\n // |w| <= 1/2\n let i = 0;\n\n if (m[5] > m[0]) {\n i = 1;\n }\n if (m[10] > m[i * 4 + i]) {\n i = 2;\n }\n\n const j = (i + 1) % 3;\n const k = (i + 2) % 3;\n\n const root = Math.sqrt(m[i * 4 + i] - m[j * 4 + j] - m[k * 4 + k] + 1.0);\n newDst[i] = 0.5 * root;\n\n const invRoot = 0.5 / root;\n\n newDst[3] = (m[j * 4 + k] - m[k * 4 + j]) * invRoot;\n newDst[j] = (m[j * 4 + i] + m[i * 4 + j]) * invRoot;\n newDst[k] = (m[k * 4 + i] + m[i * 4 + k]) * invRoot;\n }\n\n return newDst;\n}\n\n/**\n * Creates a quaternion from the given euler angle x, y, z using the provided intrinsic order for the conversion.\n *\n * @param xAngleInRadians - angle to rotate around X axis in radians.\n * @param yAngleInRadians - angle to rotate around Y axis in radians.\n * @param zAngleInRadians - angle to rotate around Z axis in radians.\n * @param order - order to apply euler angles\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion representing the same rotation as the euler angles applied in the given order\n */\nfunction fromEuler(\n xAngleInRadians: number,\n yAngleInRadians: number,\n zAngleInRadians: number,\n order: RotationOrder,\n dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const xHalfAngle = xAngleInRadians * 0.5;\n const yHalfAngle = yAngleInRadians * 0.5;\n const zHalfAngle = zAngleInRadians * 0.5;\n\n const sx = Math.sin(xHalfAngle);\n const cx = Math.cos(xHalfAngle);\n const sy = Math.sin(yHalfAngle);\n const cy = Math.cos(yHalfAngle);\n const sz = Math.sin(zHalfAngle);\n const cz = Math.cos(zHalfAngle);\n\n switch (order) {\n case 'xyz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'xzy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n case 'yxz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n case 'yzx':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'zxy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'zyx':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n default:\n throw new Error(`Unknown rotation order: ${order}`);\n }\n\n return newDst;\n}\n\n/**\n * Copies a quaternion. (same as {@link quat.clone})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is a copy of q\n */\nfunction copy(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = q[0];\n newDst[1] = q[1];\n newDst[2] = q[2];\n newDst[3] = q[3];\n\n return newDst;\n}\n\n/**\n * Clones a quaternion. (same as {@link quat.copy})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A copy of q.\n */\nconst clone = copy;\n\n/**\n * Adds two quaternions; assumes a and b have the same dimension.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the sum of a and b.\n */\nfunction add(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\nfunction subtract(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Multiplies a quaternion by a scalar.\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nfunction mulScalar(v: QuatArg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a quaternion by a scalar. (same as mulScalar)\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nfunction divScalar(v: QuatArg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two quaternions\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns dot product\n */\nfunction dot(a: QuatArg, b: QuatArg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n}\n\n/**\n * Performs linear interpolation on two quaternions.\n * Given quaternions a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param t - Interpolation coefficient.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: QuatArg, b: QuatArg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Computes the length of quaternion\n * @param v - quaternion.\n * @returns length of quaternion.\n */\nfunction length(v: QuatArg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n}\n\n/**\n * Computes the length of quaternion (same as length)\n * @param v - quaternion.\n * @returns length of quaternion.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of quaternion\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\nfunction lengthSq(v: QuatArg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n}\n\n/**\n * Computes the square of the length of quaternion (same as lengthSq)\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\nconst lenSq = lengthSq;\n\n/**\n * Divides a quaternion by its Euclidean length and returns the quotient.\n * @param v - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The normalized quaternion.\n */\nfunction normalize(v: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n }\n\n return newDst;\n}\n\n/**\n * Check if 2 quaternions are approximately equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are approximately equal\n */\nfunction equalsApproximately(a: QuatArg, b: QuatArg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON &&\n Math.abs(a[3] - b[3]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 quaternions are exactly equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are exactly equal\n */\nfunction equals(a: QuatArg, b: QuatArg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Creates an identity quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns an identity quaternion\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n\n return newDst;\n}\n\nconst tempVec3 = vec3.create();\nconst xUnitVec3 = vec3.create();\nconst yUnitVec3 = vec3.create();\n\n/**\n * Computes a quaternion to represent the shortest rotation from one vector to another.\n *\n * @param aUnit - the start vector\n * @param bUnit - the end vector\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\nfunction rotationTo(aUnit: Vec3Arg, bUnit: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const dot = vec3.dot(aUnit, bUnit);\n if (dot < -0.999999) {\n vec3.cross(xUnitVec3, aUnit, tempVec3);\n if (vec3.len(tempVec3) < 0.000001) {\n vec3.cross(yUnitVec3, aUnit, tempVec3);\n }\n\n vec3.normalize(tempVec3, tempVec3);\n fromAxisAngle(tempVec3, Math.PI, newDst);\n\n return newDst;\n } else if (dot > 0.999999) {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n\n return newDst;\n } else {\n vec3.cross(aUnit, bUnit, tempVec3);\n\n newDst[0] = tempVec3[0];\n newDst[1] = tempVec3[1];\n newDst[2] = tempVec3[2];\n newDst[3] = 1 + dot;\n\n return normalize(newDst, newDst);\n }\n}\n\nconst tempQuat1 = new Ctor(4);\nconst tempQuat2 = new Ctor(4);\n\n/**\n * Performs a spherical linear interpolation with two control points\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param c - the third quaternion\n * @param d - the fourth quaternion\n * @param t - Interpolation coefficient 0 to 1\n * @returns result\n */\nfunction sqlerp(\n a: QuatArg,\n b: QuatArg,\n c: QuatArg,\n d: QuatArg,\n t: number,\n dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n slerp(a, d, t, tempQuat1);\n slerp(b, c, t, tempQuat2);\n slerp(tempQuat1, tempQuat2, 2 * t * (1 - t), newDst);\n\n return newDst;\n}\n\nreturn {\n create,\n fromValues,\n set,\n fromAxisAngle,\n toAxisAngle,\n angle,\n multiply,\n mul,\n rotateX,\n rotateY,\n rotateZ,\n slerp,\n inverse,\n conjugate,\n fromMat,\n fromEuler,\n copy,\n clone,\n add,\n subtract,\n sub,\n mulScalar,\n scale,\n divScalar,\n dot,\n lerp,\n length,\n len,\n lengthSq,\n lenSq,\n normalize,\n equalsApproximately,\n equals,\n identity,\n rotationTo,\n sqlerp,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\n/**\n *\n * Quat4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Quat4`. In other words you can do this\n *\n * const v = quat4.cross(v1, v2); // Creates a new Quat4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = quat4.create();\n * quat4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * quat4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nexport function getAPI(Ctor: QuatCtor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Vec4Arg, Vec4Type } from './vec4';\nimport { Mat4Arg } from './mat4';\nimport { BaseArgType } from './types';\n\nexport { Vec4Arg, Vec4Type };\n\ntype Vec4Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec4\n * */\nfunction getAPIImpl(Ctor: Vec4Ctor) {\n\n/**\n * Creates a vec4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number, w?: number) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a vec4; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec4\n * Also see {@link vec4.create} and {@link vec4.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, w: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n newDst[3] = Math.ceil(v[3]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n newDst[3] = Math.floor(v[3]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n newDst[3] = Math.round(v[3]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec4Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n newDst[3] = Math.min(max, Math.max(min, v[3]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec4Arg, b: Vec4Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n newDst[3] = a[3] + b[3] * scale;\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec4Arg, b: Vec4Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON &&\n Math.abs(a[3] - b[3]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec4Arg, b: Vec4Arg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec4Arg, b: Vec4Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec4Arg, b: Vec4Arg, t: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n newDst[3] = a[3] + t[3] * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n newDst[3] = Math.max(a[3], b[3]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n newDst[3] = Math.min(a[3], b[3]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec4Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec4Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n newDst[3] = 1 / v[3];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the dot product of two vectors\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec4Arg, b: Vec4Arg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec4Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec4Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec4Arg, b: Vec4Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec4Arg, b: Vec4Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return dx * dx + dy * dy + dz * dz + dw * dw;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n }\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n newDst[3] = -v[3];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec4.clone})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n newDst[3] = v[3];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec4.copy})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n newDst[3] = a[3] * b[3];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n newDst[3] = a[3] / b[3];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform vec4 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec4 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec4Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = v[3];\n\n newDst[0] = m[0] * x + m[4] * y + m[ 8] * z + m[12] * w;\n newDst[1] = m[1] * x + m[5] * y + m[ 9] * z + m[13] * w;\n newDst[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n newDst[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n\n return newDst;\n}\n\n\n/**\n * Treat a 4D vector as a direction and set it's length\n *\n * @param a The vec4 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec4Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec4 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec4Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n zero,\n transformMat4,\n setLength,\n truncate,\n midpoint,\n};\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\n/**\n *\n * Vec4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Vec4`. In other words you can do this\n *\n * const v = vec4.cross(v1, v2); // Creates a new Vec4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = vec4.create();\n * vec4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * vec4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nexport function getAPI(Ctor: Vec4Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n\n","/**\n * Some docs\n * @namespace wgpu-matrix\n */\nimport {MutableNumberArray, 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 MutableNumberArray,\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"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825d2ba 100644 --- a/dist/3.x/wgpu-matrix.module.min.js.map +++ b/dist/3.x/wgpu-matrix.module.min.js.map @@ -1 +1 @@ -{"version":3,"file":"wgpu-matrix.module.min.js","sources":["../../../src/types.ts","../../../src/utils.ts","../../../src/vec2-impl.ts","../../../src/vec3-impl.ts","../../../src/mat3-impl.ts","../../../src/mat4-impl.ts","../../../src/quat-impl.ts","../../../src/vec4-impl.ts","../../../src/wgpu-matrix.ts"],"sourcesContent":["/**\n * The types you can pass to most functions that take an\n * array of numbers.\n */\nexport type BaseArgType = Float32Array | Float64Array | number[];\n\nfunction wrapConstructor any>(\n OriginalConstructor: T,\n modifier: (instance: InstanceType) => void\n): T {\n return class extends OriginalConstructor {\n constructor(...args: any[]) {\n super(...args);\n modifier(this as InstanceType);\n }\n } as T; // Type assertion is necessary here\n}\n\nexport const ZeroArray = wrapConstructor(Array, a => a.fill(0));\n\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nexport let EPSILON = 0.000001;\n\n/**\n * Set the value for EPSILON for various checks\n * @param v - Value to use for EPSILON.\n * @returns previous value of EPSILON;\n */\nexport function setEpsilon(v: number): number {\n const old = EPSILON;\n EPSILON = v;\n return old;\n}\n\n/**\n * Convert degrees to radians\n * @param degrees - Angle in degrees\n * @returns angle converted to radians\n */\nexport function degToRad(degrees: number): number {\n return degrees * Math.PI / 180;\n}\n\n/**\n * Convert radians to degrees\n * @param radians - Angle in radians\n * @returns angle converted to degrees\n */\nexport function radToDeg(radians: number): number {\n return radians * 180 / Math.PI;\n}\n\n/**\n * Lerps between a and b via t\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @returns a + (b - a) * t\n */\nexport function lerp(a: number, b: number, t: number): number {\n return a + (b - a) * t;\n}\n\n/**\n * Compute the opposite of lerp. Given a and b and a value between\n * a and b returns a value between 0 and 1. 0 if a, 1 if b.\n * Note: no clamping is done.\n * @param a - start value\n * @param b - end value\n * @param v - value between a and b\n * @returns (v - a) / (b - a)\n */\nexport function inverseLerp(a: number, b: number, v: number): number {\n const d = b - a;\n return (Math.abs(b - a) < EPSILON)\n ? a\n : (v - a) / d;\n}\n\n/**\n * Compute the euclidean modulo\n *\n * ```\n * // table for n / 3\n * -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 <- n\n * ------------------------------------\n * -2 -1 -0 -2 -1 0, 1, 2, 0, 1, 2 <- n % 3\n * 1 2 0 1 2 0, 1, 2, 0, 1, 2 <- euclideanModule(n, 3)\n * ```\n *\n * @param n - dividend\n * @param m - divisor\n * @returns the euclidean modulo of n / m\n */\nexport function euclideanModulo(n: number, m: number) {\n return ((n % m) + m) % m;\n}","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Mat3Arg } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { Vec2Arg, Vec2Type } from './vec2';\nimport { Vec3Arg } from './vec3';\nimport { BaseArgType } from './types';\n\nexport { Vec2Arg, Vec2Type };\n\ntype Vec2Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec3\n */\nfunction getAPIImpl(Ctor: Vec2Ctor) {\n\n/**\n * Creates a Vec2; may be called with x, y, z to set initial values.\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Vec2's specified type\n * it would be faster to use\n *\n * ```\n * const v = vec2.clone(someJSArray);\n * ```\n *\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\nfunction create(x = 0, y = 0) {\n const newDst = new Ctor(2);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n }\n }\n return newDst;\n}\n\n/**\n * Creates a Vec2; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec2\n * Also see {@link vec2.create} and {@link vec2.copy}\n *\n * @param x first value\n * @param y second value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec2Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec2Arg, b: Vec2Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n\n return newDst;\n}\n\n/**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\nfunction angle(a: Vec2Arg, b: Vec2Arg): number {\n const ax = a[0];\n const ay = a[1];\n const bx = b[0];\n const by = b[1];\n const mag1 = Math.sqrt(ax * ax + ay * ay);\n const mag2 = Math.sqrt(bx * bx + by * by);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec2Arg, b: Vec2Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec2Arg, b: Vec2Arg): boolean {\n return a[0] === b[0] && a[1] === b[1];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec2Arg, b: Vec2Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec2Arg, b: Vec2Arg, t: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec2Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec2Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\nfunction cross(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const z = a[0] * b[1] - a[1] * b[0];\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = z;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec2Arg, b: Vec2Arg): number {\n return a[0] * b[0] + a[1] * b[1];\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec2Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n return Math.sqrt(v0 * v0 + v1 * v1);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec2Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n return v0 * v0 + v1 * v1;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec2Arg, b: Vec2Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return Math.sqrt(dx * dx + dy * dy);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec2Arg, b: Vec2Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return dx * dx + dy * dy;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const len = Math.sqrt(v0 * v0 + v1 * v1);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n }\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec2.clone})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec2.copy})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Creates a random unit vector * scale\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\nfunction random(scale = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const angle = Math.random() * 2 * Math.PI;\n newDst[0] = Math.cos(angle) * scale;\n newDst[1] = Math.sin(angle) * scale;\n\n return newDst;\n}\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform Vec2 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec2Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const x = v[0];\n const y = v[1];\n\n newDst[0] = x * m[0] + y * m[4] + m[12];\n newDst[1] = x * m[1] + y * m[5] + m[13];\n\n return newDst;\n}\n\n/**\n * Transforms vec4 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat3(v: Vec2Arg, m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const x = v[0];\n const y = v[1];\n\n newDst[0] = m[0] * x + m[4] * y + m[8];\n newDst[1] = m[1] * x + m[5] * y + m[9];\n\n return newDst;\n}\n\n/**\n * Rotate a 2D vector\n *\n * @param a The vec2 point to rotate\n * @param b The origin of the rotation\n * @param rad The angle of rotation in radians\n * @returns the rotated vector\n */\nfunction rotate(a: Vec2Arg, b: Vec2Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n // Translate point to the origin\n const p0 = a[0] - b[0];\n const p1 = a[1] - b[1];\n const sinC = Math.sin(rad);\n const cosC = Math.cos(rad);\n\n //perform rotation and translate to correct position\n newDst[0] = p0 * cosC - p1 * sinC + b[0];\n newDst[1] = p0 * sinC + p1 * cosC + b[1];\n\n return newDst;\n}\n\n/**\n * Treat a 2D vector as a direction and set it's length\n *\n * @param a The vec2 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec2Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec2 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec2Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat3,\n rotate,\n setLength,\n truncate,\n midpoint,\n};\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Vec2Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Vec3Arg, Vec3Type } from './vec3';\nimport { Mat3Arg } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { QuatArg } from './quat';\nimport { BaseArgType } from './types';\n\nexport { Vec3Arg, Vec3Type };\n\ntype Vec3Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec3\n * */\nfunction getAPIImpl(Ctor: Vec3Ctor) {\n\n/**\n * Creates a vec3; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number) {\n const newDst = new Ctor(3);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a vec3; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec3\n * Also see {@link vec3.create} and {@link vec3.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec3Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec3Arg, b: Vec3Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n\n return newDst;\n}\n\n/**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\nfunction angle(a: Vec3Arg, b: Vec3Arg): number {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const mag1 = Math.sqrt(ax * ax + ay * ay + az * az);\n const mag2 = Math.sqrt(bx * bx + by * by + bz * bz);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec3Arg, b: Vec3Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec3Arg, b: Vec3Arg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec3Arg, b: Vec3Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec3Arg, b: Vec3Arg, t: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec3Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec3Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\nfunction cross(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const t1 = a[2] * b[0] - a[0] * b[2];\n const t2 = a[0] * b[1] - a[1] * b[0];\n newDst[0] = a[1] * b[2] - a[2] * b[1];\n newDst[1] = t1;\n newDst[2] = t2;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec3Arg, b: Vec3Arg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]);\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec3Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec3Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return v0 * v0 + v1 * v1 + v2 * v2;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec3Arg, b: Vec3Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return Math.sqrt(dx * dx + dy * dy + dz * dz);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec3Arg, b: Vec3Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return dx * dx + dy * dy + dz * dz;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec3.clone})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec3.copy})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Creates a random vector\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\nfunction random(scale = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const angle = Math.random() * 2 * Math.PI;\n const z = Math.random() * 2 - 1;\n const zScale = Math.sqrt(1 - z * z) * scale;\n newDst[0] = Math.cos(angle) * zScale;\n newDst[1] = Math.sin(angle) * zScale;\n newDst[2] = z * scale;\n\n return newDst;\n}\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform vec3 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec3Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1;\n\n newDst[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n newDst[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n newDst[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n\n return newDst;\n}\n\n/**\n * Transform vec3 by upper 3x3 matrix inside 4x4 matrix.\n * @param v - The direction.\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns The transformed vector.\n */\nfunction transformMat4Upper3x3(v: Vec3Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[0] = v0 * m[0 * 4 + 0] + v1 * m[1 * 4 + 0] + v2 * m[2 * 4 + 0];\n newDst[1] = v0 * m[0 * 4 + 1] + v1 * m[1 * 4 + 1] + v2 * m[2 * 4 + 1];\n newDst[2] = v0 * m[0 * 4 + 2] + v1 * m[1 * 4 + 2] + v2 * m[2 * 4 + 2];\n\n return newDst;\n}\n\n/**\n * Transforms vec3 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat3(v: Vec3Arg, m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n\n newDst[0] = x * m[0] + y * m[4] + z * m[8];\n newDst[1] = x * m[1] + y * m[5] + z * m[9];\n newDst[2] = x * m[2] + y * m[6] + z * m[10];\n\n return newDst;\n}\n\n/**\n * Transforms vec3 by Quaternion\n * @param v - the vector to transform\n * @param q - the quaternion to transform by\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed\n */\nfunction transformQuat(v: Vec3Arg, q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n\n const uvX = qy * z - qz * y;\n const uvY = qz * x - qx * z;\n const uvZ = qx * y - qy * x;\n\n newDst[0] = x + uvX * w2 + (qy * uvZ - qz * uvY) * 2;\n newDst[1] = y + uvY * w2 + (qz * uvX - qx * uvZ) * 2;\n newDst[2] = z + uvZ * w2 + (qx * uvY - qy * uvX) * 2;\n\n return newDst;\n}\n\n/**\n * Returns the translation component of a 4-by-4 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\nfunction getTranslation(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n}\n/**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat4Arg, axis: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n}\n/**\n * Returns the scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the x-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\nfunction rotateX(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n //Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n //perform rotation\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad);\n\n //translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the y-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\nfunction rotateY(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n // perform rotation\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad);\n\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the z-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns {vec3} out\n */\nfunction rotateZ(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n // perform rotation\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2];\n\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Treat a 3D vector as a direction and set it's length\n *\n * @param a The vec3 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec3Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec3 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec3Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat4Upper3x3,\n transformMat3,\n transformQuat,\n getTranslation,\n getAxis,\n getScaling,\n rotateX,\n rotateY,\n rotateZ,\n setLength,\n truncate,\n midpoint,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Vec3Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nimport * as utils from './utils.js';\nimport { QuatArg } from './quat';\nimport { Mat3Arg, Mat3Type } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { Vec2Arg } from './vec2';\nimport { Vec3Arg } from './vec3';\nimport { getAPI as getVec2API } from './vec2-impl';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\n\nexport { Mat3Arg, Mat3Type };\n\ntype Mat3Ctor = new (n: number) => T;\n\n/**\n * Generates a typed API for Mat3\n * */\nfunction getAPIImpl(Ctor: Mat3Ctor) {\n const vec2 = getVec2API(Ctor);\n const vec3 = getVec3API(Ctor);\n\n/**\n * Create a Mat3 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat3's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat3.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @returns matrix created from values.\n */\nfunction create(\n v0?: number, v1?: number, v2?: number,\n v3?: number, v4?: number, v5?: number,\n v6?: number, v7?: number, v8?: number) {\n const newDst = new Ctor(12);\n // to make the array homogenous\n newDst[3] = 0;\n newDst[7] = 0;\n newDst[11] = 0;\n\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[4] = v3;\n if (v4 !== undefined) {\n newDst[5] = v4;\n if (v5 !== undefined) {\n newDst[6] = v5;\n if (v6 !== undefined) {\n newDst[8] = v6;\n if (v7 !== undefined) {\n newDst[9] = v7;\n if (v8 !== undefined) {\n newDst[10] = v8;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n\n return newDst;\n}\n\n/**\n * Sets the values of a Mat3\n * Also see {@link mat3.create} and {@link mat3.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 set from values.\n */\nfunction set(\n v0: number, v1: number, v2: number,\n v3: number, v4: number, v5: number,\n v6: number, v7: number, v8: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[0] = v0; newDst[1] = v1; newDst[ 2] = v2; newDst[ 3] = 0;\n newDst[4] = v3; newDst[5] = v4; newDst[ 6] = v5; newDst[ 7] = 0;\n newDst[8] = v6; newDst[9] = v7; newDst[10] = v8; newDst[11] = 0;\n\n return newDst;\n}\n\n/**\n * Creates a Mat3 from the upper left 3x3 part of a Mat4\n * @param m4 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from m4\n */\nfunction fromMat4(m4: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n newDst[0] = m4[0]; newDst[1] = m4[1]; newDst[ 2] = m4[ 2]; newDst[ 3] = 0;\n newDst[4] = m4[4]; newDst[5] = m4[5]; newDst[ 6] = m4[ 6]; newDst[ 7] = 0;\n newDst[8] = m4[8]; newDst[9] = m4[9]; newDst[10] = m4[10]; newDst[11] = 0;\n return newDst;\n}\n\n/**\n * Creates a Mat3 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from q\n */\nfunction fromQuat(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3];\n const x2 = x + x; const y2 = y + y; const z2 = z + z;\n\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n newDst[ 0] = 1 - yy - zz; newDst[ 1] = yx + wz; newDst[ 2] = zx - wy; newDst[ 3] = 0;\n newDst[ 4] = yx - wz; newDst[ 5] = 1 - xx - zz; newDst[ 6] = zy + wx; newDst[ 7] = 0;\n newDst[ 8] = zx + wy; newDst[ 9] = zy - wx; newDst[10] = 1 - xx - yy; newDst[11] = 0;\n\n return newDst;\n}\n\n/**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\nfunction negate(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = -m[ 0]; newDst[ 1] = -m[ 1]; newDst[ 2] = -m[ 2];\n newDst[ 4] = -m[ 4]; newDst[ 5] = -m[ 5]; newDst[ 6] = -m[ 6];\n newDst[ 8] = -m[ 8]; newDst[ 9] = -m[ 9]; newDst[10] = -m[10];\n\n return newDst;\n}\n\n/**\n * Copies a matrix. (same as {@link mat3.clone})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nfunction copy(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = m[ 0]; newDst[ 1] = m[ 1]; newDst[ 2] = m[ 2];\n newDst[ 4] = m[ 4]; newDst[ 5] = m[ 5]; newDst[ 6] = m[ 6];\n newDst[ 8] = m[ 8]; newDst[ 9] = m[ 9]; newDst[10] = m[10];\n\n return newDst;\n}\n\n/**\n * Copies a matrix (same as {@link mat3.copy})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nconst clone = copy;\n\n/**\n * Check if 2 matrices are approximately equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are approximately equal\n */\nfunction equalsApproximately(a: Mat3Arg, b: Mat3Arg): boolean {\n return Math.abs(a[ 0] - b[ 0]) < utils.EPSILON &&\n Math.abs(a[ 1] - b[ 1]) < utils.EPSILON &&\n Math.abs(a[ 2] - b[ 2]) < utils.EPSILON &&\n Math.abs(a[ 4] - b[ 4]) < utils.EPSILON &&\n Math.abs(a[ 5] - b[ 5]) < utils.EPSILON &&\n Math.abs(a[ 6] - b[ 6]) < utils.EPSILON &&\n Math.abs(a[ 8] - b[ 8]) < utils.EPSILON &&\n Math.abs(a[ 9] - b[ 9]) < utils.EPSILON &&\n Math.abs(a[10] - b[10]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 matrices are exactly equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are exactly equal\n */\nfunction equals(a: Mat3Arg, b: Mat3Arg): boolean {\n return a[ 0] === b[ 0] &&\n a[ 1] === b[ 1] &&\n a[ 2] === b[ 2] &&\n a[ 4] === b[ 4] &&\n a[ 5] === b[ 5] &&\n a[ 6] === b[ 6] &&\n a[ 8] === b[ 8] &&\n a[ 9] === b[ 9] &&\n a[10] === b[10];\n}\n\n/**\n * Creates a 3-by-3 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 3-by-3 identity matrix.\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\nfunction transpose(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n if (newDst === m) {\n let t: number;\n\n // 0 1 2\n // 4 5 6\n // 8 9 10\n\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n\n return newDst;\n }\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n newDst[ 0] = m00; newDst[ 1] = m10; newDst[ 2] = m20;\n newDst[ 4] = m01; newDst[ 5] = m11; newDst[ 6] = m21;\n newDst[ 8] = m02; newDst[ 9] = m12; newDst[10] = m22;\n\n return newDst;\n}\n\n/**\n * Computes the inverse of a 3-by-3 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nfunction inverse(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n const b01 = m22 * m11 - m12 * m21;\n const b11 = -m22 * m10 + m12 * m20;\n const b21 = m21 * m10 - m11 * m20;\n\n const invDet = 1 / (m00 * b01 + m01 * b11 + m02 * b21);\n\n newDst[ 0] = b01 * invDet;\n newDst[ 1] = (-m22 * m01 + m02 * m21) * invDet;\n newDst[ 2] = ( m12 * m01 - m02 * m11) * invDet;\n newDst[ 4] = b11 * invDet;\n newDst[ 5] = ( m22 * m00 - m02 * m20) * invDet;\n newDst[ 6] = (-m12 * m00 + m02 * m10) * invDet;\n newDst[ 8] = b21 * invDet;\n newDst[ 9] = (-m21 * m00 + m01 * m20) * invDet;\n newDst[10] = ( m11 * m00 - m01 * m10) * invDet;\n\n return newDst;\n}\n\n/**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\nfunction determinant(m: Mat3Arg): number {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n return m00 * (m11 * m22 - m21 * m12) -\n m10 * (m01 * m22 - m21 * m02) +\n m20 * (m01 * m12 - m11 * m02);\n}\n\n/**\n * Computes the inverse of a 3-by-3 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nconst invert = inverse;\n\n/**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nfunction multiply(a: Mat3Arg, b: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[ 4 + 0];\n const a11 = a[ 4 + 1];\n const a12 = a[ 4 + 2];\n const a20 = a[ 8 + 0];\n const a21 = a[ 8 + 1];\n const a22 = a[ 8 + 2];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b10 = b[ 4 + 0];\n const b11 = b[ 4 + 1];\n const b12 = b[ 4 + 2];\n const b20 = b[ 8 + 0];\n const b21 = b[ 8 + 1];\n const b22 = b[ 8 + 2];\n\n newDst[ 0] = a00 * b00 + a10 * b01 + a20 * b02;\n newDst[ 1] = a01 * b00 + a11 * b01 + a21 * b02;\n newDst[ 2] = a02 * b00 + a12 * b01 + a22 * b02;\n newDst[ 4] = a00 * b10 + a10 * b11 + a20 * b12;\n newDst[ 5] = a01 * b10 + a11 * b11 + a21 * b12;\n newDst[ 6] = a02 * b10 + a12 * b11 + a22 * b12;\n newDst[ 8] = a00 * b20 + a10 * b21 + a20 * b22;\n newDst[ 9] = a01 * b20 + a11 * b21 + a21 * b22;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22;\n\n return newDst;\n}\n\n/**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nconst mul = multiply;\n\n/**\n * Sets the translation component of a 3-by-3 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\nfunction setTranslation(a: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? identity()) as T;\n if (a !== newDst) {\n newDst[ 0] = a[ 0];\n newDst[ 1] = a[ 1];\n newDst[ 2] = a[ 2];\n newDst[ 4] = a[ 4];\n newDst[ 5] = a[ 5];\n newDst[ 6] = a[ 6];\n }\n newDst[ 8] = v[0];\n newDst[ 9] = v[1];\n newDst[10] = 1;\n return newDst;\n}\n\n/**\n * Returns the translation component of a 3-by-3 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\nfunction getTranslation(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec2.create()) as T;\n newDst[0] = m[8];\n newDst[1] = m[9];\n return newDst;\n}\n\n/**\n * Returns an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y,\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat3Arg, axis: number, dst?: T) {\n const newDst = (dst ?? vec2.create()) as T;\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n return newDst;\n}\n\n/**\n * Sets an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\nfunction setAxis(m: Mat3Arg, v: Vec2Arg, axis: number, dst?: T) {\n const newDst = (dst === m ? m : copy(m, dst)) as T;\n\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n return newDst;\n}\n\n/**\n * Returns the \"2d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec2.create());\n\n const xx = m[0];\n const xy = m[1];\n const yx = m[4];\n const yy = m[5];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy);\n newDst[1] = Math.sqrt(yx * yx + yy * yy);\n\n return newDst;\n}\n\n\n/**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction get3DScaling(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec3.create());\n\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which translates by the given vector v.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\nfunction translation(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = v[0]; newDst[ 9] = v[1]; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Translates the given 3-by-3 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\nfunction translate(m: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 0] = m00;\n newDst[ 1] = m01;\n newDst[ 2] = m02;\n newDst[ 4] = m10;\n newDst[ 5] = m11;\n newDst[ 6] = m12;\n }\n\n newDst[ 8] = m00 * v0 + m10 * v1 + m20;\n newDst[ 9] = m01 * v0 + m11 * v1 + m21;\n newDst[10] = m02 * v0 + m12 * v1 + m22;\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotation(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = s; newDst[ 2] = 0;\n newDst[ 4] = -s; newDst[ 5] = c; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix by the given angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotate(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 + s * m10;\n newDst[ 1] = c * m01 + s * m11;\n newDst[ 2] = c * m02 + s * m12;\n\n newDst[ 4] = c * m10 - s * m00;\n newDst[ 5] = c * m11 - s * m01;\n newDst[ 6] = c * m12 - s * m02;\n\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the x-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationX(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = c; newDst[ 6] = s;\n newDst[ 8] = 0; newDst[ 9] = -s; newDst[10] = c;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix around the x-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateX(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[4] = c * m10 + s * m20;\n newDst[5] = c * m11 + s * m21;\n newDst[6] = c * m12 + s * m22;\n newDst[8] = c * m20 - s * m10;\n newDst[9] = c * m21 - s * m11;\n newDst[10] = c * m22 - s * m12;\n\n if (m !== newDst) {\n newDst[ 0] = m[ 0];\n newDst[ 1] = m[ 1];\n newDst[ 2] = m[ 2];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the y-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationY(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = 0; newDst[ 2] = -s;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = s; newDst[ 9] = 0; newDst[10] = c;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix around the y-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateY(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 - s * m20;\n newDst[ 1] = c * m01 - s * m21;\n newDst[ 2] = c * m02 - s * m22;\n newDst[ 8] = c * m20 + s * m00;\n newDst[ 9] = c * m21 + s * m01;\n newDst[10] = c * m22 + s * m02;\n\n if (m !== newDst) {\n newDst[ 4] = m[ 4];\n newDst[ 5] = m[ 5];\n newDst[ 6] = m[ 6];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the z-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nconst rotationZ = rotation;\n\n/**\n * Rotates the given 3-by-3 matrix around the z-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nconst rotateZ = rotate;\n\n/**\n * Creates a 3-by-3 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has two\n * entries.\n * @param v - A vector of\n * 2 entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * two entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of 2 entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale(m: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * 3 entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling3D(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = v[2];\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of 3 entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale3D(m: Mat3Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n\n newDst[ 8] = v2 * m[2 * 4 + 0];\n newDst[ 9] = v2 * m[2 * 4 + 1];\n newDst[10] = v2 * m[2 * 4 + 2];\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales uniformly in the X and Y dimensions\n * @param s - Amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in the X and Y dimension by an amount\n * given.\n * @param m - The matrix to be modified.\n * @param s - Amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale(m: Mat3Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales uniformly in each dimension\n * @param s - Amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling3D(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = s;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given.\n * @param m - The matrix to be modified.\n * @param s - Amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale3D(m: Mat3Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n\n newDst[ 8] = s * m[2 * 4 + 0];\n newDst[ 9] = s * m[2 * 4 + 1];\n newDst[10] = s * m[2 * 4 + 2];\n\n return newDst;\n}\n\nreturn {\n clone,\n create,\n set,\n fromMat4,\n fromQuat,\n negate,\n copy,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n invert,\n determinant,\n mul,\n multiply,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n get3DScaling,\n translation,\n translate,\n rotation,\n rotate,\n rotationX,\n rotateX,\n rotationY,\n rotateY,\n rotationZ,\n rotateZ,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n scaling3D,\n scale3D,\n uniformScaling3D,\n uniformScale3D,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Mat3Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","import { Mat4Arg, Mat4Type } from './mat4';\nimport { Mat3Arg } from './mat3';\nimport { QuatArg } from './quat';\nimport { Vec3Arg } from './vec3';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\nimport * as utils from './utils';\n\nexport { Mat4Arg, Mat4Type };\n\ntype Mat4Ctor = new (n: number) => T;\n\n/**\n * Generates a typed API for Mat4\n * */\nfunction getAPIImpl(Ctor: Mat4Ctor) {\n const vec3 = getVec3API(Ctor);\n\n/**\n * 4x4 Matrix math math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new matrix. In other words you can do this\n *\n * const mat = mat4.translation([1, 2, 3]); // Creates a new translation matrix\n *\n * or\n *\n * const mat = mat4.create();\n * mat4.translation([1, 2, 3], mat); // Puts translation matrix in mat.\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always save to pass any matrix as the destination. So for example\n *\n * const mat = mat4.identity();\n * const trans = mat4.translation([1, 2, 3]);\n * mat4.multiply(mat, trans, mat); // Multiplies mat * trans and puts result in mat.\n *\n */\n\n\n/**\n * Create a Mat4 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat4's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat4.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @returns created from values.\n */\nfunction create(\n v0?: number, v1?: number, v2?: number, v3?: number,\n v4?: number, v5?: number, v6?: number, v7?: number,\n v8?: number, v9?: number, v10?: number, v11?: number,\n v12?: number, v13?: number, v14?: number, v15?: number) {\n const newDst = new Ctor(16);\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[3] = v3;\n if (v4 !== undefined) {\n newDst[4] = v4;\n if (v5 !== undefined) {\n newDst[5] = v5;\n if (v6 !== undefined) {\n newDst[6] = v6;\n if (v7 !== undefined) {\n newDst[7] = v7;\n if (v8 !== undefined) {\n newDst[8] = v8;\n if (v9 !== undefined) {\n newDst[9] = v9;\n if (v10 !== undefined) {\n newDst[10] = v10;\n if (v11 !== undefined) {\n newDst[11] = v11;\n if (v12 !== undefined) {\n newDst[12] = v12;\n if (v13 !== undefined) {\n newDst[13] = v13;\n if (v14 !== undefined) {\n newDst[14] = v14;\n if (v15 !== undefined) {\n newDst[15] = v15;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Sets the values of a Mat4\n * Also see {@link mat4.create} and {@link mat4.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 created from values.\n */\nfunction set(\n v0: number, v1: number, v2: number, v3: number,\n v4: number, v5: number, v6: number, v7: number,\n v8: number, v9: number, v10: number, v11: number,\n v12: number, v13: number, v14: number, v15: number,\n dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = v0; newDst[ 1] = v1; newDst[ 2] = v2; newDst[ 3] = v3;\n newDst[ 4] = v4; newDst[ 5] = v5; newDst[ 6] = v6; newDst[ 7] = v7;\n newDst[ 8] = v8; newDst[ 9] = v9; newDst[10] = v10; newDst[11] = v11;\n newDst[12] = v12; newDst[13] = v13; newDst[14] = v14; newDst[15] = v15;\n\n return newDst;\n}\n\n/**\n * Creates a Mat4 from a Mat3\n * @param m3 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from m3\n */\nfunction fromMat3(m3: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = m3[0]; newDst[ 1] = m3[1]; newDst[ 2] = m3[ 2]; newDst[ 3] = 0;\n newDst[ 4] = m3[4]; newDst[ 5] = m3[5]; newDst[ 6] = m3[ 6]; newDst[ 7] = 0;\n newDst[ 8] = m3[8]; newDst[ 9] = m3[9]; newDst[10] = m3[10]; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a Mat4 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from q\n */\nfunction fromQuat(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3];\n const x2 = x + x; const y2 = y + y; const z2 = z + z;\n\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n newDst[ 0] = 1 - yy - zz; newDst[ 1] = yx + wz; newDst[ 2] = zx - wy; newDst[ 3] = 0;\n newDst[ 4] = yx - wz; newDst[ 5] = 1 - xx - zz; newDst[ 6] = zy + wx; newDst[ 7] = 0;\n newDst[ 8] = zx + wy; newDst[ 9] = zy - wx; newDst[10] = 1 - xx - yy; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\nfunction negate(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = -m[ 0]; newDst[ 1] = -m[ 1]; newDst[ 2] = -m[ 2]; newDst[ 3] = -m[ 3];\n newDst[ 4] = -m[ 4]; newDst[ 5] = -m[ 5]; newDst[ 6] = -m[ 6]; newDst[ 7] = -m[ 7];\n newDst[ 8] = -m[ 8]; newDst[ 9] = -m[ 9]; newDst[10] = -m[10]; newDst[11] = -m[11];\n newDst[12] = -m[12]; newDst[13] = -m[13]; newDst[14] = -m[14]; newDst[15] = -m[15];\n\n return newDst;\n}\n\n/**\n * Copies a matrix. (same as {@link mat4.clone})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nfunction copy(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = m[ 0]; newDst[ 1] = m[ 1]; newDst[ 2] = m[ 2]; newDst[ 3] = m[ 3];\n newDst[ 4] = m[ 4]; newDst[ 5] = m[ 5]; newDst[ 6] = m[ 6]; newDst[ 7] = m[ 7];\n newDst[ 8] = m[ 8]; newDst[ 9] = m[ 9]; newDst[10] = m[10]; newDst[11] = m[11];\n newDst[12] = m[12]; newDst[13] = m[13]; newDst[14] = m[14]; newDst[15] = m[15];\n\n return newDst;\n}\n\n/**\n * Copies a matrix (same as {@link mat4.copy})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nconst clone = copy;\n\n/**\n * Check if 2 matrices are approximately equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are approximately equal\n */\nfunction equalsApproximately(a: Mat4Arg, b: Mat4Arg): boolean {\n return Math.abs(a[ 0] - b[ 0]) < utils.EPSILON &&\n Math.abs(a[ 1] - b[ 1]) < utils.EPSILON &&\n Math.abs(a[ 2] - b[ 2]) < utils.EPSILON &&\n Math.abs(a[ 3] - b[ 3]) < utils.EPSILON &&\n Math.abs(a[ 4] - b[ 4]) < utils.EPSILON &&\n Math.abs(a[ 5] - b[ 5]) < utils.EPSILON &&\n Math.abs(a[ 6] - b[ 6]) < utils.EPSILON &&\n Math.abs(a[ 7] - b[ 7]) < utils.EPSILON &&\n Math.abs(a[ 8] - b[ 8]) < utils.EPSILON &&\n Math.abs(a[ 9] - b[ 9]) < utils.EPSILON &&\n Math.abs(a[10] - b[10]) < utils.EPSILON &&\n Math.abs(a[11] - b[11]) < utils.EPSILON &&\n Math.abs(a[12] - b[12]) < utils.EPSILON &&\n Math.abs(a[13] - b[13]) < utils.EPSILON &&\n Math.abs(a[14] - b[14]) < utils.EPSILON &&\n Math.abs(a[15] - b[15]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 matrices are exactly equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are exactly equal\n */\nfunction equals(a: Mat4Arg, b: Mat4Arg): boolean {\n return a[ 0] === b[ 0] &&\n a[ 1] === b[ 1] &&\n a[ 2] === b[ 2] &&\n a[ 3] === b[ 3] &&\n a[ 4] === b[ 4] &&\n a[ 5] === b[ 5] &&\n a[ 6] === b[ 6] &&\n a[ 7] === b[ 7] &&\n a[ 8] === b[ 8] &&\n a[ 9] === b[ 9] &&\n a[10] === b[10] &&\n a[11] === b[11] &&\n a[12] === b[12] &&\n a[13] === b[13] &&\n a[14] === b[14] &&\n a[15] === b[15];\n}\n\n/**\n * Creates a 4-by-4 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 4-by-4 identity matrix.\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\nfunction transpose(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n if (newDst === m) {\n let t;\n\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n\n t = m[3];\n m[3] = m[12];\n m[12] = t;\n\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n\n t = m[7];\n m[7] = m[13];\n m[13] = t;\n\n t = m[11];\n m[11] = m[14];\n m[14] = t;\n return newDst;\n }\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n newDst[ 0] = m00; newDst[ 1] = m10; newDst[ 2] = m20; newDst[ 3] = m30;\n newDst[ 4] = m01; newDst[ 5] = m11; newDst[ 6] = m21; newDst[ 7] = m31;\n newDst[ 8] = m02; newDst[ 9] = m12; newDst[10] = m22; newDst[11] = m32;\n newDst[12] = m03; newDst[13] = m13; newDst[14] = m23; newDst[15] = m33;\n\n return newDst;\n}\n\n/**\n * Computes the inverse of a 4-by-4 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nfunction inverse(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n const tmp12 = m20 * m31;\n const tmp13 = m30 * m21;\n const tmp14 = m10 * m31;\n const tmp15 = m30 * m11;\n const tmp16 = m10 * m21;\n const tmp17 = m20 * m11;\n const tmp18 = m00 * m31;\n const tmp19 = m30 * m01;\n const tmp20 = m00 * m21;\n const tmp21 = m20 * m01;\n const tmp22 = m00 * m11;\n const tmp23 = m10 * m01;\n\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n\n const d = 1 / (m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3);\n\n newDst[ 0] = d * t0;\n newDst[ 1] = d * t1;\n newDst[ 2] = d * t2;\n newDst[ 3] = d * t3;\n newDst[ 4] = d * ((tmp1 * m10 + tmp2 * m20 + tmp5 * m30) -\n (tmp0 * m10 + tmp3 * m20 + tmp4 * m30));\n newDst[ 5] = d * ((tmp0 * m00 + tmp7 * m20 + tmp8 * m30) -\n (tmp1 * m00 + tmp6 * m20 + tmp9 * m30));\n newDst[ 6] = d * ((tmp3 * m00 + tmp6 * m10 + tmp11 * m30) -\n (tmp2 * m00 + tmp7 * m10 + tmp10 * m30));\n newDst[ 7] = d * ((tmp4 * m00 + tmp9 * m10 + tmp10 * m20) -\n (tmp5 * m00 + tmp8 * m10 + tmp11 * m20));\n newDst[ 8] = d * ((tmp12 * m13 + tmp15 * m23 + tmp16 * m33) -\n (tmp13 * m13 + tmp14 * m23 + tmp17 * m33));\n newDst[ 9] = d * ((tmp13 * m03 + tmp18 * m23 + tmp21 * m33) -\n (tmp12 * m03 + tmp19 * m23 + tmp20 * m33));\n newDst[10] = d * ((tmp14 * m03 + tmp19 * m13 + tmp22 * m33) -\n (tmp15 * m03 + tmp18 * m13 + tmp23 * m33));\n newDst[11] = d * ((tmp17 * m03 + tmp20 * m13 + tmp23 * m23) -\n (tmp16 * m03 + tmp21 * m13 + tmp22 * m23));\n newDst[12] = d * ((tmp14 * m22 + tmp17 * m32 + tmp13 * m12) -\n (tmp16 * m32 + tmp12 * m12 + tmp15 * m22));\n newDst[13] = d * ((tmp20 * m32 + tmp12 * m02 + tmp19 * m22) -\n (tmp18 * m22 + tmp21 * m32 + tmp13 * m02));\n newDst[14] = d * ((tmp18 * m12 + tmp23 * m32 + tmp15 * m02) -\n (tmp22 * m32 + tmp14 * m02 + tmp19 * m12));\n newDst[15] = d * ((tmp22 * m22 + tmp16 * m02 + tmp21 * m12) -\n (tmp20 * m12 + tmp23 * m22 + tmp17 * m02));\n\n return newDst;\n}\n\n/**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\nfunction determinant(m: Mat4Arg): number {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n\n return m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3;\n}\n\n/**\n * Computes the inverse of a 4-by-4 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nconst invert = inverse;\n\n/**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nfunction multiply(a: Mat4Arg, b: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[ 4 + 0];\n const a11 = a[ 4 + 1];\n const a12 = a[ 4 + 2];\n const a13 = a[ 4 + 3];\n const a20 = a[ 8 + 0];\n const a21 = a[ 8 + 1];\n const a22 = a[ 8 + 2];\n const a23 = a[ 8 + 3];\n const a30 = a[12 + 0];\n const a31 = a[12 + 1];\n const a32 = a[12 + 2];\n const a33 = a[12 + 3];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b03 = b[3];\n const b10 = b[ 4 + 0];\n const b11 = b[ 4 + 1];\n const b12 = b[ 4 + 2];\n const b13 = b[ 4 + 3];\n const b20 = b[ 8 + 0];\n const b21 = b[ 8 + 1];\n const b22 = b[ 8 + 2];\n const b23 = b[ 8 + 3];\n const b30 = b[12 + 0];\n const b31 = b[12 + 1];\n const b32 = b[12 + 2];\n const b33 = b[12 + 3];\n\n newDst[ 0] = a00 * b00 + a10 * b01 + a20 * b02 + a30 * b03;\n newDst[ 1] = a01 * b00 + a11 * b01 + a21 * b02 + a31 * b03;\n newDst[ 2] = a02 * b00 + a12 * b01 + a22 * b02 + a32 * b03;\n newDst[ 3] = a03 * b00 + a13 * b01 + a23 * b02 + a33 * b03;\n newDst[ 4] = a00 * b10 + a10 * b11 + a20 * b12 + a30 * b13;\n newDst[ 5] = a01 * b10 + a11 * b11 + a21 * b12 + a31 * b13;\n newDst[ 6] = a02 * b10 + a12 * b11 + a22 * b12 + a32 * b13;\n newDst[ 7] = a03 * b10 + a13 * b11 + a23 * b12 + a33 * b13;\n newDst[ 8] = a00 * b20 + a10 * b21 + a20 * b22 + a30 * b23;\n newDst[ 9] = a01 * b20 + a11 * b21 + a21 * b22 + a31 * b23;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22 + a32 * b23;\n newDst[11] = a03 * b20 + a13 * b21 + a23 * b22 + a33 * b23;\n newDst[12] = a00 * b30 + a10 * b31 + a20 * b32 + a30 * b33;\n newDst[13] = a01 * b30 + a11 * b31 + a21 * b32 + a31 * b33;\n newDst[14] = a02 * b30 + a12 * b31 + a22 * b32 + a32 * b33;\n newDst[15] = a03 * b30 + a13 * b31 + a23 * b32 + a33 * b33;\n\n return newDst;\n}\n\n/**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nconst mul = multiply;\n\n/**\n * Sets the translation component of a 4-by-4 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\nfunction setTranslation(a: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? identity()) as T;\n if (a !== newDst) {\n newDst[ 0] = a[ 0];\n newDst[ 1] = a[ 1];\n newDst[ 2] = a[ 2];\n newDst[ 3] = a[ 3];\n newDst[ 4] = a[ 4];\n newDst[ 5] = a[ 5];\n newDst[ 6] = a[ 6];\n newDst[ 7] = a[ 7];\n newDst[ 8] = a[ 8];\n newDst[ 9] = a[ 9];\n newDst[10] = a[10];\n newDst[11] = a[11];\n }\n newDst[12] = v[0];\n newDst[13] = v[1];\n newDst[14] = v[2];\n newDst[15] = 1;\n return newDst;\n}\n\n///**\n// * Returns the translation component of a 4-by-4 matrix as a vector with 3\n// * entries.\n// * @param m - The matrix.\n// * @param dst - vector to hold result. If not passed a new one is created.\n// * @returns The translation component of m.\n// */\nfunction getTranslation(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? vec3.create()) as T;\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n}\n\n/**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat4Arg, axis: number, dst?: T) {\n const newDst = (dst ?? vec3.create());\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n}\n\n/**\n * Sets an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\nfunction setAxis(m: Mat4Arg, v: Vec3Arg, axis: number, dst: T) {\n const newDst = (dst === m) ? dst : copy(m, dst);\n\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n newDst[off + 2] = v[2];\n return newDst;\n}\n\n/**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? vec3.create()) as T;\n\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 0 to 1 in the z dimension.\n *\n * Note: If you pass `Infinity` for zFar then it will produce a projection matrix\n * returns -Infinity for Z when transforming coordinates with Z <= 0 and +Infinity for Z\n * otherwise.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */\nfunction perspective(fieldOfViewYInRadians: number, aspect: number, zNear: number, zFar: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const f = Math.tan(Math.PI * 0.5 - 0.5 * fieldOfViewYInRadians);\n\n newDst[0] = f / aspect;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n newDst[4] = 0;\n newDst[5] = f;\n newDst[6] = 0;\n newDst[7] = 0;\n\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[11] = -1;\n\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (Number.isFinite(zFar)) {\n const rangeInv = 1 / (zNear - zFar);\n newDst[10] = zFar * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n } else {\n newDst[10] = -1;\n newDst[14] = -zNear;\n }\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 1 (at -zNear) to 0 (at -zFar) in the z dimension.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane. (default = Infinity)\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */function perspectiveReverseZ(fieldOfViewYInRadians: number, aspect: number, zNear: number, zFar = Infinity, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const f = 1 / Math.tan(fieldOfViewYInRadians * 0.5);\n\n newDst[ 0] = f / aspect;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n\n newDst[ 4] = 0;\n newDst[ 5] = f;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n\n newDst[ 8] = 0;\n newDst[ 9] = 0;\n newDst[11] = -1;\n\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (zFar === Infinity) {\n newDst[10] = 0;\n newDst[14] = zNear;\n } else {\n const rangeInv = 1 / (zFar - zNear);\n newDst[10] = zNear * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n }\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 orthogonal transformation matrix that transforms from\n * the given the left, right, bottom, and top dimensions to -1 +1 in x, and y\n * and 0 to +1 in z.\n * @param left - Left side of the near clipping plane viewport.\n * @param right - Right side of the near clipping plane viewport.\n * @param bottom - Bottom of the near clipping plane viewport.\n * @param top - Top of the near clipping plane viewport.\n * @param near - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param far - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The orthographic projection matrix.\n */\nfunction ortho(left: number, right: number, bottom: number, top: number, near: number, far: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[0] = 2 / (right - left);\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n newDst[4] = 0;\n newDst[5] = 2 / (top - bottom);\n newDst[6] = 0;\n newDst[7] = 0;\n\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[10] = 1 / (near - far);\n newDst[11] = 0;\n\n newDst[12] = (right + left) / (left - right);\n newDst[13] = (top + bottom) / (bottom - top);\n newDst[14] = near / (near - far);\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 0 to 1 in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\nfunction frustum(left: number, right: number, bottom: number, top: number, near: number, far: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const dx = (right - left);\n const dy = (top - bottom);\n const dz = (near - far);\n\n newDst[ 0] = 2 * near / dx;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n newDst[ 4] = 0;\n newDst[ 5] = 2 * near / dy;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n newDst[ 8] = (left + right) / dx;\n newDst[ 9] = (top + bottom) / dy;\n newDst[10] = far / dz;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = near * far / dz;\n newDst[15] = 0;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 1 (-near) to 0 (-far) in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\nfunction frustumReverseZ(left: number, right: number, bottom: number, top: number, near: number, far = Infinity, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const dx = (right - left);\n const dy = (top - bottom);\n\n newDst[ 0] = 2 * near / dx;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n newDst[ 4] = 0;\n newDst[ 5] = 2 * near / dy;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n newDst[ 8] = (left + right) / dx;\n newDst[ 9] = (top + bottom) / dy;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (far === Infinity) {\n newDst[10] = 0;\n newDst[14] = near;\n } else {\n const rangeInv = 1 / (far - near);\n newDst[10] = near * rangeInv;\n newDst[14] = far * near * rangeInv;\n }\n\n return newDst;\n}\n\nconst xAxis = vec3.create();\nconst yAxis = vec3.create();\nconst zAxis = vec3.create();\n\n/**\n * Computes a 4-by-4 aim transformation.\n *\n * This is a matrix which positions an object aiming down positive Z.\n * toward the target.\n *\n * Note: this is **NOT** the inverse of lookAt as lookAt looks at negative Z.\n *\n * @param position - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\nfunction aim(position: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(target, position, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = xAxis[1]; newDst[ 2] = xAxis[2]; newDst[ 3] = 0;\n newDst[ 4] = yAxis[0]; newDst[ 5] = yAxis[1]; newDst[ 6] = yAxis[2]; newDst[ 7] = 0;\n newDst[ 8] = zAxis[0]; newDst[ 9] = zAxis[1]; newDst[10] = zAxis[2]; newDst[11] = 0;\n newDst[12] = position[0]; newDst[13] = position[1]; newDst[14] = position[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 camera aim transformation.\n *\n * This is a matrix which positions an object aiming down negative Z.\n * toward the target.\n *\n * Note: this is the inverse of `lookAt`\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\nfunction cameraAim(eye: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = xAxis[1]; newDst[ 2] = xAxis[2]; newDst[ 3] = 0;\n newDst[ 4] = yAxis[0]; newDst[ 5] = yAxis[1]; newDst[ 6] = yAxis[2]; newDst[ 7] = 0;\n newDst[ 8] = zAxis[0]; newDst[ 9] = zAxis[1]; newDst[10] = zAxis[2]; newDst[11] = 0;\n newDst[12] = eye[0]; newDst[13] = eye[1]; newDst[14] = eye[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 view transformation.\n *\n * This is a view matrix which transforms all other objects\n * to be in the space of the view defined by the parameters.\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The look-at matrix.\n */\nfunction lookAt(eye: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = yAxis[0]; newDst[ 2] = zAxis[0]; newDst[ 3] = 0;\n newDst[ 4] = xAxis[1]; newDst[ 5] = yAxis[1]; newDst[ 6] = zAxis[1]; newDst[ 7] = 0;\n newDst[ 8] = xAxis[2]; newDst[ 9] = yAxis[2]; newDst[10] = zAxis[2]; newDst[11] = 0;\n\n newDst[12] = -(xAxis[0] * eye[0] + xAxis[1] * eye[1] + xAxis[2] * eye[2]);\n newDst[13] = -(yAxis[0] * eye[0] + yAxis[1] * eye[1] + yAxis[2] * eye[2]);\n newDst[14] = -(zAxis[0] * eye[0] + zAxis[1] * eye[1] + zAxis[2] * eye[2]);\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which translates by the given vector v.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\nfunction translation(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = v[0]; newDst[13] = v[1]; newDst[14] = v[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Translates the given 4-by-4 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\nfunction translate(m: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n if (m !== newDst) {\n newDst[ 0] = m00;\n newDst[ 1] = m01;\n newDst[ 2] = m02;\n newDst[ 3] = m03;\n newDst[ 4] = m10;\n newDst[ 5] = m11;\n newDst[ 6] = m12;\n newDst[ 7] = m13;\n newDst[ 8] = m20;\n newDst[ 9] = m21;\n newDst[10] = m22;\n newDst[11] = m23;\n }\n\n newDst[12] = m00 * v0 + m10 * v1 + m20 * v2 + m30;\n newDst[13] = m01 * v0 + m11 * v1 + m21 * v2 + m31;\n newDst[14] = m02 * v0 + m12 * v1 + m22 * v2 + m32;\n newDst[15] = m03 * v0 + m13 * v1 + m23 * v2 + m33;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the x-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationX(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = c; newDst[ 6] = s; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = -s; newDst[10] = c; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the x-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateX(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[4] = c * m10 + s * m20;\n newDst[5] = c * m11 + s * m21;\n newDst[6] = c * m12 + s * m22;\n newDst[7] = c * m13 + s * m23;\n newDst[8] = c * m20 - s * m10;\n newDst[9] = c * m21 - s * m11;\n newDst[10] = c * m22 - s * m12;\n newDst[11] = c * m23 - s * m13;\n\n if (m !== newDst) {\n newDst[ 0] = m[ 0];\n newDst[ 1] = m[ 1];\n newDst[ 2] = m[ 2];\n newDst[ 3] = m[ 3];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the y-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationY(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = 0; newDst[ 2] = -s; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = s; newDst[ 9] = 0; newDst[10] = c; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the y-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateY(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 - s * m20;\n newDst[ 1] = c * m01 - s * m21;\n newDst[ 2] = c * m02 - s * m22;\n newDst[ 3] = c * m03 - s * m23;\n newDst[ 8] = c * m20 + s * m00;\n newDst[ 9] = c * m21 + s * m01;\n newDst[10] = c * m22 + s * m02;\n newDst[11] = c * m23 + s * m03;\n\n if (m !== newDst) {\n newDst[ 4] = m[ 4];\n newDst[ 5] = m[ 5];\n newDst[ 6] = m[ 6];\n newDst[ 7] = m[ 7];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the z-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationZ(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = s; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = -s; newDst[ 5] = c; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the z-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateZ(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 + s * m10;\n newDst[ 1] = c * m01 + s * m11;\n newDst[ 2] = c * m02 + s * m12;\n newDst[ 3] = c * m03 + s * m13;\n newDst[ 4] = c * m10 - s * m00;\n newDst[ 5] = c * m11 - s * m01;\n newDst[ 6] = c * m12 - s * m02;\n newDst[ 7] = c * m13 - s * m03;\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n newDst[11] = m[11];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\nfunction axisRotation(axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n\n newDst[ 0] = xx + (1 - xx) * c;\n newDst[ 1] = x * y * oneMinusCosine + z * s;\n newDst[ 2] = x * z * oneMinusCosine - y * s;\n newDst[ 3] = 0;\n newDst[ 4] = x * y * oneMinusCosine - z * s;\n newDst[ 5] = yy + (1 - yy) * c;\n newDst[ 6] = y * z * oneMinusCosine + x * s;\n newDst[ 7] = 0;\n newDst[ 8] = x * z * oneMinusCosine + y * s;\n newDst[ 9] = y * z * oneMinusCosine - x * s;\n newDst[10] = zz + (1 - zz) * c;\n newDst[11] = 0;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = 0;\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle. (same as axisRotation)\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\nconst rotation = axisRotation;\n\n/**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle.\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction axisRotate(m: Mat4Arg, axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n\n const r00 = xx + (1 - xx) * c;\n const r01 = x * y * oneMinusCosine + z * s;\n const r02 = x * z * oneMinusCosine - y * s;\n const r10 = x * y * oneMinusCosine - z * s;\n const r11 = yy + (1 - yy) * c;\n const r12 = y * z * oneMinusCosine + x * s;\n const r20 = x * z * oneMinusCosine + y * s;\n const r21 = y * z * oneMinusCosine - x * s;\n const r22 = zz + (1 - zz) * c;\n\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n\n newDst[ 0] = r00 * m00 + r01 * m10 + r02 * m20;\n newDst[ 1] = r00 * m01 + r01 * m11 + r02 * m21;\n newDst[ 2] = r00 * m02 + r01 * m12 + r02 * m22;\n newDst[ 3] = r00 * m03 + r01 * m13 + r02 * m23;\n newDst[ 4] = r10 * m00 + r11 * m10 + r12 * m20;\n newDst[ 5] = r10 * m01 + r11 * m11 + r12 * m21;\n newDst[ 6] = r10 * m02 + r11 * m12 + r12 * m22;\n newDst[ 7] = r10 * m03 + r11 * m13 + r12 * m23;\n newDst[ 8] = r20 * m00 + r21 * m10 + r22 * m20;\n newDst[ 9] = r20 * m01 + r21 * m11 + r22 * m21;\n newDst[10] = r20 * m02 + r21 * m12 + r22 * m22;\n newDst[11] = r20 * m03 + r21 * m13 + r22 * m23;\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle. (same as rotate)\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nconst rotate = axisRotate;\n\n/**\n * Creates a 4-by-4 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * three entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = v[2]; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 4-by-4 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of three entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale(m: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n newDst[ 3] = v0 * m[0 * 4 + 3];\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n newDst[ 7] = v1 * m[1 * 4 + 3];\n newDst[ 8] = v2 * m[2 * 4 + 0];\n newDst[ 9] = v2 * m[2 * 4 + 1];\n newDst[10] = v2 * m[2 * 4 + 2];\n newDst[11] = v2 * m[2 * 4 + 3];\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which scales a uniform amount in each dimension.\n * @param s - the amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = s; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 4-by-4 matrix in each dimension by a uniform scale.\n * @param m - The matrix to be modified.\n * @param s - The amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale(m: Mat4Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n newDst[ 3] = s * m[0 * 4 + 3];\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n newDst[ 7] = s * m[1 * 4 + 3];\n newDst[ 8] = s * m[2 * 4 + 0];\n newDst[ 9] = s * m[2 * 4 + 1];\n newDst[10] = s * m[2 * 4 + 2];\n newDst[11] = s * m[2 * 4 + 3];\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\nreturn {\n create,\n set,\n fromMat3,\n fromQuat,\n negate,\n copy,\n clone,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n determinant,\n invert,\n multiply,\n mul,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n perspective,\n perspectiveReverseZ,\n ortho,\n frustum,\n frustumReverseZ,\n aim,\n cameraAim,\n lookAt,\n translation,\n translate,\n rotationX,\n rotateX,\n rotationY,\n rotateY,\n rotationZ,\n rotateZ,\n axisRotation,\n rotation,\n axisRotate,\n rotate,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n};\n\n}\n\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Mat4Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { QuatArg, QuatType } from './quat';\nimport { Mat3Arg } from './mat3.js';\nimport { Mat4Arg } from './mat4.js';\nimport { Vec3Arg } from './vec3.js';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\n\nexport { QuatArg, QuatType };\n\ntype QuatCtor = new (n: number) => T;\n\nexport type RotationOrder = 'xyz' | 'xzy' | 'yxz' | 'yzx' | 'zxy' | 'zyx';\n\n/**\n * Generates am typed API for Qud\n * */\nfunction getAPIImpl(Ctor: QuatCtor) {\n const vec3 = getVec3API(Ctor);\n\n/**\n * Creates a quat4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number, w?: number) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a Quat; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Quat\n * Also see {@link quat.create} and {@link quat.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, w: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n\n return newDst;\n}\n\n/**\n * Sets a quaternion from the given angle and axis,\n * then returns it.\n *\n * @param axis - the axis to rotate around\n * @param angleInRadians - the angle\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The quaternion that represents the given axis and angle\n **/\nfunction fromAxisAngle(axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n const s = Math.sin(halfAngle);\n\n newDst[0] = s * axis[0];\n newDst[1] = s * axis[1];\n newDst[2] = s * axis[2];\n newDst[3] = Math.cos(halfAngle);\n\n return newDst;\n}\n\n/**\n * Gets the rotation axis and angle\n * @param q - quaternion to compute from\n * @param dst - Vec3 to hold result. If not passed in a new one is created.\n * @return angle and axis\n */\nfunction toAxisAngle(q: QuatArg, dst?: T): { angle: number, axis: T } {\n const newDst = (dst ?? vec3.create(3)) as T;\n\n const angle = Math.acos(q[3]) * 2;\n const s = Math.sin(angle * 0.5);\n if (s > utils.EPSILON) {\n newDst[0] = q[0] / s;\n newDst[1] = q[1] / s;\n newDst[2] = q[2] / s;\n } else {\n newDst[0] = 1;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n\n return { angle, axis: newDst };\n}\n\n/**\n * Returns the angle in degrees between two rotations a and b.\n * @param a - quaternion a\n * @param b - quaternion b\n * @return angle in radians between the two quaternions\n */\nfunction angle(a: QuatArg, b: QuatArg) {\n const d = dot(a, b);\n return Math.acos(2 * d * d - 1);\n}\n\n/**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction multiply(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const bw = b[3];\n\n newDst[0] = ax * bw + aw * bx + ay * bz - az * by;\n newDst[1] = ay * bw + aw * by + az * bx - ax * bz;\n newDst[2] = az * bw + aw * bz + ax * by - ay * bx;\n newDst[3] = aw * bw - ax * bx - ay * by - az * bz;\n\n return newDst;\n}\n\n/**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nconst mul = multiply;\n\n/**\n * Rotates the given quaternion around the X axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateX(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const bx = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw + qw * bx;\n newDst[1] = qy * bw + qz * bx;\n newDst[2] = qz * bw - qy * bx;\n newDst[3] = qw * bw - qx * bx;\n\n return newDst;\n}\n\n/**\n * Rotates the given quaternion around the Y axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateY(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const by = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw - qz * by;\n newDst[1] = qy * bw + qw * by;\n newDst[2] = qz * bw + qx * by;\n newDst[3] = qw * bw - qy * by;\n\n return newDst;\n}\n\n/**\n * Rotates the given quaternion around the Z axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateZ(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const bz = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw + qy * bz;\n newDst[1] = qy * bw - qx * bz;\n newDst[2] = qz * bw + qw * bz;\n newDst[3] = qw * bw - qz * bz;\n\n return newDst;\n}\n\n/**\n * Spherically linear interpolate between two quaternions\n *\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction slerp(a: QuatArg, b: QuatArg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n\n let bx = b[0];\n let by = b[1];\n let bz = b[2];\n let bw = b[3];\n\n let cosOmega = ax * bx + ay * by + az * bz + aw * bw;\n\n if (cosOmega < 0) {\n cosOmega = -cosOmega;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n\n let scale0;\n let scale1;\n\n if (1.0 - cosOmega > utils.EPSILON) {\n const omega = Math.acos(cosOmega);\n const sinOmega = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinOmega;\n scale1 = Math.sin(t * omega) / sinOmega;\n } else {\n scale0 = 1.0 - t;\n scale1 = t;\n }\n\n newDst[0] = scale0 * ax + scale1 * bx;\n newDst[1] = scale0 * ay + scale1 * by;\n newDst[2] = scale0 * az + scale1 * bz;\n newDst[3] = scale0 * aw + scale1 * bw;\n\n return newDst;\n}\n\n/**\n * Compute the inverse of a quaternion\n *\n * @param q - quaternion to compute the inverse of\n * @returns A quaternion that is the result of a * b\n */\nfunction inverse(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const a0 = q[0];\n const a1 = q[1];\n const a2 = q[2];\n const a3 = q[3];\n\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n\n newDst[0] = -a0 * invDot;\n newDst[1] = -a1 * invDot;\n newDst[2] = -a2 * invDot;\n newDst[3] = a3 * invDot;\n\n return newDst;\n}\n\n/**\n * Compute the conjugate of a quaternion\n * For quaternions with a magnitude of 1 (a unit quaternion)\n * this returns the same as the inverse but is faster to calculate.\n *\n * @param q - quaternion to compute the conjugate of.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The conjugate of q\n */\nfunction conjugate(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = -q[0];\n newDst[1] = -q[1];\n newDst[2] = -q[2];\n newDst[3] = q[3];\n\n return newDst;\n}\n\n/**\n * Creates a quaternion from the given rotation matrix.\n *\n * The created quaternion is not normalized.\n *\n * @param m - rotation matrix\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\nfunction fromMat(m: Mat3Arg | Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n /*\n 0 1 2\n 3 4 5\n 6 7 8\n\n 0 1 2\n 4 5 6\n 8 9 10\n */\n\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n const trace = m[0] + m[5] + m[10];\n\n if (trace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n const root = Math.sqrt(trace + 1); // 2w\n newDst[3] = 0.5 * root;\n const invRoot = 0.5 / root; // 1/(4w)\n\n newDst[0] = (m[6] - m[9]) * invRoot;\n newDst[1] = (m[8] - m[2]) * invRoot;\n newDst[2] = (m[1] - m[4]) * invRoot;\n } else {\n // |w| <= 1/2\n let i = 0;\n\n if (m[5] > m[0]) {\n i = 1;\n }\n if (m[10] > m[i * 4 + i]) {\n i = 2;\n }\n\n const j = (i + 1) % 3;\n const k = (i + 2) % 3;\n\n const root = Math.sqrt(m[i * 4 + i] - m[j * 4 + j] - m[k * 4 + k] + 1.0);\n newDst[i] = 0.5 * root;\n\n const invRoot = 0.5 / root;\n\n newDst[3] = (m[j * 4 + k] - m[k * 4 + j]) * invRoot;\n newDst[j] = (m[j * 4 + i] + m[i * 4 + j]) * invRoot;\n newDst[k] = (m[k * 4 + i] + m[i * 4 + k]) * invRoot;\n }\n\n return newDst;\n}\n\n/**\n * Creates a quaternion from the given euler angle x, y, z using the provided intrinsic order for the conversion.\n *\n * @param xAngleInRadians - angle to rotate around X axis in radians.\n * @param yAngleInRadians - angle to rotate around Y axis in radians.\n * @param zAngleInRadians - angle to rotate around Z axis in radians.\n * @param order - order to apply euler angles\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion representing the same rotation as the euler angles applied in the given order\n */\nfunction fromEuler(\n xAngleInRadians: number,\n yAngleInRadians: number,\n zAngleInRadians: number,\n order: RotationOrder,\n dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const xHalfAngle = xAngleInRadians * 0.5;\n const yHalfAngle = yAngleInRadians * 0.5;\n const zHalfAngle = zAngleInRadians * 0.5;\n\n const sx = Math.sin(xHalfAngle);\n const cx = Math.cos(xHalfAngle);\n const sy = Math.sin(yHalfAngle);\n const cy = Math.cos(yHalfAngle);\n const sz = Math.sin(zHalfAngle);\n const cz = Math.cos(zHalfAngle);\n\n switch (order) {\n case 'xyz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'xzy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n case 'yxz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n case 'yzx':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'zxy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'zyx':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n default:\n throw new Error(`Unknown rotation order: ${order}`);\n }\n\n return newDst;\n}\n\n/**\n * Copies a quaternion. (same as {@link quat.clone})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is a copy of q\n */\nfunction copy(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = q[0];\n newDst[1] = q[1];\n newDst[2] = q[2];\n newDst[3] = q[3];\n\n return newDst;\n}\n\n/**\n * Clones a quaternion. (same as {@link quat.copy})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A copy of q.\n */\nconst clone = copy;\n\n/**\n * Adds two quaternions; assumes a and b have the same dimension.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the sum of a and b.\n */\nfunction add(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\nfunction subtract(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Multiplies a quaternion by a scalar.\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nfunction mulScalar(v: QuatArg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a quaternion by a scalar. (same as mulScalar)\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nfunction divScalar(v: QuatArg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two quaternions\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns dot product\n */\nfunction dot(a: QuatArg, b: QuatArg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n}\n\n/**\n * Performs linear interpolation on two quaternions.\n * Given quaternions a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param t - Interpolation coefficient.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: QuatArg, b: QuatArg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Computes the length of quaternion\n * @param v - quaternion.\n * @returns length of quaternion.\n */\nfunction length(v: QuatArg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n}\n\n/**\n * Computes the length of quaternion (same as length)\n * @param v - quaternion.\n * @returns length of quaternion.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of quaternion\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\nfunction lengthSq(v: QuatArg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n}\n\n/**\n * Computes the square of the length of quaternion (same as lengthSq)\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\nconst lenSq = lengthSq;\n\n/**\n * Divides a quaternion by its Euclidean length and returns the quotient.\n * @param v - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The normalized quaternion.\n */\nfunction normalize(v: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n }\n\n return newDst;\n}\n\n/**\n * Check if 2 quaternions are approximately equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are approximately equal\n */\nfunction equalsApproximately(a: QuatArg, b: QuatArg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON &&\n Math.abs(a[3] - b[3]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 quaternions are exactly equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are exactly equal\n */\nfunction equals(a: QuatArg, b: QuatArg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Creates an identity quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns an identity quaternion\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n\n return newDst;\n}\n\nconst tempVec3 = vec3.create();\nconst xUnitVec3 = vec3.create();\nconst yUnitVec3 = vec3.create();\n\n/**\n * Computes a quaternion to represent the shortest rotation from one vector to another.\n *\n * @param aUnit - the start vector\n * @param bUnit - the end vector\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\nfunction rotationTo(aUnit: Vec3Arg, bUnit: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const dot = vec3.dot(aUnit, bUnit);\n if (dot < -0.999999) {\n vec3.cross(xUnitVec3, aUnit, tempVec3);\n if (vec3.len(tempVec3) < 0.000001) {\n vec3.cross(yUnitVec3, aUnit, tempVec3);\n }\n\n vec3.normalize(tempVec3, tempVec3);\n fromAxisAngle(tempVec3, Math.PI, newDst);\n\n return newDst;\n } else if (dot > 0.999999) {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n\n return newDst;\n } else {\n vec3.cross(aUnit, bUnit, tempVec3);\n\n newDst[0] = tempVec3[0];\n newDst[1] = tempVec3[1];\n newDst[2] = tempVec3[2];\n newDst[3] = 1 + dot;\n\n return normalize(newDst, newDst);\n }\n}\n\nconst tempQuat1 = new Ctor(4);\nconst tempQuat2 = new Ctor(4);\n\n/**\n * Performs a spherical linear interpolation with two control points\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param c - the third quaternion\n * @param d - the fourth quaternion\n * @param t - Interpolation coefficient 0 to 1\n * @returns result\n */\nfunction sqlerp(\n a: QuatArg,\n b: QuatArg,\n c: QuatArg,\n d: QuatArg,\n t: number,\n dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n slerp(a, d, t, tempQuat1);\n slerp(b, c, t, tempQuat2);\n slerp(tempQuat1, tempQuat2, 2 * t * (1 - t), newDst);\n\n return newDst;\n}\n\nreturn {\n create,\n fromValues,\n set,\n fromAxisAngle,\n toAxisAngle,\n angle,\n multiply,\n mul,\n rotateX,\n rotateY,\n rotateZ,\n slerp,\n inverse,\n conjugate,\n fromMat,\n fromEuler,\n copy,\n clone,\n add,\n subtract,\n sub,\n mulScalar,\n scale,\n divScalar,\n dot,\n lerp,\n length,\n len,\n lengthSq,\n lenSq,\n normalize,\n equalsApproximately,\n equals,\n identity,\n rotationTo,\n sqlerp,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\n/**\n *\n * Quat4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Quat4`. In other words you can do this\n *\n * const v = quat4.cross(v1, v2); // Creates a new Quat4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = quat4.create();\n * quat4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * quat4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nexport function getAPI(Ctor: QuatCtor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Vec4Arg, Vec4Type } from './vec4';\nimport { Mat4Arg } from './mat4';\nimport { BaseArgType } from './types';\n\nexport { Vec4Arg, Vec4Type };\n\ntype Vec4Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec4\n * */\nfunction getAPIImpl(Ctor: Vec4Ctor) {\n\n/**\n * Creates a vec4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number, w?: number) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a vec4; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec4\n * Also see {@link vec4.create} and {@link vec4.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, w: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n newDst[3] = Math.ceil(v[3]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n newDst[3] = Math.floor(v[3]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n newDst[3] = Math.round(v[3]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec4Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n newDst[3] = Math.min(max, Math.max(min, v[3]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec4Arg, b: Vec4Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n newDst[3] = a[3] + b[3] * scale;\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec4Arg, b: Vec4Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON &&\n Math.abs(a[3] - b[3]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec4Arg, b: Vec4Arg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec4Arg, b: Vec4Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec4Arg, b: Vec4Arg, t: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n newDst[3] = a[3] + t[3] * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n newDst[3] = Math.max(a[3], b[3]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n newDst[3] = Math.min(a[3], b[3]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec4Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec4Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n newDst[3] = 1 / v[3];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the dot product of two vectors\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec4Arg, b: Vec4Arg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec4Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec4Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec4Arg, b: Vec4Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec4Arg, b: Vec4Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return dx * dx + dy * dy + dz * dz + dw * dw;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n }\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n newDst[3] = -v[3];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec4.clone})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n newDst[3] = v[3];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec4.copy})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n newDst[3] = a[3] * b[3];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n newDst[3] = a[3] / b[3];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform vec4 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec4 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec4Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = v[3];\n\n newDst[0] = m[0] * x + m[4] * y + m[ 8] * z + m[12] * w;\n newDst[1] = m[1] * x + m[5] * y + m[ 9] * z + m[13] * w;\n newDst[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n newDst[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n\n return newDst;\n}\n\n\n/**\n * Treat a 4D vector as a direction and set it's length\n *\n * @param a The vec4 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec4Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec4 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec4Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n zero,\n transformMat4,\n setLength,\n truncate,\n midpoint,\n};\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\n/**\n *\n * Vec4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Vec4`. In other words you can do this\n *\n * const v = vec4.cross(v1, v2); // Creates a new Vec4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = vec4.create();\n * vec4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * vec4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nexport function getAPI(Ctor: Vec4Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n\n","/**\n * Some docs\n * @namespace wgpu-matrix\n */\nimport {BaseArgType, ZeroArray} from './types';\nimport {Mat3Arg, Mat3Type, getAPI as getMat3API} from './mat3-impl';\nimport {Mat4Arg, Mat4Type, getAPI as getMat4API} from './mat4-impl';\nimport {QuatArg, QuatType, getAPI as getQuatAPI, RotationOrder} from './quat-impl';\nimport {Vec2Arg, Vec2Type, getAPI as getVec2API} from './vec2-impl';\nimport {Vec3Arg, Vec3Type, getAPI as getVec3API} from './vec3-impl';\nimport {Vec4Arg, Vec4Type, getAPI as getVec4API} from './vec4-impl';\nimport * as utils from './utils';\n\nexport {\n RotationOrder,\n utils,\n\n BaseArgType,\n\n Mat3Arg,\n Mat4Arg,\n QuatArg,\n Vec2Arg,\n Vec3Arg,\n Vec4Arg,\n\n Mat3Type,\n Mat4Type,\n QuatType,\n Vec2Type,\n Vec3Type,\n Vec4Type,\n};\n\nexport type BaseCtor = new (n: number) => T;\n\nexport type Mat3 = Mat3Type;\nexport type Mat4 = Mat4Type;\nexport type Quat = QuatType;\nexport type Vec2 = Vec2Type;\nexport type Vec3 = Vec3Type;\nexport type Vec4 = Vec4Type;\n\nexport type Mat3d = Mat3Type;\nexport type Mat4d = Mat4Type;\nexport type Quatd = QuatType;\nexport type Vec2d = Vec2Type;\nexport type Vec3d = Vec3Type;\nexport type Vec4d = Vec4Type;\n\nexport type Mat3n = Mat3Type;\nexport type Mat4n = Mat4Type;\nexport type Quatn = QuatType;\nexport type Vec2n = Vec2Type;\nexport type Vec3n = Vec3Type;\nexport type Vec4n = Vec4Type;\n\n/**\n * Generate wgpu-matrix API for type\n */\nfunction wgpuMatrixAPI<\n Mat3 extends BaseArgType,\n Mat4 extends BaseArgType,\n Quat extends BaseArgType,\n Vec2 extends BaseArgType,\n Vec3 extends BaseArgType,\n Vec4 extends BaseArgType,\n>(\n Mat3Ctor: BaseCtor,\n Mat4Ctor: BaseCtor,\n QuatCtor: BaseCtor,\n Vec2Ctor: BaseCtor,\n Vec3Ctor: BaseCtor,\n Vec4Ctor: BaseCtor,\n) {\n return {\n /** @namespace mat3 */\n mat3: getMat3API(Mat3Ctor),\n /** @namespace mat4 */\n mat4: getMat4API(Mat4Ctor),\n /** @namespace quat */\n quat: getQuatAPI(QuatCtor),\n /** @namespace vec2 */\n vec2: getVec2API(Vec2Ctor),\n /** @namespace vec3 */\n vec3: getVec3API(Vec3Ctor),\n /** @namespace vec4 */\n vec4: getVec4API(Vec4Ctor),\n };\n}\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat3,\n /**\n * 4x4 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat4,\n /**\n * Quaternion functions that default to returning `Float32Array`\n * @namespace\n */\n quat,\n /**\n * Vec2 functions that default to returning `Float32Array`\n * @namespace\n */\n vec2,\n /**\n * Vec3 functions that default to returning `Float32Array`\n * @namespace\n */\n vec3,\n /**\n * Vec3 functions that default to returning `Float32Array`\n * @namespace\n */\n vec4,\n} = wgpuMatrixAPI<\n Mat3, Mat4, Quat, Vec2, Vec3, Vec4>(\n Float32Array, Float32Array, Float32Array, Float32Array, Float32Array, Float32Array);\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat3: mat3d,\n /**\n * 4x4 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat4: mat4d,\n /**\n * Quaternion functions that default to returning `Float64Array`\n * @namespace\n */\n quat: quatd,\n /**\n * Vec2 functions that default to returning `Float64Array`\n * @namespace\n */\n vec2: vec2d,\n /**\n * Vec3 functions that default to returning `Float64Array`\n * @namespace\n */\n vec3: vec3d,\n /**\n * Vec3 functions that default to returning `Float64Array`\n * @namespace\n */\n vec4: vec4d,\n} = wgpuMatrixAPI<\n Mat3d, Mat4d, Quatd, Vec2d, Vec3d, Vec4d>(\n Float64Array, Float64Array, Float64Array, Float64Array, Float64Array, Float64Array);\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat3: mat3n,\n /**\n * 4x4 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat4: mat4n,\n /**\n * Quaternion functions that default to returning `number[]`\n * @namespace\n */\n quat: quatn,\n /**\n * Vec2 functions that default to returning `number[]`\n * @namespace\n */\n vec2: vec2n,\n /**\n * Vec3 functions that default to returning `number[]`\n * @namespace\n */\n vec3: vec3n,\n /**\n * Vec3 functions that default to returning `number[]`\n * @namespace\n */\n vec4: vec4n,\n} = wgpuMatrixAPI<\n Mat3n, Mat4n, Quatn, Vec2n, Vec3n, Vec4n>(\n ZeroArray, Array, Array, Array, Array, Array);\n"],"names":["ZeroArray","OriginalConstructor","modifier","a","fill","constructor","args","super","this","EPSILON","degrees","Math","PI","n","m","b","v","d","abs","t","radians","old","cache","Map","getAPI","Ctor","api","get","create","x","y","newDst","undefined","subtract","dst","lerp","mulScalar","k","inverse","dot","length","v0","v1","sqrt","lengthSq","distance","dx","dy","distanceSq","normalize","len","copy","multiply","divide","setLength","fromValues","set","ceil","floor","round","clamp","min","max","add","addScaled","scale","angle","ax","ay","bx","by","mag","cosine","acos","sub","equalsApproximately","utils.EPSILON","equals","lerpV","divScalar","invert","cross","z","lenSq","dist","distSq","negate","clone","mul","div","random","cos","sin","zero","transformMat4","transformMat3","rotate","rad","p0","p1","sinC","cosC","truncate","maxLen","midpoint","getAPIImpl","v2","dz","az","bz","t1","t2","zScale","w","transformMat4Upper3x3","transformQuat","q","qx","qy","qz","w2","uvX","uvY","uvZ","getTranslation","getAxis","axis","off","getScaling","xx","xy","xz","yx","yy","yz","zx","zy","zz","rotateX","p","r","rotateY","rotateZ","vec2","getVec2API","vec3","getVec3API","identity","m00","m01","m02","m10","m11","m12","m20","m21","m22","b01","b11","b21","invDet","a00","a01","a02","a10","a11","a12","a20","a21","a22","b00","b02","b10","b12","b20","b22","rotation","angleInRadians","c","s","v3","v4","v5","v6","v7","v8","fromMat4","m4","fromQuat","x2","y2","z2","wx","wy","wz","transpose","determinant","setTranslation","setAxis","get3DScaling","translation","translate","rotationX","rotationY","rotationZ","scaling","uniformScaling","uniformScale","scaling3D","scale3D","uniformScaling3D","uniformScale3D","m03","m13","m23","m30","m31","m32","m33","tmp0","tmp1","tmp2","tmp3","tmp4","tmp5","tmp6","tmp7","tmp8","tmp9","tmp10","tmp11","tmp12","tmp13","tmp14","tmp15","tmp16","tmp17","tmp18","tmp19","tmp20","tmp21","tmp22","tmp23","t0","t3","a03","a13","a23","a30","a31","a32","a33","b03","b13","b23","b30","b31","b32","b33","xAxis","yAxis","zAxis","axisRotation","oneMinusCosine","axisRotate","r00","r01","r02","r10","r11","r12","r20","r21","r22","v9","v10","v11","v12","v13","v14","v15","fromMat3","m3","perspective","fieldOfViewYInRadians","aspect","zNear","zFar","f","tan","Number","isFinite","rangeInv","perspectiveReverseZ","Infinity","ortho","left","right","bottom","top","near","far","frustum","frustumReverseZ","aim","position","target","up","cameraAim","eye","lookAt","fromAxisAngle","halfAngle","aw","bw","slerp","scale0","scale1","cosOmega","omega","sinOmega","tempVec3","xUnitVec3","yUnitVec3","tempQuat1","tempQuat2","toAxisAngle","qw","a0","a1","a2","a3","invDot","conjugate","fromMat","trace","root","invRoot","i","j","fromEuler","xAngleInRadians","yAngleInRadians","zAngleInRadians","order","xHalfAngle","yHalfAngle","zHalfAngle","sx","cx","sy","cy","sz","cz","Error","rotationTo","aUnit","bUnit","sqlerp","dw","wgpuMatrixAPI","Mat3Ctor","Mat4Ctor","QuatCtor","Vec2Ctor","Vec3Ctor","Vec4Ctor","mat3","getMat3API","mat4","getMat4API","quat","getQuatAPI","vec4","getVec4API","Float32Array","mat3d","mat4d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hC,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,SAAS8U,EAQLC,EACAC,EACAC,EACAC,EACAC,EACAC,GAEF,MAAO,CAELC,KAAMC,EAAiBP,GAEvBQ,KAAMC,EAAiBR,GAEvBS,KAAMC,EAAiBT,GAEvB5N,KAAMC,EAAiB4N,GAEvB3N,KAAMC,EAAiB2N,GAEvBQ,KAAMC,EAAiBR,GAE3B,CAEa,MAAAC,KAKXA,EAAIE,KAKJA,EAAIE,KAKJA,EAAIpO,KAKJA,EAAIE,KAKJA,EAAIoO,KAKJA,GACEb,EAEAe,aAAcA,aAAcA,aAAcA,aAAcA,aAAcA,eAOxER,KAAMS,EAKNP,KAAMQ,EAKNN,KAAMO,EAKN3O,KAAM4O,EAKN1O,KAAM2O,EAKNP,KAAMQ,GACJrB,EAEAsB,aAAcA,aAAcA,aAAcA,aAAcA,aAAcA,eAOxEf,KAAMgB,EAKNd,KAAMe,EAKNb,KAAMc,EAKNlP,KAAMmP,EAKNjP,KAAMkP,EAKNd,KAAMe,GACJ5B,EAEAxW,EAAWqY,MAAOA,MAAOA,MAAOA,MAAOA"} \ No newline at end of file +{"version":3,"file":"wgpu-matrix.module.min.js","sources":["../../../src/types.ts","../../../src/utils.ts","../../../src/vec2-impl.ts","../../../src/vec3-impl.ts","../../../src/mat3-impl.ts","../../../src/mat4-impl.ts","../../../src/quat-impl.ts","../../../src/vec4-impl.ts","../../../src/wgpu-matrix.ts"],"sourcesContent":["/**\n * A type wider than `number[]`, omitting any instance functions\n * unused by the API, e.g., map, sort. This allows the math\n * functions to operate on a wider range of array-like\n * values.\n */\nexport interface MutableNumberArray {\n readonly length: number;\n [n: number]: number;\n}\n\n/**\n * The types you can pass to most functions that take an\n * array of numbers.\n */\nexport type BaseArgType = Float32Array | Float64Array | MutableNumberArray;\n\nfunction wrapConstructor any>(\n OriginalConstructor: T,\n modifier: (instance: InstanceType) => void\n): T {\n return class extends OriginalConstructor {\n constructor(...args: any[]) {\n super(...args);\n modifier(this as InstanceType);\n }\n } as T; // Type assertion is necessary here\n}\n\nexport const ZeroArray = wrapConstructor(Array, a => a.fill(0));\n\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nexport let EPSILON = 0.000001;\n\n/**\n * Set the value for EPSILON for various checks\n * @param v - Value to use for EPSILON.\n * @returns previous value of EPSILON;\n */\nexport function setEpsilon(v: number): number {\n const old = EPSILON;\n EPSILON = v;\n return old;\n}\n\n/**\n * Convert degrees to radians\n * @param degrees - Angle in degrees\n * @returns angle converted to radians\n */\nexport function degToRad(degrees: number): number {\n return degrees * Math.PI / 180;\n}\n\n/**\n * Convert radians to degrees\n * @param radians - Angle in radians\n * @returns angle converted to degrees\n */\nexport function radToDeg(radians: number): number {\n return radians * 180 / Math.PI;\n}\n\n/**\n * Lerps between a and b via t\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @returns a + (b - a) * t\n */\nexport function lerp(a: number, b: number, t: number): number {\n return a + (b - a) * t;\n}\n\n/**\n * Compute the opposite of lerp. Given a and b and a value between\n * a and b returns a value between 0 and 1. 0 if a, 1 if b.\n * Note: no clamping is done.\n * @param a - start value\n * @param b - end value\n * @param v - value between a and b\n * @returns (v - a) / (b - a)\n */\nexport function inverseLerp(a: number, b: number, v: number): number {\n const d = b - a;\n return (Math.abs(b - a) < EPSILON)\n ? a\n : (v - a) / d;\n}\n\n/**\n * Compute the euclidean modulo\n *\n * ```\n * // table for n / 3\n * -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 <- n\n * ------------------------------------\n * -2 -1 -0 -2 -1 0, 1, 2, 0, 1, 2 <- n % 3\n * 1 2 0 1 2 0, 1, 2, 0, 1, 2 <- euclideanModule(n, 3)\n * ```\n *\n * @param n - dividend\n * @param m - divisor\n * @returns the euclidean modulo of n / m\n */\nexport function euclideanModulo(n: number, m: number) {\n return ((n % m) + m) % m;\n}","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Mat3Arg } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { Vec2Arg, Vec2Type } from './vec2';\nimport { Vec3Arg } from './vec3';\nimport { BaseArgType } from './types';\n\nexport { Vec2Arg, Vec2Type };\n\ntype Vec2Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec3\n */\nfunction getAPIImpl(Ctor: Vec2Ctor) {\n\n/**\n * Creates a Vec2; may be called with x, y, z to set initial values.\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Vec2's specified type\n * it would be faster to use\n *\n * ```\n * const v = vec2.clone(someJSArray);\n * ```\n *\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\nfunction create(x = 0, y = 0) {\n const newDst = new Ctor(2);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n }\n }\n return newDst;\n}\n\n/**\n * Creates a Vec2; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec2\n * Also see {@link vec2.create} and {@link vec2.copy}\n *\n * @param x first value\n * @param y second value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec2Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec2Arg, b: Vec2Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n\n return newDst;\n}\n\n/**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\nfunction angle(a: Vec2Arg, b: Vec2Arg): number {\n const ax = a[0];\n const ay = a[1];\n const bx = b[0];\n const by = b[1];\n const mag1 = Math.sqrt(ax * ax + ay * ay);\n const mag2 = Math.sqrt(bx * bx + by * by);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec2Arg, b: Vec2Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec2Arg, b: Vec2Arg): boolean {\n return a[0] === b[0] && a[1] === b[1];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec2Arg, b: Vec2Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec2Arg, b: Vec2Arg, t: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec2Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec2Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\nfunction cross(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const z = a[0] * b[1] - a[1] * b[0];\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = z;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec2Arg, b: Vec2Arg): number {\n return a[0] * b[0] + a[1] * b[1];\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec2Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n return Math.sqrt(v0 * v0 + v1 * v1);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec2Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n return v0 * v0 + v1 * v1;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec2Arg, b: Vec2Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return Math.sqrt(dx * dx + dy * dy);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec2Arg, b: Vec2Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return dx * dx + dy * dy;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const len = Math.sqrt(v0 * v0 + v1 * v1);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n }\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec2.clone})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec2.copy})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Creates a random unit vector * scale\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\nfunction random(scale = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const angle = Math.random() * 2 * Math.PI;\n newDst[0] = Math.cos(angle) * scale;\n newDst[1] = Math.sin(angle) * scale;\n\n return newDst;\n}\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform Vec2 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec2Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const x = v[0];\n const y = v[1];\n\n newDst[0] = x * m[0] + y * m[4] + m[12];\n newDst[1] = x * m[1] + y * m[5] + m[13];\n\n return newDst;\n}\n\n/**\n * Transforms vec4 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat3(v: Vec2Arg, m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n const x = v[0];\n const y = v[1];\n\n newDst[0] = m[0] * x + m[4] * y + m[8];\n newDst[1] = m[1] * x + m[5] * y + m[9];\n\n return newDst;\n}\n\n/**\n * Rotate a 2D vector\n *\n * @param a The vec2 point to rotate\n * @param b The origin of the rotation\n * @param rad The angle of rotation in radians\n * @returns the rotated vector\n */\nfunction rotate(a: Vec2Arg, b: Vec2Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n // Translate point to the origin\n const p0 = a[0] - b[0];\n const p1 = a[1] - b[1];\n const sinC = Math.sin(rad);\n const cosC = Math.cos(rad);\n\n //perform rotation and translate to correct position\n newDst[0] = p0 * cosC - p1 * sinC + b[0];\n newDst[1] = p0 * sinC + p1 * cosC + b[1];\n\n return newDst;\n}\n\n/**\n * Treat a 2D vector as a direction and set it's length\n *\n * @param a The vec2 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec2Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec2 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec2Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec2Arg, b: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(2)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat3,\n rotate,\n setLength,\n truncate,\n midpoint,\n};\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Vec2Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Vec3Arg, Vec3Type } from './vec3';\nimport { Mat3Arg } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { QuatArg } from './quat';\nimport { BaseArgType } from './types';\n\nexport { Vec3Arg, Vec3Type };\n\ntype Vec3Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec3\n * */\nfunction getAPIImpl(Ctor: Vec3Ctor) {\n\n/**\n * Creates a vec3; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number) {\n const newDst = new Ctor(3);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a vec3; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec3\n * Also see {@link vec3.create} and {@link vec3.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec3Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec3Arg, b: Vec3Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n\n return newDst;\n}\n\n/**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\nfunction angle(a: Vec3Arg, b: Vec3Arg): number {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const mag1 = Math.sqrt(ax * ax + ay * ay + az * az);\n const mag2 = Math.sqrt(bx * bx + by * by + bz * bz);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec3Arg, b: Vec3Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec3Arg, b: Vec3Arg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec3Arg, b: Vec3Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec3Arg, b: Vec3Arg, t: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec3Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec3Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\nfunction cross(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const t1 = a[2] * b[0] - a[0] * b[2];\n const t2 = a[0] * b[1] - a[1] * b[0];\n newDst[0] = a[1] * b[2] - a[2] * b[1];\n newDst[1] = t1;\n newDst[2] = t2;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec3Arg, b: Vec3Arg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]);\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec3Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec3Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return v0 * v0 + v1 * v1 + v2 * v2;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec3Arg, b: Vec3Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return Math.sqrt(dx * dx + dy * dy + dz * dz);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec3Arg, b: Vec3Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return dx * dx + dy * dy + dz * dz;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec3.clone})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec3.copy})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Creates a random vector\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\nfunction random(scale = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const angle = Math.random() * 2 * Math.PI;\n const z = Math.random() * 2 - 1;\n const zScale = Math.sqrt(1 - z * z) * scale;\n newDst[0] = Math.cos(angle) * zScale;\n newDst[1] = Math.sin(angle) * zScale;\n newDst[2] = z * scale;\n\n return newDst;\n}\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform vec3 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec3Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1;\n\n newDst[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n newDst[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n newDst[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n\n return newDst;\n}\n\n/**\n * Transform vec3 by upper 3x3 matrix inside 4x4 matrix.\n * @param v - The direction.\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns The transformed vector.\n */\nfunction transformMat4Upper3x3(v: Vec3Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[0] = v0 * m[0 * 4 + 0] + v1 * m[1 * 4 + 0] + v2 * m[2 * 4 + 0];\n newDst[1] = v0 * m[0 * 4 + 1] + v1 * m[1 * 4 + 1] + v2 * m[2 * 4 + 1];\n newDst[2] = v0 * m[0 * 4 + 2] + v1 * m[1 * 4 + 2] + v2 * m[2 * 4 + 2];\n\n return newDst;\n}\n\n/**\n * Transforms vec3 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat3(v: Vec3Arg, m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n\n newDst[0] = x * m[0] + y * m[4] + z * m[8];\n newDst[1] = x * m[1] + y * m[5] + z * m[9];\n newDst[2] = x * m[2] + y * m[6] + z * m[10];\n\n return newDst;\n}\n\n/**\n * Transforms vec3 by Quaternion\n * @param v - the vector to transform\n * @param q - the quaternion to transform by\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed\n */\nfunction transformQuat(v: Vec3Arg, q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n\n const uvX = qy * z - qz * y;\n const uvY = qz * x - qx * z;\n const uvZ = qx * y - qy * x;\n\n newDst[0] = x + uvX * w2 + (qy * uvZ - qz * uvY) * 2;\n newDst[1] = y + uvY * w2 + (qz * uvX - qx * uvZ) * 2;\n newDst[2] = z + uvZ * w2 + (qx * uvY - qy * uvX) * 2;\n\n return newDst;\n}\n\n/**\n * Returns the translation component of a 4-by-4 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\nfunction getTranslation(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n}\n/**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat4Arg, axis: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n}\n/**\n * Returns the scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the x-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\nfunction rotateX(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n //Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n //perform rotation\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad);\n\n //translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the y-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\nfunction rotateY(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n // perform rotation\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad);\n\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Rotate a 3D vector around the z-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns {vec3} out\n */\nfunction rotateZ(a: Vec3Arg, b: Vec3Arg, rad: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n const p = [];\n const r = [];\n\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n // perform rotation\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2];\n\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n\n return newDst;\n}\n\n/**\n * Treat a 3D vector as a direction and set it's length\n *\n * @param a The vec3 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec3Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec3 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec3Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec3Arg, b: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(3)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat4Upper3x3,\n transformMat3,\n transformQuat,\n getTranslation,\n getAxis,\n getScaling,\n rotateX,\n rotateY,\n rotateZ,\n setLength,\n truncate,\n midpoint,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Vec3Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nimport * as utils from './utils.js';\nimport { QuatArg } from './quat';\nimport { Mat3Arg, Mat3Type } from './mat3';\nimport { Mat4Arg } from './mat4';\nimport { Vec2Arg } from './vec2';\nimport { Vec3Arg } from './vec3';\nimport { getAPI as getVec2API } from './vec2-impl';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\n\nexport { Mat3Arg, Mat3Type };\n\ntype Mat3Ctor = new (n: number) => T;\n\n/**\n * Generates a typed API for Mat3\n * */\nfunction getAPIImpl(Ctor: Mat3Ctor) {\n const vec2 = getVec2API(Ctor);\n const vec3 = getVec3API(Ctor);\n\n/**\n * Create a Mat3 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat3's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat3.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @returns matrix created from values.\n */\nfunction create(\n v0?: number, v1?: number, v2?: number,\n v3?: number, v4?: number, v5?: number,\n v6?: number, v7?: number, v8?: number) {\n const newDst = new Ctor(12);\n // to make the array homogenous\n newDst[3] = 0;\n newDst[7] = 0;\n newDst[11] = 0;\n\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[4] = v3;\n if (v4 !== undefined) {\n newDst[5] = v4;\n if (v5 !== undefined) {\n newDst[6] = v5;\n if (v6 !== undefined) {\n newDst[8] = v6;\n if (v7 !== undefined) {\n newDst[9] = v7;\n if (v8 !== undefined) {\n newDst[10] = v8;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n\n return newDst;\n}\n\n/**\n * Sets the values of a Mat3\n * Also see {@link mat3.create} and {@link mat3.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 set from values.\n */\nfunction set(\n v0: number, v1: number, v2: number,\n v3: number, v4: number, v5: number,\n v6: number, v7: number, v8: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[0] = v0; newDst[1] = v1; newDst[ 2] = v2; newDst[ 3] = 0;\n newDst[4] = v3; newDst[5] = v4; newDst[ 6] = v5; newDst[ 7] = 0;\n newDst[8] = v6; newDst[9] = v7; newDst[10] = v8; newDst[11] = 0;\n\n return newDst;\n}\n\n/**\n * Creates a Mat3 from the upper left 3x3 part of a Mat4\n * @param m4 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from m4\n */\nfunction fromMat4(m4: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n newDst[0] = m4[0]; newDst[1] = m4[1]; newDst[ 2] = m4[ 2]; newDst[ 3] = 0;\n newDst[4] = m4[4]; newDst[5] = m4[5]; newDst[ 6] = m4[ 6]; newDst[ 7] = 0;\n newDst[8] = m4[8]; newDst[9] = m4[9]; newDst[10] = m4[10]; newDst[11] = 0;\n return newDst;\n}\n\n/**\n * Creates a Mat3 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from q\n */\nfunction fromQuat(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3];\n const x2 = x + x; const y2 = y + y; const z2 = z + z;\n\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n newDst[ 0] = 1 - yy - zz; newDst[ 1] = yx + wz; newDst[ 2] = zx - wy; newDst[ 3] = 0;\n newDst[ 4] = yx - wz; newDst[ 5] = 1 - xx - zz; newDst[ 6] = zy + wx; newDst[ 7] = 0;\n newDst[ 8] = zx + wy; newDst[ 9] = zy - wx; newDst[10] = 1 - xx - yy; newDst[11] = 0;\n\n return newDst;\n}\n\n/**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\nfunction negate(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = -m[ 0]; newDst[ 1] = -m[ 1]; newDst[ 2] = -m[ 2];\n newDst[ 4] = -m[ 4]; newDst[ 5] = -m[ 5]; newDst[ 6] = -m[ 6];\n newDst[ 8] = -m[ 8]; newDst[ 9] = -m[ 9]; newDst[10] = -m[10];\n\n return newDst;\n}\n\n/**\n * Copies a matrix. (same as {@link mat3.clone})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nfunction copy(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = m[ 0]; newDst[ 1] = m[ 1]; newDst[ 2] = m[ 2];\n newDst[ 4] = m[ 4]; newDst[ 5] = m[ 5]; newDst[ 6] = m[ 6];\n newDst[ 8] = m[ 8]; newDst[ 9] = m[ 9]; newDst[10] = m[10];\n\n return newDst;\n}\n\n/**\n * Copies a matrix (same as {@link mat3.copy})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nconst clone = copy;\n\n/**\n * Check if 2 matrices are approximately equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are approximately equal\n */\nfunction equalsApproximately(a: Mat3Arg, b: Mat3Arg): boolean {\n return Math.abs(a[ 0] - b[ 0]) < utils.EPSILON &&\n Math.abs(a[ 1] - b[ 1]) < utils.EPSILON &&\n Math.abs(a[ 2] - b[ 2]) < utils.EPSILON &&\n Math.abs(a[ 4] - b[ 4]) < utils.EPSILON &&\n Math.abs(a[ 5] - b[ 5]) < utils.EPSILON &&\n Math.abs(a[ 6] - b[ 6]) < utils.EPSILON &&\n Math.abs(a[ 8] - b[ 8]) < utils.EPSILON &&\n Math.abs(a[ 9] - b[ 9]) < utils.EPSILON &&\n Math.abs(a[10] - b[10]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 matrices are exactly equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are exactly equal\n */\nfunction equals(a: Mat3Arg, b: Mat3Arg): boolean {\n return a[ 0] === b[ 0] &&\n a[ 1] === b[ 1] &&\n a[ 2] === b[ 2] &&\n a[ 4] === b[ 4] &&\n a[ 5] === b[ 5] &&\n a[ 6] === b[ 6] &&\n a[ 8] === b[ 8] &&\n a[ 9] === b[ 9] &&\n a[10] === b[10];\n}\n\n/**\n * Creates a 3-by-3 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 3-by-3 identity matrix.\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\nfunction transpose(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n if (newDst === m) {\n let t: number;\n\n // 0 1 2\n // 4 5 6\n // 8 9 10\n\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n\n return newDst;\n }\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n newDst[ 0] = m00; newDst[ 1] = m10; newDst[ 2] = m20;\n newDst[ 4] = m01; newDst[ 5] = m11; newDst[ 6] = m21;\n newDst[ 8] = m02; newDst[ 9] = m12; newDst[10] = m22;\n\n return newDst;\n}\n\n/**\n * Computes the inverse of a 3-by-3 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nfunction inverse(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n const b01 = m22 * m11 - m12 * m21;\n const b11 = -m22 * m10 + m12 * m20;\n const b21 = m21 * m10 - m11 * m20;\n\n const invDet = 1 / (m00 * b01 + m01 * b11 + m02 * b21);\n\n newDst[ 0] = b01 * invDet;\n newDst[ 1] = (-m22 * m01 + m02 * m21) * invDet;\n newDst[ 2] = ( m12 * m01 - m02 * m11) * invDet;\n newDst[ 4] = b11 * invDet;\n newDst[ 5] = ( m22 * m00 - m02 * m20) * invDet;\n newDst[ 6] = (-m12 * m00 + m02 * m10) * invDet;\n newDst[ 8] = b21 * invDet;\n newDst[ 9] = (-m21 * m00 + m01 * m20) * invDet;\n newDst[10] = ( m11 * m00 - m01 * m10) * invDet;\n\n return newDst;\n}\n\n/**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\nfunction determinant(m: Mat3Arg): number {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n return m00 * (m11 * m22 - m21 * m12) -\n m10 * (m01 * m22 - m21 * m02) +\n m20 * (m01 * m12 - m11 * m02);\n}\n\n/**\n * Computes the inverse of a 3-by-3 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nconst invert = inverse;\n\n/**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nfunction multiply(a: Mat3Arg, b: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[ 4 + 0];\n const a11 = a[ 4 + 1];\n const a12 = a[ 4 + 2];\n const a20 = a[ 8 + 0];\n const a21 = a[ 8 + 1];\n const a22 = a[ 8 + 2];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b10 = b[ 4 + 0];\n const b11 = b[ 4 + 1];\n const b12 = b[ 4 + 2];\n const b20 = b[ 8 + 0];\n const b21 = b[ 8 + 1];\n const b22 = b[ 8 + 2];\n\n newDst[ 0] = a00 * b00 + a10 * b01 + a20 * b02;\n newDst[ 1] = a01 * b00 + a11 * b01 + a21 * b02;\n newDst[ 2] = a02 * b00 + a12 * b01 + a22 * b02;\n newDst[ 4] = a00 * b10 + a10 * b11 + a20 * b12;\n newDst[ 5] = a01 * b10 + a11 * b11 + a21 * b12;\n newDst[ 6] = a02 * b10 + a12 * b11 + a22 * b12;\n newDst[ 8] = a00 * b20 + a10 * b21 + a20 * b22;\n newDst[ 9] = a01 * b20 + a11 * b21 + a21 * b22;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22;\n\n return newDst;\n}\n\n/**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nconst mul = multiply;\n\n/**\n * Sets the translation component of a 3-by-3 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\nfunction setTranslation(a: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? identity()) as T;\n if (a !== newDst) {\n newDst[ 0] = a[ 0];\n newDst[ 1] = a[ 1];\n newDst[ 2] = a[ 2];\n newDst[ 4] = a[ 4];\n newDst[ 5] = a[ 5];\n newDst[ 6] = a[ 6];\n }\n newDst[ 8] = v[0];\n newDst[ 9] = v[1];\n newDst[10] = 1;\n return newDst;\n}\n\n/**\n * Returns the translation component of a 3-by-3 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\nfunction getTranslation(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec2.create()) as T;\n newDst[0] = m[8];\n newDst[1] = m[9];\n return newDst;\n}\n\n/**\n * Returns an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y,\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat3Arg, axis: number, dst?: T) {\n const newDst = (dst ?? vec2.create()) as T;\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n return newDst;\n}\n\n/**\n * Sets an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\nfunction setAxis(m: Mat3Arg, v: Vec2Arg, axis: number, dst?: T) {\n const newDst = (dst === m ? m : copy(m, dst)) as T;\n\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n return newDst;\n}\n\n/**\n * Returns the \"2d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec2.create());\n\n const xx = m[0];\n const xy = m[1];\n const yx = m[4];\n const yy = m[5];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy);\n newDst[1] = Math.sqrt(yx * yx + yy * yy);\n\n return newDst;\n}\n\n\n/**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction get3DScaling(m: Mat3Arg, dst?: T) {\n const newDst = (dst ?? vec3.create());\n\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which translates by the given vector v.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\nfunction translation(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = v[0]; newDst[ 9] = v[1]; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Translates the given 3-by-3 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\nfunction translate(m: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 0] = m00;\n newDst[ 1] = m01;\n newDst[ 2] = m02;\n newDst[ 4] = m10;\n newDst[ 5] = m11;\n newDst[ 6] = m12;\n }\n\n newDst[ 8] = m00 * v0 + m10 * v1 + m20;\n newDst[ 9] = m01 * v0 + m11 * v1 + m21;\n newDst[10] = m02 * v0 + m12 * v1 + m22;\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotation(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = s; newDst[ 2] = 0;\n newDst[ 4] = -s; newDst[ 5] = c; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix by the given angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotate(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 + s * m10;\n newDst[ 1] = c * m01 + s * m11;\n newDst[ 2] = c * m02 + s * m12;\n\n newDst[ 4] = c * m10 - s * m00;\n newDst[ 5] = c * m11 - s * m01;\n newDst[ 6] = c * m12 - s * m02;\n\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the x-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationX(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = c; newDst[ 6] = s;\n newDst[ 8] = 0; newDst[ 9] = -s; newDst[10] = c;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix around the x-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateX(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[4] = c * m10 + s * m20;\n newDst[5] = c * m11 + s * m21;\n newDst[6] = c * m12 + s * m22;\n newDst[8] = c * m20 - s * m10;\n newDst[9] = c * m21 - s * m11;\n newDst[10] = c * m22 - s * m12;\n\n if (m !== newDst) {\n newDst[ 0] = m[ 0];\n newDst[ 1] = m[ 1];\n newDst[ 2] = m[ 2];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the y-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationY(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = 0; newDst[ 2] = -s;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0;\n newDst[ 8] = s; newDst[ 9] = 0; newDst[10] = c;\n\n return newDst;\n}\n\n/**\n * Rotates the given 3-by-3 matrix around the y-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateY(m: Mat3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 - s * m20;\n newDst[ 1] = c * m01 - s * m21;\n newDst[ 2] = c * m02 - s * m22;\n newDst[ 8] = c * m20 + s * m00;\n newDst[ 9] = c * m21 + s * m01;\n newDst[10] = c * m22 + s * m02;\n\n if (m !== newDst) {\n newDst[ 4] = m[ 4];\n newDst[ 5] = m[ 5];\n newDst[ 6] = m[ 6];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which rotates around the z-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nconst rotationZ = rotation;\n\n/**\n * Rotates the given 3-by-3 matrix around the z-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nconst rotateZ = rotate;\n\n/**\n * Creates a 3-by-3 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has two\n * entries.\n * @param v - A vector of\n * 2 entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling(v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * two entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of 2 entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale(m: Mat3Arg, v: Vec2Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * 3 entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling3D(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = v[2];\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of 3 entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale3D(m: Mat3Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n\n newDst[ 8] = v2 * m[2 * 4 + 0];\n newDst[ 9] = v2 * m[2 * 4 + 1];\n newDst[10] = v2 * m[2 * 4 + 2];\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales uniformly in the X and Y dimensions\n * @param s - Amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in the X and Y dimension by an amount\n * given.\n * @param m - The matrix to be modified.\n * @param s - Amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale(m: Mat3Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 3-by-3 matrix which scales uniformly in each dimension\n * @param s - Amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling3D(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = s;\n\n return newDst;\n}\n\n/**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given.\n * @param m - The matrix to be modified.\n * @param s - Amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale3D(m: Mat3Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(12)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n\n newDst[ 8] = s * m[2 * 4 + 0];\n newDst[ 9] = s * m[2 * 4 + 1];\n newDst[10] = s * m[2 * 4 + 2];\n\n return newDst;\n}\n\nreturn {\n clone,\n create,\n set,\n fromMat4,\n fromQuat,\n negate,\n copy,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n invert,\n determinant,\n mul,\n multiply,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n get3DScaling,\n translation,\n translate,\n rotation,\n rotate,\n rotationX,\n rotateX,\n rotationY,\n rotateY,\n rotationZ,\n rotateZ,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n scaling3D,\n scale3D,\n uniformScaling3D,\n uniformScale3D,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Mat3Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","import { Mat4Arg, Mat4Type } from './mat4';\nimport { Mat3Arg } from './mat3';\nimport { QuatArg } from './quat';\nimport { Vec3Arg } from './vec3';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\nimport * as utils from './utils';\n\nexport { Mat4Arg, Mat4Type };\n\ntype Mat4Ctor = new (n: number) => T;\n\n/**\n * Generates a typed API for Mat4\n * */\nfunction getAPIImpl(Ctor: Mat4Ctor) {\n const vec3 = getVec3API(Ctor);\n\n/**\n * 4x4 Matrix math math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new matrix. In other words you can do this\n *\n * const mat = mat4.translation([1, 2, 3]); // Creates a new translation matrix\n *\n * or\n *\n * const mat = mat4.create();\n * mat4.translation([1, 2, 3], mat); // Puts translation matrix in mat.\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always save to pass any matrix as the destination. So for example\n *\n * const mat = mat4.identity();\n * const trans = mat4.translation([1, 2, 3]);\n * mat4.multiply(mat, trans, mat); // Multiplies mat * trans and puts result in mat.\n *\n */\n\n\n/**\n * Create a Mat4 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat4's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat4.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @returns created from values.\n */\nfunction create(\n v0?: number, v1?: number, v2?: number, v3?: number,\n v4?: number, v5?: number, v6?: number, v7?: number,\n v8?: number, v9?: number, v10?: number, v11?: number,\n v12?: number, v13?: number, v14?: number, v15?: number) {\n const newDst = new Ctor(16);\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[3] = v3;\n if (v4 !== undefined) {\n newDst[4] = v4;\n if (v5 !== undefined) {\n newDst[5] = v5;\n if (v6 !== undefined) {\n newDst[6] = v6;\n if (v7 !== undefined) {\n newDst[7] = v7;\n if (v8 !== undefined) {\n newDst[8] = v8;\n if (v9 !== undefined) {\n newDst[9] = v9;\n if (v10 !== undefined) {\n newDst[10] = v10;\n if (v11 !== undefined) {\n newDst[11] = v11;\n if (v12 !== undefined) {\n newDst[12] = v12;\n if (v13 !== undefined) {\n newDst[13] = v13;\n if (v14 !== undefined) {\n newDst[14] = v14;\n if (v15 !== undefined) {\n newDst[15] = v15;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Sets the values of a Mat4\n * Also see {@link mat4.create} and {@link mat4.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 created from values.\n */\nfunction set(\n v0: number, v1: number, v2: number, v3: number,\n v4: number, v5: number, v6: number, v7: number,\n v8: number, v9: number, v10: number, v11: number,\n v12: number, v13: number, v14: number, v15: number,\n dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = v0; newDst[ 1] = v1; newDst[ 2] = v2; newDst[ 3] = v3;\n newDst[ 4] = v4; newDst[ 5] = v5; newDst[ 6] = v6; newDst[ 7] = v7;\n newDst[ 8] = v8; newDst[ 9] = v9; newDst[10] = v10; newDst[11] = v11;\n newDst[12] = v12; newDst[13] = v13; newDst[14] = v14; newDst[15] = v15;\n\n return newDst;\n}\n\n/**\n * Creates a Mat4 from a Mat3\n * @param m3 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from m3\n */\nfunction fromMat3(m3: Mat3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = m3[0]; newDst[ 1] = m3[1]; newDst[ 2] = m3[ 2]; newDst[ 3] = 0;\n newDst[ 4] = m3[4]; newDst[ 5] = m3[5]; newDst[ 6] = m3[ 6]; newDst[ 7] = 0;\n newDst[ 8] = m3[8]; newDst[ 9] = m3[9]; newDst[10] = m3[10]; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a Mat4 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from q\n */\nfunction fromQuat(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const x = q[0]; const y = q[1]; const z = q[2]; const w = q[3];\n const x2 = x + x; const y2 = y + y; const z2 = z + z;\n\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n newDst[ 0] = 1 - yy - zz; newDst[ 1] = yx + wz; newDst[ 2] = zx - wy; newDst[ 3] = 0;\n newDst[ 4] = yx - wz; newDst[ 5] = 1 - xx - zz; newDst[ 6] = zy + wx; newDst[ 7] = 0;\n newDst[ 8] = zx + wy; newDst[ 9] = zy - wx; newDst[10] = 1 - xx - yy; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\nfunction negate(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = -m[ 0]; newDst[ 1] = -m[ 1]; newDst[ 2] = -m[ 2]; newDst[ 3] = -m[ 3];\n newDst[ 4] = -m[ 4]; newDst[ 5] = -m[ 5]; newDst[ 6] = -m[ 6]; newDst[ 7] = -m[ 7];\n newDst[ 8] = -m[ 8]; newDst[ 9] = -m[ 9]; newDst[10] = -m[10]; newDst[11] = -m[11];\n newDst[12] = -m[12]; newDst[13] = -m[13]; newDst[14] = -m[14]; newDst[15] = -m[15];\n\n return newDst;\n}\n\n/**\n * Copies a matrix. (same as {@link mat4.clone})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nfunction copy(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = m[ 0]; newDst[ 1] = m[ 1]; newDst[ 2] = m[ 2]; newDst[ 3] = m[ 3];\n newDst[ 4] = m[ 4]; newDst[ 5] = m[ 5]; newDst[ 6] = m[ 6]; newDst[ 7] = m[ 7];\n newDst[ 8] = m[ 8]; newDst[ 9] = m[ 9]; newDst[10] = m[10]; newDst[11] = m[11];\n newDst[12] = m[12]; newDst[13] = m[13]; newDst[14] = m[14]; newDst[15] = m[15];\n\n return newDst;\n}\n\n/**\n * Copies a matrix (same as {@link mat4.copy})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\nconst clone = copy;\n\n/**\n * Check if 2 matrices are approximately equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are approximately equal\n */\nfunction equalsApproximately(a: Mat4Arg, b: Mat4Arg): boolean {\n return Math.abs(a[ 0] - b[ 0]) < utils.EPSILON &&\n Math.abs(a[ 1] - b[ 1]) < utils.EPSILON &&\n Math.abs(a[ 2] - b[ 2]) < utils.EPSILON &&\n Math.abs(a[ 3] - b[ 3]) < utils.EPSILON &&\n Math.abs(a[ 4] - b[ 4]) < utils.EPSILON &&\n Math.abs(a[ 5] - b[ 5]) < utils.EPSILON &&\n Math.abs(a[ 6] - b[ 6]) < utils.EPSILON &&\n Math.abs(a[ 7] - b[ 7]) < utils.EPSILON &&\n Math.abs(a[ 8] - b[ 8]) < utils.EPSILON &&\n Math.abs(a[ 9] - b[ 9]) < utils.EPSILON &&\n Math.abs(a[10] - b[10]) < utils.EPSILON &&\n Math.abs(a[11] - b[11]) < utils.EPSILON &&\n Math.abs(a[12] - b[12]) < utils.EPSILON &&\n Math.abs(a[13] - b[13]) < utils.EPSILON &&\n Math.abs(a[14] - b[14]) < utils.EPSILON &&\n Math.abs(a[15] - b[15]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 matrices are exactly equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are exactly equal\n */\nfunction equals(a: Mat4Arg, b: Mat4Arg): boolean {\n return a[ 0] === b[ 0] &&\n a[ 1] === b[ 1] &&\n a[ 2] === b[ 2] &&\n a[ 3] === b[ 3] &&\n a[ 4] === b[ 4] &&\n a[ 5] === b[ 5] &&\n a[ 6] === b[ 6] &&\n a[ 7] === b[ 7] &&\n a[ 8] === b[ 8] &&\n a[ 9] === b[ 9] &&\n a[10] === b[10] &&\n a[11] === b[11] &&\n a[12] === b[12] &&\n a[13] === b[13] &&\n a[14] === b[14] &&\n a[15] === b[15];\n}\n\n/**\n * Creates a 4-by-4 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 4-by-4 identity matrix.\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\nfunction transpose(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n if (newDst === m) {\n let t;\n\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n\n t = m[3];\n m[3] = m[12];\n m[12] = t;\n\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n\n t = m[7];\n m[7] = m[13];\n m[13] = t;\n\n t = m[11];\n m[11] = m[14];\n m[14] = t;\n return newDst;\n }\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n newDst[ 0] = m00; newDst[ 1] = m10; newDst[ 2] = m20; newDst[ 3] = m30;\n newDst[ 4] = m01; newDst[ 5] = m11; newDst[ 6] = m21; newDst[ 7] = m31;\n newDst[ 8] = m02; newDst[ 9] = m12; newDst[10] = m22; newDst[11] = m32;\n newDst[12] = m03; newDst[13] = m13; newDst[14] = m23; newDst[15] = m33;\n\n return newDst;\n}\n\n/**\n * Computes the inverse of a 4-by-4 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nfunction inverse(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n const tmp12 = m20 * m31;\n const tmp13 = m30 * m21;\n const tmp14 = m10 * m31;\n const tmp15 = m30 * m11;\n const tmp16 = m10 * m21;\n const tmp17 = m20 * m11;\n const tmp18 = m00 * m31;\n const tmp19 = m30 * m01;\n const tmp20 = m00 * m21;\n const tmp21 = m20 * m01;\n const tmp22 = m00 * m11;\n const tmp23 = m10 * m01;\n\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n\n const d = 1 / (m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3);\n\n newDst[ 0] = d * t0;\n newDst[ 1] = d * t1;\n newDst[ 2] = d * t2;\n newDst[ 3] = d * t3;\n newDst[ 4] = d * ((tmp1 * m10 + tmp2 * m20 + tmp5 * m30) -\n (tmp0 * m10 + tmp3 * m20 + tmp4 * m30));\n newDst[ 5] = d * ((tmp0 * m00 + tmp7 * m20 + tmp8 * m30) -\n (tmp1 * m00 + tmp6 * m20 + tmp9 * m30));\n newDst[ 6] = d * ((tmp3 * m00 + tmp6 * m10 + tmp11 * m30) -\n (tmp2 * m00 + tmp7 * m10 + tmp10 * m30));\n newDst[ 7] = d * ((tmp4 * m00 + tmp9 * m10 + tmp10 * m20) -\n (tmp5 * m00 + tmp8 * m10 + tmp11 * m20));\n newDst[ 8] = d * ((tmp12 * m13 + tmp15 * m23 + tmp16 * m33) -\n (tmp13 * m13 + tmp14 * m23 + tmp17 * m33));\n newDst[ 9] = d * ((tmp13 * m03 + tmp18 * m23 + tmp21 * m33) -\n (tmp12 * m03 + tmp19 * m23 + tmp20 * m33));\n newDst[10] = d * ((tmp14 * m03 + tmp19 * m13 + tmp22 * m33) -\n (tmp15 * m03 + tmp18 * m13 + tmp23 * m33));\n newDst[11] = d * ((tmp17 * m03 + tmp20 * m13 + tmp23 * m23) -\n (tmp16 * m03 + tmp21 * m13 + tmp22 * m23));\n newDst[12] = d * ((tmp14 * m22 + tmp17 * m32 + tmp13 * m12) -\n (tmp16 * m32 + tmp12 * m12 + tmp15 * m22));\n newDst[13] = d * ((tmp20 * m32 + tmp12 * m02 + tmp19 * m22) -\n (tmp18 * m22 + tmp21 * m32 + tmp13 * m02));\n newDst[14] = d * ((tmp18 * m12 + tmp23 * m32 + tmp15 * m02) -\n (tmp22 * m32 + tmp14 * m02 + tmp19 * m12));\n newDst[15] = d * ((tmp22 * m22 + tmp16 * m02 + tmp21 * m12) -\n (tmp20 * m12 + tmp23 * m22 + tmp17 * m02));\n\n return newDst;\n}\n\n/**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\nfunction determinant(m: Mat4Arg): number {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n\n return m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3;\n}\n\n/**\n * Computes the inverse of a 4-by-4 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\nconst invert = inverse;\n\n/**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nfunction multiply(a: Mat4Arg, b: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[ 4 + 0];\n const a11 = a[ 4 + 1];\n const a12 = a[ 4 + 2];\n const a13 = a[ 4 + 3];\n const a20 = a[ 8 + 0];\n const a21 = a[ 8 + 1];\n const a22 = a[ 8 + 2];\n const a23 = a[ 8 + 3];\n const a30 = a[12 + 0];\n const a31 = a[12 + 1];\n const a32 = a[12 + 2];\n const a33 = a[12 + 3];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b03 = b[3];\n const b10 = b[ 4 + 0];\n const b11 = b[ 4 + 1];\n const b12 = b[ 4 + 2];\n const b13 = b[ 4 + 3];\n const b20 = b[ 8 + 0];\n const b21 = b[ 8 + 1];\n const b22 = b[ 8 + 2];\n const b23 = b[ 8 + 3];\n const b30 = b[12 + 0];\n const b31 = b[12 + 1];\n const b32 = b[12 + 2];\n const b33 = b[12 + 3];\n\n newDst[ 0] = a00 * b00 + a10 * b01 + a20 * b02 + a30 * b03;\n newDst[ 1] = a01 * b00 + a11 * b01 + a21 * b02 + a31 * b03;\n newDst[ 2] = a02 * b00 + a12 * b01 + a22 * b02 + a32 * b03;\n newDst[ 3] = a03 * b00 + a13 * b01 + a23 * b02 + a33 * b03;\n newDst[ 4] = a00 * b10 + a10 * b11 + a20 * b12 + a30 * b13;\n newDst[ 5] = a01 * b10 + a11 * b11 + a21 * b12 + a31 * b13;\n newDst[ 6] = a02 * b10 + a12 * b11 + a22 * b12 + a32 * b13;\n newDst[ 7] = a03 * b10 + a13 * b11 + a23 * b12 + a33 * b13;\n newDst[ 8] = a00 * b20 + a10 * b21 + a20 * b22 + a30 * b23;\n newDst[ 9] = a01 * b20 + a11 * b21 + a21 * b22 + a31 * b23;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22 + a32 * b23;\n newDst[11] = a03 * b20 + a13 * b21 + a23 * b22 + a33 * b23;\n newDst[12] = a00 * b30 + a10 * b31 + a20 * b32 + a30 * b33;\n newDst[13] = a01 * b30 + a11 * b31 + a21 * b32 + a31 * b33;\n newDst[14] = a02 * b30 + a12 * b31 + a22 * b32 + a32 * b33;\n newDst[15] = a03 * b30 + a13 * b31 + a23 * b32 + a33 * b33;\n\n return newDst;\n}\n\n/**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\nconst mul = multiply;\n\n/**\n * Sets the translation component of a 4-by-4 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\nfunction setTranslation(a: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? identity()) as T;\n if (a !== newDst) {\n newDst[ 0] = a[ 0];\n newDst[ 1] = a[ 1];\n newDst[ 2] = a[ 2];\n newDst[ 3] = a[ 3];\n newDst[ 4] = a[ 4];\n newDst[ 5] = a[ 5];\n newDst[ 6] = a[ 6];\n newDst[ 7] = a[ 7];\n newDst[ 8] = a[ 8];\n newDst[ 9] = a[ 9];\n newDst[10] = a[10];\n newDst[11] = a[11];\n }\n newDst[12] = v[0];\n newDst[13] = v[1];\n newDst[14] = v[2];\n newDst[15] = 1;\n return newDst;\n}\n\n///**\n// * Returns the translation component of a 4-by-4 matrix as a vector with 3\n// * entries.\n// * @param m - The matrix.\n// * @param dst - vector to hold result. If not passed a new one is created.\n// * @returns The translation component of m.\n// */\nfunction getTranslation(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? vec3.create()) as T;\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n}\n\n/**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\nfunction getAxis(m: Mat4Arg, axis: number, dst?: T) {\n const newDst = (dst ?? vec3.create());\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n}\n\n/**\n * Sets an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\nfunction setAxis(m: Mat4Arg, v: Vec3Arg, axis: number, dst: T) {\n const newDst = (dst === m) ? dst : copy(m, dst);\n\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n newDst[off + 2] = v[2];\n return newDst;\n}\n\n/**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\nfunction getScaling(m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? vec3.create()) as T;\n\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 0 to 1 in the z dimension.\n *\n * Note: If you pass `Infinity` for zFar then it will produce a projection matrix\n * returns -Infinity for Z when transforming coordinates with Z <= 0 and +Infinity for Z\n * otherwise.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */\nfunction perspective(fieldOfViewYInRadians: number, aspect: number, zNear: number, zFar: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const f = Math.tan(Math.PI * 0.5 - 0.5 * fieldOfViewYInRadians);\n\n newDst[0] = f / aspect;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n newDst[4] = 0;\n newDst[5] = f;\n newDst[6] = 0;\n newDst[7] = 0;\n\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[11] = -1;\n\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (Number.isFinite(zFar)) {\n const rangeInv = 1 / (zNear - zFar);\n newDst[10] = zFar * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n } else {\n newDst[10] = -1;\n newDst[14] = -zNear;\n }\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 1 (at -zNear) to 0 (at -zFar) in the z dimension.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane. (default = Infinity)\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */function perspectiveReverseZ(fieldOfViewYInRadians: number, aspect: number, zNear: number, zFar = Infinity, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const f = 1 / Math.tan(fieldOfViewYInRadians * 0.5);\n\n newDst[ 0] = f / aspect;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n\n newDst[ 4] = 0;\n newDst[ 5] = f;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n\n newDst[ 8] = 0;\n newDst[ 9] = 0;\n newDst[11] = -1;\n\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (zFar === Infinity) {\n newDst[10] = 0;\n newDst[14] = zNear;\n } else {\n const rangeInv = 1 / (zFar - zNear);\n newDst[10] = zNear * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n }\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 orthogonal transformation matrix that transforms from\n * the given the left, right, bottom, and top dimensions to -1 +1 in x, and y\n * and 0 to +1 in z.\n * @param left - Left side of the near clipping plane viewport.\n * @param right - Right side of the near clipping plane viewport.\n * @param bottom - Bottom of the near clipping plane viewport.\n * @param top - Top of the near clipping plane viewport.\n * @param near - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param far - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The orthographic projection matrix.\n */\nfunction ortho(left: number, right: number, bottom: number, top: number, near: number, far: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[0] = 2 / (right - left);\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n newDst[4] = 0;\n newDst[5] = 2 / (top - bottom);\n newDst[6] = 0;\n newDst[7] = 0;\n\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[10] = 1 / (near - far);\n newDst[11] = 0;\n\n newDst[12] = (right + left) / (left - right);\n newDst[13] = (top + bottom) / (bottom - top);\n newDst[14] = near / (near - far);\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 0 to 1 in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\nfunction frustum(left: number, right: number, bottom: number, top: number, near: number, far: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const dx = (right - left);\n const dy = (top - bottom);\n const dz = (near - far);\n\n newDst[ 0] = 2 * near / dx;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n newDst[ 4] = 0;\n newDst[ 5] = 2 * near / dy;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n newDst[ 8] = (left + right) / dx;\n newDst[ 9] = (top + bottom) / dy;\n newDst[10] = far / dz;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = near * far / dz;\n newDst[15] = 0;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 1 (-near) to 0 (-far) in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\nfunction frustumReverseZ(left: number, right: number, bottom: number, top: number, near: number, far = Infinity, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const dx = (right - left);\n const dy = (top - bottom);\n\n newDst[ 0] = 2 * near / dx;\n newDst[ 1] = 0;\n newDst[ 2] = 0;\n newDst[ 3] = 0;\n newDst[ 4] = 0;\n newDst[ 5] = 2 * near / dy;\n newDst[ 6] = 0;\n newDst[ 7] = 0;\n newDst[ 8] = (left + right) / dx;\n newDst[ 9] = (top + bottom) / dy;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n\n if (far === Infinity) {\n newDst[10] = 0;\n newDst[14] = near;\n } else {\n const rangeInv = 1 / (far - near);\n newDst[10] = near * rangeInv;\n newDst[14] = far * near * rangeInv;\n }\n\n return newDst;\n}\n\nconst xAxis = vec3.create();\nconst yAxis = vec3.create();\nconst zAxis = vec3.create();\n\n/**\n * Computes a 4-by-4 aim transformation.\n *\n * This is a matrix which positions an object aiming down positive Z.\n * toward the target.\n *\n * Note: this is **NOT** the inverse of lookAt as lookAt looks at negative Z.\n *\n * @param position - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\nfunction aim(position: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(target, position, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = xAxis[1]; newDst[ 2] = xAxis[2]; newDst[ 3] = 0;\n newDst[ 4] = yAxis[0]; newDst[ 5] = yAxis[1]; newDst[ 6] = yAxis[2]; newDst[ 7] = 0;\n newDst[ 8] = zAxis[0]; newDst[ 9] = zAxis[1]; newDst[10] = zAxis[2]; newDst[11] = 0;\n newDst[12] = position[0]; newDst[13] = position[1]; newDst[14] = position[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 camera aim transformation.\n *\n * This is a matrix which positions an object aiming down negative Z.\n * toward the target.\n *\n * Note: this is the inverse of `lookAt`\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\nfunction cameraAim(eye: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = xAxis[1]; newDst[ 2] = xAxis[2]; newDst[ 3] = 0;\n newDst[ 4] = yAxis[0]; newDst[ 5] = yAxis[1]; newDst[ 6] = yAxis[2]; newDst[ 7] = 0;\n newDst[ 8] = zAxis[0]; newDst[ 9] = zAxis[1]; newDst[10] = zAxis[2]; newDst[11] = 0;\n newDst[12] = eye[0]; newDst[13] = eye[1]; newDst[14] = eye[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Computes a 4-by-4 view transformation.\n *\n * This is a view matrix which transforms all other objects\n * to be in the space of the view defined by the parameters.\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The look-at matrix.\n */\nfunction lookAt(eye: Vec3Arg, target: Vec3Arg, up: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n\n newDst[ 0] = xAxis[0]; newDst[ 1] = yAxis[0]; newDst[ 2] = zAxis[0]; newDst[ 3] = 0;\n newDst[ 4] = xAxis[1]; newDst[ 5] = yAxis[1]; newDst[ 6] = zAxis[1]; newDst[ 7] = 0;\n newDst[ 8] = xAxis[2]; newDst[ 9] = yAxis[2]; newDst[10] = zAxis[2]; newDst[11] = 0;\n\n newDst[12] = -(xAxis[0] * eye[0] + xAxis[1] * eye[1] + xAxis[2] * eye[2]);\n newDst[13] = -(yAxis[0] * eye[0] + yAxis[1] * eye[1] + yAxis[2] * eye[2]);\n newDst[14] = -(zAxis[0] * eye[0] + zAxis[1] * eye[1] + zAxis[2] * eye[2]);\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which translates by the given vector v.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\nfunction translation(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = v[0]; newDst[13] = v[1]; newDst[14] = v[2]; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Translates the given 4-by-4 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\nfunction translate(m: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n\n if (m !== newDst) {\n newDst[ 0] = m00;\n newDst[ 1] = m01;\n newDst[ 2] = m02;\n newDst[ 3] = m03;\n newDst[ 4] = m10;\n newDst[ 5] = m11;\n newDst[ 6] = m12;\n newDst[ 7] = m13;\n newDst[ 8] = m20;\n newDst[ 9] = m21;\n newDst[10] = m22;\n newDst[11] = m23;\n }\n\n newDst[12] = m00 * v0 + m10 * v1 + m20 * v2 + m30;\n newDst[13] = m01 * v0 + m11 * v1 + m21 * v2 + m31;\n newDst[14] = m02 * v0 + m12 * v1 + m22 * v2 + m32;\n newDst[15] = m03 * v0 + m13 * v1 + m23 * v2 + m33;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the x-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationX(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = 1; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = c; newDst[ 6] = s; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = -s; newDst[10] = c; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the x-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateX(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[4] = c * m10 + s * m20;\n newDst[5] = c * m11 + s * m21;\n newDst[6] = c * m12 + s * m22;\n newDst[7] = c * m13 + s * m23;\n newDst[8] = c * m20 - s * m10;\n newDst[9] = c * m21 - s * m11;\n newDst[10] = c * m22 - s * m12;\n newDst[11] = c * m23 - s * m13;\n\n if (m !== newDst) {\n newDst[ 0] = m[ 0];\n newDst[ 1] = m[ 1];\n newDst[ 2] = m[ 2];\n newDst[ 3] = m[ 3];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the y-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationY(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = 0; newDst[ 2] = -s; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = 1; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = s; newDst[ 9] = 0; newDst[10] = c; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the y-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateY(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 - s * m20;\n newDst[ 1] = c * m01 - s * m21;\n newDst[ 2] = c * m02 - s * m22;\n newDst[ 3] = c * m03 - s * m23;\n newDst[ 8] = c * m20 + s * m00;\n newDst[ 9] = c * m21 + s * m01;\n newDst[10] = c * m22 + s * m02;\n newDst[11] = c * m23 + s * m03;\n\n if (m !== newDst) {\n newDst[ 4] = m[ 4];\n newDst[ 5] = m[ 5];\n newDst[ 6] = m[ 6];\n newDst[ 7] = m[ 7];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the z-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\nfunction rotationZ(angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c; newDst[ 1] = s; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = -s; newDst[ 5] = c; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = 1; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the z-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction rotateZ(m: Mat4Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n\n newDst[ 0] = c * m00 + s * m10;\n newDst[ 1] = c * m01 + s * m11;\n newDst[ 2] = c * m02 + s * m12;\n newDst[ 3] = c * m03 + s * m13;\n newDst[ 4] = c * m10 - s * m00;\n newDst[ 5] = c * m11 - s * m01;\n newDst[ 6] = c * m12 - s * m02;\n newDst[ 7] = c * m13 - s * m03;\n\n if (m !== newDst) {\n newDst[ 8] = m[ 8];\n newDst[ 9] = m[ 9];\n newDst[10] = m[10];\n newDst[11] = m[11];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\nfunction axisRotation(axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n\n newDst[ 0] = xx + (1 - xx) * c;\n newDst[ 1] = x * y * oneMinusCosine + z * s;\n newDst[ 2] = x * z * oneMinusCosine - y * s;\n newDst[ 3] = 0;\n newDst[ 4] = x * y * oneMinusCosine - z * s;\n newDst[ 5] = yy + (1 - yy) * c;\n newDst[ 6] = y * z * oneMinusCosine + x * s;\n newDst[ 7] = 0;\n newDst[ 8] = x * z * oneMinusCosine + y * s;\n newDst[ 9] = y * z * oneMinusCosine - x * s;\n newDst[10] = zz + (1 - zz) * c;\n newDst[11] = 0;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = 0;\n newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle. (same as axisRotation)\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\nconst rotation = axisRotation;\n\n/**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle.\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nfunction axisRotate(m: Mat4Arg, axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n\n const r00 = xx + (1 - xx) * c;\n const r01 = x * y * oneMinusCosine + z * s;\n const r02 = x * z * oneMinusCosine - y * s;\n const r10 = x * y * oneMinusCosine - z * s;\n const r11 = yy + (1 - yy) * c;\n const r12 = y * z * oneMinusCosine + x * s;\n const r20 = x * z * oneMinusCosine + y * s;\n const r21 = y * z * oneMinusCosine - x * s;\n const r22 = zz + (1 - zz) * c;\n\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n\n newDst[ 0] = r00 * m00 + r01 * m10 + r02 * m20;\n newDst[ 1] = r00 * m01 + r01 * m11 + r02 * m21;\n newDst[ 2] = r00 * m02 + r01 * m12 + r02 * m22;\n newDst[ 3] = r00 * m03 + r01 * m13 + r02 * m23;\n newDst[ 4] = r10 * m00 + r11 * m10 + r12 * m20;\n newDst[ 5] = r10 * m01 + r11 * m11 + r12 * m21;\n newDst[ 6] = r10 * m02 + r11 * m12 + r12 * m22;\n newDst[ 7] = r10 * m03 + r11 * m13 + r12 * m23;\n newDst[ 8] = r20 * m00 + r21 * m10 + r22 * m20;\n newDst[ 9] = r20 * m01 + r21 * m11 + r22 * m21;\n newDst[10] = r20 * m02 + r21 * m12 + r22 * m22;\n newDst[11] = r20 * m03 + r21 * m13 + r22 * m23;\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle. (same as rotate)\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\nconst rotate = axisRotate;\n\n/**\n * Creates a 4-by-4 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * three entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction scaling(v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = v[0]; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = v[1]; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = v[2]; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 4-by-4 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of three entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction scale(m: Mat4Arg, v: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n\n newDst[ 0] = v0 * m[0 * 4 + 0];\n newDst[ 1] = v0 * m[0 * 4 + 1];\n newDst[ 2] = v0 * m[0 * 4 + 2];\n newDst[ 3] = v0 * m[0 * 4 + 3];\n newDst[ 4] = v1 * m[1 * 4 + 0];\n newDst[ 5] = v1 * m[1 * 4 + 1];\n newDst[ 6] = v1 * m[1 * 4 + 2];\n newDst[ 7] = v1 * m[1 * 4 + 3];\n newDst[ 8] = v2 * m[2 * 4 + 0];\n newDst[ 9] = v2 * m[2 * 4 + 1];\n newDst[10] = v2 * m[2 * 4 + 2];\n newDst[11] = v2 * m[2 * 4 + 3];\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\n/**\n * Creates a 4-by-4 matrix which scales a uniform amount in each dimension.\n * @param s - the amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\nfunction uniformScaling(s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = s; newDst[ 1] = 0; newDst[ 2] = 0; newDst[ 3] = 0;\n newDst[ 4] = 0; newDst[ 5] = s; newDst[ 6] = 0; newDst[ 7] = 0;\n newDst[ 8] = 0; newDst[ 9] = 0; newDst[10] = s; newDst[11] = 0;\n newDst[12] = 0; newDst[13] = 0; newDst[14] = 0; newDst[15] = 1;\n\n return newDst;\n}\n\n/**\n * Scales the given 4-by-4 matrix in each dimension by a uniform scale.\n * @param m - The matrix to be modified.\n * @param s - The amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\nfunction uniformScale(m: Mat4Arg, s: number, dst?: T) {\n const newDst = (dst ?? new Ctor(16)) as T;\n\n newDst[ 0] = s * m[0 * 4 + 0];\n newDst[ 1] = s * m[0 * 4 + 1];\n newDst[ 2] = s * m[0 * 4 + 2];\n newDst[ 3] = s * m[0 * 4 + 3];\n newDst[ 4] = s * m[1 * 4 + 0];\n newDst[ 5] = s * m[1 * 4 + 1];\n newDst[ 6] = s * m[1 * 4 + 2];\n newDst[ 7] = s * m[1 * 4 + 3];\n newDst[ 8] = s * m[2 * 4 + 0];\n newDst[ 9] = s * m[2 * 4 + 1];\n newDst[10] = s * m[2 * 4 + 2];\n newDst[11] = s * m[2 * 4 + 3];\n\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n\n return newDst;\n}\n\nreturn {\n create,\n set,\n fromMat3,\n fromQuat,\n negate,\n copy,\n clone,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n determinant,\n invert,\n multiply,\n mul,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n perspective,\n perspectiveReverseZ,\n ortho,\n frustum,\n frustumReverseZ,\n aim,\n cameraAim,\n lookAt,\n translation,\n translate,\n rotationX,\n rotateX,\n rotationY,\n rotateY,\n rotationZ,\n rotateZ,\n axisRotation,\n rotation,\n axisRotate,\n rotate,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n};\n\n}\n\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\nexport function getAPI(Ctor: Mat4Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { QuatArg, QuatType } from './quat';\nimport { Mat3Arg } from './mat3.js';\nimport { Mat4Arg } from './mat4.js';\nimport { Vec3Arg } from './vec3.js';\nimport { getAPI as getVec3API } from './vec3-impl';\nimport { BaseArgType } from './types';\n\nexport { QuatArg, QuatType };\n\ntype QuatCtor = new (n: number) => T;\n\nexport type RotationOrder = 'xyz' | 'xzy' | 'yxz' | 'yzx' | 'zxy' | 'zyx';\n\n/**\n * Generates am typed API for Qud\n * */\nfunction getAPIImpl(Ctor: QuatCtor) {\n const vec3 = getVec3API(Ctor);\n\n/**\n * Creates a quat4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number, w?: number) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a Quat; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Quat\n * Also see {@link quat.create} and {@link quat.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, w: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n\n return newDst;\n}\n\n/**\n * Sets a quaternion from the given angle and axis,\n * then returns it.\n *\n * @param axis - the axis to rotate around\n * @param angleInRadians - the angle\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The quaternion that represents the given axis and angle\n **/\nfunction fromAxisAngle(axis: Vec3Arg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n const s = Math.sin(halfAngle);\n\n newDst[0] = s * axis[0];\n newDst[1] = s * axis[1];\n newDst[2] = s * axis[2];\n newDst[3] = Math.cos(halfAngle);\n\n return newDst;\n}\n\n/**\n * Gets the rotation axis and angle\n * @param q - quaternion to compute from\n * @param dst - Vec3 to hold result. If not passed in a new one is created.\n * @return angle and axis\n */\nfunction toAxisAngle(q: QuatArg, dst?: T): { angle: number, axis: T } {\n const newDst = (dst ?? vec3.create(3)) as T;\n\n const angle = Math.acos(q[3]) * 2;\n const s = Math.sin(angle * 0.5);\n if (s > utils.EPSILON) {\n newDst[0] = q[0] / s;\n newDst[1] = q[1] / s;\n newDst[2] = q[2] / s;\n } else {\n newDst[0] = 1;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n\n return { angle, axis: newDst };\n}\n\n/**\n * Returns the angle in degrees between two rotations a and b.\n * @param a - quaternion a\n * @param b - quaternion b\n * @return angle in radians between the two quaternions\n */\nfunction angle(a: QuatArg, b: QuatArg) {\n const d = dot(a, b);\n return Math.acos(2 * d * d - 1);\n}\n\n/**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction multiply(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const bw = b[3];\n\n newDst[0] = ax * bw + aw * bx + ay * bz - az * by;\n newDst[1] = ay * bw + aw * by + az * bx - ax * bz;\n newDst[2] = az * bw + aw * bz + ax * by - ay * bx;\n newDst[3] = aw * bw - ax * bx - ay * by - az * bz;\n\n return newDst;\n}\n\n/**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nconst mul = multiply;\n\n/**\n * Rotates the given quaternion around the X axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateX(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const bx = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw + qw * bx;\n newDst[1] = qy * bw + qz * bx;\n newDst[2] = qz * bw - qy * bx;\n newDst[3] = qw * bw - qx * bx;\n\n return newDst;\n}\n\n/**\n * Rotates the given quaternion around the Y axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateY(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const by = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw - qz * by;\n newDst[1] = qy * bw + qw * by;\n newDst[2] = qz * bw + qx * by;\n newDst[3] = qw * bw - qy * by;\n\n return newDst;\n}\n\n/**\n * Rotates the given quaternion around the Z axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction rotateZ(q: QuatArg, angleInRadians: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const halfAngle = angleInRadians * 0.5;\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n const bz = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n\n newDst[0] = qx * bw + qy * bz;\n newDst[1] = qy * bw - qx * bz;\n newDst[2] = qz * bw + qw * bz;\n newDst[3] = qw * bw - qz * bz;\n\n return newDst;\n}\n\n/**\n * Spherically linear interpolate between two quaternions\n *\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\nfunction slerp(a: QuatArg, b: QuatArg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n\n let bx = b[0];\n let by = b[1];\n let bz = b[2];\n let bw = b[3];\n\n let cosOmega = ax * bx + ay * by + az * bz + aw * bw;\n\n if (cosOmega < 0) {\n cosOmega = -cosOmega;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n\n let scale0;\n let scale1;\n\n if (1.0 - cosOmega > utils.EPSILON) {\n const omega = Math.acos(cosOmega);\n const sinOmega = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinOmega;\n scale1 = Math.sin(t * omega) / sinOmega;\n } else {\n scale0 = 1.0 - t;\n scale1 = t;\n }\n\n newDst[0] = scale0 * ax + scale1 * bx;\n newDst[1] = scale0 * ay + scale1 * by;\n newDst[2] = scale0 * az + scale1 * bz;\n newDst[3] = scale0 * aw + scale1 * bw;\n\n return newDst;\n}\n\n/**\n * Compute the inverse of a quaternion\n *\n * @param q - quaternion to compute the inverse of\n * @returns A quaternion that is the result of a * b\n */\nfunction inverse(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const a0 = q[0];\n const a1 = q[1];\n const a2 = q[2];\n const a3 = q[3];\n\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n\n newDst[0] = -a0 * invDot;\n newDst[1] = -a1 * invDot;\n newDst[2] = -a2 * invDot;\n newDst[3] = a3 * invDot;\n\n return newDst;\n}\n\n/**\n * Compute the conjugate of a quaternion\n * For quaternions with a magnitude of 1 (a unit quaternion)\n * this returns the same as the inverse but is faster to calculate.\n *\n * @param q - quaternion to compute the conjugate of.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The conjugate of q\n */\nfunction conjugate(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = -q[0];\n newDst[1] = -q[1];\n newDst[2] = -q[2];\n newDst[3] = q[3];\n\n return newDst;\n}\n\n/**\n * Creates a quaternion from the given rotation matrix.\n *\n * The created quaternion is not normalized.\n *\n * @param m - rotation matrix\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\nfunction fromMat(m: Mat3Arg | Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n /*\n 0 1 2\n 3 4 5\n 6 7 8\n\n 0 1 2\n 4 5 6\n 8 9 10\n */\n\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n const trace = m[0] + m[5] + m[10];\n\n if (trace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n const root = Math.sqrt(trace + 1); // 2w\n newDst[3] = 0.5 * root;\n const invRoot = 0.5 / root; // 1/(4w)\n\n newDst[0] = (m[6] - m[9]) * invRoot;\n newDst[1] = (m[8] - m[2]) * invRoot;\n newDst[2] = (m[1] - m[4]) * invRoot;\n } else {\n // |w| <= 1/2\n let i = 0;\n\n if (m[5] > m[0]) {\n i = 1;\n }\n if (m[10] > m[i * 4 + i]) {\n i = 2;\n }\n\n const j = (i + 1) % 3;\n const k = (i + 2) % 3;\n\n const root = Math.sqrt(m[i * 4 + i] - m[j * 4 + j] - m[k * 4 + k] + 1.0);\n newDst[i] = 0.5 * root;\n\n const invRoot = 0.5 / root;\n\n newDst[3] = (m[j * 4 + k] - m[k * 4 + j]) * invRoot;\n newDst[j] = (m[j * 4 + i] + m[i * 4 + j]) * invRoot;\n newDst[k] = (m[k * 4 + i] + m[i * 4 + k]) * invRoot;\n }\n\n return newDst;\n}\n\n/**\n * Creates a quaternion from the given euler angle x, y, z using the provided intrinsic order for the conversion.\n *\n * @param xAngleInRadians - angle to rotate around X axis in radians.\n * @param yAngleInRadians - angle to rotate around Y axis in radians.\n * @param zAngleInRadians - angle to rotate around Z axis in radians.\n * @param order - order to apply euler angles\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion representing the same rotation as the euler angles applied in the given order\n */\nfunction fromEuler(\n xAngleInRadians: number,\n yAngleInRadians: number,\n zAngleInRadians: number,\n order: RotationOrder,\n dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const xHalfAngle = xAngleInRadians * 0.5;\n const yHalfAngle = yAngleInRadians * 0.5;\n const zHalfAngle = zAngleInRadians * 0.5;\n\n const sx = Math.sin(xHalfAngle);\n const cx = Math.cos(xHalfAngle);\n const sy = Math.sin(yHalfAngle);\n const cy = Math.cos(yHalfAngle);\n const sz = Math.sin(zHalfAngle);\n const cz = Math.cos(zHalfAngle);\n\n switch (order) {\n case 'xyz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'xzy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n case 'yxz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n case 'yzx':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'zxy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n\n case 'zyx':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n\n default:\n throw new Error(`Unknown rotation order: ${order}`);\n }\n\n return newDst;\n}\n\n/**\n * Copies a quaternion. (same as {@link quat.clone})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is a copy of q\n */\nfunction copy(q: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = q[0];\n newDst[1] = q[1];\n newDst[2] = q[2];\n newDst[3] = q[3];\n\n return newDst;\n}\n\n/**\n * Clones a quaternion. (same as {@link quat.copy})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A copy of q.\n */\nconst clone = copy;\n\n/**\n * Adds two quaternions; assumes a and b have the same dimension.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the sum of a and b.\n */\nfunction add(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\nfunction subtract(a: QuatArg, b: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Multiplies a quaternion by a scalar.\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nfunction mulScalar(v: QuatArg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a quaternion by a scalar. (same as mulScalar)\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\nfunction divScalar(v: QuatArg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n\n return newDst;\n}\n\n/**\n * Computes the dot product of two quaternions\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns dot product\n */\nfunction dot(a: QuatArg, b: QuatArg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n}\n\n/**\n * Performs linear interpolation on two quaternions.\n * Given quaternions a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param t - Interpolation coefficient.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: QuatArg, b: QuatArg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Computes the length of quaternion\n * @param v - quaternion.\n * @returns length of quaternion.\n */\nfunction length(v: QuatArg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n}\n\n/**\n * Computes the length of quaternion (same as length)\n * @param v - quaternion.\n * @returns length of quaternion.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of quaternion\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\nfunction lengthSq(v: QuatArg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n}\n\n/**\n * Computes the square of the length of quaternion (same as lengthSq)\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\nconst lenSq = lengthSq;\n\n/**\n * Divides a quaternion by its Euclidean length and returns the quotient.\n * @param v - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The normalized quaternion.\n */\nfunction normalize(v: QuatArg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n }\n\n return newDst;\n}\n\n/**\n * Check if 2 quaternions are approximately equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are approximately equal\n */\nfunction equalsApproximately(a: QuatArg, b: QuatArg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON &&\n Math.abs(a[3] - b[3]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 quaternions are exactly equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are exactly equal\n */\nfunction equals(a: QuatArg, b: QuatArg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Creates an identity quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns an identity quaternion\n */\nfunction identity(dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n\n return newDst;\n}\n\nconst tempVec3 = vec3.create();\nconst xUnitVec3 = vec3.create();\nconst yUnitVec3 = vec3.create();\n\n/**\n * Computes a quaternion to represent the shortest rotation from one vector to another.\n *\n * @param aUnit - the start vector\n * @param bUnit - the end vector\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\nfunction rotationTo(aUnit: Vec3Arg, bUnit: Vec3Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const dot = vec3.dot(aUnit, bUnit);\n if (dot < -0.999999) {\n vec3.cross(xUnitVec3, aUnit, tempVec3);\n if (vec3.len(tempVec3) < 0.000001) {\n vec3.cross(yUnitVec3, aUnit, tempVec3);\n }\n\n vec3.normalize(tempVec3, tempVec3);\n fromAxisAngle(tempVec3, Math.PI, newDst);\n\n return newDst;\n } else if (dot > 0.999999) {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n\n return newDst;\n } else {\n vec3.cross(aUnit, bUnit, tempVec3);\n\n newDst[0] = tempVec3[0];\n newDst[1] = tempVec3[1];\n newDst[2] = tempVec3[2];\n newDst[3] = 1 + dot;\n\n return normalize(newDst, newDst);\n }\n}\n\nconst tempQuat1 = new Ctor(4);\nconst tempQuat2 = new Ctor(4);\n\n/**\n * Performs a spherical linear interpolation with two control points\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param c - the third quaternion\n * @param d - the fourth quaternion\n * @param t - Interpolation coefficient 0 to 1\n * @returns result\n */\nfunction sqlerp(\n a: QuatArg,\n b: QuatArg,\n c: QuatArg,\n d: QuatArg,\n t: number,\n dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n slerp(a, d, t, tempQuat1);\n slerp(b, c, t, tempQuat2);\n slerp(tempQuat1, tempQuat2, 2 * t * (1 - t), newDst);\n\n return newDst;\n}\n\nreturn {\n create,\n fromValues,\n set,\n fromAxisAngle,\n toAxisAngle,\n angle,\n multiply,\n mul,\n rotateX,\n rotateY,\n rotateZ,\n slerp,\n inverse,\n conjugate,\n fromMat,\n fromEuler,\n copy,\n clone,\n add,\n subtract,\n sub,\n mulScalar,\n scale,\n divScalar,\n dot,\n lerp,\n length,\n len,\n lengthSq,\n lenSq,\n normalize,\n equalsApproximately,\n equals,\n identity,\n rotationTo,\n sqlerp,\n};\n\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\n/**\n *\n * Quat4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Quat4`. In other words you can do this\n *\n * const v = quat4.cross(v1, v2); // Creates a new Quat4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = quat4.create();\n * quat4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * quat4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nexport function getAPI(Ctor: QuatCtor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n","/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport * as utils from './utils.js';\nimport { Vec4Arg, Vec4Type } from './vec4';\nimport { Mat4Arg } from './mat4';\nimport { BaseArgType } from './types';\n\nexport { Vec4Arg, Vec4Type };\n\ntype Vec4Ctor = new (n: number) => T;\n\n/**\n * Generates am typed API for Vec4\n * */\nfunction getAPIImpl(Ctor: Vec4Ctor) {\n\n/**\n * Creates a vec4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\nfunction create(x?: number, y?: number, z?: number, w?: number) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n}\n\n/**\n * Creates a vec4; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\nconst fromValues = create;\n\n/**\n * Sets the values of a Vec4\n * Also see {@link vec4.create} and {@link vec4.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\nfunction set(x: number, y: number, z: number, w: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n\n return newDst;\n}\n\n/**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\nfunction ceil(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n newDst[3] = Math.ceil(v[3]);\n\n return newDst;\n}\n\n/**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\nfunction floor(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n newDst[3] = Math.floor(v[3]);\n\n return newDst;\n}\n\n/**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\nfunction round(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n newDst[3] = Math.round(v[3]);\n\n return newDst;\n}\n\n/**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\nfunction clamp(v: Vec4Arg, min = 0, max = 1, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n newDst[3] = Math.min(max, Math.max(min, v[3]));\n\n return newDst;\n}\n\n/**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\nfunction add(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n\n return newDst;\n}\n\n/**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\nfunction addScaled(a: Vec4Arg, b: Vec4Arg, scale: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n newDst[3] = a[3] + b[3] * scale;\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nfunction subtract(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n\n return newDst;\n}\n\n/**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\nconst sub = subtract;\n\n/**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\nfunction equalsApproximately(a: Vec4Arg, b: Vec4Arg): boolean {\n return Math.abs(a[0] - b[0]) < utils.EPSILON &&\n Math.abs(a[1] - b[1]) < utils.EPSILON &&\n Math.abs(a[2] - b[2]) < utils.EPSILON &&\n Math.abs(a[3] - b[3]) < utils.EPSILON;\n}\n\n/**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\nfunction equals(a: Vec4Arg, b: Vec4Arg): boolean {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\nfunction lerp(a: Vec4Arg, b: Vec4Arg, t: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\nfunction lerpV(a: Vec4Arg, b: Vec4Arg, t: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n newDst[3] = a[3] + t[3] * (b[3] - a[3]);\n\n return newDst;\n}\n\n/**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\nfunction max(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n newDst[3] = Math.max(a[3], b[3]);\n\n return newDst;\n}\n\n/**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\nfunction min(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n newDst[3] = Math.min(a[3], b[3]);\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction mulScalar(v: Vec4Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nconst scale = mulScalar;\n\n/**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\nfunction divScalar(v: Vec4Arg, k: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n\n return newDst;\n}\n\n/**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nfunction inverse(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n newDst[3] = 1 / v[3];\n\n return newDst;\n}\n\n/**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\nconst invert = inverse;\n\n/**\n * Computes the dot product of two vectors\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\nfunction dot(a: Vec4Arg, b: Vec4Arg): number {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n}\n\n/**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\nfunction length(v: Vec4Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n}\n\n/**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\nconst len = length;\n\n/**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\nfunction lengthSq(v: Vec4Arg): number {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n}\n\n/**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\nconst lenSq = lengthSq;\n\n/**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nfunction distance(a: Vec4Arg, b: Vec4Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw);\n}\n\n/**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\nconst dist = distance;\n\n/**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nfunction distanceSq(a: Vec4Arg, b: Vec4Arg): number {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return dx * dx + dy * dy + dz * dz + dw * dw;\n}\n\n/**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\nconst distSq = distanceSq;\n\n/**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\nfunction normalize(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n } else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n }\n\n return newDst;\n}\n\n/**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\nfunction negate(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n newDst[3] = -v[3];\n\n return newDst;\n}\n\n/**\n * Copies a vector. (same as {@link vec4.clone})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nfunction copy(v: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n newDst[3] = v[3];\n\n return newDst;\n}\n\n/**\n * Clones a vector. (same as {@link vec4.copy})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\nconst clone = copy;\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nfunction multiply(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n newDst[3] = a[3] * b[3];\n\n return newDst;\n}\n\n/**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\nconst mul = multiply;\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nfunction divide(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n newDst[3] = a[3] / b[3];\n\n return newDst;\n}\n\n/**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\nconst div = divide;\n\n/**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\nfunction zero(dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n\n return newDst;\n}\n\n\n/**\n * transform vec4 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec4 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\nfunction transformMat4(v: Vec4Arg, m: Mat4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = v[3];\n\n newDst[0] = m[0] * x + m[4] * y + m[ 8] * z + m[12] * w;\n newDst[1] = m[1] * x + m[5] * y + m[ 9] * z + m[13] * w;\n newDst[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n newDst[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n\n return newDst;\n}\n\n\n/**\n * Treat a 4D vector as a direction and set it's length\n *\n * @param a The vec4 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\nfunction setLength(a: Vec4Arg, len: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n}\n\n/**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec4 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\nfunction truncate(a: Vec4Arg, maxLen: number, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n\n return copy(a, newDst);\n}\n\n/**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\nfunction midpoint(a: Vec4Arg, b: Vec4Arg, dst?: T) {\n const newDst = (dst ?? new Ctor(4)) as T;\n return lerp(a, b, 0.5, newDst);\n}\n\nreturn {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n zero,\n transformMat4,\n setLength,\n truncate,\n midpoint,\n};\n}\n\ntype API = ReturnType>;\n\nconst cache = new Map();\n\n/**\n *\n * Vec4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Vec4`. In other words you can do this\n *\n * const v = vec4.cross(v1, v2); // Creates a new Vec4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = vec4.create();\n * vec4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * vec4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nexport function getAPI(Ctor: Vec4Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api as API;\n}\n\n","/**\n * Some docs\n * @namespace wgpu-matrix\n */\nimport {MutableNumberArray, 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 MutableNumberArray,\n BaseArgType,\n\n Mat3Arg,\n Mat4Arg,\n QuatArg,\n Vec2Arg,\n Vec3Arg,\n Vec4Arg,\n\n Mat3Type,\n Mat4Type,\n QuatType,\n Vec2Type,\n Vec3Type,\n Vec4Type,\n};\n\nexport type BaseCtor = new (n: number) => T;\n\nexport type Mat3 = Mat3Type;\nexport type Mat4 = Mat4Type;\nexport type Quat = QuatType;\nexport type Vec2 = Vec2Type;\nexport type Vec3 = Vec3Type;\nexport type Vec4 = Vec4Type;\n\nexport type Mat3d = Mat3Type;\nexport type Mat4d = Mat4Type;\nexport type Quatd = QuatType;\nexport type Vec2d = Vec2Type;\nexport type Vec3d = Vec3Type;\nexport type Vec4d = Vec4Type;\n\nexport type Mat3n = Mat3Type;\nexport type Mat4n = Mat4Type;\nexport type Quatn = QuatType;\nexport type Vec2n = Vec2Type;\nexport type Vec3n = Vec3Type;\nexport type Vec4n = Vec4Type;\n\n/**\n * Generate wgpu-matrix API for type\n */\nfunction wgpuMatrixAPI<\n Mat3 extends BaseArgType,\n Mat4 extends BaseArgType,\n Quat extends BaseArgType,\n Vec2 extends BaseArgType,\n Vec3 extends BaseArgType,\n Vec4 extends BaseArgType,\n>(\n Mat3Ctor: BaseCtor,\n Mat4Ctor: BaseCtor,\n QuatCtor: BaseCtor,\n Vec2Ctor: BaseCtor,\n Vec3Ctor: BaseCtor,\n Vec4Ctor: BaseCtor,\n) {\n return {\n /** @namespace mat3 */\n mat3: getMat3API(Mat3Ctor),\n /** @namespace mat4 */\n mat4: getMat4API(Mat4Ctor),\n /** @namespace quat */\n quat: getQuatAPI(QuatCtor),\n /** @namespace vec2 */\n vec2: getVec2API(Vec2Ctor),\n /** @namespace vec3 */\n vec3: getVec3API(Vec3Ctor),\n /** @namespace vec4 */\n vec4: getVec4API(Vec4Ctor),\n };\n}\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat3,\n /**\n * 4x4 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\n mat4,\n /**\n * Quaternion functions that default to returning `Float32Array`\n * @namespace\n */\n quat,\n /**\n * Vec2 functions that default to returning `Float32Array`\n * @namespace\n */\n vec2,\n /**\n * Vec3 functions that default to returning `Float32Array`\n * @namespace\n */\n vec3,\n /**\n * Vec3 functions that default to returning `Float32Array`\n * @namespace\n */\n vec4,\n} = wgpuMatrixAPI<\n Mat3, Mat4, Quat, Vec2, Vec3, Vec4>(\n Float32Array, Float32Array, Float32Array, Float32Array, Float32Array, Float32Array);\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat3: mat3d,\n /**\n * 4x4 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\n mat4: mat4d,\n /**\n * Quaternion functions that default to returning `Float64Array`\n * @namespace\n */\n quat: quatd,\n /**\n * Vec2 functions that default to returning `Float64Array`\n * @namespace\n */\n vec2: vec2d,\n /**\n * Vec3 functions that default to returning `Float64Array`\n * @namespace\n */\n vec3: vec3d,\n /**\n * Vec3 functions that default to returning `Float64Array`\n * @namespace\n */\n vec4: vec4d,\n} = wgpuMatrixAPI<\n Mat3d, Mat4d, Quatd, Vec2d, Vec3d, Vec4d>(\n Float64Array, Float64Array, Float64Array, Float64Array, Float64Array, Float64Array);\n\nexport const {\n /**\n * 3x3 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat3: mat3n,\n /**\n * 4x4 Matrix functions that default to returning `number[]`\n * @namespace\n */\n mat4: mat4n,\n /**\n * Quaternion functions that default to returning `number[]`\n * @namespace\n */\n quat: quatn,\n /**\n * Vec2 functions that default to returning `number[]`\n * @namespace\n */\n vec2: vec2n,\n /**\n * Vec3 functions that default to returning `number[]`\n * @namespace\n */\n vec3: vec3n,\n /**\n * Vec3 functions that default to returning `number[]`\n * @namespace\n */\n vec4: vec4n,\n} = wgpuMatrixAPI<\n Mat3n, Mat4n, Quatn, Vec2n, Vec3n, Vec4n>(\n ZeroArray, Array, Array, Array, Array, Array);\n"],"names":["ZeroArray","OriginalConstructor","modifier","a","fill","constructor","args","super","this","EPSILON","degrees","Math","PI","n","m","b","v","d","abs","t","radians","old","cache","Map","getAPI","Ctor","api","get","create","x","y","newDst","undefined","subtract","dst","lerp","mulScalar","k","inverse","dot","length","v0","v1","sqrt","lengthSq","distance","dx","dy","distanceSq","normalize","len","copy","multiply","divide","setLength","fromValues","set","ceil","floor","round","clamp","min","max","add","addScaled","scale","angle","ax","ay","bx","by","mag","cosine","acos","sub","equalsApproximately","utils.EPSILON","equals","lerpV","divScalar","invert","cross","z","lenSq","dist","distSq","negate","clone","mul","div","random","cos","sin","zero","transformMat4","transformMat3","rotate","rad","p0","p1","sinC","cosC","truncate","maxLen","midpoint","getAPIImpl","v2","dz","az","bz","t1","t2","zScale","w","transformMat4Upper3x3","transformQuat","q","qx","qy","qz","w2","uvX","uvY","uvZ","getTranslation","getAxis","axis","off","getScaling","xx","xy","xz","yx","yy","yz","zx","zy","zz","rotateX","p","r","rotateY","rotateZ","vec2","getVec2API","vec3","getVec3API","identity","m00","m01","m02","m10","m11","m12","m20","m21","m22","b01","b11","b21","invDet","a00","a01","a02","a10","a11","a12","a20","a21","a22","b00","b02","b10","b12","b20","b22","rotation","angleInRadians","c","s","v3","v4","v5","v6","v7","v8","fromMat4","m4","fromQuat","x2","y2","z2","wx","wy","wz","transpose","determinant","setTranslation","setAxis","get3DScaling","translation","translate","rotationX","rotationY","rotationZ","scaling","uniformScaling","uniformScale","scaling3D","scale3D","uniformScaling3D","uniformScale3D","m03","m13","m23","m30","m31","m32","m33","tmp0","tmp1","tmp2","tmp3","tmp4","tmp5","tmp6","tmp7","tmp8","tmp9","tmp10","tmp11","tmp12","tmp13","tmp14","tmp15","tmp16","tmp17","tmp18","tmp19","tmp20","tmp21","tmp22","tmp23","t0","t3","a03","a13","a23","a30","a31","a32","a33","b03","b13","b23","b30","b31","b32","b33","xAxis","yAxis","zAxis","axisRotation","oneMinusCosine","axisRotate","r00","r01","r02","r10","r11","r12","r20","r21","r22","v9","v10","v11","v12","v13","v14","v15","fromMat3","m3","perspective","fieldOfViewYInRadians","aspect","zNear","zFar","f","tan","Number","isFinite","rangeInv","perspectiveReverseZ","Infinity","ortho","left","right","bottom","top","near","far","frustum","frustumReverseZ","aim","position","target","up","cameraAim","eye","lookAt","fromAxisAngle","halfAngle","aw","bw","slerp","scale0","scale1","cosOmega","omega","sinOmega","tempVec3","xUnitVec3","yUnitVec3","tempQuat1","tempQuat2","toAxisAngle","qw","a0","a1","a2","a3","invDot","conjugate","fromMat","trace","root","invRoot","i","j","fromEuler","xAngleInRadians","yAngleInRadians","zAngleInRadians","order","xHalfAngle","yHalfAngle","zHalfAngle","sx","cx","sy","cy","sz","cz","Error","rotationTo","aUnit","bUnit","sqlerp","dw","wgpuMatrixAPI","Mat3Ctor","Mat4Ctor","QuatCtor","Vec2Ctor","Vec3Ctor","Vec4Ctor","mat3","getMat3API","mat4","getMat4API","quat","getQuatAPI","vec4","getVec4API","Float32Array","mat3d","mat4d","quatd","vec2d","vec3d","vec4d","Float64Array","mat3n","mat4n","quatn","vec2n","vec3n","vec4n","Array"],"mappings":"AA6BO,MAAMA,GAXXC,EAWsC,MAVtCC,EAUsDC,GAAKA,EAAEC,KAAK,GAR3D,cAAcH,EACnB,WAAAI,IAAeC,GACbC,SAASD,GACTJ,EAASM,KACV,IARL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+BUgF,CAAchF,GACpBH,EAAMkC,IAAI/B,EAAMC,IAEXA,CACT,CC1tBA,SAAS8U,EAQLC,EACAC,EACAC,EACAC,EACAC,EACAC,GAEF,MAAO,CAELC,KAAMC,EAAiBP,GAEvBQ,KAAMC,EAAiBR,GAEvBS,KAAMC,EAAiBT,GAEvB5N,KAAMC,EAAiB4N,GAEvB3N,KAAMC,EAAiB2N,GAEvBQ,KAAMC,EAAiBR,GAE3B,CAEa,MAAAC,KAKXA,EAAIE,KAKJA,EAAIE,KAKJA,EAAIpO,KAKJA,EAAIE,KAKJA,EAAIoO,KAKJA,GACEb,EAEAe,aAAcA,aAAcA,aAAcA,aAAcA,aAAcA,eAOxER,KAAMS,EAKNP,KAAMQ,EAKNN,KAAMO,EAKN3O,KAAM4O,EAKN1O,KAAM2O,EAKNP,KAAMQ,GACJrB,EAEAsB,aAAcA,aAAcA,aAAcA,aAAcA,aAAcA,eAOxEf,KAAMgB,EAKNd,KAAMe,EAKNb,KAAMc,EAKNlP,KAAMmP,EAKNjP,KAAMkP,EAKNd,KAAMe,GACJ5B,EAEAxW,EAAWqY,MAAOA,MAAOA,MAAOA,MAAOA"} \ No newline at end of file diff --git a/docs/assets/navigation.js b/docs/assets/navigation.js index 57808d9..0979e6b 100644 --- a/docs/assets/navigation.js +++ b/docs/assets/navigation.js @@ -1 +1 @@ -window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA7WdXZPbxhFF/8s+K3asvkkqfttEfkiVHSeSovJH+QHehlaIySZFgirJKf/3FACSC+5ieoZz248GutvYITS8p3gI/vi/m7792N98ebNuerl5drNt+nfDf230sGr3nw9HP3vXr1c3z25+6UxvvsSzm7t33Up3rd18+eO5/W61sfah/+3B7vpuY8cJ49nLOX/Gb88eujfbT+nmzfaT17trm975X4+nnX5t+3a37qyxPjlkVuNMat8fmtU+OWQ6ne2/3W53m4/duunbVXpRFmqdyW93m/U3TY/kuFNBZsa/D016kU4Fzoz7tpcXr+6aVWf3yTnzIn/W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EVQsiIoWRGhsiIiZUUEyIoIeQ4iaJ8PlM8HxucD6fOB9/nA+nygfD4wPh9Inw+kz4d6nw+sz4cQnw+8z4cAnw+lPwrrpG/OYgNjsYG12MBabCAtNlxtsSUzeNhjA8GKXCgTubAscoEVucCKXCgTubwYTplY4EwsUCYWOBMLRb/lmo7hnEoFXqVCjEoFWqUCq1IhQKUCpVKBUqkQqlIhUqVCgEqFkAf3gbaNQNlGYGwjkLYReNsIrG0EyjYCYxuBtI1A2kaot43A2kYIsY3A20YIsI1Q+oO/TgznHBswjg1YxwasYwPSscHVjk0yhoc95w6sZoICzeRvzb693d2//rSdXUb/advuP5+duhzx/I9//csXf3r+aMrf+/m75cOI4Xiu/9JZmnqHY3/4oqTzdne/1Hy7uy/pXvrTT8dL+nWpWcuu3JZ6ragXC60o61xeL5StFxLrhcL1wtJ6oWy9sLReKFivSy1sah2OlXUurNfxcEn30nqdjpf0P1mv8WDZlT9Zr/Fgvvfl8cfWv91p++Qf9cXJ3KQ3Fz/LPA0YjuWvYahaWPnj4ZLupZU/HS/pf7Ly48GyK3+y8uPBot4nO+FwrKxzeb1KdsKhLLFeRTvhm8sH0Dw0l63X051wPFjU+2QnHI6VdS6vV8lOOJQl1qtoJ3xz+Sn0Q3PZej3dCceDqd6f/g/b017/aeMAAA==" \ No newline at end of file +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA7WdXZPbxhFF/8s+K3KsvnYqfttEfkiVZSeSovJH+QHahlaIySYXBLckp/LfUwBILriL6Rnith8NdLfBWWh4T/EQ/OW/V139qbv65mpddXL17GpbdR/7/9roflXvvuiPPv/YrVdXz65+a0yvvsGzq5uPzUrb2q6++eXUfrPaWP3Q/2FvN12zscOE4ez5nK/xv2cP3Zvt53TzZvvZ623rqnP+18Npp1/rrm7XjVXWJYdMapxJ9d2+Wu2SQ8bT2f7r7bbdfGrWVVev0osyU+tM/tBu1q+qDslxx4LMjH/tq/QiHQucGbd1Jy/f3FSrxm6Tc6ZF/qzr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ArgpIVQcmKCJUVESkrIkBWRMhzEEH7fKB8PjA+H0ifD7zPB9bnA+XzgfH5QPp8IH0+LPf5wPp8CPH5wPt8CPD5UPqjsE765iw2MBYbWIsNrMUG0mLDxRZbMoOHPTYQrMiFMpEL8yIXWJELrMiFMpHLi+GUiQXOxAJlYoEzsVD0W67pGM6pVOBVKsSoVKBVKrAqFQJUKlAqFSiVCqEqFSJVKgSoVAh5cB9o2wiUbQTGNgJpG4G3jcDaRqBsIzC2EUjbCKRthOW2EVjbCCG2EXjbCAG2EUp/8NeJ4ZxjA8axAevYgHVsQDo2uNixScbwsOfcgdVMUKCZvNp3/e/ifr9fv6/b67atJv9SGuvq9kN1U+++eFp2PvXFV19Phv6t2tXX7e3bz9vJa+s+b+vdF5NTjyb8+a9/+fKrF4+m/L2bvgU/jOiP5/rPRaixtz/2py9LOq/b27nm6/a2pHvupR+Pl/TrXLOWXbnN9VpRL2ZaUdY5v14oWy8k1guF64W59ULZemFuvVCwXueu2djaHyvrnFmvw+GS7rn1Oh4v6X+yXsPBsit/sl7DwXzv68MvuP/Qav3kH/XZydykd2e/9TwO6I/lr6Gvmln5w+GS7rmVPx4v6X+y8sPBsit/svLDwaLeJzthf6ysc369SnbCviyxXkU74bvzp9o8NJet19OdcDhY1PtkJ+yPlXXOr1fJTtiXJdaraCd8d/7R9kNz2Xo93QmHg6neX/8PdRDk9L7jAAA=" \ No newline at end of file diff --git a/docs/assets/search.js b/docs/assets/search.js index 8505e43..5a4a80c 100644 --- a/docs/assets/search.js +++ b/docs/assets/search.js @@ -1 +1 @@ -window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA62d25IjyXGm36V0W9tEnANzRy11ITNxtStyaZLaxmjFBqZZUhVQU4fZIWl897WMhGdnOn739EjMVbcVAI/ISM8Id/8i4//b3ev5/73dfff5b3f//Xg63H3nd/vikr+/Oz08H+++u/vHh7fj/3w/v97d3328Pt19d/f+l5fj26/oz5/+/P78dHd/9+Xp4e3t+Hb33d3d3+/J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YMJudbTKaNirZnZDB2XX6cvzZZzL1a7ladefpl0I21wMHS1aDPS9/G16oHO+xdpXmMSBOP/fKWg754+4OmKvOgA9g+301QzEO1iBJmJigHN0byg6WrQZ8Xj4ttiR3sLAd9QQFpkrfNN4Ox5aDP69DTy6r2nl0P+rzIZtwq8dfj63ID/oIl7KciK/2HcrI4cT/qeqKcrEwbaCi9rMlwVd/f3708vhyfHk/Hu+8+f//3v/9/ZQArTStiAgA="; \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA62db3MjyXHmvwv9ljdC/S/su/XJLxxh+e4sncL2hELBJaARbRKcBcm9lRT67hddjezpTjyZndXYVzNBAFnV3dlVmfmrqudvd+fX//d2993nv93999PpcPed3+2LS/7+7vTwcrz77u4fH96O//P99Xx3f/dxfr777u79L1+Pb7+iP3/68/vL89393ePzw9vb8e3uu7u7v9+TreS+2fnjH4cfalb+YfrKzNj93deH8/H0Pu/JtwZ4Z3/z8B5YE8Of/odTuwmsxGsrsdPK//l4eGdWhj91Wvn98dEzK8Of+q3w+zL8qd8Kvy/Dn/rvbjiAh3TY8JSAndhrZ3go3E7724Ynxe20v214VsBO9/0ZHg2w031/hmdzAs/rtOF5ATux187wbLid9rcNz4vbaX/b8LyAne77MzwbYGf1/sTJwst89Ht5PXw8H99+NfxR/X3+ZuDx+fX0bYj+08fp8f3p9XSx0T4ElmYjdOsAtnw+PrzLptunW22/Hd8lw2/H961W/3R+fVlMBMw0fX6L/cUUAewPn2+1fzp+Ue74+Onmp/n69S/is3z9+petdo8/fjw8v33/9ev59eenl4f347PYDPjqba3qDW21/XQ4nt6f3sXLoM+32n8/P5zevr6+iQ96+sLmKzj9dDzL9i8f32RdfAfGT7faPhzfj+eXp9PDSWxg9pWtrbx8PEvWXz6eb7D6/vRVdn/6/IYx83eDZzw/DEaV4XP2ra1tfTG19eWXauv7n5/El/ny8Q13TbP+dpv1L8f33z4+PD+dvijdv3zjhjbCr9dbmb5z07ikP/D32582mdBHv+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YieUtxInY/01CMVFNK0DoY6X9xUviEcYlwi8/6KFyPNn9ZEQSfCaSxCN5f+0+v5anXPcCLV7F2bVhjQpEYFyTSVZGlQrDvbmD5vOi6bnj8IuiIfp9ecXGUqHfrpNZ8qMuQh++k1tznGolcfX78ez+FndmPmOxJolE80cFfjUpOpHV5AGE7ymtmn2hxNRtW4FoHGqmWiOfMZskyPNlALgR5tprksG5fdCuNjnHkS+c9UKyb3CfQw8zSQGWu8rdWvr2zdxWzOmaA0NTUVQaYlszSgZGOt9v38cXpkN9ctMBc5qZ8WL041cHLSRB1LU6GbYqdKXazGqPrj9DQ403U8OystpKm0QHNSmCoKEyOaCgm20X7eLovOZrFGnpLbKYO1xecz8zzinN3sNCWrdD1Utw5TrZZocTauUFm2zC5tlpXRTBZousrGVaYf70/LhdDDgQ2zOMl2g346PvpF12Y9u9wU456uwdJV+XFehS22gWewsyw/zkdzqlx5W+wzGFsGk/PlK9MiSNs7Mhi7Lj/ON0EamfRPx8flStiZp19uurEWOFi6uunzOqZxp+xgh+2DmseINPCYbzrj94udJTRUmW864Pfzeo9xt9dPx8dFlDB7bpSDGyP5wdLVTZ+zjGK3s7zpC7BIg7z5CTKEP69DTxthze8gQPjz4cWYJPz1eF4u7l+whP1UZKX/UE4WJ5RIXU+Uk5VpTQ6llzUZruoP93dfn74en59Ox7vvPv/h73///6lSZ3TkYwIA"; \ No newline at end of file diff --git a/docs/interfaces/MutableNumberArray.html b/docs/interfaces/MutableNumberArray.html new file mode 100644 index 0000000..a09c1e7 --- /dev/null +++ b/docs/interfaces/MutableNumberArray.html @@ -0,0 +1,6 @@ +MutableNumberArray | wgpu-matrix

Interface MutableNumberArray

A type wider than number[], omitting any instance functions +unused by the API, e.g., map, sort. This allows the math +functions to operate on a wider range of array-like +values.

+
interface MutableNumberArray {
    length: number;
    [n: number]: number;
}

Indexable

[n: number]: number

Properties

Properties

length: number
\ No newline at end of file diff --git a/docs/modules.html b/docs/modules.html index 89fc64e..d9bae3b 100644 --- a/docs/modules.html +++ b/docs/modules.html @@ -17,6 +17,7 @@ vec4 vec4d vec4n +

Interfaces

Type Aliases

BaseArgType BaseCtor Mat3 diff --git a/docs/types/BaseArgType.html b/docs/types/BaseArgType.html index ffe425e..e944bde 100644 --- a/docs/types/BaseArgType.html +++ b/docs/types/BaseArgType.html @@ -1,3 +1,3 @@ -BaseArgType | wgpu-matrix

Type Alias BaseArgType

BaseArgType: Float32Array | Float64Array | number[]

The types you can pass to most functions that take an +BaseArgType | wgpu-matrix

Type Alias BaseArgType

BaseArgType: Float32Array | Float64Array | MutableNumberArray

The types you can pass to most functions that take an array of numbers.

\ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 535bb09..137d3a4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wgpu-matrix", - "version": "3.2.0", + "version": "3.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "wgpu-matrix", - "version": "3.2.0", + "version": "3.3.0", "license": "MIT", "devDependencies": { "@rollup/plugin-terser": "^0.4.4", diff --git a/package.json b/package.json index 5f26743..2a47eff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wgpu-matrix", - "version": "3.2.0", + "version": "3.3.0", "description": "fast matrix math library for WebGPU", "main": "dist/3.x/wgpu-matrix.module.js", "module": "dist/3.x/wgpu-matrix.module.js", diff --git a/src/types.ts b/src/types.ts index 87cb587..726151a 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,8 +1,19 @@ +/** + * A type wider than `number[]`, omitting any instance functions + * unused by the API, e.g., map, sort. This allows the math + * functions to operate on a wider range of array-like + * values. + */ +export interface MutableNumberArray { + readonly length: number; + [n: number]: number; +} + /** * The types you can pass to most functions that take an * array of numbers. */ -export type BaseArgType = Float32Array | Float64Array | number[]; +export type BaseArgType = Float32Array | Float64Array | MutableNumberArray; function wrapConstructor any>( OriginalConstructor: T, diff --git a/src/wgpu-matrix.ts b/src/wgpu-matrix.ts index d757056..4f51b2f 100644 --- a/src/wgpu-matrix.ts +++ b/src/wgpu-matrix.ts @@ -2,7 +2,7 @@ * Some docs * @namespace wgpu-matrix */ -import {BaseArgType, ZeroArray} from './types'; +import {MutableNumberArray, BaseArgType, ZeroArray} from './types'; import {Mat3Arg, Mat3Type, getAPI as getMat3API} from './mat3-impl'; import {Mat4Arg, Mat4Type, getAPI as getMat4API} from './mat4-impl'; import {QuatArg, QuatType, getAPI as getQuatAPI, RotationOrder} from './quat-impl'; @@ -15,6 +15,7 @@ export { RotationOrder, utils, + MutableNumberArray, BaseArgType, Mat3Arg,