curvy 1.0.9 → 2.0.0-alpha.2

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 (173) hide show
  1. package/dist/characteristic/index.d.mts +88 -0
  2. package/dist/characteristic/index.mjs +2 -0
  3. package/dist/curve/index.d.mts +2 -0
  4. package/dist/curve/index.mjs +2 -0
  5. package/dist/interval/index.d.mts +3 -0
  6. package/dist/interval/index.mjs +3 -0
  7. package/dist/matrix/index.d.mts +2 -0
  8. package/dist/matrix/index.mjs +267 -0
  9. package/dist/matrix/index.mjs.map +1 -0
  10. package/dist/number.d.mts +280 -0
  11. package/dist/number.mjs +140 -0
  12. package/dist/number.mjs.map +1 -0
  13. package/dist/path/index.d.mts +261 -0
  14. package/dist/path/index.mjs +325 -0
  15. package/dist/path/index.mjs.map +1 -0
  16. package/dist/polynomial/index.d.mts +2 -0
  17. package/dist/polynomial/index.mjs +3 -0
  18. package/dist/shared/characteristic-B9nCh_cx.mjs +104 -0
  19. package/dist/shared/characteristic-B9nCh_cx.mjs.map +1 -0
  20. package/dist/shared/chunk-25Hzd3z8.mjs +13 -0
  21. package/dist/shared/cubic-BajUY0JT.d.mts +1100 -0
  22. package/dist/shared/cubic-CpHAx8cC.mjs +479 -0
  23. package/dist/shared/cubic-CpHAx8cC.mjs.map +1 -0
  24. package/dist/shared/interval-05CR6eBf.mjs +421 -0
  25. package/dist/shared/interval-05CR6eBf.mjs.map +1 -0
  26. package/dist/shared/interval-Dy-RMEE3.d.mts +533 -0
  27. package/dist/shared/interval2d-8IBZnUOq.mjs +108 -0
  28. package/dist/shared/interval2d-8IBZnUOq.mjs.map +1 -0
  29. package/dist/shared/interval2d-C2id9u31.d.mts +172 -0
  30. package/dist/shared/matrix4x4-Ck2WROK-.mjs +440 -0
  31. package/dist/shared/matrix4x4-Ck2WROK-.mjs.map +1 -0
  32. package/dist/shared/matrix4x4-Dm_tSiH1.d.mts +1183 -0
  33. package/dist/shared/quadratic-CamozcFc.mjs +330 -0
  34. package/dist/shared/quadratic-CamozcFc.mjs.map +1 -0
  35. package/dist/shared/rationalCubic2d-B6g97ryJ.d.mts +308 -0
  36. package/dist/shared/rationalCubic2d-BEgUGSFf.mjs +295 -0
  37. package/dist/shared/rationalCubic2d-BEgUGSFf.mjs.map +1 -0
  38. package/dist/shared/rationalCubic2d-Bys2Uory.mjs +695 -0
  39. package/dist/shared/rationalCubic2d-Bys2Uory.mjs.map +1 -0
  40. package/dist/shared/rationalCubic2d-DlQfBURs.d.mts +818 -0
  41. package/dist/shared/solution-CrtLfqEq.mjs +306 -0
  42. package/dist/shared/solution-CrtLfqEq.mjs.map +1 -0
  43. package/dist/shared/solution-sNQ-ZVhN.d.mts +251 -0
  44. package/dist/{pipe.d.mts → shared/utils-MCckigYk.d.mts} +44 -26
  45. package/dist/shared/vector2-CL1HDdPr.mjs +187 -0
  46. package/dist/shared/vector2-CL1HDdPr.mjs.map +1 -0
  47. package/dist/shared/vector2-DPUY3_eA.d.mts +470 -0
  48. package/dist/shared/vector2.internal-DU_E808S.mjs +97 -0
  49. package/dist/shared/vector2.internal-DU_E808S.mjs.map +1 -0
  50. package/dist/shared/vector3-D-tv_aKL.mjs +204 -0
  51. package/dist/shared/vector3-D-tv_aKL.mjs.map +1 -0
  52. package/dist/shared/vector3-DqeOZtOB.d.mts +703 -0
  53. package/dist/shared/vector4-5KbjoHVj.mjs +109 -0
  54. package/dist/shared/vector4-5KbjoHVj.mjs.map +1 -0
  55. package/dist/shared/vector4.internal-5XcaX12X.mjs +163 -0
  56. package/dist/shared/vector4.internal-5XcaX12X.mjs.map +1 -0
  57. package/dist/solution/index.d.mts +2 -0
  58. package/dist/solution/index.mjs +2 -0
  59. package/dist/splines/index.d.mts +701 -0
  60. package/dist/splines/index.mjs +734 -0
  61. package/dist/splines/index.mjs.map +1 -0
  62. package/dist/utils.d.mts +2 -205
  63. package/dist/utils.mjs +88 -52
  64. package/dist/utils.mjs.map +1 -1
  65. package/dist/vector/index.d.mts +3 -0
  66. package/dist/vector/index.mjs +4 -0
  67. package/package.json +49 -92
  68. package/dist/curve/cubic2d.d.mts +0 -109
  69. package/dist/curve/cubic2d.d.ts +0 -109
  70. package/dist/curve/cubic2d.mjs +0 -80
  71. package/dist/curve/cubic2d.mjs.map +0 -1
  72. package/dist/curve/linear2d.d.mts +0 -94
  73. package/dist/curve/linear2d.d.ts +0 -94
  74. package/dist/curve/linear2d.mjs +0 -46
  75. package/dist/curve/linear2d.mjs.map +0 -1
  76. package/dist/curve/quadratic2d.d.mts +0 -117
  77. package/dist/curve/quadratic2d.d.ts +0 -117
  78. package/dist/curve/quadratic2d.mjs +0 -82
  79. package/dist/curve/quadratic2d.mjs.map +0 -1
  80. package/dist/interval.d.mts +0 -251
  81. package/dist/interval.d.ts +0 -251
  82. package/dist/interval.mjs +0 -86
  83. package/dist/interval.mjs.map +0 -1
  84. package/dist/matrix/matrix2x2.d.mts +0 -320
  85. package/dist/matrix/matrix2x2.d.ts +0 -320
  86. package/dist/matrix/matrix2x2.mjs +0 -25
  87. package/dist/matrix/matrix2x2.mjs.map +0 -1
  88. package/dist/matrix/matrix3x3.d.mts +0 -370
  89. package/dist/matrix/matrix3x3.d.ts +0 -370
  90. package/dist/matrix/matrix3x3.mjs +0 -28
  91. package/dist/matrix/matrix3x3.mjs.map +0 -1
  92. package/dist/matrix/matrix4x4.d.mts +0 -381
  93. package/dist/matrix/matrix4x4.d.ts +0 -381
  94. package/dist/matrix/matrix4x4.mjs +0 -178
  95. package/dist/matrix/matrix4x4.mjs.map +0 -1
  96. package/dist/path/cubic2d.d.mts +0 -95
  97. package/dist/path/cubic2d.d.ts +0 -95
  98. package/dist/path/cubic2d.mjs +0 -60
  99. package/dist/path/cubic2d.mjs.map +0 -1
  100. package/dist/path/linear2d.d.mts +0 -95
  101. package/dist/path/linear2d.d.ts +0 -95
  102. package/dist/path/linear2d.mjs +0 -53
  103. package/dist/path/linear2d.mjs.map +0 -1
  104. package/dist/path/quadratic2d.d.mts +0 -95
  105. package/dist/path/quadratic2d.d.ts +0 -95
  106. package/dist/path/quadratic2d.mjs +0 -57
  107. package/dist/path/quadratic2d.mjs.map +0 -1
  108. package/dist/pipe.d.ts +0 -58
  109. package/dist/pipe.mjs +0 -92
  110. package/dist/pipe.mjs.map +0 -1
  111. package/dist/polynomial/cubic.d.mts +0 -7
  112. package/dist/polynomial/cubic.d.ts +0 -7
  113. package/dist/polynomial/cubic.mjs +0 -133
  114. package/dist/polynomial/cubic.mjs.map +0 -1
  115. package/dist/polynomial/linear.d.mts +0 -7
  116. package/dist/polynomial/linear.d.ts +0 -7
  117. package/dist/polynomial/linear.mjs +0 -24
  118. package/dist/polynomial/linear.mjs.map +0 -1
  119. package/dist/polynomial/quadratic.d.mts +0 -7
  120. package/dist/polynomial/quadratic.d.ts +0 -7
  121. package/dist/polynomial/quadratic.mjs +0 -27
  122. package/dist/polynomial/quadratic.mjs.map +0 -1
  123. package/dist/shared/curvy.Bf5TIk31.d.mts +0 -22
  124. package/dist/shared/curvy.Bf5TIk31.d.ts +0 -22
  125. package/dist/shared/curvy.BkkW8Tx9.mjs +0 -102
  126. package/dist/shared/curvy.BkkW8Tx9.mjs.map +0 -1
  127. package/dist/shared/curvy.BxdGW9he.mjs +0 -116
  128. package/dist/shared/curvy.BxdGW9he.mjs.map +0 -1
  129. package/dist/shared/curvy.C_sCeg9J.mjs +0 -66
  130. package/dist/shared/curvy.C_sCeg9J.mjs.map +0 -1
  131. package/dist/shared/curvy.Cg8lZVUz.d.ts +0 -688
  132. package/dist/shared/curvy.DCt1gGII.mjs +0 -147
  133. package/dist/shared/curvy.DCt1gGII.mjs.map +0 -1
  134. package/dist/shared/curvy.DJ4xO0al.mjs +0 -63
  135. package/dist/shared/curvy.DJ4xO0al.mjs.map +0 -1
  136. package/dist/shared/curvy.DmVFTi0N.mjs +0 -35
  137. package/dist/shared/curvy.DmVFTi0N.mjs.map +0 -1
  138. package/dist/shared/curvy.FDaj5rlj.d.mts +0 -688
  139. package/dist/shared/curvy.lktriTpx.mjs +0 -101
  140. package/dist/shared/curvy.lktriTpx.mjs.map +0 -1
  141. package/dist/shared/curvy.mLFprrGm.mjs +0 -85
  142. package/dist/shared/curvy.mLFprrGm.mjs.map +0 -1
  143. package/dist/shared/curvy.r6f1j287.mjs +0 -76
  144. package/dist/shared/curvy.r6f1j287.mjs.map +0 -1
  145. package/dist/splines/basis2d.d.mts +0 -130
  146. package/dist/splines/basis2d.d.ts +0 -130
  147. package/dist/splines/basis2d.mjs +0 -90
  148. package/dist/splines/basis2d.mjs.map +0 -1
  149. package/dist/splines/bezier2d.d.mts +0 -182
  150. package/dist/splines/bezier2d.d.ts +0 -182
  151. package/dist/splines/bezier2d.mjs +0 -23
  152. package/dist/splines/bezier2d.mjs.map +0 -1
  153. package/dist/splines/cardinal2d.d.mts +0 -178
  154. package/dist/splines/cardinal2d.d.ts +0 -178
  155. package/dist/splines/cardinal2d.mjs +0 -114
  156. package/dist/splines/cardinal2d.mjs.map +0 -1
  157. package/dist/splines/hermite2d.d.mts +0 -124
  158. package/dist/splines/hermite2d.d.ts +0 -124
  159. package/dist/splines/hermite2d.mjs +0 -63
  160. package/dist/splines/hermite2d.mjs.map +0 -1
  161. package/dist/utils.d.ts +0 -205
  162. package/dist/vector/vector2.d.mts +0 -324
  163. package/dist/vector/vector2.d.ts +0 -324
  164. package/dist/vector/vector2.mjs +0 -30
  165. package/dist/vector/vector2.mjs.map +0 -1
  166. package/dist/vector/vector3.d.mts +0 -417
  167. package/dist/vector/vector3.d.ts +0 -417
  168. package/dist/vector/vector3.mjs +0 -38
  169. package/dist/vector/vector3.mjs.map +0 -1
  170. package/dist/vector/vector4.d.mts +0 -205
  171. package/dist/vector/vector4.d.ts +0 -205
  172. package/dist/vector/vector4.mjs +0 -20
  173. package/dist/vector/vector4.mjs.map +0 -1
