curvy 1.0.3 → 1.0.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 (77) hide show
  1. package/dist/curve/cubic2d.d.mts +2 -2
  2. package/dist/curve/cubic2d.d.ts +2 -2
  3. package/dist/curve/cubic2d.mjs +5 -4
  4. package/dist/curve/linear2d.d.mts +2 -2
  5. package/dist/curve/linear2d.d.ts +2 -2
  6. package/dist/curve/linear2d.mjs +4 -3
  7. package/dist/curve/quadratic2d.d.mts +2 -2
  8. package/dist/curve/quadratic2d.d.ts +2 -2
  9. package/dist/curve/quadratic2d.mjs +5 -4
  10. package/dist/interval.d.mts +1 -1
  11. package/dist/interval.d.ts +1 -1
  12. package/dist/interval.mjs +2 -1
  13. package/dist/matrix/matrix2x2.d.mts +1 -1
  14. package/dist/matrix/matrix2x2.d.ts +1 -1
  15. package/dist/matrix/matrix2x2.mjs +4 -3
  16. package/dist/matrix/matrix3x3.d.mts +2 -2
  17. package/dist/matrix/matrix3x3.d.ts +2 -2
  18. package/dist/matrix/matrix3x3.mjs +6 -5
  19. package/dist/matrix/matrix4x4.d.mts +1 -1
  20. package/dist/matrix/matrix4x4.d.ts +1 -1
  21. package/dist/matrix/matrix4x4.mjs +7 -6
  22. package/dist/path/cubic2d.d.mts +2 -2
  23. package/dist/path/cubic2d.d.ts +2 -2
  24. package/dist/path/cubic2d.mjs +5 -4
  25. package/dist/path/linear2d.d.mts +2 -2
  26. package/dist/path/linear2d.d.ts +2 -2
  27. package/dist/path/linear2d.mjs +4 -3
  28. package/dist/path/quadratic2d.d.mts +2 -2
  29. package/dist/path/quadratic2d.d.ts +2 -2
  30. package/dist/path/quadratic2d.mjs +5 -4
  31. package/dist/{shared/curvy.BN-oFBsc.d.mts → pipe.d.mts} +33 -1
  32. package/dist/{shared/curvy.BN-oFBsc.d.ts → pipe.d.ts} +33 -1
  33. package/dist/{shared/curvy.DLOeble8.mjs → pipe.mjs} +1 -37
  34. package/dist/polynomial/cubic.d.mts +2 -2
  35. package/dist/polynomial/cubic.d.ts +2 -2
  36. package/dist/polynomial/cubic.mjs +4 -3
  37. package/dist/polynomial/linear.d.mts +2 -2
  38. package/dist/polynomial/linear.d.ts +2 -2
  39. package/dist/polynomial/linear.mjs +3 -2
  40. package/dist/polynomial/quadratic.d.mts +2 -2
  41. package/dist/polynomial/quadratic.d.ts +2 -2
  42. package/dist/polynomial/quadratic.mjs +4 -3
  43. package/dist/shared/{curvy.O57gIOmy.mjs → curvy.BDhiZ7He.mjs} +2 -1
  44. package/dist/shared/{curvy.BrrC9QVB.mjs → curvy.BYDuJMHv.mjs} +3 -2
  45. package/dist/shared/{curvy.CkJRVnqj.d.ts → curvy.BsHoYJNv.d.ts} +1 -1
  46. package/dist/shared/{curvy.DTco5vku.mjs → curvy.BvJuXVua.mjs} +4 -3
  47. package/dist/shared/{curvy.ZjG-q57I.mjs → curvy.BzVmUIKm.mjs} +3 -2
  48. package/dist/shared/{curvy.B1zfBfvf.mjs → curvy.C2XGH0R0.mjs} +2 -1
  49. package/dist/shared/{curvy.BZXFCKQe.mjs → curvy.CE4X6_Is.mjs} +2 -1
  50. package/dist/shared/{curvy.DV4S13Cq.mjs → curvy.D7YvJAMV.mjs} +2 -1
  51. package/dist/shared/{curvy.BPOevbwG.mjs → curvy.DSxnsSFS.mjs} +2 -1
  52. package/dist/shared/{curvy.DwHW5Fqt.d.mts → curvy.NsmY7zcr.d.mts} +1 -1
  53. package/dist/splines/basis2d.d.mts +2 -2
  54. package/dist/splines/basis2d.d.ts +2 -2
  55. package/dist/splines/basis2d.mjs +10 -9
  56. package/dist/splines/bezier2d.d.mts +2 -2
  57. package/dist/splines/bezier2d.d.ts +2 -2
  58. package/dist/splines/bezier2d.mjs +10 -9
  59. package/dist/splines/cardinal2d.d.mts +2 -2
  60. package/dist/splines/cardinal2d.d.ts +2 -2
  61. package/dist/splines/cardinal2d.mjs +10 -9
  62. package/dist/splines/hermite2d.d.mts +2 -2
  63. package/dist/splines/hermite2d.d.ts +2 -2
  64. package/dist/splines/hermite2d.mjs +10 -9
  65. package/dist/utils.d.mts +27 -0
  66. package/dist/utils.d.ts +27 -0
  67. package/dist/utils.mjs +47 -0
  68. package/dist/vector/vector2.d.mts +1 -1
  69. package/dist/vector/vector2.d.ts +1 -1
  70. package/dist/vector/vector2.mjs +3 -2
  71. package/dist/vector/vector3.d.mts +1 -1
  72. package/dist/vector/vector3.d.ts +1 -1
  73. package/dist/vector/vector3.mjs +3 -2
  74. package/dist/vector/vector4.d.mts +1 -1
  75. package/dist/vector/vector4.d.ts +1 -1
  76. package/dist/vector/vector4.mjs +3 -2
  77. package/package.json +9 -1
