curvy 2.0.0-alpha.2 → 2.0.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/characteristic/index.d.mts +9 -9
  2. package/dist/characteristic/index.mjs +1 -1
  3. package/dist/curve/index.d.mts +10 -2
  4. package/dist/curve/index.mjs +1 -1
  5. package/dist/interval/index.d.mts +9 -3
  6. package/dist/interval/index.mjs +2 -2
  7. package/dist/matrix/index.d.mts +9 -2
  8. package/dist/path/index.d.mts +15 -223
  9. package/dist/path/index.mjs +6 -6
  10. package/dist/path/index.mjs.map +1 -1
  11. package/dist/polynomial/index.d.mts +9 -2
  12. package/dist/polynomial/index.mjs +2 -2
  13. package/dist/shared/{characteristic-B9nCh_cx.mjs → characteristic-DLlhja-I.mjs} +9 -9
  14. package/dist/shared/{characteristic-B9nCh_cx.mjs.map → characteristic-DLlhja-I.mjs.map} +1 -1
  15. package/dist/shared/{cubic-CpHAx8cC.mjs → cubic-CMonq6bg.mjs} +26 -5
  16. package/dist/shared/cubic-CMonq6bg.mjs.map +1 -0
  17. package/dist/shared/cubic-DkBqcZf-.d.mts +121 -0
  18. package/dist/shared/interval-Bhzeqp8M.d.mts +62 -0
  19. package/dist/shared/{interval-05CR6eBf.mjs → interval-X1EYuf-T.mjs} +2 -2
  20. package/dist/shared/{interval-05CR6eBf.mjs.map → interval-X1EYuf-T.mjs.map} +1 -1
  21. package/dist/shared/interval2d-BMk5UYXD.d.mts +29 -0
  22. package/dist/shared/{interval2d-8IBZnUOq.mjs → interval2d-ca0J1NMr.mjs} +8 -8
  23. package/dist/shared/{interval2d-8IBZnUOq.mjs.map → interval2d-ca0J1NMr.mjs.map} +1 -1
  24. package/dist/shared/matrix4x4-CaytTaB_.d.mts +168 -0
  25. package/dist/shared/{quadratic-CamozcFc.mjs → quadratic-DyeMtvET.mjs} +20 -2
  26. package/dist/shared/quadratic-DyeMtvET.mjs.map +1 -0
  27. package/dist/shared/rationalCubic2d-D-UevGKu.d.mts +60 -0
  28. package/dist/shared/{rationalCubic2d-Bys2Uory.mjs → rationalCubic2d-D658ltUM.mjs} +17 -17
  29. package/dist/shared/{rationalCubic2d-Bys2Uory.mjs.map → rationalCubic2d-D658ltUM.mjs.map} +1 -1
  30. package/dist/shared/rationalCubic2d-MgMSJaAU.d.mts +104 -0
  31. package/dist/shared/{rationalCubic2d-BEgUGSFf.mjs → rationalCubic2d-Vw4qGPZj.mjs} +9 -9
  32. package/dist/shared/{rationalCubic2d-BEgUGSFf.mjs.map → rationalCubic2d-Vw4qGPZj.mjs.map} +1 -1
  33. package/dist/shared/{solution-CrtLfqEq.mjs → solution-3TDATEMn.mjs} +28 -2
  34. package/dist/shared/solution-3TDATEMn.mjs.map +1 -0
  35. package/dist/shared/solution-DInDT2Hq.d.mts +60 -0
  36. package/dist/shared/{vector2-CL1HDdPr.mjs → vector2-CCuJx1rX.mjs} +6 -6
  37. package/dist/shared/{vector2-CL1HDdPr.mjs.map → vector2-CCuJx1rX.mjs.map} +1 -1
  38. package/dist/shared/vector2-euuV_bNQ.d.mts +58 -0
  39. package/dist/shared/vector3-3Xx7GVk7.d.mts +37 -0
  40. package/dist/shared/{vector3-D-tv_aKL.mjs → vector3-C-qgKAjR.mjs} +2 -2
  41. package/dist/shared/{vector3-D-tv_aKL.mjs.map → vector3-C-qgKAjR.mjs.map} +1 -1
  42. package/dist/shared/{vector4-5KbjoHVj.mjs → vector4-BhOKDhD5.mjs} +2 -2
  43. package/dist/shared/{vector4-5KbjoHVj.mjs.map → vector4-BhOKDhD5.mjs.map} +1 -1
  44. package/dist/solution/index.d.mts +7 -2
  45. package/dist/solution/index.mjs +1 -1
  46. package/dist/splines/index.d.mts +37 -606
  47. package/dist/splines/index.mjs +193 -35
  48. package/dist/splines/index.mjs.map +1 -1
  49. package/dist/vector/index.d.mts +10 -3
  50. package/dist/vector/index.mjs +3 -3
  51. package/package.json +1 -1
  52. package/dist/shared/cubic-BajUY0JT.d.mts +0 -1100
  53. package/dist/shared/cubic-CpHAx8cC.mjs.map +0 -1
  54. package/dist/shared/interval-Dy-RMEE3.d.mts +0 -533
  55. package/dist/shared/interval2d-C2id9u31.d.mts +0 -172
  56. package/dist/shared/matrix4x4-Dm_tSiH1.d.mts +0 -1183
  57. package/dist/shared/quadratic-CamozcFc.mjs.map +0 -1
  58. package/dist/shared/rationalCubic2d-B6g97ryJ.d.mts +0 -308
  59. package/dist/shared/rationalCubic2d-DlQfBURs.d.mts +0 -818
  60. package/dist/shared/solution-CrtLfqEq.mjs.map +0 -1
  61. package/dist/shared/solution-sNQ-ZVhN.d.mts +0 -251
  62. package/dist/shared/vector2-DPUY3_eA.d.mts +0 -470
  63. package/dist/shared/vector3-DqeOZtOB.d.mts +0 -703