@@ -0,0 +1,109 @@
1
+ import { t as __exportAll } from "./chunk-25Hzd3z8.mjs";
2
+ import { a as hadamard$1, c as make$1, d as softmax$1, f as subtract$1, i as equals$1, l as normalize$1, n as components$1, o as isVector4$1, p as transpose$1, r as dot$1, s as magnitude$1, t as add$1, u as scale$1 } from "./vector4.internal-5XcaX12X.mjs";
3
+ //#region src/vector/vector4.ts
4
+ var vector4_exports = /* @__PURE__ */ __exportAll({
5
+ add: () => add,
6
+ components: () => components,
7
+ dot: () => dot,
8
+ equals: () => equals,
9
+ hadamard: () => hadamard,
10
+ isVector4: () => isVector4,
11
+ magnitude: () => magnitude,
12
+ make: () => make,
13
+ normalize: () => normalize,
14
+ scale: () => scale,
15
+ softmax: () => softmax,
16
+ subtract: () => subtract,
17
+ transpose: () => transpose,
18
+ unit: () => unit,
19
+ zero: () => zero
20
+ });
21
+ /**
22
+ * Checks if a value is a `Vector4`.
23
+ *
24
+ * @param v - The value to check.
25
+ * @returns `true` if the value is a `Vector4`, `false` otherwise.
26
+ * @since 1.0.0
27
+ */
28
+ const isVector4 = isVector4$1;
29
+ const equals = equals$1;
30
+ const make = make$1;
31
+ /**
32
+ * Transposes a 4-tuple of items into one or more `Vector4`s, one per channel
33
+ * extracted by the projection function.
34
+ *
35
+ * For each output channel, takes the corresponding number from each of the
36
+ * four projected items and packs them into a `Vector4` — the data-layout
37
+ * transformation NumPy calls a transpose, FP calls `unzip`, GPUs call a
38
+ * gather, and DSP people inexplicably call deinterleaving.
39
+ *
40
+ * The projection's return-tuple arity determines the number of output
41
+ * vectors, and that arity is preserved in the return type.
42
+ *
43
+ * @example
44
+ * ```ts
45
+ * // Pack the x and y coordinates of four control points into two Vector4s.
46
+ * const [xs, ys] = Vector4.transpose(
47
+ * [p0, p1, p2, p3],
48
+ * (p) => [p.x, p.y],
49
+ * )
50
+ * ```
51
+ *
52
+ * @param inputs - Exactly four items of any type.
53
+ * @param project - A function returning a fixed-arity tuple of numbers — one per output channel.
54
+ * @returns A tuple of `Vector4`s with the same arity as the projection's return tuple.
55
+ * @since 2.1.0
56
+ */
57
+ const transpose = transpose$1;
58
+ /**
59
+ * Gets the magnitude of a `Vector4`.
60
+ *
61
+ * @param vector - The vector to calculate the magnitude of.
62
+ * @returns The magnitude of the vector.
63
+ * @since 1.0.0
64
+ */
65
+ const magnitude = magnitude$1;
66
+ /**
67
+ * Normalizes a `Vector4`.
68
+ *
69
+ * @param vector - The vector to normalize.
70
+ * @returns A new `Vector4` instance with the same direction as the input vector but with a magnitude of 1.
71
+ * @since 1.0.0
72
+ */
73
+ const normalize = normalize$1;
74
+ const dot = dot$1;
75
+ /**
76
+ * Returns the components of a `Vector4` as an array.
77
+ *
78
+ * @param v - The vector to get the components of.
79
+ * @returns An array containing the x, y, z, and w components of the vector.
80
+ * @since 1.0.0
81
+ */
82
+ const components = components$1;
83
+ /**
84
+ * Applies the softmax function to a `Vector4`.
85
+ *
86
+ * @param v - The vector to calculate the softmax of.
87
+ * @returns A new `Vector4` instance representing the softmax of the input vector.
88
+ */
89
+ const softmax = softmax$1;
90
+ /**
91
+ * Creates a zero vector.
92
+ *
93
+ * @since 1.0.0
94
+ */
95
+ const zero = make(0);
96
+ /**
97
+ * Creates a unit vector.
98
+ *
99
+ * @since 1.0.0
100
+ */
101
+ const unit = make(1);
102
+ const add = add$1;
103
+ const subtract = subtract$1;
104
+ const hadamard = hadamard$1;
105
+ const scale = scale$1;
106
+ //#endregion
107
+ export { transpose as n, vector4_exports as r, make as t };
108
+
109
+ //# sourceMappingURL=vector4-5KbjoHVj.mjs.map
@@ -0,0 +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"}
@@ -0,0 +1,163 @@
1
+ import { Pipeable, dual } from "../utils.mjs";
2
+ import { epsEquals } from "../number.mjs";
3
+ //#region src/vector/vector3.internal.ts
4
+ const Vector3TypeId = Symbol.for("curvy/vector3");
5
+ var Vector3Impl = class extends Pipeable {
6
+ [Vector3TypeId] = Vector3TypeId;
7
+ x;
8
+ y;
9
+ z;
10
+ constructor(v0 = 0, v1 = 0, v2 = 0) {
11
+ super();
12
+ this.x = v0;
13
+ this.y = v1;
14
+ this.z = v2;
15
+ }
16
+ get [0]() {
17
+ return this.x;
18
+ }
19
+ get [1]() {
20
+ return this.y;
21
+ }
22
+ get [2]() {
23
+ return this.z;
24
+ }
25
+ get [Symbol.toStringTag]() {
26
+ return `Vector3(${this.x}, ${this.y}, ${this.z})`;
27
+ }
28
+ get [Symbol.for("nodejs.util.inspect.custom")]() {
29
+ return this[Symbol.toStringTag];
30
+ }
31
+ };
32
+ const isVector3 = (v) => typeof v === "object" && v !== null && Vector3TypeId in v;
33
+ const equals$1 = dual(2, (a, b) => epsEquals(a.x, b.x) && epsEquals(a.y, b.y) && epsEquals(a.z, b.z));
34
+ const make$1 = (v0, v1 = v0, v2 = v1) => new Vector3Impl(v0, v1, v2);
35
+ const transpose$1 = (inputs, project) => {
36
+ const a = project(inputs[0]);
37
+ const b = project(inputs[1]);
38
+ const c = project(inputs[2]);
39
+ const result = [];
40
+ for (let i = 0; i < a.length; i++) result.push(make$1(a[i], b[i], c[i]));
41
+ return result;
42
+ };
43
+ const fromSpherical = (r, theta, phi) => new Vector3Impl(r * Math.sin(theta) * Math.cos(phi), r * Math.sin(theta) * Math.sin(phi), r * Math.cos(theta));
44
+ const magnitude$1 = (vector) => Math.hypot(vector.x, vector.y, vector.z);
45
+ const normalize$1 = (vector) => {
46
+ const m = magnitude$1(vector);
47
+ return make$1(vector.x / m, vector.y / m, vector.z / m);
48
+ };
49
+ const dot$1 = dual(2, (a, b) => a.x * b.x + a.y * b.y + a.z * b.z);
50
+ const cross = dual(2, (a, b) => {
51
+ return make$1(a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x);
52
+ });
53
+ const components$1 = (v) => [
54
+ v.x,
55
+ v.y,
56
+ v.z
57
+ ];
58
+ const softmax$1 = (v) => {
59
+ const max = Math.max(v.x, v.y, v.z);
60
+ const v0 = Math.exp(v.x - max);
61
+ const v1 = Math.exp(v.y - max);
62
+ const v2 = Math.exp(v.z - max);
63
+ const sum = v0 + v1 + v2;
64
+ return make$1(v0 / sum, v1 / sum, v2 / sum);
65
+ };
66
+ const add$1 = dual(2, (a, b) => make$1(a.x + b.x, a.y + b.y, a.z + b.z));
67
+ const subtract$1 = dual(2, (a, b) => make$1(a.x - b.x, a.y - b.y, a.z - b.z));
68
+ const hadamard$1 = dual(2, (a, b) => make$1(a.x * b.x, a.y * b.y, a.z * b.z));
69
+ const scale$1 = dual(2, (v, s) => s === 1 ? v : make$1(v.x * s, v.y * s, v.z * s));
70
+ const getX = (v) => v.x;
71
+ const setX = dual(2, (v, x) => make$1(x, v.y, v.z));
72
+ const getY = (v) => v.y;
73
+ const setY = dual(2, (v, y) => make$1(v.x, y, v.z));
74
+ const getZ = (v) => v.z;
75
+ const setZ = dual(2, (v, z) => make$1(v.x, v.y, z));
76
+ const setR = dual(2, (v, r) => scale$1(r / magnitude$1(v))(v));
77
+ const getTheta = (v) => Math.acos(v.z / magnitude$1(v));
78
+ const setTheta = dual(2, (v, phi) => {
79
+ const m = magnitude$1(v);
80
+ const sinTheta = Math.sin(phi);
81
+ return make$1(m * sinTheta * Math.cos(v.y), m * sinTheta * Math.sin(v.y), m * Math.cos(phi));
82
+ });
83
+ const getPhi = (v) => Math.atan2(v.y, v.x);
84
+ const setPhi = dual(2, (v, theta) => {
85
+ const m = magnitude$1(v);
86
+ return make$1(m * Math.cos(theta), m * Math.sin(theta), v.z);
87
+ });
88
+ //#endregion
89
+ //#region src/vector/vector4.internal.ts
90
+ const Vector4TypeId = Symbol.for("curvy/vector4");
91
+ var Vector4Impl = class extends Pipeable {
92
+ [Vector4TypeId] = Vector4TypeId;
93
+ x;
94
+ y;
95
+ z;
96
+ w;
97
+ constructor(v0 = 0, v1 = 0, v2 = 0, v3 = 0) {
98
+ super();
99
+ this.x = v0;
100
+ this.y = v1;
101
+ this.z = v2;
102
+ this.w = v3;
103
+ }
104
+ get [0]() {
105
+ return this.x;
106
+ }
107
+ get [1]() {
108
+ return this.y;
109
+ }
110
+ get [2]() {
111
+ return this.z;
112
+ }
113
+ get [3]() {
114
+ return this.w;
115
+ }
116
+ get [Symbol.toStringTag]() {
117
+ return `Vector4(${this.x}, ${this.y}, ${this.z}, ${this.w})`;
118
+ }
119
+ get [Symbol.for("nodejs.util.inspect.custom")]() {
120
+ return this[Symbol.toStringTag];
121
+ }
122
+ };
123
+ const isVector4 = (v) => typeof v === "object" && v !== null && Vector4TypeId in v;
124
+ const equals = dual(2, (a, b) => epsEquals(a.x, b.x) && epsEquals(a.y, b.y) && epsEquals(a.z, b.z) && epsEquals(a.w, b.w));
125
+ const make = (v0, v1 = v0, v2 = v1, v3 = v2) => new Vector4Impl(v0, v1, v2, v3);
126
+ const transpose = (inputs, project) => {
127
+ const a = project(inputs[0]);
128
+ const b = project(inputs[1]);
129
+ const c = project(inputs[2]);
130
+ const d = project(inputs[3]);
131
+ const result = [];
132
+ for (let i = 0; i < a.length; i++) result.push(make(a[i], b[i], c[i], d[i]));
133
+ return result;
134
+ };
135
+ const magnitude = (vector) => Math.hypot(vector.x, vector.y, vector.z, vector.w);
136
+ const normalize = (vector) => {
137
+ const m = magnitude(vector);
138
+ return make(vector.x / m, vector.y / m, vector.z / m, vector.w / m);
139
+ };
140
+ const dot = dual(2, (a, b) => a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w);
141
+ const components = (v) => [
142
+ v.x,
143
+ v.y,
144
+ v.z,
145
+ v.w
146
+ ];
147
+ const softmax = (v) => {
148
+ const max = Math.max(v.x, v.y, v.z, v.w);
149
+ const v0 = Math.exp(v.x - max);
150
+ const v1 = Math.exp(v.y - max);
151
+ const v2 = Math.exp(v.z - max);
152
+ const v3 = Math.exp(v.w - max);
153
+ const sum = v0 + v1 + v2 + v3;
154
+ return make(v0 / sum, v1 / sum, v2 / sum, v3 / sum);
155
+ };
156
+ const add = dual(2, (a, b) => make(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w));
157
+ const subtract = dual(2, (a, b) => make(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w));
158
+ const hadamard = dual(2, (a, b) => make(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w));
159
+ const scale = dual(2, (v, s) => s === 1 ? v : make(v.x * s, v.y * s, v.z * s, v.w * s));
160
+ //#endregion
161
+ export { scale$1 as A, getY as C, magnitude$1 as D, isVector3 as E, setY as F, setZ as I, softmax$1 as L, setR as M, setTheta as N, make$1 as O, setX as P, subtract$1 as R, getX as S, hadamard$1 as T, dot$1 as _, hadamard as a, getPhi as b, make as c, softmax as d, subtract as f, cross as g, components$1 as h, equals as i, setPhi as j, normalize$1 as k, normalize as l, add$1 as m, components as n, isVector4 as o, transpose as p, dot as r, magnitude as s, add as t, scale as u, equals$1 as v, getZ as w, getTheta as x, fromSpherical as y, transpose$1 as z };
162
+
163
+ //# sourceMappingURL=vector4.internal-5XcaX12X.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vector4.internal-5XcaX12X.mjs","names":["equals","make","transpose","magnitude","normalize","dot","components","softmax","add","subtract","hadamard","scale"],"sources":["../../src/vector/vector3.internal.ts","../../src/vector/vector4.internal.ts"],"sourcesContent":["import { dual, Pipeable } from '../utils'\nimport { epsEquals } from '../number'\nimport type { Vector3 } from './vector3'\n\nexport const Vector3TypeId: unique symbol = Symbol.for('curvy/vector3')\nexport type Vector3TypeId = typeof Vector3TypeId\n\nclass Vector3Impl extends Pipeable implements Vector3 {\n readonly [Vector3TypeId]: Vector3TypeId = Vector3TypeId\n\n readonly x: number\n readonly y: number\n readonly z: number\n\n constructor(v0 = 0, v1 = 0, v2 = 0) {\n super()\n this.x = v0\n this.y = v1\n this.z = v2\n }\n\n get [0]() {\n return this.x\n }\n\n get [1]() {\n return this.y\n }\n\n get [2]() {\n return this.z\n }\n\n get [Symbol.toStringTag]() {\n return `Vector3(${this.x}, ${this.y}, ${this.z})`\n }\n\n get [Symbol.for('nodejs.util.inspect.custom')]() {\n return this[Symbol.toStringTag]\n }\n}\n\nexport const isVector3 = (v: unknown): v is Vector3 =>\n typeof v === 'object' && v !== null && Vector3TypeId in v\n\nexport const equals = dual<\n (b: Vector3) => (a: Vector3) => boolean,\n (a: Vector3, b: Vector3) => boolean\n>(2, (a: Vector3, b: Vector3) => epsEquals(a.x, b.x) && epsEquals(a.y, b.y) && epsEquals(a.z, b.z))\n\nexport const make = (v0: number, v1 = v0, v2 = v1): Vector3 => new Vector3Impl(v0, v1, v2)\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 } => {\n const a = project(inputs[0])\n const b = project(inputs[1])\n const c = project(inputs[2])\n const result: Array<Vector3> = []\n for (let i = 0; i < a.length; i++) {\n result.push(make(a[i] as number, b[i] as number, c[i] as number))\n }\n return result as never\n}\n\nexport const fromSpherical = (r: number, theta: number, phi: number) =>\n new Vector3Impl(\n r * Math.sin(theta) * Math.cos(phi),\n r * Math.sin(theta) * Math.sin(phi),\n r * Math.cos(theta),\n )\n\nexport const magnitude = (vector: Vector3) => Math.hypot(vector.x, vector.y, vector.z)\n\nexport const normalize = (vector: Vector3) => {\n const m = magnitude(vector)\n\n return make(vector.x / m, vector.y / m, vector.z / m)\n}\n\nexport const dot = dual<(b: Vector3) => (a: Vector3) => number, (a: Vector3, b: Vector3) => number>(\n 2,\n (a: Vector3, b: Vector3) => a.x * b.x + a.y * b.y + a.z * b.z,\n)\n\nexport const cross = dual<\n (b: Vector3) => (a: Vector3) => Vector3,\n (a: Vector3, b: Vector3) => Vector3\n>(2, (a: Vector3, b: Vector3) => {\n const x = a.y * b.z - a.z * b.y\n const y = a.z * b.x - a.x * b.z\n const z = a.x * b.y - a.y * b.x\n\n return make(x, y, z)\n})\n\nexport const components: (v: Vector3) => [number, number, number] = (v: Vector3) => [v.x, v.y, v.z]\n\nexport const softmax = (v: Vector3) => {\n const max = Math.max(v.x, v.y, v.z)\n\n const v0 = Math.exp(v.x - max)\n const v1 = Math.exp(v.y - max)\n const v2 = Math.exp(v.z - max)\n\n const sum = v0 + v1 + v2\n\n return make(v0 / sum, v1 / sum, v2 / sum)\n}\n\nexport const add = dual<\n (b: Vector3) => (a: Vector3) => Vector3,\n (a: Vector3, b: Vector3) => Vector3\n>(2, (a: Vector3, b: Vector3) => make(a.x + b.x, a.y + b.y, a.z + b.z))\n\nexport const subtract = dual<\n (b: Vector3) => (a: Vector3) => Vector3,\n (a: Vector3, b: Vector3) => Vector3\n>(2, (a: Vector3, b: Vector3) => make(a.x - b.x, a.y - b.y, a.z - b.z))\n\nexport const hadamard = dual<\n (b: Vector3) => (a: Vector3) => Vector3,\n (a: Vector3, b: Vector3) => Vector3\n>(2, (a: Vector3, b: Vector3) => make(a.x * b.x, a.y * b.y, a.z * b.z))\n\nexport const scale = dual<\n (s: number) => (v: Vector3) => Vector3,\n (v: Vector3, s: number) => Vector3\n>(2, (v: Vector3, s: number) => (s === 1 ? v : make(v.x * s, v.y * s, v.z * s)))\n\nexport const getX: (v: Vector3) => number = (v: Vector3) => v.x\nexport const setX = dual<\n (x: number) => (v: Vector3) => Vector3,\n (v: Vector3, x: number) => Vector3\n>(2, (v: Vector3, x: number) => make(x, v.y, v.z))\n\nexport const getY: (v: Vector3) => number = (v: Vector3) => v.y\nexport const setY = dual<\n (y: number) => (v: Vector3) => Vector3,\n (v: Vector3, y: number) => Vector3\n>(2, (v: Vector3, y: number) => make(v.x, y, v.z))\n\nexport const getZ: (v: Vector3) => number = (v: Vector3) => v.z\nexport const setZ = dual<\n (z: number) => (v: Vector3) => Vector3,\n (v: Vector3, z: number) => Vector3\n>(2, (v: Vector3, z: number) => make(v.x, v.y, z))\n\nexport const setR = dual<\n (r: number) => (v: Vector3) => Vector3,\n (v: Vector3, r: number) => Vector3\n>(2, (v: Vector3, r: number) => scale(r / magnitude(v))(v))\n\nexport const getTheta = (v: Vector3) => Math.acos(v.z / magnitude(v))\nexport const setTheta = dual<\n (phi: number) => (v: Vector3) => Vector3,\n (v: Vector3, phi: number) => Vector3\n>(2, (v: Vector3, phi: number) => {\n const m = magnitude(v)\n const sinTheta = Math.sin(phi)\n return make(m * sinTheta * Math.cos(v.y), m * sinTheta * Math.sin(v.y), m * Math.cos(phi))\n})\n\nexport const getPhi = (v: Vector3) => Math.atan2(v.y, v.x)\nexport const setPhi = dual<\n (theta: number) => (v: Vector3) => Vector3,\n (v: Vector3, theta: number) => Vector3\n>(2, (v: Vector3, theta: number) => {\n const m = magnitude(v)\n return make(m * Math.cos(theta), m * Math.sin(theta), v.z)\n})\n","import { dual, Pipeable } from '../utils'\nimport { epsEquals } from '../number'\nimport type { Vector4 } from './vector4'\n\nexport const Vector4TypeId: unique symbol = Symbol.for('curvy/vector4')\nexport type Vector4TypeId = typeof Vector4TypeId\n\nclass Vector4Impl extends Pipeable implements Vector4 {\n readonly [Vector4TypeId]: Vector4TypeId = Vector4TypeId\n\n readonly x: number\n readonly y: number\n readonly z: number\n readonly w: number\n\n constructor(v0 = 0, v1 = 0, v2 = 0, v3 = 0) {\n super()\n\n this.x = v0\n this.y = v1\n this.z = v2\n this.w = v3\n }\n\n get [0]() {\n return this.x\n }\n\n get [1]() {\n return this.y\n }\n\n get [2]() {\n return this.z\n }\n\n get [3]() {\n return this.w\n }\n\n get [Symbol.toStringTag]() {\n return `Vector4(${this.x}, ${this.y}, ${this.z}, ${this.w})`\n }\n\n get [Symbol.for('nodejs.util.inspect.custom')]() {\n return this[Symbol.toStringTag]\n }\n}\n\nexport const isVector4 = (v: unknown): v is Vector4 =>\n typeof v === 'object' && v !== null && Vector4TypeId in v\n\nexport const equals = dual<\n (b: Vector4) => (a: Vector4) => boolean,\n (a: Vector4, b: Vector4) => boolean\n>(\n 2,\n (a: Vector4, b: Vector4) =>\n epsEquals(a.x, b.x) && epsEquals(a.y, b.y) && epsEquals(a.z, b.z) && epsEquals(a.w, b.w),\n)\n\nexport const make = (v0: number, v1 = v0, v2 = v1, v3 = v2): Vector4 =>\n new Vector4Impl(v0, v1, v2, v3)\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 } => {\n const a = project(inputs[0])\n const b = project(inputs[1])\n const c = project(inputs[2])\n const d = project(inputs[3])\n const result: Array<Vector4> = []\n for (let i = 0; i < a.length; i++) {\n result.push(make(a[i] as number, b[i] as number, c[i] as number, d[i] as number))\n }\n return result as never\n}\n\nexport const magnitude: (vector: Vector4) => number = (vector: Vector4) =>\n Math.hypot(vector.x, vector.y, vector.z, vector.w)\n\nexport const normalize: (vector: Vector4) => Vector4 = (vector: Vector4) => {\n const m = magnitude(vector)\n\n return make(vector.x / m, vector.y / m, vector.z / m, vector.w / m)\n}\n\nexport const dot = dual<(b: Vector4) => (a: Vector4) => number, (a: Vector4, b: Vector4) => number>(\n 2,\n (a: Vector4, b: Vector4) => a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w,\n)\n\nexport const components: (v: Vector4) => [number, number, number, number] = (v: Vector4) => [\n v.x,\n v.y,\n v.z,\n v.w,\n]\n\nexport const softmax: (v: Vector4) => Vector4 = (v: Vector4) => {\n const max = Math.max(v.x, v.y, v.z, v.w)\n\n const v0 = Math.exp(v.x - max)\n const v1 = Math.exp(v.y - max)\n const v2 = Math.exp(v.z - max)\n const v3 = Math.exp(v.w - max)\n\n const sum = v0 + v1 + v2 + v3\n\n return make(v0 / sum, v1 / sum, v2 / sum, v3 / sum)\n}\n\nexport const add = dual<\n (b: Vector4) => (a: Vector4) => Vector4,\n (a: Vector4, b: Vector4) => Vector4\n>(2, (a: Vector4, b: Vector4) => make(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w))\n\nexport const subtract = dual<\n (b: Vector4) => (a: Vector4) => Vector4,\n (a: Vector4, b: Vector4) => Vector4\n>(2, (a: Vector4, b: Vector4) => make(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w))\n\nexport const hadamard = dual<\n (b: Vector4) => (a: Vector4) => Vector4,\n (a: Vector4, b: Vector4) => Vector4\n>(2, (a: Vector4, b: Vector4) => make(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w))\nexport const scale = dual<\n (s: number) => (v: Vector4) => Vector4,\n (v: Vector4, s: number) => Vector4\n>(2, (v: Vector4, s: number) => (s === 1 ? v : make(v.x * s, v.y * s, v.z * s, v.w * s)))\n"],"mappings":";;;AAIA,MAAa,gBAA+B,OAAO,IAAI,gBAAgB;AAGvE,IAAM,cAAN,cAA0B,SAA4B;CACpD,CAAU,iBAAgC;CAE1C;CACA;CACA;CAEA,YAAY,KAAK,GAAG,KAA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AG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC;AAClF,MAAa,QAAQ,KAGnB,IAAI,GAAY,MAAe,MAAM,IAAI,IAAI,KAAK,EAAE,IAAI,GAAG,EAAE,IAAI,GAAG,EAAE,IAAI,GAAG,EAAE,IAAI,EAAE,CAAE"}
@@ -0,0 +1,2 @@
1
+ import { a as solution_d_exports } from "../shared/solution-sNQ-ZVhN.mjs";
2
+ export { solution_d_exports as Solution };
@@ -0,0 +1,2 @@
1
+ import { c as solution_exports } from "../shared/solution-CrtLfqEq.mjs";
2
+ export { solution_exports as Solution };