{"version":3,"file":"matrix4x4-BWmf4lZM.mjs","names":["equals","make","fromRows","fromColumns","setRow","toRows","setColumn","toColumns","determinant","vectorProductLeft","vector2.make","vector2.dot","rowVector","vectorProductRight","columnVector","solveSystem","transpose","reverseRows","reverseColumns","equals","make","fromRows","fromColumns","setRow","toRows","setColumn","toColumns","determinant","matrix2x2.determinant","minor","vector3.components","matrix2x2.make","vectorProductLeft","vector3.make","vector3.dot","vectorProductRight","solveSystem","rowVector","columnVector","transpose","reverseRows","reverseColumns","isMatrix4x4","equals","identity","make","fromRows","fromColumns","setRow","toRows","setColumn","toColumns","determinant","matrix3x3.determinant","minor","vector4.components","matrix3x3.make","vectorProductLeft","vector4.make","vector4.dot","vectorProductRight","multiply","inverse","solveSystem","rowVector","columnVector","transpose","reverseRows","reverseColumns","internal.isMatrix4x4","internal.identity","internal.equals","internal.make","internal.fromRows","internal.fromColumns","internal.setRow","internal.setColumn","internal.determinant","internal.minor","internal.vectorProductLeft","internal.vectorProductRight","internal.multiply","internal.inverse","internal.solveSystem","internal.toRows","internal.toColumns","internal.rowVector","internal.columnVector","internal.transpose","internal.reverseRows","internal.reverseColumns"],"sources":["../../src/dimensions.ts","../../src/matrix/matrix2x2.internal.ts","../../src/matrix/matrix3x3.internal.ts","../../src/matrix/matrix4x4.internal.ts","../../src/matrix/matrix4x4.ts"],"sourcesContent":["import { invariant } from './utils.ts'\n\nexport type TwoDimensionalIndex = 0 | 1\nexport type TwoDimensionalComponent = 'x' | 'y'\n\nexport interface TwoDimensional<out T1, out T2 = T1> {\n  readonly x: T1\n  readonly y: T2\n\n  readonly 0: T1\n  readonly 1: T2\n}\n\nexport type ThreeDimensionalIndex = TwoDimensionalIndex | 2\nexport type ThreeDimensionalComponent = TwoDimensionalComponent | 'z'\n\nexport interface ThreeDimensional<out T1, out T2 = T1, out T3 = T2> extends TwoDimensional<T1, T2> {\n  readonly z: T3\n  readonly 2: T3\n}\n\nexport type FourDimensionalIndex = ThreeDimensionalIndex | 3\nexport type FourDimensionalComponent = ThreeDimensionalComponent | 'w'\n\nexport interface FourDimensional<\n  out T1,\n  out T2 = T1,\n  out T3 = T2,\n  out T4 = T3,\n> extends ThreeDimensional<T1, T2, T3> {\n  readonly w: T4\n  readonly 3: T4\n}\n\nfunction toIndex(input: string | number): number {\n  if (typeof input === 'number') {\n    invariant(input >= 0 && input <= 3, 'Index out of bounds')\n\n    return input\n  }\n\n  if (input === 'x') {\n    return 0\n  }\n\n  if (input === 'y') {\n    return 1\n  }\n\n  if (input === 'z') {\n    return 2\n  }\n\n  if (input === 'w') {\n    return 3\n  }\n\n  invariant(false, 'Invalid component')\n}\n\nexport const toTwoDimensionalIndex = toIndex as (\n  input: TwoDimensionalIndex | TwoDimensionalComponent,\n) => TwoDimensionalIndex\nexport const toThreeDimensionalIndex = toIndex as (\n  input: ThreeDimensionalIndex | ThreeDimensionalComponent,\n) => ThreeDimensionalIndex\nexport const toFourDimensionalIndex = toIndex as (\n  input: FourDimensionalIndex | FourDimensionalComponent,\n) => FourDimensionalIndex\n","import { toTwoDimensionalIndex } from '../dimensions.ts'\nimport { dual, Pipeable } from '../utils.ts'\nimport { invariant } from '../utils.ts'\nimport { epsEquals } from '../number.ts'\nimport type { Vector2 } from '../vector/vector2.ts'\nimport * as vector2 from '../vector/vector2.internal.ts'\nimport type { Matrix2x2, Matrix2x2Coordinate } from './matrix2x2.ts'\n\nexport const Matrix2x2TypeId: unique symbol = Symbol.for('curvy/matrix2x2')\nexport type Matrix2x2TypeId = typeof Matrix2x2TypeId\n\nclass Matrix2x2Impl extends Pipeable implements Matrix2x2 {\n  readonly [Matrix2x2TypeId]: Matrix2x2TypeId = Matrix2x2TypeId\n\n  readonly m00: number\n  readonly m01: number\n\n  readonly m10: number\n  readonly m11: number\n\n  constructor(m00 = 0, m01 = 0, m10 = 0, m11 = 0) {\n    super()\n    this.m00 = m00\n    this.m01 = m01\n    this.m10 = m10\n    this.m11 = m11\n  }\n\n  get [Symbol.toStringTag]() {\n    return `Matrix2x2(${this.m00}, ${this.m01}, ${this.m10}, ${this.m11})`\n  }\n\n  get [Symbol.for('nodejs.util.inspect.custom')]() {\n    return `Matrix2x2(${this.m00}, ${this.m01}, ${this.m10}, ${this.m11})`\n  }\n\n  [Symbol.hasInstance](m: unknown): m is Matrix2x2 {\n    return isMatrix2x2(m)\n  }\n}\n\n/** @internal */\nexport const isMatrix2x2 = (m: unknown): m is Matrix2x2 =>\n  typeof m === 'object' && m !== null && Matrix2x2TypeId in m\n\n/** @internal */\nexport const equals = dual<\n  (b: Matrix2x2) => (a: Matrix2x2) => boolean,\n  (a: Matrix2x2, b: Matrix2x2) => boolean\n>(\n  2,\n  (a: Matrix2x2, b: Matrix2x2) =>\n    epsEquals(a.m00, b.m00) &&\n    epsEquals(a.m01, b.m01) &&\n    epsEquals(a.m10, b.m10) &&\n    epsEquals(a.m11, b.m11),\n)\n\n/** @internal */\nexport const make = (m00 = 0, m01 = m00, m10 = m01, m11 = m10) =>\n  new Matrix2x2Impl(m00, m01, m10, m11)\n\n/** @internal */\nexport const fromRows = (v0: Vector2, v1: Vector2) => new Matrix2x2Impl(v0.x, v0.y, v1.x, v1.y)\n\n/** @internal */\nexport const fromColumns = (v0: Vector2, v1: Vector2) => new Matrix2x2Impl(v0.x, v1.x, v0.y, v1.y)\n\n/** @internal */\nexport const setRow = dual<\n  (row: Matrix2x2Coordinate, v: Vector2) => (m: Matrix2x2) => Matrix2x2,\n  (m: Matrix2x2, row: Matrix2x2Coordinate, v: Vector2) => Matrix2x2\n>(3, (m: Matrix2x2, row: Matrix2x2Coordinate, v: Vector2) =>\n  fromRows(...(toRows(m).with(toTwoDimensionalIndex(row), v) as [Vector2, Vector2])),\n)\n\n/** @internal */\nexport const setColumn = dual<\n  (column: Matrix2x2Coordinate, v: Vector2) => (m: Matrix2x2) => Matrix2x2,\n  (m: Matrix2x2, column: Matrix2x2Coordinate, v: Vector2) => Matrix2x2\n>(3, (m: Matrix2x2, column: Matrix2x2Coordinate, v: Vector2) =>\n  fromColumns(...(toColumns(m).with(toTwoDimensionalIndex(column), v) as [Vector2, Vector2])),\n)\n\n/** @internal */\nexport const determinant = (m: Matrix2x2): number => m.m00 * m.m11 - m.m01 * m.m10\n\n//   (a: Vector2, b: Vector2) => a.x * b.x + a.y * b.y\n\n/*\n * {\n *   x: first row dot v -> fr.x\n *   y: second row dot v\n * }\n * */\n\n/** @internal */\nexport const vectorProductLeft = dual<\n  (v: Vector2) => (m: Matrix2x2) => Vector2,\n  (m: Matrix2x2, v: Vector2) => Vector2\n>(2, (m: Matrix2x2, v: Vector2) =>\n  vector2.make(vector2.dot(rowVector(m, 0), v), vector2.dot(rowVector(m, 1), v)),\n)\n\n/** @internal */\nexport const vectorProductRight = dual<\n  (v: Vector2) => (m: Matrix2x2) => Vector2,\n  (m: Matrix2x2, v: Vector2) => Vector2\n>(2, (m: Matrix2x2, v: Vector2) =>\n  vector2.make(vector2.dot(columnVector(m, 0), v), vector2.dot(columnVector(m, 1), v)),\n)\n\n/** @internal */\nexport const solveSystem = dual<\n  (v: Vector2) => (m: Matrix2x2) => Vector2,\n  (m: Matrix2x2, v: Vector2) => Vector2\n>(2, (m: Matrix2x2, v: Vector2) => {\n  const inverseDeterminant = 1 / determinant(m)\n\n  invariant(\n    Number.isFinite(inverseDeterminant),\n    'cannot solve system when coefficient matrix determinant is zero',\n  )\n\n  return vector2.make(\n    determinant(setColumn(m, 0, v)) * inverseDeterminant,\n    determinant(setColumn(m, 1, v)) * inverseDeterminant,\n  )\n})\n\n/** @internal */\nexport const toRows = (m: Matrix2x2): [Vector2, Vector2] => [\n  vector2.make(m.m00, m.m01),\n  vector2.make(m.m10, m.m11),\n]\n\n/** @internal */\nexport const toColumns = (m: Matrix2x2): [Vector2, Vector2] => [\n  vector2.make(m.m00, m.m10),\n  vector2.make(m.m01, m.m11),\n]\n\n/** @internal */\nexport const rowVector = dual<\n  (row: Matrix2x2Coordinate) => (m: Matrix2x2) => Vector2,\n  (m: Matrix2x2, row: Matrix2x2Coordinate) => Vector2\n>(2, (m: Matrix2x2, row: Matrix2x2Coordinate) => toRows(m)[toTwoDimensionalIndex(row)])\n\n/** @internal */\nexport const columnVector = dual<\n  (column: Matrix2x2Coordinate) => (m: Matrix2x2) => Vector2,\n  (m: Matrix2x2, column: Matrix2x2Coordinate) => Vector2\n>(2, (m: Matrix2x2, column: Matrix2x2Coordinate) => toColumns(m)[toTwoDimensionalIndex(column)])\n\n/** @internal */\nexport const transpose = (m: Matrix2x2) => fromColumns(...toRows(m))\n\n/** @internal */\nexport const reverseRows = (m: Matrix2x2) => {\n  const [r0, r1] = toRows(m)\n  return fromRows(r1, r0)\n}\n\n/** @internal */\nexport const reverseColumns = (m: Matrix2x2) => {\n  const [c0, c1] = toColumns(m)\n  return fromColumns(c1, c0)\n}\n","import { toThreeDimensionalIndex } from '../dimensions.ts'\nimport { dual, Pipeable } from '../utils.ts'\nimport { invariant } from '../utils.ts'\nimport { epsEquals } from '../number.ts'\nimport type { Vector3 } from '../vector/vector3.ts'\nimport * as vector3 from '../vector/vector3.internal.ts'\nimport type { Matrix2x2 } from './matrix2x2.ts'\nimport * as matrix2x2 from './matrix2x2.internal.ts'\nimport type { Matrix3x3, Matrix3x3Coordinate } from './matrix3x3.ts'\n\nexport const Matrix3x3TypeId: unique symbol = Symbol.for('curvy/matrix3x3')\nexport type Matrix3x3TypeId = typeof Matrix3x3TypeId\n\nclass Matrix3x3Impl extends Pipeable implements Matrix3x3 {\n  readonly [Matrix3x3TypeId]: Matrix3x3TypeId = Matrix3x3TypeId\n\n  readonly m00: number\n  readonly m01: number\n  readonly m02: number\n\n  readonly m10: number\n  readonly m11: number\n  readonly m12: number\n\n  readonly m20: number\n  readonly m21: number\n  readonly m22: number\n\n  constructor(m00 = 0, m01 = 0, m02 = 0, m10 = 0, m11 = 0, m12 = 0, m20 = 0, m21 = 0, m22 = 0) {\n    super()\n    this.m00 = m00\n    this.m01 = m01\n    this.m02 = m02\n    this.m10 = m10\n    this.m11 = m11\n    this.m12 = m12\n    this.m20 = m20\n    this.m21 = m21\n    this.m22 = m22\n  }\n\n  get [Symbol.toStringTag]() {\n    return `Matrix3x3(${this.m00}, ${this.m01}, ${this.m02}, ${this.m10}, ${this.m11}, ${this.m12}, ${this.m20}, ${this.m21}, ${this.m22})`\n  }\n\n  get [Symbol.for('nodejs.util.inspect.custom')]() {\n    return `Matrix3x3(${this.m00}, ${this.m01}, ${this.m02}, ${this.m10}, ${this.m11}, ${this.m12}, ${this.m20}, ${this.m21}, ${this.m22})`\n  }\n\n  [Symbol.hasInstance](m: unknown): m is Matrix3x3 {\n    return isMatrix3x3(m)\n  }\n}\n\nexport type { Matrix3x3 }\n\n/** @internal */\nexport const isMatrix3x3 = (m: unknown): m is Matrix3x3 =>\n  typeof m === 'object' && m !== null && Matrix3x3TypeId in m\n\n/** @internal */\nexport const equals = dual<\n  (b: Matrix3x3) => (a: Matrix3x3) => boolean,\n  (a: Matrix3x3, b: Matrix3x3) => boolean\n>(\n  2,\n  (a: Matrix3x3, b: Matrix3x3) =>\n    epsEquals(a.m00, b.m00) &&\n    epsEquals(a.m01, b.m01) &&\n    epsEquals(a.m02, b.m02) &&\n    epsEquals(a.m10, b.m10) &&\n    epsEquals(a.m11, b.m11) &&\n    epsEquals(a.m12, b.m12) &&\n    epsEquals(a.m20, b.m20) &&\n    epsEquals(a.m21, b.m21) &&\n    epsEquals(a.m22, b.m22),\n)\n\n/** @internal */\nexport const make = (\n  m00 = 0,\n  m01 = m00,\n  m02 = m01,\n  m10 = m02,\n  m11 = m10,\n  m12 = m11,\n  m20 = m12,\n  m21 = m20,\n  m22 = m21,\n): Matrix3x3 => {\n  return new Matrix3x3Impl(m00, m01, m02, m10, m11, m12, m20, m21, m22)\n}\n\n/** @internal */\nexport const fromRows = (v0: Vector3, v1: Vector3, v2: Vector3): Matrix3x3 =>\n  new Matrix3x3Impl(v0.x, v0.y, v0.z, v1.x, v1.y, v1.z, v2.x, v2.y, v2.z)\n\n/** @internal */\nexport const fromColumns = (v0: Vector3, v1: Vector3, v2: Vector3): Matrix3x3 =>\n  new Matrix3x3Impl(v0.x, v1.x, v2.x, v0.y, v1.y, v2.y, v0.z, v1.z, v2.z)\n\n/** @internal */\nexport const setRow = dual<\n  (row: Matrix3x3Coordinate, v: Vector3) => (m: Matrix3x3) => Matrix3x3,\n  (m: Matrix3x3, row: Matrix3x3Coordinate, v: Vector3) => Matrix3x3\n>(3, (m: Matrix3x3, row: Matrix3x3Coordinate, v: Vector3) =>\n  fromRows(...(toRows(m).with(toThreeDimensionalIndex(row), v) as [Vector3, Vector3, Vector3])),\n)\n\n/** @internal */\nexport const setColumn = dual<\n  (column: Matrix3x3Coordinate, v: Vector3) => (m: Matrix3x3) => Matrix3x3,\n  (m: Matrix3x3, column: Matrix3x3Coordinate, v: Vector3) => Matrix3x3\n>(3, (m: Matrix3x3, column: Matrix3x3Coordinate, v: Vector3) =>\n  fromColumns(\n    ...(toColumns(m).with(toThreeDimensionalIndex(column), v) as [Vector3, Vector3, Vector3]),\n  ),\n)\n\n/** @internal */\nexport const determinant = (m: Matrix3x3) =>\n  m.m00 * matrix2x2.determinant(minor(m, 0, 0)) -\n  m.m01 * matrix2x2.determinant(minor(m, 0, 1)) +\n  m.m02 * matrix2x2.determinant(minor(m, 0, 2))\n\n/** @internal */\nexport const minor = dual<\n  (row: Matrix3x3Coordinate, column: Matrix3x3Coordinate) => (m: Matrix3x3) => Matrix2x2,\n  (m: Matrix3x3, row: Matrix3x3Coordinate, column: Matrix3x3Coordinate) => Matrix2x2\n>(3, (m: Matrix3x3, row: Matrix3x3Coordinate, column: Matrix3x3Coordinate) => {\n  const [v0, v1] = toRows(m).toSpliced(toThreeDimensionalIndex(row), 1) as [Vector3, Vector3]\n  const columnIndex = toThreeDimensionalIndex(column)\n  const [m00, m01] = vector3.components(v0).toSpliced(columnIndex, 1) as [number, number]\n  const [m10, m11] = vector3.components(v1).toSpliced(columnIndex, 1) as [number, number]\n\n  return matrix2x2.make(m00, m01, m10, m11) as Matrix2x2\n})\n\n/** @internal */\nexport const vectorProductLeft = dual<\n  (v: Vector3) => (m: Matrix3x3) => Vector3,\n  (m: Matrix3x3, v: Vector3) => Vector3\n>(2, (m: Matrix3x3, v: Vector3) => {\n  const [v0, v1, v2] = toRows(m) as [Vector3, Vector3, Vector3]\n  return vector3.make(vector3.dot(v0, v), vector3.dot(v1, v), vector3.dot(v2, v))\n})\n\n/** @internal */\nexport const vectorProductRight = dual<\n  (v: Vector3) => (m: Matrix3x3) => Vector3,\n  (m: Matrix3x3, v: Vector3) => Vector3\n>(2, (m: Matrix3x3, v: Vector3) => {\n  const [v0, v1, v2] = toColumns(m) as [Vector3, Vector3, Vector3]\n  return vector3.make(vector3.dot(v, v0), vector3.dot(v, v1), vector3.dot(v, v2))\n})\n\n/** @internal */\nexport const solveSystem = dual<\n  (v: Vector3) => (m: Matrix3x3) => Vector3,\n  (m: Matrix3x3, v: Vector3) => Vector3\n>(2, (m: Matrix3x3, v: Vector3) => {\n  const inverseDeterminant = 1 / determinant(m)\n\n  invariant(\n    Number.isFinite(inverseDeterminant),\n    'cannot solve system when coefficient matrix determinant is zero',\n  )\n\n  return vector3.make(\n    determinant(setColumn(m, 0, v)) * inverseDeterminant,\n    determinant(setColumn(m, 1, v)) * inverseDeterminant,\n    determinant(setColumn(m, 2, v)) * inverseDeterminant,\n  )\n})\n\n/** @internal */\nexport const toRows = (m: Matrix3x3): [Vector3, Vector3, Vector3] => [\n  vector3.make(m.m00, m.m01, m.m02),\n  vector3.make(m.m10, m.m11, m.m12),\n  vector3.make(m.m20, m.m21, m.m22),\n]\n\n/** @internal */\nexport const toColumns = (m: Matrix3x3): [Vector3, Vector3, Vector3] => [\n  vector3.make(m.m00, m.m10, m.m20),\n  vector3.make(m.m01, m.m11, m.m21),\n  vector3.make(m.m02, m.m12, m.m22),\n]\n\n/** @internal */\nexport const rowVector = dual<\n  (row: Matrix3x3Coordinate) => (m: Matrix3x3) => Vector3,\n  (m: Matrix3x3, row: Matrix3x3Coordinate) => Vector3\n>(2, (m: Matrix3x3, row: Matrix3x3Coordinate) => toRows(m)[toThreeDimensionalIndex(row)])\n\n/** @internal */\nexport const columnVector = dual<\n  (column: Matrix3x3Coordinate) => (m: Matrix3x3) => Vector3,\n  (m: Matrix3x3, column: Matrix3x3Coordinate) => Vector3\n>(2, (m: Matrix3x3, column: Matrix3x3Coordinate) => toColumns(m)[toThreeDimensionalIndex(column)])\n\n/** @internal */\nexport const transpose = (m: Matrix3x3) => fromColumns(...toRows(m))\n\n/** @internal */\nexport const reverseRows = (m: Matrix3x3) => {\n  const [v0, v1, v2] = toRows(m)\n  return fromRows(v2, v1, v0)\n}\n\n/** @internal */\nexport const reverseColumns = (m: Matrix3x3) => {\n  const [v0, v1, v2] = toColumns(m)\n  return fromColumns(v2, v1, v0)\n}\n","import { toFourDimensionalIndex } from '../dimensions.ts'\nimport { dual, Pipeable } from '../utils.ts'\nimport { invariant } from '../utils.ts'\nimport { epsEquals } from '../number.ts'\nimport type { Vector4 } from '../vector/vector4.ts'\nimport * as vector4 from '../vector/vector4.internal.ts'\nimport type { Matrix3x3 } from './matrix3x3.ts'\nimport * as matrix3x3 from './matrix3x3.internal.ts'\nimport type { Matrix4x4, Matrix4x4Coordinate } from './matrix4x4.ts'\n\nexport const Matrix4x4TypeId: unique symbol = Symbol.for('curvy/matrix4x4')\nexport type Matrix4x4TypeId = typeof Matrix4x4TypeId\n\nclass Matrix4x4Impl extends Pipeable implements Matrix4x4 {\n  readonly [Matrix4x4TypeId]: Matrix4x4TypeId = Matrix4x4TypeId\n\n  readonly m00: number\n  readonly m01: number\n  readonly m02: number\n  readonly m03: number\n\n  readonly m10: number\n  readonly m11: number\n  readonly m12: number\n  readonly m13: number\n\n  readonly m20: number\n  readonly m21: number\n  readonly m22: number\n  readonly m23: number\n\n  readonly m30: number\n  readonly m31: number\n  readonly m32: number\n  readonly m33: number\n\n  constructor(\n    m00 = 0,\n    m01 = m00,\n    m02 = m01,\n    m03 = m02,\n    m10 = m00,\n    m11 = m01,\n    m12 = m02,\n    m13 = m03,\n    m20 = m00,\n    m21 = m01,\n    m22 = m02,\n    m23 = m03,\n    m30 = m00,\n    m31 = m01,\n    m32 = m02,\n    m33 = m03,\n  ) {\n    super()\n\n    this.m00 = m00\n    this.m01 = m01\n    this.m02 = m02\n    this.m03 = m03\n    this.m10 = m10\n    this.m11 = m11\n    this.m12 = m12\n    this.m13 = m13\n    this.m20 = m20\n    this.m21 = m21\n    this.m22 = m22\n    this.m23 = m23\n    this.m30 = m30\n    this.m31 = m31\n    this.m32 = m32\n    this.m33 = m33\n  }\n\n  get [Symbol.toStringTag]() {\n    return `Matrix4x4(${this.m00}, ${this.m01}, ${this.m02}, ${this.m03}, ${this.m10}, ${this.m11}, ${this.m12}, ${this.m13}, ${this.m20}, ${this.m21}, ${this.m22}, ${this.m23}, ${this.m30}, ${this.m31}, ${this.m32}, ${this.m33})`\n  }\n\n  get [Symbol.for('nodejs.util.inspect.custom')]() {\n    return `Matrix4x4(${this.m00}, ${this.m01}, ${this.m02}, ${this.m03}, ${this.m10}, ${this.m11}, ${this.m12}, ${this.m13}, ${this.m20}, ${this.m21}, ${this.m22}, ${this.m23}, ${this.m30}, ${this.m31}, ${this.m32}, ${this.m33})`\n  }\n\n  [Symbol.hasInstance](m: unknown): m is Matrix4x4 {\n    return isMatrix4x4(m)\n  }\n}\n\n/** @internal */\nexport const isMatrix4x4 = (m: unknown): m is Matrix4x4 =>\n  typeof m === 'object' && m !== null && Matrix4x4TypeId in m\n\n/** @internal */\nexport const equals = dual<\n  (b: Matrix4x4) => (a: Matrix4x4) => boolean,\n  (a: Matrix4x4, b: Matrix4x4) => boolean\n>(\n  2,\n  (a: Matrix4x4, b: Matrix4x4) =>\n    epsEquals(a.m00, b.m00) &&\n    epsEquals(a.m01, b.m01) &&\n    epsEquals(a.m02, b.m02) &&\n    epsEquals(a.m03, b.m03) &&\n    epsEquals(a.m10, b.m10) &&\n    epsEquals(a.m11, b.m11) &&\n    epsEquals(a.m12, b.m12) &&\n    epsEquals(a.m13, b.m13) &&\n    epsEquals(a.m20, b.m20) &&\n    epsEquals(a.m21, b.m21) &&\n    epsEquals(a.m22, b.m22) &&\n    epsEquals(a.m23, b.m23) &&\n    epsEquals(a.m30, b.m30) &&\n    epsEquals(a.m31, b.m31) &&\n    epsEquals(a.m32, b.m32) &&\n    epsEquals(a.m33, b.m33),\n)\n\n/**\n * The 4x4 identity matrix.\n * @internal\n */\nexport const identity: Matrix4x4 = new Matrix4x4Impl(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)\n\n// first four arguments are the top row\n/** @internal */\nexport const make = (\n  m00 = 0,\n  m01 = m00,\n  m02 = m01,\n  m03 = m02,\n  m10 = m00,\n  m11 = m01,\n  m12 = m02,\n  m13 = m03,\n  m20 = m00,\n  m21 = m01,\n  m22 = m02,\n  m23 = m03,\n  m30 = m00,\n  m31 = m01,\n  m32 = m02,\n  m33 = m03,\n) =>\n  new Matrix4x4Impl(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33)\n\n/** @internal */\nexport const fromRows = (v0: Vector4, v1: Vector4, v2: Vector4, v3: Vector4) =>\n  new Matrix4x4Impl(\n    v0.x,\n    v0.y,\n    v0.z,\n    v0.w,\n    v1.x,\n    v1.y,\n    v1.z,\n    v1.w,\n    v2.x,\n    v2.y,\n    v2.z,\n    v2.w,\n    v3.x,\n    v3.y,\n    v3.z,\n    v3.w,\n  )\n\n/** @internal */\nexport const fromColumns = (v0: Vector4, v1: Vector4, v2: Vector4, v3: Vector4) =>\n  new Matrix4x4Impl(\n    v0.x,\n    v1.x,\n    v2.x,\n    v3.x,\n    v0.y,\n    v1.y,\n    v2.y,\n    v3.y,\n    v0.z,\n    v1.z,\n    v2.z,\n    v3.z,\n    v0.w,\n    v1.w,\n    v2.w,\n    v3.w,\n  )\n\n/** @internal */\nexport const setRow = dual<\n  (row: Matrix4x4Coordinate, v: Vector4) => (m: Matrix4x4) => Matrix4x4,\n  (m: Matrix4x4, row: Matrix4x4Coordinate, v: Vector4) => Matrix4x4\n>(3, (m: Matrix4x4, row: Matrix4x4Coordinate, v: Vector4) =>\n  fromRows(\n    ...(toRows(m).with(toFourDimensionalIndex(row), v) as [Vector4, Vector4, Vector4, Vector4]),\n  ),\n)\n\n/** @internal */\nexport const setColumn = dual<\n  (column: Matrix4x4Coordinate, v: Vector4) => (m: Matrix4x4) => Matrix4x4,\n  (m: Matrix4x4, column: Matrix4x4Coordinate, v: Vector4) => Matrix4x4\n>(3, (m: Matrix4x4, column: Matrix4x4Coordinate, v: Vector4) =>\n  fromColumns(\n    ...(toColumns(m).with(toFourDimensionalIndex(column), v) as [\n      Vector4,\n      Vector4,\n      Vector4,\n      Vector4,\n    ]),\n  ),\n)\n\n/** @internal */\nexport const determinant = (m: Matrix4x4) =>\n  m.m00 * matrix3x3.determinant(minor(m, 0, 0)) -\n  m.m01 * matrix3x3.determinant(minor(m, 0, 1)) +\n  m.m02 * matrix3x3.determinant(minor(m, 0, 2)) -\n  m.m03 * matrix3x3.determinant(minor(m, 0, 3))\n\n/** @internal */\nexport const minor = dual<\n  (row: Matrix4x4Coordinate, column: Matrix4x4Coordinate) => (m: Matrix4x4) => Matrix3x3,\n  (m: Matrix4x4, row: Matrix4x4Coordinate, column: Matrix4x4Coordinate) => Matrix3x3\n>(3, (m: Matrix4x4, row: Matrix4x4Coordinate, column: Matrix4x4Coordinate) => {\n  const [v0, v1, v2] = toRows(m).toSpliced(toFourDimensionalIndex(row), 1) as [\n    Vector4,\n    Vector4,\n    Vector4,\n  ]\n  const columnIndex = toFourDimensionalIndex(column)\n  const [m00, m01, m02] = vector4.components(v0).toSpliced(columnIndex, 1) as [\n    number,\n    number,\n    number,\n  ]\n  const [m10, m11, m12] = vector4.components(v1).toSpliced(columnIndex, 1) as [\n    number,\n    number,\n    number,\n  ]\n  const [m20, m21, m22] = vector4.components(v2).toSpliced(columnIndex, 1) as [\n    number,\n    number,\n    number,\n  ]\n\n  return matrix3x3.make(m00, m01, m02, m10, m11, m12, m20, m21, m22)\n})\n\n/** @internal */\nexport const vectorProductLeft = dual<\n  (v: Vector4) => (m: Matrix4x4) => Vector4,\n  (m: Matrix4x4, v: Vector4) => Vector4\n>(2, (m: Matrix4x4, v: Vector4) => {\n  const [v0, v1, v2, v3] = toRows(m) as [Vector4, Vector4, Vector4, Vector4]\n  return vector4.make(\n    vector4.dot(v0, v),\n    vector4.dot(v1, v),\n    vector4.dot(v2, v),\n    vector4.dot(v3, v),\n  )\n})\n\n/** @internal */\nexport const vectorProductRight = dual<\n  (v: Vector4) => (m: Matrix4x4) => Vector4,\n  (m: Matrix4x4, v: Vector4) => Vector4\n>(2, (m: Matrix4x4, v: Vector4) => {\n  const [v0, v1, v2, v3] = toColumns(m) as [Vector4, Vector4, Vector4, Vector4]\n\n  return vector4.make(\n    vector4.dot(v, v0),\n    vector4.dot(v, v1),\n    vector4.dot(v, v2),\n    vector4.dot(v, v3),\n  )\n})\n\n/** @internal */\nexport const multiply = dual<\n  (b: Matrix4x4) => (a: Matrix4x4) => Matrix4x4,\n  (a: Matrix4x4, b: Matrix4x4) => Matrix4x4\n>(\n  2,\n  (a: Matrix4x4, b: Matrix4x4) =>\n    new Matrix4x4Impl(\n      a.m00 * b.m00 + a.m01 * b.m10 + a.m02 * b.m20 + a.m03 * b.m30,\n      a.m00 * b.m01 + a.m01 * b.m11 + a.m02 * b.m21 + a.m03 * b.m31,\n      a.m00 * b.m02 + a.m01 * b.m12 + a.m02 * b.m22 + a.m03 * b.m32,\n      a.m00 * b.m03 + a.m01 * b.m13 + a.m02 * b.m23 + a.m03 * b.m33,\n      a.m10 * b.m00 + a.m11 * b.m10 + a.m12 * b.m20 + a.m13 * b.m30,\n      a.m10 * b.m01 + a.m11 * b.m11 + a.m12 * b.m21 + a.m13 * b.m31,\n      a.m10 * b.m02 + a.m11 * b.m12 + a.m12 * b.m22 + a.m13 * b.m32,\n      a.m10 * b.m03 + a.m11 * b.m13 + a.m12 * b.m23 + a.m13 * b.m33,\n      a.m20 * b.m00 + a.m21 * b.m10 + a.m22 * b.m20 + a.m23 * b.m30,\n      a.m20 * b.m01 + a.m21 * b.m11 + a.m22 * b.m21 + a.m23 * b.m31,\n      a.m20 * b.m02 + a.m21 * b.m12 + a.m22 * b.m22 + a.m23 * b.m32,\n      a.m20 * b.m03 + a.m21 * b.m13 + a.m22 * b.m23 + a.m23 * b.m33,\n      a.m30 * b.m00 + a.m31 * b.m10 + a.m32 * b.m20 + a.m33 * b.m30,\n      a.m30 * b.m01 + a.m31 * b.m11 + a.m32 * b.m21 + a.m33 * b.m31,\n      a.m30 * b.m02 + a.m31 * b.m12 + a.m32 * b.m22 + a.m33 * b.m32,\n      a.m30 * b.m03 + a.m31 * b.m13 + a.m32 * b.m23 + a.m33 * b.m33,\n    ),\n)\n\n/** @internal */\nexport const inverse = (m: Matrix4x4): Matrix4x4 => {\n  const det = determinant(m)\n  invariant(det !== 0, 'cannot invert singular matrix')\n\n  const inv = 1 / det\n  // adjugate is the transpose of the cofactor matrix\n  const cof = (row: Matrix4x4Coordinate, col: Matrix4x4Coordinate) => {\n    const sign = ((row as number) + (col as number)) % 2 === 0 ? 1 : -1\n    return sign * matrix3x3.determinant(minor(m, row, col)) * inv\n  }\n\n  return new Matrix4x4Impl(\n    cof(0, 0),\n    cof(1, 0),\n    cof(2, 0),\n    cof(3, 0),\n    cof(0, 1),\n    cof(1, 1),\n    cof(2, 1),\n    cof(3, 1),\n    cof(0, 2),\n    cof(1, 2),\n    cof(2, 2),\n    cof(3, 2),\n    cof(0, 3),\n    cof(1, 3),\n    cof(2, 3),\n    cof(3, 3),\n  )\n}\n\n/** @internal */\nexport const solveSystem = dual<\n  (v: Vector4) => (m: Matrix4x4) => Vector4,\n  (m: Matrix4x4, v: Vector4) => Vector4\n>(2, (m: Matrix4x4, v: Vector4) => {\n  const inverseDeterminant = 1 / determinant(m)\n\n  invariant(\n    Number.isFinite(inverseDeterminant),\n    'cannot solve system when coefficient matrix determinant is zero',\n  )\n\n  return vector4.make(\n    determinant(setColumn(m, 0, v)) * inverseDeterminant,\n    determinant(setColumn(m, 1, v)) * inverseDeterminant,\n    determinant(setColumn(m, 2, v)) * inverseDeterminant,\n    determinant(setColumn(m, 3, v)) * inverseDeterminant,\n  )\n})\n\n/** @internal */\nexport const toRows = (m: Matrix4x4) =>\n  [\n    vector4.make(m.m00, m.m01, m.m02, m.m03),\n    vector4.make(m.m10, m.m11, m.m12, m.m13),\n    vector4.make(m.m20, m.m21, m.m22, m.m23),\n    vector4.make(m.m30, m.m31, m.m32, m.m33),\n  ] as const\n\n/** @internal */\nexport const toColumns = (m: Matrix4x4) =>\n  [\n    vector4.make(m.m00, m.m10, m.m20, m.m30),\n    vector4.make(m.m01, m.m11, m.m21, m.m31),\n    vector4.make(m.m02, m.m12, m.m22, m.m32),\n    vector4.make(m.m03, m.m13, m.m23, m.m33),\n  ] as const\n\n/** @internal */\nexport const rowVector = dual<\n  (row: Matrix4x4Coordinate) => (m: Matrix4x4) => Vector4,\n  (m: Matrix4x4, row: Matrix4x4Coordinate) => Vector4\n>(2, (m: Matrix4x4, row: Matrix4x4Coordinate) => toRows(m)[toFourDimensionalIndex(row)])\n\n/** @internal */\nexport const columnVector = dual<\n  (column: Matrix4x4Coordinate) => (m: Matrix4x4) => Vector4,\n  (m: Matrix4x4, column: Matrix4x4Coordinate) => Vector4\n>(2, (m: Matrix4x4, column: Matrix4x4Coordinate) => toColumns(m)[toFourDimensionalIndex(column)])\n\n/** @internal */\nexport const transpose = (m: Matrix4x4) => fromColumns(...toRows(m)) as Matrix4x4\n\n/** @internal */\nexport const reverseRows = (m: Matrix4x4) => {\n  const [v0, v1, v2, v3] = toRows(m) as [Vector4, Vector4, Vector4, Vector4]\n  return fromRows(v3, v2, v1, v0)\n}\n\n/** @internal */\nexport const reverseColumns = (m: Matrix4x4) => {\n  const [v0, v1, v2, v3] = toColumns(m) as [Vector4, Vector4, Vector4, Vector4]\n  return fromColumns(v3, v2, v1, v0)\n}\n","import type { FourDimensionalComponent, FourDimensionalIndex } from '../dimensions.ts'\nimport type { Pipeable } from '../utils.ts'\nimport type { Vector4 } from '../vector/vector4.ts'\nimport type { Matrix3x3 } from './matrix3x3.ts'\nimport type { Matrix4x4TypeId } from './matrix4x4.internal.ts'\nimport * as internal from './matrix4x4.internal.ts'\n\n/**\n * A coordinate in a 4x4 matrix.\n *\n * @since 1.0.0\n */\nexport type Matrix4x4Coordinate = FourDimensionalIndex | FourDimensionalComponent\n\n/**\n * A 4x4 matrix.\n *\n * All fields are readonly and immutable, and all operations create new instances.\n *\n * @since 1.0.0\n */\nexport interface Matrix4x4 extends Pipeable {\n  readonly [Matrix4x4TypeId]: Matrix4x4TypeId\n\n  /**\n   * The value of the first row and first column.\n   */\n  readonly m00: number\n  /**\n   * The value of the first row and second column.\n   */\n  readonly m01: number\n  /**\n   * The value of the first row and third column.\n   */\n  readonly m02: number\n  /**\n   * The value of the first row and fourth column.\n   */\n  readonly m03: number\n  /**\n   * The value of the second row and first column.\n   */\n  readonly m10: number\n  /**\n   * The value of the second row and second column.\n   */\n  readonly m11: number\n  /**\n   * The value of the second row and third column.\n   */\n  readonly m12: number\n  /**\n   * The value of the second row and fourth column.\n   */\n  readonly m13: number\n  /**\n   * The value of the third row and first column.\n   */\n  readonly m20: number\n  /**\n   * The value of the third row and second column.\n   */\n  readonly m21: number\n  /**\n   * The value of the third row and third column.\n   */\n  readonly m22: number\n  /**\n   * The value of the third row and fourth column.\n   */\n  readonly m23: number\n  /**\n   * The value of the fourth row and first column.\n   */\n  readonly m30: number\n  /**\n   * The value of the fourth row and second column.\n   */\n  readonly m31: number\n  /**\n   * The value of the fourth row and third column.\n   */\n  readonly m32: number\n  /**\n   * The value of the fourth row and fourth column.\n   */\n  readonly m33: number\n}\n\n/**\n * Checks if a value is a `Matrix4x4`.\n *\n * @param m - The value to check.\n * @returns `true` if the value is a `Matrix4x4`, `false` otherwise.\n * @since 1.0.0\n */\nexport const isMatrix4x4: (m: unknown) => m is Matrix4x4 = internal.isMatrix4x4\n\n/**\n * The 4x4 identity matrix.\n *\n * @since 1.1.0\n */\nexport const identity: Matrix4x4 = internal.identity\n\nexport const equals: {\n  /**\n   * Checks if two `Matrix4x4` instances are approximately equal within the\n   * default absolute tolerance ({@link EPSILON}).\n   *\n   * @param a - The first matrix.\n   * @param b - The second matrix.\n   * @returns `true` when each pair of components is within tolerance.\n   * @since 1.1.0\n   */\n  (a: Matrix4x4, b: Matrix4x4): boolean\n  /**\n   * Checks if two `Matrix4x4` instances are approximately equal within the\n   * default absolute tolerance ({@link EPSILON}).\n   *\n   * @param b - The second matrix.\n   * @returns A function that takes the first matrix and returns the comparison result.\n   * @since 1.1.0\n   */\n  (b: Matrix4x4): (a: Matrix4x4) => boolean\n} = internal.equals\n\n/**\n * Creates a new `Matrix4x4` instance.\n *\n * @param m00 - The value of the first row and first column.\n * @param m01 - The value of the first row and second column.\n * @param m02 - The value of the first row and third column.\n * @param m03 - The value of the first row and fourth column.\n * @param m10 - The value of the second row and first column.\n * @param m11 - The value of the second row and second column.\n * @param m12 - The value of the second row and third column.\n * @param m13 - The value of the second row and fourth column.\n * @param m20 - The value of the third row and first column.\n * @param m21 - The value of the third row and second column.\n * @param m22 - The value of the third row and third column.\n * @param m23 - The value of the third row and fourth column.\n * @param m30 - The value of the fourth row and first column.\n * @param m31 - The value of the fourth row and second column.\n * @param m32 - The value of the fourth row and third column.\n * @param m33 - The value of the fourth row and fourth column.\n * @returns A new `Matrix4x4` instance.\n * @since 1.0.0\n */\nexport const make: (\n  m00?: number,\n  m01?: number,\n  m02?: number,\n  m03?: number,\n  m10?: number,\n  m11?: number,\n  m12?: number,\n  m13?: number,\n  m20?: number,\n  m21?: number,\n  m22?: number,\n  m23?: number,\n  m30?: number,\n  m31?: number,\n  m32?: number,\n  m33?: number,\n) => Matrix4x4 = internal.make\n\n/**\n * Creates a new `Matrix4x4` instance from four row vectors.\n *\n * @param v0 - The first row vector.\n * @param v1 - The second row vector.\n * @param v2 - The third row vector.\n * @param v3 - The fourth row vector.\n * @returns A new `Matrix4x4` instance.\n * @since 1.0.0\n */\nexport const fromRows: (v0: Vector4, v1: Vector4, v2: Vector4, v3: Vector4) => Matrix4x4 =\n  internal.fromRows\n\n/**\n * Creates a new `Matrix4x4` instance from four column vectors.\n *\n * @param v0 - The first column vector.\n * @param v1 - The second column vector.\n * @param v2 - The third column vector.\n * @param v3 - The fourth column vector.\n */\nexport const fromColumns: (v0: Vector4, v1: Vector4, v2: Vector4, v3: Vector4) => Matrix4x4 =\n  internal.fromColumns\n\nexport const setRow: {\n  /**\n   * Sets a row of a `Matrix4x4` to a new vector.\n   *\n   * @param m - The matrix to modify.\n   * @param row - The row to set.\n   * @param v - The new vector.\n   * @returns A new `Matrix4x4` instance with the specified row set to the new vector.\n   * @since 1.0.0\n   */\n  (m: Matrix4x4, row: Matrix4x4Coordinate, v: Vector4): Matrix4x4\n  /**\n   * Sets a row of a `Matrix4x4` to a new vector.\n   *\n   * @param row - The row to set.\n   * @param v - The new vector.\n   * @returns A function that takes a matrix and returns a new `Matrix4x4` instance with the specified row set to the new vector.\n   * @since 1.0.0\n   */\n  (row: Matrix4x4Coordinate, v: Vector4): (m: Matrix4x4) => Matrix4x4\n} = internal.setRow\n\nexport const setColumn: {\n  /**\n   * Sets a column of a `Matrix4x4` to a new vector.\n   *\n   * @param m - The matrix to modify.\n   * @param column - The column to set.\n   * @param v - The new vector.\n   * @returns A new `Matrix4x4` instance with the specified column set to the new vector.\n   * @since 1.0.0\n   */\n  (m: Matrix4x4, column: Matrix4x4Coordinate, v: Vector4): Matrix4x4\n  /**\n   * Sets a column of a `Matrix4x4` to a new vector.\n   *\n   * @param column - The column to set.\n   * @param v - The new vector.\n   * @returns A function that takes a matrix and returns a new `Matrix4x4` instance with the specified column set to the new vector.\n   * @since 1.0.0\n   */\n  (column: Matrix4x4Coordinate, v: Vector4): (m: Matrix4x4) => Matrix4x4\n} = internal.setColumn\n\n/**\n * Calculates the determinant of a `Matrix4x4`.\n *\n * @param m - The matrix to calculate the determinant of.\n * @returns The determinant of the matrix.\n * @since 1.0.0\n */\nexport const determinant: (m: Matrix4x4) => number = internal.determinant\n\n/**\n * Calculates the minor of a `Matrix4x4` at a given row and column.\n *\n * @param m - The matrix to calculate the minor of.\n * @param row - The row to exclude.\n * @param column - The column to exclude.\n * @returns The minor of the matrix at the given row and column.\n */\nexport const minor: (\n  m: Matrix4x4,\n  row: Matrix4x4Coordinate,\n  column: Matrix4x4Coordinate,\n) => Matrix3x3 = internal.minor\n\nexport const vectorProductLeft: {\n  /**\n   * Calculates the left vector product of a `Matrix4x4` and a `Vector4`.\n   *\n   * @example\n   * ```ts\n   * import * as Matrix4x4 from 'curvy/matrix4x4'\n   * import * as Vector4 from 'curvy/vector4'\n   *\n   * const m = Matrix4x4.make(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)\n   * const v = Vector4.make(17, 18, 19, 20)\n   *\n   * // Result:\n   * // x = 1 * 17 + 2 * 18 + 3 * 19 + 4 * 20\n   * // y = 5 * 17 + 6 * 18 + 7 * 19 + 8 * 20\n   * // z = 9 * 17 + 10 * 18 + 11 * 19 + 12 * 20\n   * // w = 13 * 17 + 14 * 18 + 15 * 19 + 16 * 20\n   * const result = Matrix4x4.vectorProductLeft(m, v)\n   * ```\n   * @param m - The matrix to multiply.\n   * @param v - The vector to multiply.\n   * @returns The resulting vector.\n   * @since 1.0.0\n   */\n  (m: Matrix4x4, v: Vector4): Vector4\n  /**\n   * Calculates the left vector product of a `Matrix4x4` and a `Vector4`.\n   *\n   * @example\n   * ```ts\n   * import * as Matrix4x4 from 'curvy/matrix4x4'\n   * import * as Vector4 from 'curvy/vector4'\n   *\n   * const m = Matrix4x4.make(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)\n   * const v = Vector4.make(17, 18, 19, 20)\n   *\n   * // Result:\n   * // x = 1 * 17 + 2 * 18 + 3 * 19 + 4 * 20\n   * // y = 5 * 17 + 6 * 18 + 7 * 19 + 8 * 20\n   * // z = 9 * 17 + 10 * 18 + 11 * 19 + 12 * 20\n   * // w = 13 * 17 + 14 * 18 + 15 * 19 + 16 * 20\n   * const result = Matrix4x4.vectorProductLeft(v)(m)\n   * ```\n   * @since 1.0.0\n   */\n  (v: Vector4): (m: Matrix4x4) => Vector4\n} = internal.vectorProductLeft\n\nexport const vectorProductRight: {\n  /**\n   * Calculates the right vector product of a `Matrix4x4` and a `Vector4`.\n   *\n   * @example\n   * ```ts\n   * import * as Matrix4x4 from 'curvy/matrix4x4'\n   * import * as Vector4 from 'curvy/vector4'\n   *\n   * const m = Matrix4x4.make(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)\n   * const v = Vector4.make(17, 18, 19, 20)\n   *\n   * // Result:\n   * // x = 1 * 17 + 5 * 18 + 9 * 19 + 13 * 20\n   * // y = 2 * 17 + 6 * 18 + 10 * 19 + 14 * 20\n   * // z = 3 * 17 + 7 * 18 + 11 * 19 + 15 * 20\n   * // w = 4 * 17 + 8 * 18 + 12 * 19 + 16 * 20\n   * const result = Matrix4x4.vectorProductRight(m, v)\n   * ```\n   * @since 1.0.0\n   */\n  (m: Matrix4x4, v: Vector4): Vector4\n  /**\n   * Calculates the right vector product of a `Matrix4x4` and a `Vector4`.\n   *\n   * @example\n   * ```ts\n   * import * as Matrix4x4 from 'curvy/matrix4x4'\n   * import * as Vector4 from 'curvy/vector4'\n   *\n   * const m = Matrix4x4.make(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)\n   * const v = Vector4.make(17, 18, 19, 20)\n   *\n   * // Result:\n   * // x = 1 * 17 + 5 * 18 + 9 * 19 + 13 * 20\n   * // y = 2 * 17 + 6 * 18 + 10 * 19 + 14 * 20\n   * // z = 3 * 17 + 7 * 18 + 11 * 19 + 15 * 20\n   * // w = 4 * 17 + 8 * 18 + 12 * 19 + 16 * 20\n   * const result = Matrix4x4.vectorProductRight(v)(m)\n   * ```\n   * @since 1.0.0\n   */\n  (v: Vector4): (m: Matrix4x4) => Vector4\n} = internal.vectorProductRight\n\nexport const multiply: {\n  /**\n   * Multiplies two `Matrix4x4` instances. Result is `a · b`.\n   *\n   * @param a - The left-hand matrix.\n   * @param b - The right-hand matrix.\n   * @returns The product matrix.\n   * @since 1.1.0\n   */\n  (a: Matrix4x4, b: Matrix4x4): Matrix4x4\n  /**\n   * Multiplies two `Matrix4x4` instances. Result is `a · b`.\n   *\n   * @param b - The right-hand matrix.\n   * @returns A function that takes the left-hand matrix and returns the product.\n   * @since 1.1.0\n   */\n  (b: Matrix4x4): (a: Matrix4x4) => Matrix4x4\n} = internal.multiply\n\n/**\n * Returns the inverse of a `Matrix4x4`.\n *\n * Throws when the matrix is singular (determinant is zero).\n *\n * @param m - The matrix to invert.\n * @returns The inverse matrix.\n * @since 1.1.0\n */\nexport const inverse: (m: Matrix4x4) => Matrix4x4 = internal.inverse\n\nexport const solveSystem: {\n  /**\n   * Solves a system of linear equations represented by a `Matrix4x4` and a `Vector4`.\n   *\n   * @param m - The matrix representing the coefficients of the equations.\n   * @param v - The vector representing the constants of the equations.\n   * @returns The solution vector.\n   * @since 1.0.0\n   */\n  (m: Matrix4x4, v: Vector4): Vector4\n  /**\n   * Solves a system of linear equations represented by a `Matrix4x4` and a `Vector4`.\n   *\n   * @param v - The vector representing the constants of the equations.\n   * @returns A function that takes a matrix and returns the solution vector.\n   * @since 1.0.0\n   */\n  (v: Vector4): (m: Matrix4x4) => Vector4\n} = internal.solveSystem\n\n/**\n * Returns the rows of a `Matrix4x4` as an array of vectors.\n *\n * @param m - The matrix to convert.\n * @returns An array of vectors representing the rows of the matrix.\n * @since 1.0.0\n */\nexport const toRows: (m: Matrix4x4) => [Vector4, Vector4, Vector4, Vector4] = internal.toRows as (\n  m: Matrix4x4,\n) => [Vector4, Vector4, Vector4, Vector4]\n\n/**\n * Returns the columns of a `Matrix4x4` as an array of vectors.\n *\n * @param m - The matrix to convert.\n * @returns An array of vectors representing the columns of the matrix.\n * @since 1.0.0\n */\nexport const toColumns: (m: Matrix4x4) => [Vector4, Vector4, Vector4, Vector4] =\n  internal.toColumns as (m: Matrix4x4) => [Vector4, Vector4, Vector4, Vector4]\n\nexport const rowVector: {\n  /**\n   * Returns a row vector from a `Matrix4x4`.\n   *\n   * @param m - The matrix to get the row vector from.\n   * @param row - The row index.\n   * @returns The row vector.\n   * @since 1.0.0\n   */\n  (m: Matrix4x4, row: Matrix4x4Coordinate): Vector4\n  /**\n   * Returns a row vector from a `Matrix4x4`.\n   *\n   * @param row - The row index.\n   * @returns A function that takes a matrix and returns the row vector.\n   * @since 1.0.0\n   */\n  (row: Matrix4x4Coordinate): (m: Matrix4x4) => Vector4\n} = internal.rowVector\n\nexport const columnVector: {\n  /**\n   * Returns a column vector from a `Matrix4x4`.\n   *\n   * @param m - The matrix to get the column vector from.\n   * @param column - The column index.\n   * @returns The column vector.\n   * @since 1.0.0\n   */\n  (m: Matrix4x4, column: Matrix4x4Coordinate): Vector4\n  /**\n   * Returns a column vector from a `Matrix4x4`.\n   *\n   * @param column - The column index.\n   * @returns A function that takes a matrix and returns the column vector.\n   * @since 1.0.0\n   */\n  (column: Matrix4x4Coordinate): (m: Matrix4x4) => Vector4\n} = internal.columnVector\n\n/**\n * Transposes a `Matrix4x4`.\n *\n * @param m - The matrix to transpose.\n * @returns The transposed matrix.\n * @since 1.0.0\n */\nexport const transpose: (m: Matrix4x4) => Matrix4x4 = internal.transpose\n\n/**\n * Reverses the rows of a `Matrix4x4`.\n *\n * @param m - The matrix to reverse the rows of.\n * @returns The matrix with the rows reversed.\n * @since 1.0.0\n */\nexport const reverseRows: (m: Matrix4x4) => Matrix4x4 = internal.reverseRows\n\n/**\n * Reverses the columns of a `Matrix4x4`.\n *\n * @param m - The matrix to reverse the columns of.\n * @returns The matrix with the columns reversed.\n * @since 1.0.0\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