@@ -1,7 +1,7 @@
1
- import '../shared/curvy.BN-oFBsc.js';
2
1
  import '../interval.js';
2
+ import '../pipe.js';
3
3
  import '../vector/vector2.js';
4
- export { L as LinearPolynomial, U as antiderivative, T as derivative, V as domain, J as fromPointSlope, K as fromPoints, I as fromVector, G as isLinearPolynomial, X as length, H as make, S as monotonicity, W as range, R as root, M as solve, O as solveInverse, P as toInverseSolver, N as toSolver } from '../shared/curvy.CkJRVnqj.js';
4
+ export { L as LinearPolynomial, U as antiderivative, T as derivative, V as domain, J as fromPointSlope, K as fromPoints, I as fromVector, G as isLinearPolynomial, X as length, H as make, S as monotonicity, W as range, R as root, M as solve, O as solveInverse, P as toInverseSolver, N as toSolver } from '../shared/curvy.BsHoYJNv.js';
5
5
  import '../shared/curvy.Bf5TIk31.js';
6
6
  import '../vector/vector3.js';
7
7
  import '../vector/vector4.js';
@@ -1,6 +1,7 @@
1
- import { i as isLinearPolynomial$1, a as make$1, f as fromVector$1, d as fromPointSlope$1, e as fromPoints$1, s as solve$1, t as toSolver$1, c as solveInverse$1, g as toInverseSolver$1, m as monotonicity$1, h as derivative$1, j as antiderivative$1, k as domain$1, r as range$1, l as length$1 } from '../shared/curvy.O57gIOmy.mjs';
2
- import '../shared/curvy.DLOeble8.mjs';
1
+ import { i as isLinearPolynomial$1, a as make$1, f as fromVector$1, d as fromPointSlope$1, e as fromPoints$1, s as solve$1, t as toSolver$1, c as solveInverse$1, g as toInverseSolver$1, m as monotonicity$1, h as derivative$1, j as antiderivative$1, k as domain$1, r as range$1, l as length$1 } from '../shared/curvy.BDhiZ7He.mjs';
3
2
  import '../interval.mjs';
3
+ import '../pipe.mjs';
4
+ import '../utils.mjs';
4
5
 
5
6
  const isLinearPolynomial = isLinearPolynomial$1;
6
7
  const make = make$1;
@@ -1,7 +1,7 @@
1
- import '../shared/curvy.BN-oFBsc.mjs';
2
1
  import '../interval.mjs';
2
+ import '../pipe.mjs';
3
3
  import '../vector/vector3.mjs';
4
- export { Q as QuadraticPolynomial, A as antiderivative, F as curvature, w as derivative, B as domain, y as extreme, o as fromVector, k as isQuadraticPolynomial, E as length, n as make, z as monotonicity, D as range, x as roots, p as solve, u as solveInverse, v as toInverseSolver, q as toSolver } from '../shared/curvy.DwHW5Fqt.mjs';
4
+ export { Q as QuadraticPolynomial, A as antiderivative, F as curvature, w as derivative, B as domain, y as extreme, o as fromVector, k as isQuadraticPolynomial, E as length, n as make, z as monotonicity, D as range, x as roots, p as solve, u as solveInverse, v as toInverseSolver, q as toSolver } from '../shared/curvy.NsmY7zcr.mjs';
5
5
  import '../shared/curvy.Bf5TIk31.mjs';
6
6
  import '../vector/vector2.mjs';
7
7
  import '../vector/vector4.mjs';
@@ -1,7 +1,7 @@
1
- import '../shared/curvy.BN-oFBsc.js';
2
1
  import '../interval.js';
2
+ import '../pipe.js';
3
3
  import '../vector/vector3.js';
4
- export { Q as QuadraticPolynomial, A as antiderivative, F as curvature, w as derivative, B as domain, y as extreme, o as fromVector, k as isQuadraticPolynomial, E as length, n as make, z as monotonicity, D as range, x as roots, p as solve, u as solveInverse, v as toInverseSolver, q as toSolver } from '../shared/curvy.CkJRVnqj.js';
4
+ export { Q as QuadraticPolynomial, A as antiderivative, F as curvature, w as derivative, B as domain, y as extreme, o as fromVector, k as isQuadraticPolynomial, E as length, n as make, z as monotonicity, D as range, x as roots, p as solve, u as solveInverse, v as toInverseSolver, q as toSolver } from '../shared/curvy.BsHoYJNv.js';
5
5
  import '../shared/curvy.Bf5TIk31.js';
6
6
  import '../vector/vector2.js';
7
7
  import '../vector/vector4.js';
@@ -1,7 +1,8 @@
1
- import { i as isQuadraticPolynomial$1, m as make$1, f as fromVector$1, c as solve$1, t as toSolver$1, s as solveInverse$1, e as toInverseSolver$1, d as derivative$1, r as roots$1, h as extreme$1, b as monotonicity$1, j as antiderivative$1, k as domain$1, n as range$1, l as length$1, o as curvature$1 } from '../shared/curvy.ZjG-q57I.mjs';
2
- import '../shared/curvy.DLOeble8.mjs';
1
+ import { i as isQuadraticPolynomial$1, m as make$1, f as fromVector$1, c as solve$1, t as toSolver$1, s as solveInverse$1, e as toInverseSolver$1, d as derivative$1, r as roots$1, h as extreme$1, b as monotonicity$1, j as antiderivative$1, k as domain$1, n as range$1, l as length$1, o as curvature$1 } from '../shared/curvy.BzVmUIKm.mjs';
3
2
  import '../interval.mjs';