@@ -1 +1 @@
1
- {"version":3,"file":"vector3-D-tv_aKL.mjs","names":["internal.isVector3","internal.equals","internal.make","internal.transpose","internal.fromSpherical","internal.magnitude","internal.normalize","internal.dot","internal.cross","internal.components","internal.softmax","internal.add","internal.subtract","internal.hadamard","internal.scale","internal.getX","internal.setX","internal.getY","internal.setY","internal.getZ","internal.setZ","internal.setR","internal.getTheta","internal.setTheta","internal.getPhi","internal.setPhi"],"sources":["../../src/vector/vector3.ts"],"sourcesContent":["import type { ThreeDimensional } from '../dimensions'\nimport type { Pipeable } from '../utils'\nimport type { Vector3TypeId } from './vector3.internal'\nimport * as internal from './vector3.internal'\n\n/**\n * A 3D vector.\n *\n * All fields are readonly and immutable, and all operations create new instances.\n *\n * @since 1.0.0\n */\nexport interface Vector3 extends Pipeable, ThreeDimensional<number> {\n readonly [Vector3TypeId]: Vector3TypeId\n}\n\n/**\n * Checks if a value is a `Vector3`.\n *\n * @param v - The value to check.\n * @returns `true` if the value is a `Vector3`, `false` otherwise.\n * @since 1.0.0\n */\nexport const isVector3: (v: unknown) => v is Vector3 = internal.isVector3\n\nexport const equals: {\n /**\n * Checks if two `Vector3` instances are approximately equal within the\n * default absolute tolerance ({@link EPSILON}).\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` when each pair of components is within tolerance.\n * @since 1.1.0\n */\n (a: Vector3, b: Vector3): boolean\n /**\n * Checks if two `Vector3` instances are approximately equal within the\n * default absolute tolerance ({@link EPSILON}).\n *\n * @param b - The second vector.\n * @returns A function that takes the first vector and returns the comparison result.\n * @since 1.1.0\n */\n (b: Vector3): (a: Vector3) => boolean\n} = internal.equals\n\nexport const make: {\n /**\n * Creates a new `Vector3` instance.\n *\n * @param xyz - The x, y, and z components of the vector.\n * @returns A new `Vector3` instance.\n * @since 1.0.0\n */\n (xyz: number): Vector3\n /**\n * Creates a new `Vector3` instance.\n *\n * @param x - The x component of the vector.\n * @param yz - The y and z components of the vector.\n * @returns A new `Vector3` instance.\n * @since 1.0.0\n */\n (x: number, yz: number): Vector3\n /**\n * Creates a new `Vector3` instance.\n *\n * @param x - The x component of the vector.\n * @param y - The y component of the vector.\n * @param z - The z component of the vector.\n * @returns A new `Vector3` instance.\n * @since 1.0.0\n */\n (x: number, y: number, z: number): Vector3\n} = internal.make\n\n/**\n * Transposes a 3-tuple of items into one or more `Vector3`s, one per channel\n * extracted by the projection function. See {@link Vector4.transpose} for the\n * full operation description; this is the 3-component analog.\n *\n * @param inputs - Exactly three items of any type.\n * @param project - A function returning a fixed-arity tuple of numbers — one per output channel.\n * @returns A tuple of `Vector3`s with the same arity as the projection's return tuple.\n * @since 2.1.0\n */\nexport const transpose: <T, const Channels extends ReadonlyArray<number>>(\n inputs: readonly [T, T, T],\n project: (item: T) => Channels,\n) => { readonly [K in keyof Channels]: Vector3 } = internal.transpose\n\n/**\n * Creates a new `Vector3` instance from spherical coordinates.\n *\n * @param r - The radius.\n * @param theta - The polar angle, in radians. Ranges from 0 to π\n * @param phi - The azimuthal angle, in radians. Ranges from 0 to 2π\n * @returns A new `Vector3` instance.\n * @since 1.0.0\n */\nexport const fromSpherical: (r: number, theta: number, phi: number) => Vector3 =\n internal.fromSpherical\n\n/**\n * Calculates the magnitude of a `Vector3`.\n *\n * @param vector - The vector to calculate the magnitude of.\n * @returns The magnitude of the vector.\n * @since 1.0.0\n */\nexport const magnitude: (vector: Vector3) => number = internal.magnitude\n\n/**\n * Calculates the length of a `Vector3`.\n *\n * @param vector - The vector to calculate the length of.\n * @returns The length of the vector.\n * @see {@link magnitude}\n * @since 1.0.0\n */\nexport const length: (vector: Vector3) => number = magnitude\n\n/**\n * Normalizes a `Vector3`.\n *\n * @param vector - The vector to normalize.\n * @returns A new `Vector3` instance with the same direction as the input vector, but with a magnitude of 1.\n * @since 1.0.0\n */\nexport const normalize: (vector: Vector3) => Vector3 = internal.normalize\n\nexport const dot: {\n /**\n * Calculates the dot product of two `Vector3` instances.\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns The dot product of the two vectors.\n * @since 1.0.0\n */\n (a: Vector3, b: Vector3): number\n /**\n * Calculates the dot product of two `Vector3` instances.\n *\n * @param b - The second vector.\n * @returns A function that takes the first vector and returns the dot product.\n * @since 1.0.0\n */\n (b: Vector3): (a: Vector3) => number\n} = internal.dot\n\nexport const cross: {\n /**\n * Calculates the cross product of two `Vector3` instances.\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns A new `Vector3` instance representing the cross product of the two vectors.\n * @since 1.0.0\n */\n (a: Vector3, b: Vector3): Vector3\n /**\n * Calculates the cross product of two `Vector3` instances.\n *\n * @param b - The second vector.\n * @returns A function that takes the first vector and returns the cross product.\n * @since 1.0.0\n */\n (b: Vector3): (a: Vector3) => Vector3\n} = internal.cross\n\n/**\n * Returns the components of a `Vector3` as an array.\n *\n * @param v - The vector to get the components of.\n * @returns An array containing the x, y, and z components of the vector.\n * @since 1.0.0\n */\nexport const components: (v: Vector3) => [number, number, number] = internal.components\n\n/**\n * Calculates the softmax of a `Vector3`.\n *\n * @param v - The vector to calculate the softmax of.\n * @returns A new `Vector3` instance representing the softmax of the input vector.\n * @since 1.0.0\n */\nexport const softmax: (v: Vector3) => Vector3 = internal.softmax\n\n/**\n * Creates a zero vector.\n *\n * @since 1.0.0\n */\nexport const zero = make(0)\n\n/**\n * Creates a unit vector.\n *\n * @since 1.0.0\n */\nexport const unit = make(1)\n\n/**\n * Creates a unit vector in the x direction.\n *\n * @since 1.0.0\n */\nexport const unitX = make(1, 0, 0)\n\n/**\n * Creates a unit vector in the y direction.\n *\n * @since 1.0.0\n */\nexport const unitY = make(0, 1, 0)\n\n/**\n * Creates a unit vector in the z direction.\n *\n * @since 1.0.0\n */\nexport const unitZ = make(0, 0, 1)\n\nexport const add: {\n /**\n * Adds two `Vector3` instances.\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns A new `Vector3` instance representing the sum of the two vectors.\n * @since 1.0.0\n */\n (a: Vector3, b: Vector3): Vector3\n /**\n * Adds two `Vector3` instances.\n *\n * @param b - The second vector.\n * @returns A function that takes the first vector and returns the sum.\n * @since 1.0.0\n */\n (b: Vector3): (a: Vector3) => Vector3\n} = internal.add\n\nexport const subtract: {\n /**\n * Subtracts one `Vector3` instance from another.\n *\n * @param a - The vector to subtract from.\n * @param b - The vector to subtract.\n * @returns A new `Vector3` instance representing the difference of the two vectors.\n * @since 1.0.0\n */\n (a: Vector3, b: Vector3): Vector3\n /**\n * Subtracts one `Vector3` instance from another.\n *\n * @param b - The vector to subtract.\n * @returns A function that takes the first vector and returns the difference.\n * @since 1.0.0\n */\n (b: Vector3): (a: Vector3) => Vector3\n} = internal.subtract\n\nexport const hadamard: {\n /**\n * Calculates the Hadamard product of two `Vector3` instances.\n *\n * The Hadamard product is an element-wise multiplication of two vectors.\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns A new `Vector3` instance representing the Hadamard product of the two vectors.\n * @since 1.0.0\n */\n (a: Vector3, b: Vector3): Vector3\n /**\n * Calculates the Hadamard product of two `Vector3` instances.\n *\n * The Hadamard product is an element-wise multiplication of two vectors.\n *\n * @param b - The second vector.\n * @returns A function that takes the first vector and returns the Hadamard product.\n * @since 1.0.0\n */\n (b: Vector3): (a: Vector3) => Vector3\n} = internal.hadamard\n\nexport const scale: {\n /**\n * Scales a `Vector3` instance by a scalar value.\n *\n * @param s - The scalar value to scale by.\n * @return A function that takes a vector and returns the scaled vector.\n * @since 1.0.0\n */\n (s: number): (v: Vector3) => Vector3\n /**\n * Scales a `Vector3` instance by a scalar value.\n *\n * @param s - The scalar value to scale by.\n * @param v - The vector to scale.\n * @returns A new `Vector3` instance representing the scaled vector.\n * @since 1.0.0\n */\n (v: Vector3, s: number): Vector3\n} = internal.scale\n\n/**\n * Gets the x component of a `Vector3`.\n *\n * @param v - The vector to get the x component of.\n * @returns The x component of the vector.\n * @since 1.0.0\n */\nexport const getX: (v: Vector3) => number = internal.getX\n\nexport const setX: {\n /**\n * Sets the x component of a `Vector3`.\n *\n * @param v - The vector to set the x component of.\n * @param x - The new x component.\n * @returns A new `Vector3` instance with the updated x component.\n * @since 1.0.0\n */\n (v: Vector3, x: number): Vector3\n /**\n * Sets the x component of a `Vector3`.\n *\n * @param x - The new x component.\n * @returns A function that takes the vector and returns a new `Vector3` instance with the updated x component.\n * @since 1.0.0\n */\n (x: number): (v: Vector3) => Vector3\n} = internal.setX\n\n/**\n * Gets the y component of a `Vector3`.\n *\n * @param v - The vector of which to get the y component.\n * @returns The y component of the vector.\n * @since 1.0.0\n */\nexport const getY: (v: Vector3) => number = internal.getY\n\nexport const setY: {\n /**\n * Sets the y component of a `Vector3`.\n *\n * @param v - The vector of which to set the y component.\n * @param y - The new y component.\n * @returns A new `Vector3` instance with the updated y component.\n * @since 1.0.0\n */\n (v: Vector3, y: number): Vector3\n /**\n * Sets the y component of a `Vector3`.\n *\n * @param y - The new y component.\n * @returns A function that takes the vector and returns a new `Vector3` instance with the updated y component.\n * @since 1.0.0\n */\n (y: number): (v: Vector3) => Vector3\n} = internal.setY\n\n/**\n * Gets the z component of a `Vector3`.\n *\n * @param v - The vector of which to get the z component.\n * @returns The z component of the vector.\n * @since 1.0.0\n */\nexport const getZ: (v: Vector3) => number = internal.getZ\n\nexport const setZ: {\n /**\n * Sets the z component of a `Vector3`.\n *\n * @param v - The vector of which to set the z component.\n * @param z - The new z component.\n * @returns A new `Vector3` instance with the updated z component.\n * @since 1.0.0\n */\n (v: Vector3, z: number): Vector3\n /**\n * Sets the z component of a `Vector3`.\n *\n * @param z - The new z component.\n * @returns A function that takes the vector and returns a new `Vector3` instance with the updated z component.\n * @since 1.0.0\n */\n (z: number): (v: Vector3) => Vector3\n} = internal.setZ\n\n/**\n * Gets the radius of a `Vector3`.\n *\n * @param v - The vector of which to get the radius.\n * @returns The radius of the vector.\n * @since 1.0.0\n */\nexport const getR: (v: Vector3) => number = magnitude\n\nexport const setR: {\n /**\n * Sets the radius of a `Vector3`.\n *\n * @param v - The vector of which to set the radius.\n * @param r - The new radius.\n * @returns A new `Vector3` instance with the updated radius.\n * @since 1.0.0\n */\n (v: Vector3, r: number): Vector3\n /**\n * Sets the radius of a `Vector3`.\n *\n * @param r - The new radius.\n * @returns A function that takes the vector and returns the updated vector.\n * @since 1.0.0\n */\n (r: number): (v: Vector3) => Vector3\n} = internal.setR\n\n/**\n * Gets the polar angle (theta) of a `Vector3`.\n *\n * @param v - The vector of which to get the polar angle.\n * @returns The polar angle of the vector.\n * @since 1.0.0\n */\nexport const getTheta: (v: Vector3) => number = internal.getTheta\n\nexport const setTheta: {\n /**\n * Sets the polar angle (theta) of a `Vector3`.\n *\n * @param v - The vector of which to set the polar angle.\n * @param theta - The new polar angle.\n * @returns A new `Vector3` instance with the updated polar angle.\n * @since 1.0.0\n */\n (v: Vector3, theta: number): Vector3\n /**\n * Sets the polar angle (theta) of a `Vector3`.\n *\n * @param theta - The new polar angle.\n * @returns A function that takes the vector and returns the updated vector.\n * @since 1.0.0\n */\n (theta: number): (v: Vector3) => Vector3\n} = internal.setTheta\n\n/**\n * Gets the azimuthal angle (phi) of a `Vector3`.\n *\n * @param v - The vector of which to get the azimuthal angle.\n * @returns The azimuthal angle of the vector.\n * @since 1.0.0\n */\nexport const getPhi: (v: Vector3) => number = internal.getPhi\n\nexport const setPhi: {\n /**\n * Sets the azimuthal angle (phi) of a `Vector3`.\n *\n * @param v - The vector of which to set the azimuthal angle.\n * @param phi - The new azimuthal angle.\n * @returns A new `Vector3` instance with the updated azimuthal angle.\n * @since 1.0.0\n */\n (v: Vector3, phi: number): Vector3\n /**\n * Sets the azimuthal angle (phi) of a `Vector3`.\n *\n * @param phi - The new azimuthal angle.\n * @returns A function that takes the vector and returns the updated vector.\n * @since 1.0.0\n */\n (phi: number): (v: Vector3) => Vector3\n} = internal.setPhi\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAa,YAA0CA;AAEvD,MAAa,SAoBTC;AAEJ,MAAa,OA4BTC;;;;;;;;;;;AAYJ,MAAa,YAGsCC;;;;;;;;;;AAWnD,MAAa,gBACXC;;;;;;;;AASF,MAAa,YAAyCC;;;;;;;;;AAUtD,MAAa,SAAsC;;;;;;;;AASnD,MAAa,YAA0CC;AAEvD,MAAa,MAkBTC;AAEJ,MAAa,QAkBTC;;;;;;;;AASJ,MAAa,aAAuDC;;;;;;;;AASpE,MAAa,UAAmCC;;;;;;AAOhD,MAAa,OAAO,KAAK,EAAE;;;;;;AAO3B,MAAa,OAAO,KAAK,EAAE;;;;;;AAO3B,MAAa,QAAQ,KAAK,GAAG,GAAG,EAAE;;;;;;AAOlC,MAAa,QAAQ,KAAK,GAAG,GAAG,EAAE;;;;;;AAOlC,MAAa,QAAQ,KAAK,GAAG,GAAG,EAAE;AAElC,MAAa,MAkBTC;AAEJ,MAAa,WAkBTC;AAEJ,MAAa,WAsBTC;AAEJ,MAAa,QAkBTC;;;;;;;;AASJ,MAAa,OAA+BC;AAE5C,MAAa,OAkBTC;;;;;;;;AASJ,MAAa,OAA+BC;AAE5C,MAAa,OAkBTC;;;;;;;;AASJ,MAAa,OAA+BC;AAE5C,MAAa,OAkBTC;;;;;;;;AASJ,MAAa,OAA+B;AAE5C,MAAa,OAkBTC;;;;;;;;AASJ,MAAa,WAAmCC;AAEhD,MAAa,WAkBTC;;;;;;;;AASJ,MAAa,SAAiCC;AAE9C,MAAa,SAkBTC"}
1
+ {"version":3,"file":"vector3-C-qgKAjR.mjs","names":["internal.isVector3","internal.equals","internal.make","internal.transpose","internal.fromSpherical","internal.magnitude","internal.normalize","internal.dot","internal.cross","internal.components","internal.softmax","internal.add","internal.subtract","internal.hadamard","internal.scale","internal.getX","internal.setX","internal.getY","internal.setY","internal.getZ","internal.setZ","internal.setR","internal.getTheta","internal.setTheta","internal.getPhi","internal.setPhi"],"sources":["../../src/vector/vector3.ts"],"sourcesContent":["import type { ThreeDimensional } from '../dimensions'\nimport type { Pipeable } from '../utils'\nimport type { Vector3TypeId } from './vector3.internal'\nimport * as internal from './vector3.internal'\n\n/**\n * A 3D vector.\n *\n * All fields are readonly and immutable, and all operations create new instances.\n *\n * @since 1.0.0\n */\nexport interface Vector3 extends Pipeable, ThreeDimensional<number> {\n readonly [Vector3TypeId]: Vector3TypeId\n}\n\n/**\n * Checks if a value is a `Vector3`.\n *\n * @param v - The value to check.\n * @returns `true` if the value is a `Vector3`, `false` otherwise.\n * @since 1.0.0\n */\nexport const isVector3: (v: unknown) => v is Vector3 = internal.isVector3\n\nexport const equals: {\n /**\n * Checks if two `Vector3` instances are approximately equal within the\n * default absolute tolerance ({@link EPSILON}).\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` when each pair of components is within tolerance.\n * @since 1.1.0\n */\n (a: Vector3, b: Vector3): boolean\n /**\n * Checks if two `Vector3` instances are approximately equal within the\n * default absolute tolerance ({@link EPSILON}).\n *\n * @param b - The second vector.\n * @returns A function that takes the first vector and returns the comparison result.\n * @since 1.1.0\n */\n (b: Vector3): (a: Vector3) => boolean\n} = internal.equals\n\nexport const make: {\n /**\n * Creates a new `Vector3` instance.\n *\n * @param xyz - The x, y, and z components of the vector.\n * @returns A new `Vector3` instance.\n * @since 1.0.0\n */\n (xyz: number): Vector3\n /**\n * Creates a new `Vector3` instance.\n *\n * @param x - The x component of the vector.\n * @param yz - The y and z components of the vector.\n * @returns A new `Vector3` instance.\n * @since 1.0.0\n */\n (x: number, yz: number): Vector3\n /**\n * Creates a new `Vector3` instance.\n *\n * @param x - The x component of the vector.\n * @param y - The y component of the vector.\n * @param z - The z component of the vector.\n * @returns A new `Vector3` instance.\n * @since 1.0.0\n */\n (x: number, y: number, z: number): Vector3\n} = internal.make\n\n/**\n * Transposes a 3-tuple of items into one or more `Vector3`s, one per channel\n * extracted by the projection function. See {@link Vector4.transpose} for the\n * full operation description; this is the 3-component analog.\n *\n * @param inputs - Exactly three items of any type.\n * @param project - A function returning a fixed-arity tuple of numbers — one per output channel.\n * @returns A tuple of `Vector3`s with the same arity as the projection's return tuple.\n * @since 2.0.0\n */\nexport const transpose: <T, const Channels extends ReadonlyArray<number>>(\n inputs: readonly [T, T, T],\n project: (item: T) => Channels,\n) => { readonly [K in keyof Channels]: Vector3 } = internal.transpose\n\n/**\n * Creates a new `Vector3` instance from spherical coordinates.\n *\n * @param r - The radius.\n * @param theta - The polar angle, in radians. Ranges from 0 to π\n * @param phi - The azimuthal angle, in radians. Ranges from 0 to 2π\n * @returns A new `Vector3` instance.\n * @since 1.0.0\n */\nexport const fromSpherical: (r: number, theta: number, phi: number) => Vector3 =\n internal.fromSpherical\n\n/**\n * Calculates the magnitude of a `Vector3`.\n *\n * @param vector - The vector to calculate the magnitude of.\n * @returns The magnitude of the vector.\n * @since 1.0.0\n */\nexport const magnitude: (vector: Vector3) => number = internal.magnitude\n\n/**\n * Calculates the length of a `Vector3`.\n *\n * @param vector - The vector to calculate the length of.\n * @returns The length of the vector.\n * @see {@link magnitude}\n * @since 1.0.0\n */\nexport const length: (vector: Vector3) => number = magnitude\n\n/**\n * Normalizes a `Vector3`.\n *\n * @param vector - The vector to normalize.\n * @returns A new `Vector3` instance with the same direction as the input vector, but with a magnitude of 1.\n * @since 1.0.0\n */\nexport const normalize: (vector: Vector3) => Vector3 = internal.normalize\n\nexport const dot: {\n /**\n * Calculates the dot product of two `Vector3` instances.\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns The dot product of the two vectors.\n * @since 1.0.0\n */\n (a: Vector3, b: Vector3): number\n /**\n * Calculates the dot product of two `Vector3` instances.\n *\n * @param b - The second vector.\n * @returns A function that takes the first vector and returns the dot product.\n * @since 1.0.0\n */\n (b: Vector3): (a: Vector3) => number\n} = internal.dot\n\nexport const cross: {\n /**\n * Calculates the cross product of two `Vector3` instances.\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns A new `Vector3` instance representing the cross product of the two vectors.\n * @since 1.0.0\n */\n (a: Vector3, b: Vector3): Vector3\n /**\n * Calculates the cross product of two `Vector3` instances.\n *\n * @param b - The second vector.\n * @returns A function that takes the first vector and returns the cross product.\n * @since 1.0.0\n */\n (b: Vector3): (a: Vector3) => Vector3\n} = internal.cross\n\n/**\n * Returns the components of a `Vector3` as an array.\n *\n * @param v - The vector to get the components of.\n * @returns An array containing the x, y, and z components of the vector.\n * @since 1.0.0\n */\nexport const components: (v: Vector3) => [number, number, number] = internal.components\n\n/**\n * Calculates the softmax of a `Vector3`.\n *\n * @param v - The vector to calculate the softmax of.\n * @returns A new `Vector3` instance representing the softmax of the input vector.\n * @since 1.0.0\n */\nexport const softmax: (v: Vector3) => Vector3 = internal.softmax\n\n/**\n * Creates a zero vector.\n *\n * @since 1.0.0\n */\nexport const zero = make(0)\n\n/**\n * Creates a unit vector.\n *\n * @since 1.0.0\n */\nexport const unit = make(1)\n\n/**\n * Creates a unit vector in the x direction.\n *\n * @since 1.0.0\n */\nexport const unitX = make(1, 0, 0)\n\n/**\n * Creates a unit vector in the y direction.\n *\n * @since 1.0.0\n */\nexport const unitY = make(0, 1, 0)\n\n/**\n * Creates a unit vector in the z direction.\n *\n * @since 1.0.0\n */\nexport const unitZ = make(0, 0, 1)\n\nexport const add: {\n /**\n * Adds two `Vector3` instances.\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns A new `Vector3` instance representing the sum of the two vectors.\n * @since 1.0.0\n */\n (a: Vector3, b: Vector3): Vector3\n /**\n * Adds two `Vector3` instances.\n *\n * @param b - The second vector.\n * @returns A function that takes the first vector and returns the sum.\n * @since 1.0.0\n */\n (b: Vector3): (a: Vector3) => Vector3\n} = internal.add\n\nexport const subtract: {\n /**\n * Subtracts one `Vector3` instance from another.\n *\n * @param a - The vector to subtract from.\n * @param b - The vector to subtract.\n * @returns A new `Vector3` instance representing the difference of the two vectors.\n * @since 1.0.0\n */\n (a: Vector3, b: Vector3): Vector3\n /**\n * Subtracts one `Vector3` instance from another.\n *\n * @param b - The vector to subtract.\n * @returns A function that takes the first vector and returns the difference.\n * @since 1.0.0\n */\n (b: Vector3): (a: Vector3) => Vector3\n} = internal.subtract\n\nexport const hadamard: {\n /**\n * Calculates the Hadamard product of two `Vector3` instances.\n *\n * The Hadamard product is an element-wise multiplication of two vectors.\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns A new `Vector3` instance representing the Hadamard product of the two vectors.\n * @since 1.0.0\n */\n (a: Vector3, b: Vector3): Vector3\n /**\n * Calculates the Hadamard product of two `Vector3` instances.\n *\n * The Hadamard product is an element-wise multiplication of two vectors.\n *\n * @param b - The second vector.\n * @returns A function that takes the first vector and returns the Hadamard product.\n * @since 1.0.0\n */\n (b: Vector3): (a: Vector3) => Vector3\n} = internal.hadamard\n\nexport const scale: {\n /**\n * Scales a `Vector3` instance by a scalar value.\n *\n * @param s - The scalar value to scale by.\n * @return A function that takes a vector and returns the scaled vector.\n * @since 1.0.0\n */\n (s: number): (v: Vector3) => Vector3\n /**\n * Scales a `Vector3` instance by a scalar value.\n *\n * @param s - The scalar value to scale by.\n * @param v - The vector to scale.\n * @returns A new `Vector3` instance representing the scaled vector.\n * @since 1.0.0\n */\n (v: Vector3, s: number): Vector3\n} = internal.scale\n\n/**\n * Gets the x component of a `Vector3`.\n *\n * @param v - The vector to get the x component of.\n * @returns The x component of the vector.\n * @since 1.0.0\n */\nexport const getX: (v: Vector3) => number = internal.getX\n\nexport const setX: {\n /**\n * Sets the x component of a `Vector3`.\n *\n * @param v - The vector to set the x component of.\n * @param x - The new x component.\n * @returns A new `Vector3` instance with the updated x component.\n * @since 1.0.0\n */\n (v: Vector3, x: number): Vector3\n /**\n * Sets the x component of a `Vector3`.\n *\n * @param x - The new x component.\n * @returns A function that takes the vector and returns a new `Vector3` instance with the updated x component.\n * @since 1.0.0\n */\n (x: number): (v: Vector3) => Vector3\n} = internal.setX\n\n/**\n * Gets the y component of a `Vector3`.\n *\n * @param v - The vector of which to get the y component.\n * @returns The y component of the vector.\n * @since 1.0.0\n */\nexport const getY: (v: Vector3) => number = internal.getY\n\nexport const setY: {\n /**\n * Sets the y component of a `Vector3`.\n *\n * @param v - The vector of which to set the y component.\n * @param y - The new y component.\n * @returns A new `Vector3` instance with the updated y component.\n * @since 1.0.0\n */\n (v: Vector3, y: number): Vector3\n /**\n * Sets the y component of a `Vector3`.\n *\n * @param y - The new y component.\n * @returns A function that takes the vector and returns a new `Vector3` instance with the updated y component.\n * @since 1.0.0\n */\n (y: number): (v: Vector3) => Vector3\n} = internal.setY\n\n/**\n * Gets the z component of a `Vector3`.\n *\n * @param v - The vector of which to get the z component.\n * @returns The z component of the vector.\n * @since 1.0.0\n */\nexport const getZ: (v: Vector3) => number = internal.getZ\n\nexport const setZ: {\n /**\n * Sets the z component of a `Vector3`.\n *\n * @param v - The vector of which to set the z component.\n * @param z - The new z component.\n * @returns A new `Vector3` instance with the updated z component.\n * @since 1.0.0\n */\n (v: Vector3, z: number): Vector3\n /**\n * Sets the z component of a `Vector3`.\n *\n * @param z - The new z component.\n * @returns A function that takes the vector and returns a new `Vector3` instance with the updated z component.\n * @since 1.0.0\n */\n (z: number): (v: Vector3) => Vector3\n} = internal.setZ\n\n/**\n * Gets the radius of a `Vector3`.\n *\n * @param v - The vector of which to get the radius.\n * @returns The radius of the vector.\n * @since 1.0.0\n */\nexport const getR: (v: Vector3) => number = magnitude\n\nexport const setR: {\n /**\n * Sets the radius of a `Vector3`.\n *\n * @param v - The vector of which to set the radius.\n * @param r - The new radius.\n * @returns A new `Vector3` instance with the updated radius.\n * @since 1.0.0\n */\n (v: Vector3, r: number): Vector3\n /**\n * Sets the radius of a `Vector3`.\n *\n * @param r - The new radius.\n * @returns A function that takes the vector and returns the updated vector.\n * @since 1.0.0\n */\n (r: number): (v: Vector3) => Vector3\n} = internal.setR\n\n/**\n * Gets the polar angle (theta) of a `Vector3`.\n *\n * @param v - The vector of which to get the polar angle.\n * @returns The polar angle of the vector.\n * @since 1.0.0\n */\nexport const getTheta: (v: Vector3) => number = internal.getTheta\n\nexport const setTheta: {\n /**\n * Sets the polar angle (theta) of a `Vector3`.\n *\n * @param v - The vector of which to set the polar angle.\n * @param theta - The new polar angle.\n * @returns A new `Vector3` instance with the updated polar angle.\n * @since 1.0.0\n */\n (v: Vector3, theta: number): Vector3\n /**\n * Sets the polar angle (theta) of a `Vector3`.\n *\n * @param theta - The new polar angle.\n * @returns A function that takes the vector and returns the updated vector.\n * @since 1.0.0\n */\n (theta: number): (v: Vector3) => Vector3\n} = internal.setTheta\n\n/**\n * Gets the azimuthal angle (phi) of a `Vector3`.\n *\n * @param v - The vector of which to get the azimuthal angle.\n * @returns The azimuthal angle of the vector.\n * @since 1.0.0\n */\nexport const getPhi: (v: Vector3) => number = internal.getPhi\n\nexport const setPhi: {\n /**\n * Sets the azimuthal angle (phi) of a `Vector3`.\n *\n * @param v - The vector of which to set the azimuthal angle.\n * @param phi - The new azimuthal angle.\n * @returns A new `Vector3` instance with the updated azimuthal angle.\n * @since 1.0.0\n */\n (v: Vector3, phi: number): Vector3\n /**\n * Sets the azimuthal angle (phi) of a `Vector3`.\n *\n * @param phi - The new azimuthal angle.\n * @returns A function that takes the vector and returns the updated vector.\n * @since 1.0.0\n */\n (phi: number): (v: Vector3) => Vector3\n} = internal.setPhi\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAa,YAA0CA;AAEvD,MAAa,SAoBTC;AAEJ,MAAa,OA4BTC;;;;;;;;;;;AAYJ,MAAa,YAGsCC;;;;;;;;;;AAWnD,MAAa,gBACXC;;;;;;;;AASF,MAAa,YAAyCC;;;;;;;;;AAUtD,MAAa,SAAsC;;;;;;;;AASnD,MAAa,YAA0CC;AAEvD,MAAa,MAkBTC;AAEJ,MAAa,QAkBTC;;;;;;;;AASJ,MAAa,aAAuDC;;;;;;;;AASpE,MAAa,UAAmCC;;;;;;AAOhD,MAAa,OAAO,KAAK,EAAE;;;;;;AAO3B,MAAa,OAAO,KAAK,EAAE;;;;;;AAO3B,MAAa,QAAQ,KAAK,GAAG,GAAG,EAAE;;;;;;AAOlC,MAAa,QAAQ,KAAK,GAAG,GAAG,EAAE;;;;;;AAOlC,MAAa,QAAQ,KAAK,GAAG,GAAG,EAAE;AAElC,MAAa,MAkBTC;AAEJ,MAAa,WAkBTC;AAEJ,MAAa,WAsBTC;AAEJ,MAAa,QAkBTC;;;;;;;;AASJ,MAAa,OAA+BC;AAE5C,MAAa,OAkBTC;;;;;;;;AASJ,MAAa,OAA+BC;AAE5C,MAAa,OAkBTC;;;;;;;;AASJ,MAAa,OAA+BC;AAE5C,MAAa,OAkBTC;;;;;;;;AASJ,MAAa,OAA+B;AAE5C,MAAa,OAkBTC;;;;;;;;AASJ,MAAa,WAAmCC;AAEhD,MAAa,WAkBTC;;;;;;;;AASJ,MAAa,SAAiCC;AAE9C,MAAa,SAkBTC"}
@@ -52,7 +52,7 @@ const make = make$1;
52
52
  * @param inputs - Exactly four items of any type.
53
53
  * @param project - A function returning a fixed-arity tuple of numbers — one per output channel.
54
54
  * @returns A tuple of `Vector4`s with the same arity as the projection's return tuple.
55
- * @since 2.1.0
55
+ * @since 2.0.0
56
56
  */
57
57
  const transpose = transpose$1;
58
58
  /**
@@ -106,4 +106,4 @@ const scale = scale$1;
106
106
  //#endregion
107
107
  export { transpose as n, vector4_exports as r, make as t };
108
108
 
109
- //# sourceMappingURL=vector4-5KbjoHVj.mjs.map
109
+ //# sourceMappingURL=vector4-BhOKDhD5.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"vector4-5KbjoHVj.mjs","names":["internal.isVector4","internal.equals","internal.make","internal.transpose","internal.magnitude","internal.normalize","internal.dot","internal.components","internal.softmax","internal.add","internal.subtract","internal.hadamard","internal.scale"],"sources":["../../src/vector/vector4.ts"],"sourcesContent":["import type { FourDimensional } from '../dimensions'\nimport type { Pipeable } from '../utils'\nimport type { Vector4TypeId } from './vector4.internal'\nimport * as internal from './vector4.internal'\n\n/**\n * A 4D vector.\n *\n * All fields are readonly and immutable, and all operations create new instances.\n *\n * @since 1.0.0\n */\nexport interface Vector4 extends Pipeable, FourDimensional<number> {\n readonly [Vector4TypeId]: Vector4TypeId\n}\n\n/**\n * Checks if a value is a `Vector4`.\n *\n * @param v - The value to check.\n * @returns `true` if the value is a `Vector4`, `false` otherwise.\n * @since 1.0.0\n */\nexport const isVector4: (v: unknown) => v is Vector4 = internal.isVector4\n\nexport const equals: {\n /**\n * Checks if two `Vector4` instances are approximately equal within the\n * default absolute tolerance ({@link EPSILON}).\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` when each pair of components is within tolerance.\n * @since 1.1.0\n */\n (a: Vector4, b: Vector4): boolean\n /**\n * Checks if two `Vector4` instances are approximately equal within the\n * default absolute tolerance ({@link EPSILON}).\n *\n * @param b - The second vector.\n * @returns A function that takes the first vector and returns the comparison result.\n * @since 1.1.0\n */\n (b: Vector4): (a: Vector4) => boolean\n} = internal.equals\n\nexport const make: {\n /**\n * Creates a new `Vector4` instance.\n *\n * @param xyzw - The x, y, z, and w components of the vector.\n * @returns A new `Vector4` instance.\n * @since 1.0.0\n */\n (xyzw: number): Vector4\n /**\n * Creates a new `Vector4` instance.\n *\n * @param x - The x component of the vector.\n * @param yzw - The y, z, and w components of the vector.\n * @returns A new `Vector4` instance.\n * @since 1.0.0\n */\n (x: number, yzw: number): Vector4\n /**\n * Creates a new `Vector4` instance.\n *\n * @param x - The x component of the vector.\n * @param y - The y component of the vector.\n * @param zw - The z and w components of the vector.\n * @returns A new `Vector4` instance.\n * @since 1.0.0\n */\n (x: number, y: number, zw: number): Vector4\n /**\n * Creates a new `Vector4` instance.\n *\n * @param x - The x component of the vector.\n * @param y - The y component of the vector.\n * @param z - The z component of the vector.\n * @param w - The w component of the vector.\n * @returns A new `Vector4` instance.\n * @since 1.0.0\n */\n (x: number, y: number, z: number, w: number): Vector4\n} = internal.make\n\n/**\n * Transposes a 4-tuple of items into one or more `Vector4`s, one per channel\n * extracted by the projection function.\n *\n * For each output channel, takes the corresponding number from each of the\n * four projected items and packs them into a `Vector4` — the data-layout\n * transformation NumPy calls a transpose, FP calls `unzip`, GPUs call a\n * gather, and DSP people inexplicably call deinterleaving.\n *\n * The projection's return-tuple arity determines the number of output\n * vectors, and that arity is preserved in the return type.\n *\n * @example\n * ```ts\n * // Pack the x and y coordinates of four control points into two Vector4s.\n * const [xs, ys] = Vector4.transpose(\n * [p0, p1, p2, p3],\n * (p) => [p.x, p.y],\n * )\n * ```\n *\n * @param inputs - Exactly four items of any type.\n * @param project - A function returning a fixed-arity tuple of numbers — one per output channel.\n * @returns A tuple of `Vector4`s with the same arity as the projection's return tuple.\n * @since 2.1.0\n */\nexport const transpose: <T, const Channels extends ReadonlyArray<number>>(\n inputs: readonly [T, T, T, T],\n project: (item: T) => Channels,\n) => { readonly [K in keyof Channels]: Vector4 } = internal.transpose\n\n/**\n * Gets the magnitude of a `Vector4`.\n *\n * @param vector - The vector to calculate the magnitude of.\n * @returns The magnitude of the vector.\n * @since 1.0.0\n */\nexport const magnitude: (vector: Vector4) => number = internal.magnitude\n\n/**\n * Normalizes a `Vector4`.\n *\n * @param vector - The vector to normalize.\n * @returns A new `Vector4` instance with the same direction as the input vector but with a magnitude of 1.\n * @since 1.0.0\n */\nexport const normalize: (vector: Vector4) => Vector4 = internal.normalize\n\nexport const dot: {\n /**\n * Computes the dot product of two `Vector4` instances.\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns The dot product of the two vectors.\n * @since 1.0.0\n */\n (a: Vector4, b: Vector4): number\n /**\n * Computes the dot product of a `Vector4` instance and another vector.\n *\n * @param b - The second vector.\n * @returns A function that takes the first vector and returns the dot product.\n * @since 1.0.0\n */\n (b: Vector4): (a: Vector4) => number\n} = internal.dot\n\n/**\n * Returns the components of a `Vector4` as an array.\n *\n * @param v - The vector to get the components of.\n * @returns An array containing the x, y, z, and w components of the vector.\n * @since 1.0.0\n */\nexport const components: (v: Vector4) => [number, number, number, number] = internal.components\n\n/**\n * Applies the softmax function to a `Vector4`.\n *\n * @param v - The vector to calculate the softmax of.\n * @returns A new `Vector4` instance representing the softmax of the input vector.\n */\nexport const softmax: (v: Vector4) => Vector4 = internal.softmax\n\n/**\n * Creates a zero vector.\n *\n * @since 1.0.0\n */\nexport const zero = make(0)\n\n/**\n * Creates a unit vector.\n *\n * @since 1.0.0\n */\nexport const unit = make(1)\n\nexport const add: {\n /**\n * Adds two `Vector4` instances.\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns A new `Vector4` instance representing the sum of the two vectors.\n * @since 1.0.0\n */\n (a: Vector4, b: Vector4): Vector4\n\n /**\n * Adds a `Vector4` instance to another vector.\n *\n * @param b - The second vector.\n * @returns A function that takes the first vector and returns the sum.\n * @since 1.0.0\n */\n (b: Vector4): (a: Vector4) => Vector4\n} = internal.add\n\nexport const subtract: {\n /**\n * Subtracts one `Vector4` instance from another.\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns A new `Vector4` instance representing the difference of the two vectors.\n * @since 1.0.0\n */\n (a: Vector4, b: Vector4): Vector4\n /**\n * Subtracts a `Vector4` instance from another vector.\n *\n * @param b - The second vector.\n * @returns A function that takes the first vector and returns the difference.\n * @since 1.0.0\n */\n (b: Vector4): (a: Vector4) => Vector4\n} = internal.subtract\n\nexport const hadamard: {\n /**\n * Computes the Hadamard product of two `Vector4` instances.\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns A new `Vector4` instance representing the Hadamard product of the two vectors.\n * @since 1.0.0\n */\n (a: Vector4, b: Vector4): Vector4\n /**\n * Computes the Hadamard product of a `Vector4` instance and another vector.\n *\n * @param b - The second vector.\n * @returns A function that takes the first vector and returns the Hadamard product.\n * @since 1.0.0\n */\n (b: Vector4): (a: Vector4) => Vector4\n} = internal.hadamard\n\nexport const scale: {\n /**\n * Scales a `Vector4` by a scalar.\n *\n * @param s - The scalar to scale the vector by.\n * @returns A function that takes the vector and returns the scaled vector.\n * @since 1.0.0\n */\n (s: number): (v: Vector4) => Vector4\n /**\n * Scales a `Vector4` by a scalar.\n *\n * @param s - The scalar to scale the vector by.\n * @param v - The vector to scale.\n * @returns A new `Vector4` instance representing the scaled vector.\n * @since 1.0.0\n */\n (v: Vector4, s: number): Vector4\n} = internal.scale\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAa,YAA0CA;AAEvD,MAAa,SAoBTC;AAEJ,MAAa,OAuCTC;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BJ,MAAa,YAGsCC;;;;;;;;AASnD,MAAa,YAAyCC;;;;;;;;AAStD,MAAa,YAA0CC;AAEvD,MAAa,MAkBTC;;;;;;;;AASJ,MAAa,aAA+DC;;;;;;;AAQ5E,MAAa,UAAmCC;;;;;;AAOhD,MAAa,OAAO,KAAK,EAAE;;;;;;AAO3B,MAAa,OAAO,KAAK,EAAE;AAE3B,MAAa,MAmBTC;AAEJ,MAAa,WAkBTC;AAEJ,MAAa,WAkBTC;AAEJ,MAAa,QAkBTC"}
1
+ {"version":3,"file":"vector4-BhOKDhD5.mjs","names":["internal.isVector4","internal.equals","internal.make","internal.transpose","internal.magnitude","internal.normalize","internal.dot","internal.components","internal.softmax","internal.add","internal.subtract","internal.hadamard","internal.scale"],"sources":["../../src/vector/vector4.ts"],"sourcesContent":["import type { FourDimensional } from '../dimensions'\nimport type { Pipeable } from '../utils'\nimport type { Vector4TypeId } from './vector4.internal'\nimport * as internal from './vector4.internal'\n\n/**\n * A 4D vector.\n *\n * All fields are readonly and immutable, and all operations create new instances.\n *\n * @since 1.0.0\n */\nexport interface Vector4 extends Pipeable, FourDimensional<number> {\n readonly [Vector4TypeId]: Vector4TypeId\n}\n\n/**\n * Checks if a value is a `Vector4`.\n *\n * @param v - The value to check.\n * @returns `true` if the value is a `Vector4`, `false` otherwise.\n * @since 1.0.0\n */\nexport const isVector4: (v: unknown) => v is Vector4 = internal.isVector4\n\nexport const equals: {\n /**\n * Checks if two `Vector4` instances are approximately equal within the\n * default absolute tolerance ({@link EPSILON}).\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` when each pair of components is within tolerance.\n * @since 1.1.0\n */\n (a: Vector4, b: Vector4): boolean\n /**\n * Checks if two `Vector4` instances are approximately equal within the\n * default absolute tolerance ({@link EPSILON}).\n *\n * @param b - The second vector.\n * @returns A function that takes the first vector and returns the comparison result.\n * @since 1.1.0\n */\n (b: Vector4): (a: Vector4) => boolean\n} = internal.equals\n\nexport const make: {\n /**\n * Creates a new `Vector4` instance.\n *\n * @param xyzw - The x, y, z, and w components of the vector.\n * @returns A new `Vector4` instance.\n * @since 1.0.0\n */\n (xyzw: number): Vector4\n /**\n * Creates a new `Vector4` instance.\n *\n * @param x - The x component of the vector.\n * @param yzw - The y, z, and w components of the vector.\n * @returns A new `Vector4` instance.\n * @since 1.0.0\n */\n (x: number, yzw: number): Vector4\n /**\n * Creates a new `Vector4` instance.\n *\n * @param x - The x component of the vector.\n * @param y - The y component of the vector.\n * @param zw - The z and w components of the vector.\n * @returns A new `Vector4` instance.\n * @since 1.0.0\n */\n (x: number, y: number, zw: number): Vector4\n /**\n * Creates a new `Vector4` instance.\n *\n * @param x - The x component of the vector.\n * @param y - The y component of the vector.\n * @param z - The z component of the vector.\n * @param w - The w component of the vector.\n * @returns A new `Vector4` instance.\n * @since 1.0.0\n */\n (x: number, y: number, z: number, w: number): Vector4\n} = internal.make\n\n/**\n * Transposes a 4-tuple of items into one or more `Vector4`s, one per channel\n * extracted by the projection function.\n *\n * For each output channel, takes the corresponding number from each of the\n * four projected items and packs them into a `Vector4` — the data-layout\n * transformation NumPy calls a transpose, FP calls `unzip`, GPUs call a\n * gather, and DSP people inexplicably call deinterleaving.\n *\n * The projection's return-tuple arity determines the number of output\n * vectors, and that arity is preserved in the return type.\n *\n * @example\n * ```ts\n * // Pack the x and y coordinates of four control points into two Vector4s.\n * const [xs, ys] = Vector4.transpose(\n * [p0, p1, p2, p3],\n * (p) => [p.x, p.y],\n * )\n * ```\n *\n * @param inputs - Exactly four items of any type.\n * @param project - A function returning a fixed-arity tuple of numbers — one per output channel.\n * @returns A tuple of `Vector4`s with the same arity as the projection's return tuple.\n * @since 2.0.0\n */\nexport const transpose: <T, const Channels extends ReadonlyArray<number>>(\n inputs: readonly [T, T, T, T],\n project: (item: T) => Channels,\n) => { readonly [K in keyof Channels]: Vector4 } = internal.transpose\n\n/**\n * Gets the magnitude of a `Vector4`.\n *\n * @param vector - The vector to calculate the magnitude of.\n * @returns The magnitude of the vector.\n * @since 1.0.0\n */\nexport const magnitude: (vector: Vector4) => number = internal.magnitude\n\n/**\n * Normalizes a `Vector4`.\n *\n * @param vector - The vector to normalize.\n * @returns A new `Vector4` instance with the same direction as the input vector but with a magnitude of 1.\n * @since 1.0.0\n */\nexport const normalize: (vector: Vector4) => Vector4 = internal.normalize\n\nexport const dot: {\n /**\n * Computes the dot product of two `Vector4` instances.\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns The dot product of the two vectors.\n * @since 1.0.0\n */\n (a: Vector4, b: Vector4): number\n /**\n * Computes the dot product of a `Vector4` instance and another vector.\n *\n * @param b - The second vector.\n * @returns A function that takes the first vector and returns the dot product.\n * @since 1.0.0\n */\n (b: Vector4): (a: Vector4) => number\n} = internal.dot\n\n/**\n * Returns the components of a `Vector4` as an array.\n *\n * @param v - The vector to get the components of.\n * @returns An array containing the x, y, z, and w components of the vector.\n * @since 1.0.0\n */\nexport const components: (v: Vector4) => [number, number, number, number] = internal.components\n\n/**\n * Applies the softmax function to a `Vector4`.\n *\n * @param v - The vector to calculate the softmax of.\n * @returns A new `Vector4` instance representing the softmax of the input vector.\n */\nexport const softmax: (v: Vector4) => Vector4 = internal.softmax\n\n/**\n * Creates a zero vector.\n *\n * @since 1.0.0\n */\nexport const zero = make(0)\n\n/**\n * Creates a unit vector.\n *\n * @since 1.0.0\n */\nexport const unit = make(1)\n\nexport const add: {\n /**\n * Adds two `Vector4` instances.\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns A new `Vector4` instance representing the sum of the two vectors.\n * @since 1.0.0\n */\n (a: Vector4, b: Vector4): Vector4\n\n /**\n * Adds a `Vector4` instance to another vector.\n *\n * @param b - The second vector.\n * @returns A function that takes the first vector and returns the sum.\n * @since 1.0.0\n */\n (b: Vector4): (a: Vector4) => Vector4\n} = internal.add\n\nexport const subtract: {\n /**\n * Subtracts one `Vector4` instance from another.\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns A new `Vector4` instance representing the difference of the two vectors.\n * @since 1.0.0\n */\n (a: Vector4, b: Vector4): Vector4\n /**\n * Subtracts a `Vector4` instance from another vector.\n *\n * @param b - The second vector.\n * @returns A function that takes the first vector and returns the difference.\n * @since 1.0.0\n */\n (b: Vector4): (a: Vector4) => Vector4\n} = internal.subtract\n\nexport const hadamard: {\n /**\n * Computes the Hadamard product of two `Vector4` instances.\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns A new `Vector4` instance representing the Hadamard product of the two vectors.\n * @since 1.0.0\n */\n (a: Vector4, b: Vector4): Vector4\n /**\n * Computes the Hadamard product of a `Vector4` instance and another vector.\n *\n * @param b - The second vector.\n * @returns A function that takes the first vector and returns the Hadamard product.\n * @since 1.0.0\n */\n (b: Vector4): (a: Vector4) => Vector4\n} = internal.hadamard\n\nexport const scale: {\n /**\n * Scales a `Vector4` by a scalar.\n *\n * @param s - The scalar to scale the vector by.\n * @returns A function that takes the vector and returns the scaled vector.\n * @since 1.0.0\n */\n (s: number): (v: Vector4) => Vector4\n /**\n * Scales a `Vector4` by a scalar.\n *\n * @param s - The scalar to scale the vector by.\n * @param v - The vector to scale.\n * @returns A new `Vector4` instance representing the scaled vector.\n * @since 1.0.0\n */\n (v: Vector4, s: number): Vector4\n} = internal.scale\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAa,YAA0CA;AAEvD,MAAa,SAoBTC;AAEJ,MAAa,OAuCTC;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BJ,MAAa,YAGsCC;;;;;;;;AASnD,MAAa,YAAyCC;;;;;;;;AAStD,MAAa,YAA0CC;AAEvD,MAAa,MAkBTC;;;;;;;;AASJ,MAAa,aAA+DC;;;;;;;AAQ5E,MAAa,UAAmCC;;;;;;AAOhD,MAAa,OAAO,KAAK,EAAE;;;;;;AAO3B,MAAa,OAAO,KAAK,EAAE;AAE3B,MAAa,MAmBTC;AAEJ,MAAa,WAkBTC;AAEJ,MAAa,WAkBTC;AAEJ,MAAa,QAkBTC"}
@@ -1,2 +1,7 @@
1
- import { a as solution_d_exports } from "../shared/solution-sNQ-ZVhN.mjs";
2
- export { solution_d_exports as Solution };
1
+ import { t as Solution$1 } from "../shared/solution-DInDT2Hq.mjs";
2
+
3
+ //#region src/solution/index.d.ts
4
+ type Solution<T> = Solution$1<T>;
5
+ //#endregion
6
+ export { Solution };
7
+ //# sourceMappingURL=index.d.mts.map
@@ -1,2 +1,2 @@
1
- import { c as solution_exports } from "../shared/solution-CrtLfqEq.mjs";
1
+ import { c as solution_exports } from "../shared/solution-3TDATEMn.mjs";
2
2
  export { solution_exports as Solution };