4
- import '../shared/curvy.O57gIOmy.mjs';
3
+ import '../pipe.mjs';
4
+ import '../utils.mjs';
5
+ import '../shared/curvy.BDhiZ7He.mjs';
5
6
 
6
7
  const isQuadraticPolynomial = isQuadraticPolynomial$1;
7
8
  const make = make$1;
@@ -1,5 +1,6 @@
1
- import { P as Pipeable, r as round, d as dual } from './curvy.DLOeble8.mjs';
2
1
  import { make as make$1, size } from '../interval.mjs';
2
+ import { Pipeable, dual } from '../pipe.mjs';
3
+ import { round } from '../utils.mjs';
3
4
 
4
5
  const QuadraticPolynomialTypeId = Symbol.for(
5
6
  "curvy/polynomial/quadratic"
@@ -1,5 +1,6 @@
1
- import { i as invariant, d as dual, r as round, P as Pipeable } from './curvy.DLOeble8.mjs';
2
- import { m as make$1, d as dot } from './curvy.BPOevbwG.mjs';
1
+ import { invariant, round } from '../utils.mjs';
2
+ import { dual, Pipeable } from '../pipe.mjs';
3
+ import { m as make$1, d as dot } from './curvy.DSxnsSFS.mjs';
3
4
 
4
5
  function toIndex(input) {
5
6
  if (typeof input === "number") {
@@ -1,5 +1,5 @@
1
- import { P as Pipeable } from './curvy.BN-oFBsc.js';
2
1
  import { Interval } from '../interval.js';
2
+ import { Pipeable } from '../pipe.js';
3
3
  import { Vector2 } from '../vector/vector2.js';
4
4
  import { Vector3 } from '../vector/vector3.js';
5
5
  import { Vector4 } from '../vector/vector4.js';
@@ -1,6 +1,7 @@
1
- import { o as toThreeDimensionalIndex, d as determinant$1, m as make$1 } from './curvy.BrrC9QVB.mjs';
2
- import { d as dual, r as round, i as invariant, P as Pipeable } from './curvy.DLOeble8.mjs';
3
- import { c as components, m as make$2, d as dot } from './curvy.DV4S13Cq.mjs';
1
+ import { o as toThreeDimensionalIndex, d as determinant$1, m as make$1 } from './curvy.BYDuJMHv.mjs';
2
+ import { dual, Pipeable } from '../pipe.mjs';
3
+ import { round, invariant } from '../utils.mjs';
4
+ import { c as components, m as make$2, d as dot } from './curvy.D7YvJAMV.mjs';
4
5
 
5
6
  const Matrix3x3TypeId = Symbol.for("curvy/matrix3x3");
6
7
  class Matrix3x3Impl extends Pipeable {
@@ -1,6 +1,7 @@
1
- import { P as Pipeable, r as round, d as dual } from './curvy.DLOeble8.mjs';
2
1
  import { size, contains, fromMinMax } from '../interval.mjs';
3
- import { Q as QuadraticPolynomialImpl, b as QuadraticPolynomialTypeId, a as make$1, c as solveInverse$1, m as monotonicity$1, r as range$1, l as length$1, s as solve$1 } from './curvy.O57gIOmy.mjs';
2
+ import { Pipeable, dual } from '../pipe.mjs';
3
+ import { round } from '../utils.mjs';
4
+ import { Q as QuadraticPolynomialImpl, b as QuadraticPolynomialTypeId, a as make$1, c as solveInverse$1, m as monotonicity$1, r as range$1, l as length$1, s as solve$1 } from './curvy.BDhiZ7He.mjs';
4
5
 
5
6
  const CubicPolynomialTypeId = Symbol.for(
6
7
  "curvy/polynomial/cubic"
@@ -1,4 +1,5 @@
1
- import { d as dual, r as round, P as Pipeable } from './curvy.DLOeble8.mjs';
1
+ import { dual, Pipeable } from '../pipe.mjs';
2
+ import { round } from '../utils.mjs';
2
3
 
3
4
  const Vector4TypeId = Symbol.for("curvy/vector4");
4
5
  class Vector4Impl extends Pipeable {
@@ -1,6 +1,7 @@
1
- import { d as dual, P as Pipeable, i as invariant } from './curvy.DLOeble8.mjs';
2
1
  import { vectorProductLeft, make as make$3, solveSystem } from '../matrix/matrix4x4.mjs';
3
2
  import { fromCurves } from '../path/cubic2d.mjs';
3
+ import { dual, Pipeable } from '../pipe.mjs';
4
+ import { invariant } from '../utils.mjs';
4
5
  import { make as make$4 } from '../vector/vector2.mjs';
5
6
  import { make as make$2 } from '../vector/vector4.mjs';
6
7
  import { fromPolynomials } from '../curve/cubic2d.mjs';
@@ -1,4 +1,5 @@
1
- import { d as dual, r as round, P as Pipeable } from './curvy.DLOeble8.mjs';
1
+ import { dual, Pipeable } from '../pipe.mjs';
2
+ import { round } from '../utils.mjs';
2
3
 
3
4
  const Vector3TypeId = Symbol.for("curvy/vector3");
4
5
  class Vector3Impl extends Pipeable {
@@ -1,4 +1,5 @@
1
- import { d as dual, r as round, P as Pipeable } from './curvy.DLOeble8.mjs';
1
+ import { dual, Pipeable } from '../pipe.mjs';
2
+ import { round } from '../utils.mjs';
2
3
 
3
4
  const Vector2TypeId = Symbol.for("curvy/vector2");
4
5
  class Vector2Impl extends Pipeable {
@@ -1,5 +1,5 @@
1
- import { P as Pipeable } from './curvy.BN-oFBsc.mjs';
2
1
  import { Interval } from '../interval.mjs';
2
+ import { Pipeable } from '../pipe.mjs';
3
3
  import { Vector2 } from '../vector/vector2.mjs';
4
4
  import { Vector3 } from '../vector/vector3.mjs';
5
5
  import { Vector4 } from '../vector/vector4.mjs';
@@ -1,6 +1,6 @@
1
- import { P as Pipeable } from '../shared/curvy.BN-oFBsc.mjs';
2
1
  import { Matrix4x4 } from '../matrix/matrix4x4.mjs';
3
2
  import { CubicPath2d } from '../path/cubic2d.mjs';
3
+ import { Pipeable } from '../pipe.mjs';
4
4
  import { Vector2 } from '../vector/vector2.mjs';
5
5
  import { Bezier2d } from './bezier2d.mjs';
6
6
  import '../shared/curvy.Bf5TIk31.mjs';
@@ -10,7 +10,7 @@ import '../vector/vector3.mjs';
10
10
  import '../matrix/matrix2x2.mjs';
11
11
  import '../curve/cubic2d.mjs';
12
12
  import '../interval.mjs';
13
- import '../shared/curvy.DwHW5Fqt.mjs';
13
+ import '../shared/curvy.NsmY7zcr.mjs';
14
14
 
15
15
  declare const Basis2dTypeId: unique symbol;
16
16
  type Basis2dTypeId = typeof Basis2dTypeId;
@@ -1,6 +1,6 @@
1
- import { P as Pipeable } from '../shared/curvy.BN-oFBsc.js';
2
1
  import { Matrix4x4 } from '../matrix/matrix4x4.js';
3
2
  import { CubicPath2d } from '../path/cubic2d.js';
3
+ import { Pipeable } from '../pipe.js';
4
4
  import { Vector2 } from '../vector/vector2.js';
5
5
  import { Bezier2d } from './bezier2d.js';
6
6
  import '../shared/curvy.Bf5TIk31.js';
@@ -10,7 +10,7 @@ import '../vector/vector3.js';
10
10
  import '../matrix/matrix2x2.js';
11
11
  import '../curve/cubic2d.js';
12
12
  import '../interval.js';
13
- import '../shared/curvy.CkJRVnqj.js';
13
+ import '../shared/curvy.BsHoYJNv.js';
14
14
 
15
15
  declare const Basis2dTypeId: unique symbol;
16
16
  type Basis2dTypeId = typeof Basis2dTypeId;
@@ -1,18 +1,19 @@
1
- import { a as roundDown, d as dual, P as Pipeable, i as invariant } from '../shared/curvy.DLOeble8.mjs';
2
1
  import { make as make$2 } from '../matrix/matrix4x4.mjs';
3
2
  import { fromCurves } from '../path/cubic2d.mjs';
4
- import { t as toCurves, f as fromSpline } from '../shared/curvy.BZXFCKQe.mjs';
5
- import '../shared/curvy.BrrC9QVB.mjs';
6
- import '../shared/curvy.BPOevbwG.mjs';
7
- import '../shared/curvy.B1zfBfvf.mjs';
8
- import '../shared/curvy.DTco5vku.mjs';
9
- import '../shared/curvy.DV4S13Cq.mjs';
3
+ import { dual, Pipeable } from '../pipe.mjs';
4
+ import { roundDown, invariant } from '../utils.mjs';
5
+ import { t as toCurves, f as fromSpline } from '../shared/curvy.CE4X6_Is.mjs';
6
+ import '../shared/curvy.BYDuJMHv.mjs';
7
+ import '../shared/curvy.DSxnsSFS.mjs';
8
+ import '../shared/curvy.C2XGH0R0.mjs';
9
+ import '../shared/curvy.BvJuXVua.mjs';
10
+ import '../shared/curvy.D7YvJAMV.mjs';
10
11
  import '../curve/cubic2d.mjs';
11
12
  import '../interval.mjs';
12
13
  import '../shared/curvy.DmVFTi0N.mjs';
13
14
  import '../polynomial/cubic.mjs';
14
- import '../shared/curvy.ZjG-q57I.mjs';
15
- import '../shared/curvy.O57gIOmy.mjs';
15
+ import '../shared/curvy.BzVmUIKm.mjs';
16
+ import '../shared/curvy.BDhiZ7He.mjs';
16
17
  import '../polynomial/quadratic.mjs';
17
18
  import '../vector/vector2.mjs';
18
19
  import '../curve/linear2d.mjs';
@@ -1,6 +1,6 @@
1
- import { P as Pipeable } from '../shared/curvy.BN-oFBsc.mjs';
2
1
  import { Matrix4x4 } from '../matrix/matrix4x4.mjs';
3
2
  import { CubicPath2d } from '../path/cubic2d.mjs';
3
+ import { Pipeable } from '../pipe.mjs';
4
4
  import { Vector2 } from '../vector/vector2.mjs';
5
5
  import '../shared/curvy.Bf5TIk31.mjs';
6
6
  import '../vector/vector4.mjs';
@@ -9,7 +9,7 @@ import '../vector/vector3.mjs';
9
9
  import '../matrix/matrix2x2.mjs';
10
10
  import '../curve/cubic2d.mjs';
11
11
  import '../interval.mjs';
12
- import '../shared/curvy.DwHW5Fqt.mjs';
12
+ import '../shared/curvy.NsmY7zcr.mjs';
13
13
 
14
14
  declare const Bezier2dTypeId: unique symbol;
15
15
  type Bezier2dTypeId = typeof Bezier2dTypeId;
@@ -1,6 +1,6 @@
1
- import { P as Pipeable } from '../shared/curvy.BN-oFBsc.js';
2
1
  import { Matrix4x4 } from '../matrix/matrix4x4.js';
3
2
  import { CubicPath2d } from '../path/cubic2d.js';
3
+ import { Pipeable } from '../pipe.js';
4
4
  import { Vector2 } from '../vector/vector2.js';
5
5
  import '../shared/curvy.Bf5TIk31.js';
6
6
  import '../vector/vector4.js';
@@ -9,7 +9,7 @@ import '../vector/vector3.js';
9
9
  import '../matrix/matrix2x2.js';
10
10
  import '../curve/cubic2d.js';
11
11
  import '../interval.js';
12
- import '../shared/curvy.CkJRVnqj.js';
12
+ import '../shared/curvy.BsHoYJNv.js';
13
13
 
14
14
  declare const Bezier2dTypeId: unique symbol;
15
15
  type Bezier2dTypeId = typeof Bezier2dTypeId;
@@ -1,18 +1,19 @@
1
- export { b as append, h as appendAccelerationAligned, e as appendCurvatureMirrored, d as appendTangentAligned, g as appendVelocityAligned, c as characteristic, a as fromArray, f as fromSpline, i as isCubicBezier2d, m as make, j as toPath } from '../shared/curvy.BZXFCKQe.mjs';
2
- import '../shared/curvy.DLOeble8.mjs';
1
+ export { b as append, h as appendAccelerationAligned, e as appendCurvatureMirrored, d as appendTangentAligned, g as appendVelocityAligned, c as characteristic, a as fromArray, f as fromSpline, i as isCubicBezier2d, m as make, j as toPath } from '../shared/curvy.CE4X6_Is.mjs';
3
2
  import '../matrix/matrix4x4.mjs';
4
- import '../shared/curvy.BrrC9QVB.mjs';
5
- import '../shared/curvy.BPOevbwG.mjs';
6
- import '../shared/curvy.B1zfBfvf.mjs';
7
- import '../shared/curvy.DTco5vku.mjs';
8
- import '../shared/curvy.DV4S13Cq.mjs';
3
+ import '../shared/curvy.BYDuJMHv.mjs';
4
+ import '../utils.mjs';
5
+ import '../pipe.mjs';
6
+ import '../shared/curvy.DSxnsSFS.mjs';
7
+ import '../shared/curvy.C2XGH0R0.mjs';
8
+ import '../shared/curvy.BvJuXVua.mjs';
9
+ import '../shared/curvy.D7YvJAMV.mjs';
9
10
  import '../path/cubic2d.mjs';
10
11
  import '../curve/cubic2d.mjs';
11
12
  import '../interval.mjs';
12
13
  import '../shared/curvy.DmVFTi0N.mjs';
13
14
  import '../polynomial/cubic.mjs';
14
- import '../shared/curvy.ZjG-q57I.mjs';
15
- import '../shared/curvy.O57gIOmy.mjs';
15
+ import '../shared/curvy.BzVmUIKm.mjs';
16
+ import '../shared/curvy.BDhiZ7He.mjs';
16
17
  import '../polynomial/quadratic.mjs';
17
18
  import '../vector/vector2.mjs';
18
19
  import '../curve/linear2d.mjs';
@@ -1,6 +1,6 @@
1
- import { P as Pipeable } from '../shared/curvy.BN-oFBsc.mjs';
2
1
  import { Matrix4x4 } from '../matrix/matrix4x4.mjs';
3
2
  import { CubicPath2d } from '../path/cubic2d.mjs';
3
+ import { Pipeable } from '../pipe.mjs';
4
4
  import { Vector2 } from '../vector/vector2.mjs';
5
5
  import { Bezier2d } from './bezier2d.mjs';
6
6
  import '../shared/curvy.Bf5TIk31.mjs';
@@ -10,7 +10,7 @@ import '../vector/vector3.mjs';
10
10
  import '../matrix/matrix2x2.mjs';
11
11
  import '../curve/cubic2d.mjs';
12
12
  import '../interval.mjs';
13
- import '../shared/curvy.DwHW5Fqt.mjs';
13
+ import '../shared/curvy.NsmY7zcr.mjs';
14
14
 
15
15
  declare const Cardinal2dTypeId: unique symbol;
16
16
  type Cardinal2dTypeId = typeof Cardinal2dTypeId;
@@ -1,6 +1,6 @@
1
- import { P as Pipeable } from '../shared/curvy.BN-oFBsc.js';
2
1
  import { Matrix4x4 } from '../matrix/matrix4x4.js';
3
2
  import { CubicPath2d } from '../path/cubic2d.js';
3
+ import { Pipeable } from '../pipe.js';
4
4
  import { Vector2 } from '../vector/vector2.js';
5
5
  import { Bezier2d } from './bezier2d.js';
6
6
  import '../shared/curvy.Bf5TIk31.js';
@@ -10,7 +10,7 @@ import '../vector/vector3.js';
10
10
  import '../matrix/matrix2x2.js';
11
11
  import '../curve/cubic2d.js';
12
12
  import '../interval.js';
13
- import '../shared/curvy.CkJRVnqj.js';
13
+ import '../shared/curvy.BsHoYJNv.js';
14
14
 
15
15
  declare const Cardinal2dTypeId: unique symbol;
16
16
  type Cardinal2dTypeId = typeof Cardinal2dTypeId;
@@ -1,19 +1,20 @@
1
- import { d as dual, P as Pipeable, i as invariant } from '../shared/curvy.DLOeble8.mjs';
2
1
  import { make as make$2 } from '../matrix/matrix4x4.mjs';
3
2
  import { fromCurves } from '../path/cubic2d.mjs';
3
+ import { dual, Pipeable } from '../pipe.mjs';
4
+ import { invariant } from '../utils.mjs';
4
5
  import { subtract, scale, add } from '../vector/vector2.mjs';
5
- import { t as toCurves, f as fromSpline } from '../shared/curvy.BZXFCKQe.mjs';
6
- import '../shared/curvy.BrrC9QVB.mjs';
7
- import '../shared/curvy.BPOevbwG.mjs';
8
- import '../shared/curvy.B1zfBfvf.mjs';
9
- import '../shared/curvy.DTco5vku.mjs';
10
- import '../shared/curvy.DV4S13Cq.mjs';
6
+ import { t as toCurves, f as fromSpline } from '../shared/curvy.CE4X6_Is.mjs';
7
+ import '../shared/curvy.BYDuJMHv.mjs';
8
+ import '../shared/curvy.DSxnsSFS.mjs';
9
+ import '../shared/curvy.C2XGH0R0.mjs';
10
+ import '../shared/curvy.BvJuXVua.mjs';
11
+ import '../shared/curvy.D7YvJAMV.mjs';
11
12
  import '../curve/cubic2d.mjs';
12
13
  import '../interval.mjs';
13
14
  import '../shared/curvy.DmVFTi0N.mjs';
14
15
  import '../polynomial/cubic.mjs';
15
- import '../shared/curvy.ZjG-q57I.mjs';
16
- import '../shared/curvy.O57gIOmy.mjs';
16
+ import '../shared/curvy.BzVmUIKm.mjs';
17
+ import '../shared/curvy.BDhiZ7He.mjs';
17
18
  import '../polynomial/quadratic.mjs';
18
19
  import '../curve/linear2d.mjs';
19
20
  import '../polynomial/linear.mjs';
@@ -1,6 +1,6 @@
1
- import { P as Pipeable } from '../shared/curvy.BN-oFBsc.mjs';
2
1
  import { Matrix4x4 } from '../matrix/matrix4x4.mjs';
3
2
  import { CubicPath2d } from '../path/cubic2d.mjs';
3
+ import { Pipeable } from '../pipe.mjs';
4
4
  import { Vector2 } from '../vector/vector2.mjs';
5
5
  import { Bezier2d } from './bezier2d.mjs';
6
6
  import '../shared/curvy.Bf5TIk31.mjs';
@@ -10,7 +10,7 @@ import '../vector/vector3.mjs';
10
10
  import '../matrix/matrix2x2.mjs';
11
11
  import '../curve/cubic2d.mjs';
12
12
  import '../interval.mjs';
13
- import '../shared/curvy.DwHW5Fqt.mjs';
13
+ import '../shared/curvy.NsmY7zcr.mjs';
14
14
 
15
15
  declare const Hermite2dTypeId: unique symbol;
16
16
  type Hermite2dTypeId = typeof Hermite2dTypeId;
@@ -1,6 +1,6 @@
1
- import { P as Pipeable } from '../shared/curvy.BN-oFBsc.js';
2
1
  import { Matrix4x4 } from '../matrix/matrix4x4.js';
3
2
  import { CubicPath2d } from '../path/cubic2d.js';
3
+ import { Pipeable } from '../pipe.js';
4
4
  import { Vector2 } from '../vector/vector2.js';
5
5
  import { Bezier2d } from './bezier2d.js';
6
6
  import '../shared/curvy.Bf5TIk31.js';
@@ -10,7 +10,7 @@ import '../vector/vector3.js';
10
10
  import '../matrix/matrix2x2.js';
11
11
  import '../curve/cubic2d.js';
12
12
  import '../interval.js';
13
- import '../shared/curvy.CkJRVnqj.js';
13
+ import '../shared/curvy.BsHoYJNv.js';
14
14
 
15
15
  declare const Hermite2dTypeId: unique symbol;
16
16
  type Hermite2dTypeId = typeof Hermite2dTypeId;
@@ -1,18 +1,19 @@
1
- import { d as dual, P as Pipeable, i as invariant } from '../shared/curvy.DLOeble8.mjs';
2
1
  import { make as make$2 } from '../matrix/matrix4x4.mjs';
3
2
  import { fromCurves } from '../path/cubic2d.mjs';
4
- import { t as toCurves, f as fromSpline } from '../shared/curvy.BZXFCKQe.mjs';
5
- import '../shared/curvy.BrrC9QVB.mjs';
6
- import '../shared/curvy.BPOevbwG.mjs';
7
- import '../shared/curvy.B1zfBfvf.mjs';
8
- import '../shared/curvy.DTco5vku.mjs';
9
- import '../shared/curvy.DV4S13Cq.mjs';
3
+ import { dual, Pipeable } from '../pipe.mjs';
4
+ import { invariant } from '../utils.mjs';
5
+ import { t as toCurves, f as fromSpline } from '../shared/curvy.CE4X6_Is.mjs';
6
+ import '../shared/curvy.BYDuJMHv.mjs';
7
+ import '../shared/curvy.DSxnsSFS.mjs';
8
+ import '../shared/curvy.C2XGH0R0.mjs';
9
+ import '../shared/curvy.BvJuXVua.mjs';
10
+ import '../shared/curvy.D7YvJAMV.mjs';
10
11
  import '../curve/cubic2d.mjs';
11
12
  import '../interval.mjs';
12
13
  import '../shared/curvy.DmVFTi0N.mjs';
13
14
  import '../polynomial/cubic.mjs';
14
- import '../shared/curvy.ZjG-q57I.mjs';
15
- import '../shared/curvy.O57gIOmy.mjs';
15
+ import '../shared/curvy.BzVmUIKm.mjs';
16
+ import '../shared/curvy.BDhiZ7He.mjs';
16
17
  import '../polynomial/quadratic.mjs';
17
18
  import '../vector/vector2.mjs';
18
19
  import '../curve/linear2d.mjs';
@@ -0,0 +1,27 @@
1
+ declare const PRECISION = 8;
2
+ declare function round(value: number, precision?: number): number;
3
+ declare function roundDown(value: number, precision?: number): number;
4
+ declare const lerp: {
5
+ (t: number, a: number, b: number): number;
6
+ (a: number, b: number): (t: number) => number;
7
+ };
8
+ declare const normalize: {
9
+ (x: number, a: number, b: number): number;
10
+ (a: number, b: number): (x: number) => number;
11
+ };
12
+ declare const remap: {
13
+ (x: number, x1: number, x2: number, y1: number, y2: number): number;
14
+ (x1: number, x2: number, y1: number, y2: number): (x: number) => number;
15
+ };
16
+ declare const clamp: {
17
+ (value: number, min: number, max: number): number;
18
+ (min: number, max: number): (value: number) => number;
19
+ };
20
+ declare const clip: {
21
+ <T>(value: number, min: number, max: number, onClip: T): T | number;
22
+ <T>(min: number, max: number, onClip: T): (value: number) => T | number;
23
+ };
24
+ declare function minMax(a: number, b: number): [number, number];
25
+ declare function invariant(condition: boolean, message: string): asserts condition;
26
+
27
+ export { PRECISION, clamp, clip, invariant, lerp, minMax, normalize, remap, round, roundDown };
@@ -0,0 +1,27 @@
1
+ declare const PRECISION = 8;
2
+ declare function round(value: number, precision?: number): number;
3
+ declare function roundDown(value: number, precision?: number): number;
4
+ declare const lerp: {
5
+ (t: number, a: number, b: number): number;
6
+ (a: number, b: number): (t: number) => number;
7
+ };
8
+ declare const normalize: {
9
+ (x: number, a: number, b: number): number;
10
+ (a: number, b: number): (x: number) => number;
11
+ };
12
+ declare const remap: {
13
+ (x: number, x1: number, x2: number, y1: number, y2: number): number;
14
+ (x1: number, x2: number, y1: number, y2: number): (x: number) => number;
15
+ };
16
+ declare const clamp: {
17
+ (value: number, min: number, max: number): number;
18
+ (min: number, max: number): (value: number) => number;
19
+ };
20
+ declare const clip: {
21
+ <T>(value: number, min: number, max: number, onClip: T): T | number;
22
+ <T>(min: number, max: number, onClip: T): (value: number) => T | number;
23
+ };
24
+ declare function minMax(a: number, b: number): [number, number];
25
+ declare function invariant(condition: boolean, message: string): asserts condition;
26
+
27
+ export { PRECISION, clamp, clip, invariant, lerp, minMax, normalize, remap, round, roundDown };
package/dist/utils.mjs ADDED
@@ -0,0 +1,47 @@
1
+ import { dual } from './pipe.mjs';
2
+
3
+ const PRECISION = 8;
4
+ function round(value, precision = PRECISION) {
5
+ const scale = 10 ** precision;
6
+ const result = Math.round(value * scale) / scale;
7
+ if (result === 0) {
8
+ return 0;
9
+ }
10
+ return result;
11
+ }
12
+ function roundDown(value, precision = PRECISION) {
13
+ const scale = 10 ** precision;
14
+ const result = Math.floor(value * scale) / scale;
15
+ if (result === 0) {
16
+ return 0;
17
+ }
18
+ return result;
19
+ }
20
+ const lerp = dual(3, (t, a, b) => {
21
+ return b * t + a * (1 - t);
22
+ });
23
+ const normalize = dual(3, (x, a, b) => {
24
+ return (x - a) / (b - a);
25
+ });
26
+ const remap = dual(
27
+ 5,
28
+ (x, x1, x2, y1, y2) => {
29
+ return y1 + (x - x1) / (x2 - x1) * (y2 - y1);
30
+ }
31
+ );
32
+ const clamp = dual(3, (value, min, max) => {
33
+ return value < min ? min : value > max ? max : value;
34
+ });
35
+ const clip = dual(4, (value, min, max, onClip) => {
36
+ return value < min ? onClip : value > max ? onClip : value;
37
+ });
38
+ function minMax(a, b) {
39
+ return a < b ? [a, b] : [b, a];
40
+ }
41
+ function invariant(condition, message) {
42
+ if (!condition) {
43
+ throw new Error(message);
44
+ }
45
+ }
46
+
47
+ export { PRECISION, clamp, clip, invariant, lerp, minMax, normalize, remap, round, roundDown };
@@ -1,5 +1,5 @@
1
1
  import { T as TwoDimensional } from '../shared/curvy.Bf5TIk31.mjs';
2
- import { P as Pipeable } from '../shared/curvy.BN-oFBsc.mjs';
2
+ import { Pipeable } from '../pipe.mjs';
3
3
 
4
4
  declare const Vector2TypeId: unique symbol;
5
5
  type Vector2TypeId = typeof Vector2TypeId;
@@ -1,5 +1,5 @@
1
1
  import { T as TwoDimensional } from '../shared/curvy.Bf5TIk31.js';
2
- import { P as Pipeable } from '../shared/curvy.BN-oFBsc.js';
2
+ import { Pipeable } from '../pipe.js';
3
3
 
4
4
  declare const Vector2TypeId: unique symbol;
5
5
  type Vector2TypeId = typeof Vector2TypeId;
@@ -1,5 +1,6 @@
1
- import { i as isVector2$1, m as make$1, a as magnitude$1, n as normalize$1, d as dot$1, c as cross$1, b as components$1, s as softmax$1, e as add$1, f as subtract$1, h as hadamard$1, g as scale$1 } from '../shared/curvy.BPOevbwG.mjs';
2
- import '../shared/curvy.DLOeble8.mjs';
1
+ import { i as isVector2$1, m as make$1, a as magnitude$1, n as normalize$1, d as dot$1, c as cross$1, b as components$1, s as softmax$1, e as add$1, f as subtract$1, h as hadamard$1, g as scale$1 } from '../shared/curvy.DSxnsSFS.mjs';
2
+ import '../pipe.mjs';
3
+ import '../utils.mjs';
3
4
 
4
5
  const isVector2 = isVector2$1;
5
6
  const make = make$1;
@@ -1,5 +1,5 @@
1
1
  import { g as ThreeDimensional } from '../shared/curvy.Bf5TIk31.mjs';
2
- import { P as Pipeable } from '../shared/curvy.BN-oFBsc.mjs';
2
+ import { Pipeable } from '../pipe.mjs';
3
3
 
4
4
  declare const Vector3TypeId: unique symbol;
5
5
  type Vector3TypeId = typeof Vector3TypeId;
@@ -1,5 +1,5 @@
1
1
  import { g as ThreeDimensional } from '../shared/curvy.Bf5TIk31.js';
2
- import { P as Pipeable } from '../shared/curvy.BN-oFBsc.js';
2
+ import { Pipeable } from '../pipe.js';
3
3
 
4
4
  declare const Vector3TypeId: unique symbol;
5
5
  type Vector3TypeId = typeof Vector3TypeId;
@@ -1,5 +1,6 @@
1
- import { i as isVector3$1, m as make$1, a as magnitude$1, n as normalize$1, d as dot$1, c as components$1, s as softmax$1, b as add$1, e as subtract$1, h as hadamard$1, f as scale$1 } from '../shared/curvy.DV4S13Cq.mjs';
2
- import '../shared/curvy.DLOeble8.mjs';
1
+ import { i as isVector3$1, m as make$1, a as magnitude$1, n as normalize$1, d as dot$1, c as components$1, s as softmax$1, b as add$1, e as subtract$1, h as hadamard$1, f as scale$1 } from '../shared/curvy.D7YvJAMV.mjs';
2
+ import '../pipe.mjs';
3
+ import '../utils.mjs';
3
4
 
4
5
  const isVector3 = isVector3$1;
5
6
  const make = make$1;
@@ -1,5 +1,5 @@
1
1
  import { f as FourDimensional } from '../shared/curvy.Bf5TIk31.mjs';
2
- import { P as Pipeable } from '../shared/curvy.BN-oFBsc.mjs';
2
+ import { Pipeable } from '../pipe.mjs';
3
3
 
4
4
  declare const Vector4TypeId: unique symbol;
5
5
  type Vector4TypeId = typeof Vector4TypeId;
@@ -1,5 +1,5 @@
1
1
  import { f as FourDimensional } from '../shared/curvy.Bf5TIk31.js';
2
- import { P as Pipeable } from '../shared/curvy.BN-oFBsc.js';
2
+ import { Pipeable } from '../pipe.js';
3
3
 
4
4
  declare const Vector4TypeId: unique symbol;
5
5
  type Vector4TypeId = typeof Vector4TypeId;
@@ -1,5 +1,6 @@
1
- import { i as isVector4$1, m as make$1, a as magnitude$1, n as normalize$1, d as dot$1, c as components$1, s as softmax$1, b as add$1, e as subtract$1, h as hadamard$1, f as scale$1 } from '../shared/curvy.B1zfBfvf.mjs';
2
- import '../shared/curvy.DLOeble8.mjs';
1
+ import { i as isVector4$1, m as make$1, a as magnitude$1, n as normalize$1, d as dot$1, c as components$1, s as softmax$1, b as add$1, e as subtract$1, h as hadamard$1, f as scale$1 } from '../shared/curvy.C2XGH0R0.mjs';
2
+ import '../pipe.mjs';
3
+ import '../utils.mjs';
3
4
 
4
5
  const isVector4 = isVector4$1;
5
6
  const make = make$1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "curvy",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Spline and Curve utilities",
5
5
  "author": "Tim Morris <timthewebguy@gmail.com>",
6
6
  "homepage": "https://github.com/tkofh/curvy#readme",
@@ -87,6 +87,14 @@
87
87
  "./splines/basis2d": {
88
88
  "types": "./dist/splines/basis2d.d.ts",
89
89
  "import": "./dist/splines/basis2d.mjs"
90
+ },
91
+ "./pipe": {
92
+ "types": "./dist/pipe.d.ts",
93
+ "import": "./dist/pipe.mjs"
94
+ },
95
+ "./utils": {
96
+ "types": "./dist/utils.d.ts",
97
+ "import": "./dist/utils.mjs"
90
98
  }
91
99
  },
92
100
  "files": [