curvy 1.0.0 → 1.0.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 (72) hide show
  1. package/dist/curve/cubic2d.d.mts +7 -3
  2. package/dist/curve/cubic2d.d.ts +7 -3
  3. package/dist/curve/cubic2d.mjs +22 -11
  4. package/dist/curve/linear2d.d.mts +4 -3
  5. package/dist/curve/linear2d.d.ts +4 -3
  6. package/dist/curve/linear2d.mjs +6 -4
  7. package/dist/curve/quadratic2d.d.mts +9 -3
  8. package/dist/curve/quadratic2d.d.ts +9 -3
  9. package/dist/curve/quadratic2d.mjs +24 -12
  10. package/dist/interval.mjs +1 -1
  11. package/dist/matrix/matrix2x2.d.mts +1 -1
  12. package/dist/matrix/matrix2x2.d.ts +1 -1
  13. package/dist/matrix/matrix2x2.mjs +3 -3
  14. package/dist/matrix/matrix3x3.d.mts +1 -1
  15. package/dist/matrix/matrix3x3.d.ts +1 -1
  16. package/dist/matrix/matrix3x3.mjs +5 -5
  17. package/dist/matrix/matrix4x4.d.mts +1 -1
  18. package/dist/matrix/matrix4x4.d.ts +1 -1
  19. package/dist/matrix/matrix4x4.mjs +6 -6
  20. package/dist/path/cubic2d.d.mts +2 -2
  21. package/dist/path/cubic2d.d.ts +2 -2
  22. package/dist/path/cubic2d.mjs +7 -6
  23. package/dist/path/linear2d.d.mts +2 -2
  24. package/dist/path/linear2d.d.ts +2 -2
  25. package/dist/path/linear2d.mjs +3 -3
  26. package/dist/path/quadratic2d.d.mts +3 -2
  27. package/dist/path/quadratic2d.d.ts +3 -2
  28. package/dist/path/quadratic2d.mjs +4 -4
  29. package/dist/polynomial/cubic.d.mts +2 -2
  30. package/dist/polynomial/cubic.d.ts +2 -2
  31. package/dist/polynomial/cubic.mjs +12 -4
  32. package/dist/polynomial/linear.d.mts +2 -2
  33. package/dist/polynomial/linear.d.ts +2 -2
  34. package/dist/polynomial/linear.mjs +6 -3
  35. package/dist/polynomial/quadratic.d.mts +2 -2
  36. package/dist/polynomial/quadratic.d.ts +2 -2
  37. package/dist/polynomial/quadratic.mjs +5 -4
  38. package/dist/shared/{curvy.Cty3LrOR.mjs → curvy.B1zfBfvf.mjs} +6 -2
  39. package/dist/shared/{curvy.DOLqYbKE.mjs → curvy.BPOevbwG.mjs} +8 -8
  40. package/dist/shared/{curvy.CT38g_II.d.mts → curvy.Bf5TIk31.d.mts} +1 -1
  41. package/dist/shared/{curvy.CT38g_II.d.ts → curvy.Bf5TIk31.d.ts} +1 -1
  42. package/dist/shared/{curvy.C-sUk7ux.mjs → curvy.BrrC9QVB.mjs} +2 -2
  43. package/dist/shared/{curvy.CO0Wclt0.d.ts → curvy.CkJRVnqj.d.ts} +14 -3
  44. package/dist/shared/{curvy.ChkqgKuv.mjs → curvy.DLOeble8.mjs} +9 -1
  45. package/dist/shared/curvy.DN9ptodP.mjs +55 -0
  46. package/dist/shared/{curvy.BAW_cKLu.mjs → curvy.DTco5vku.mjs} +3 -3
  47. package/dist/shared/{curvy.D7bhnwZy.mjs → curvy.DV4S13Cq.mjs} +3 -2
  48. package/dist/shared/{curvy.Bxxwly94.d.mts → curvy.DwHW5Fqt.d.mts} +14 -3
  49. package/dist/shared/{curvy.DgRsieUW.mjs → curvy.O57gIOmy.mjs} +5 -2
  50. package/dist/shared/{curvy.CLzGuqek.mjs → curvy.ZjG-q57I.mjs} +9 -3
  51. package/dist/splines/basis2d.d.mts +36 -0
  52. package/dist/splines/basis2d.d.ts +36 -0
  53. package/dist/splines/basis2d.mjs +86 -0
  54. package/dist/splines/bezier2d.d.mts +13 -5
  55. package/dist/splines/bezier2d.d.ts +13 -5
  56. package/dist/splines/bezier2d.mjs +50 -58
  57. package/dist/splines/cardinal2d.d.mts +44 -0
  58. package/dist/splines/cardinal2d.d.ts +44 -0
  59. package/dist/splines/cardinal2d.mjs +116 -0
  60. package/dist/splines/hermite2d.d.mts +31 -0
  61. package/dist/splines/hermite2d.d.ts +31 -0
  62. package/dist/splines/hermite2d.mjs +74 -0
  63. package/dist/vector/vector2.d.mts +10 -2
  64. package/dist/vector/vector2.d.ts +10 -2
  65. package/dist/vector/vector2.mjs +5 -3
  66. package/dist/vector/vector3.d.mts +6 -2
  67. package/dist/vector/vector3.d.ts +6 -2
  68. package/dist/vector/vector3.mjs +4 -3
  69. package/dist/vector/vector4.d.mts +6 -2
  70. package/dist/vector/vector4.d.ts +6 -2
  71. package/dist/vector/vector4.mjs +4 -3
  72. package/package.json +13 -1
@@ -1,7 +1,7 @@
1
- import { e as TwoDimensional } from '../shared/curvy.CT38g_II.mjs';
1
+ import { T as TwoDimensional } from '../shared/curvy.Bf5TIk31.mjs';
2
2
  import { P as Pipeable } from '../shared/curvy.BN-oFBsc.mjs';
3
3
  import { Interval } from '../interval.mjs';
4
- import { C as CubicPolynomial } from '../shared/curvy.Bxxwly94.mjs';
4
+ import { C as CubicPolynomial } from '../shared/curvy.DwHW5Fqt.mjs';
5
5
  import { Vector2 } from '../vector/vector2.mjs';
6
6
  import '../vector/vector3.mjs';
7
7
  import '../vector/vector4.mjs';
@@ -23,5 +23,9 @@ declare const length: {
23
23
  (c: CubicCurve2d, i: Interval): number;
24
24
  (i: Interval): (c: CubicCurve2d) => number;
25
25
  };
26
+ declare const curvature: {
27
+ (c: CubicCurve2d, t: number): number;
28
+ (t: number): (c: CubicCurve2d) => number;
29
+ };
26
30
 
27
- export { type CubicCurve2d, fromPoints, fromPolynomials, isCubicCurve2d, length, solve };
31
+ export { type CubicCurve2d, curvature, fromPoints, fromPolynomials, isCubicCurve2d, length, solve };
@@ -1,7 +1,7 @@
1
- import { e as TwoDimensional } from '../shared/curvy.CT38g_II.js';
1
+ import { T as TwoDimensional } from '../shared/curvy.Bf5TIk31.js';
2
2
  import { P as Pipeable } from '../shared/curvy.BN-oFBsc.js';
3
3
  import { Interval } from '../interval.js';
4
- import { C as CubicPolynomial } from '../shared/curvy.CO0Wclt0.js';
4
+ import { C as CubicPolynomial } from '../shared/curvy.CkJRVnqj.js';
5
5
  import { Vector2 } from '../vector/vector2.js';
6
6
  import '../vector/vector3.js';
7
7
  import '../vector/vector4.js';
@@ -23,5 +23,9 @@ declare const length: {
23
23
  (c: CubicCurve2d, i: Interval): number;
24
24
  (i: Interval): (c: CubicCurve2d) => number;
25
25
  };
26
+ declare const curvature: {
27
+ (c: CubicCurve2d, t: number): number;
28
+ (t: number): (c: CubicCurve2d) => number;
29
+ };
26
30
 
27
- export { type CubicCurve2d, fromPoints, fromPolynomials, isCubicCurve2d, length, solve };
31
+ export { type CubicCurve2d, curvature, fromPoints, fromPolynomials, isCubicCurve2d, length, solve };
@@ -1,15 +1,15 @@
1
- import { d as dual, r as round, P as Pipeable } from '../shared/curvy.ChkqgKuv.mjs';
1
+ import { d as dual, r as round, P as Pipeable } from '../shared/curvy.DLOeble8.mjs';
2
2
  import { size, scaleShift, biunit } from '../interval.mjs';
3
3
  import { G as GL32_W0, a as GL32_X0, b as GL32_W1, c as GL32_X1, d as GL32_W2, e as GL32_X2, f as GL32_W3, g as GL32_X3, h as GL32_W4, i as GL32_X4, j as GL32_W5, k as GL32_X5, l as GL32_W6, m as GL32_X6, n as GL32_W7, o as GL32_X7, p as GL32_W8, q as GL32_X8, r as GL32_W9, s as GL32_X9, t as GL32_W10, u as GL32_X10, v as GL32_W11, w as GL32_X11, x as GL32_W12, y as GL32_X12, z as GL32_W13, A as GL32_X13, B as GL32_W14, C as GL32_X14, D as GL32_W15, E as GL32_X15 } from '../shared/curvy.DmVFTi0N.mjs';
4
- import { make, solve as solve$2, derivative as derivative$1 } from '../polynomial/cubic.mjs';
4
+ import { make, solve as solve$2, derivative as derivative$2 } from '../polynomial/cubic.mjs';
5
5
  import { make as make$2 } from '../polynomial/quadratic.mjs';
6
- import { make as make$1, magnitude } from '../vector/vector2.mjs';
7
- import { length as length$2, fromPolynomials as fromPolynomials$2, solve as solve$3 } from './quadratic2d.mjs';
8
- import '../shared/curvy.CLzGuqek.mjs';
9
- import '../shared/curvy.DgRsieUW.mjs';
10
- import '../shared/curvy.DOLqYbKE.mjs';
6
+ import { make as make$1, magnitude, cross } from '../vector/vector2.mjs';
7
+ import { solve as solve$4 } from './linear2d.mjs';
8
+ import { length as length$2, fromPolynomials as fromPolynomials$2, solve as solve$3, derivative as derivative$1 } from './quadratic2d.mjs';
9
+ import '../shared/curvy.ZjG-q57I.mjs';
10
+ import '../shared/curvy.O57gIOmy.mjs';
11
+ import '../shared/curvy.BPOevbwG.mjs';
11
12
  import '../polynomial/linear.mjs';
12
- import './linear2d.mjs';
13
13
 
14
14
  const CubicCurve2dTypeId = Symbol("curvy/curve/cubic2d");
15
15
  class CubicCurve2dImpl extends Pipeable {
@@ -39,8 +39,8 @@ const solve$1 = dual(
39
39
  (c, t) => make$1(solve$2(c.x, t), solve$2(c.y, t))
40
40
  );
41
41
  const derivative = (c) => fromPolynomials$2(
42
- derivative$1(c.x),
43
- derivative$1(c.y)
42
+ derivative$2(c.x),
43
+ derivative$2(c.y)
44
44
  );
45
45
  const length$1 = dual(2, (c, i) => {
46
46
  if (size(i) === 0) {
@@ -75,11 +75,22 @@ const length$1 = dual(2, (c, i) => {
75
75
  )) * scale
76
76
  );
77
77
  });
78
+ const curvature$1 = dual(2, (c, t) => {
79
+ const d = derivative(c);
80
+ const v = solve$3(d, t);
81
+ const a = solve$4(derivative$1(d), t);
82
+ const vMag = magnitude(v);
83
+ if (vMag === 0) {
84
+ return 0;
85
+ }
86
+ return round(Math.abs(cross(v, a)) / vMag ** 3);
87
+ });
78
88
 
79
89
  const fromPolynomials = fromPolynomials$1;
80
90
  const fromPoints = fromPoints$1;
81
91
  const isCubicCurve2d = isCubicCurve2d$1;
82
92
  const solve = solve$1;
83
93
  const length = length$1;
94
+ const curvature = curvature$1;
84
95
 
85
- export { fromPoints, fromPolynomials, isCubicCurve2d, length, solve };
96
+ export { curvature, fromPoints, fromPolynomials, isCubicCurve2d, length, solve };
@@ -1,7 +1,7 @@
1
- import { e as TwoDimensional } from '../shared/curvy.CT38g_II.mjs';
1
+ import { T as TwoDimensional } from '../shared/curvy.Bf5TIk31.mjs';
2
2
  import { P as Pipeable } from '../shared/curvy.BN-oFBsc.mjs';
3
3
  import { Interval } from '../interval.mjs';
4
- import { L as LinearPolynomial } from '../shared/curvy.Bxxwly94.mjs';
4
+ import { L as LinearPolynomial } from '../shared/curvy.DwHW5Fqt.mjs';
5
5
  import { Vector2 } from '../vector/vector2.mjs';
6
6
  import '../vector/vector3.mjs';
7
7
  import '../vector/vector4.mjs';
@@ -15,6 +15,7 @@ interface LinearCurve2d extends Pipeable, TwoDimensional<LinearPolynomial> {
15
15
  declare const fromPolynomials: (x: LinearPolynomial, y: LinearPolynomial) => LinearCurve2d;
16
16
  declare const fromPoints: (p0: Vector2, p1: Vector2) => LinearCurve2d;
17
17
  declare const isLinearCurve2d: (c: unknown) => c is LinearCurve2d;
18
+ declare const derivative: (c: LinearCurve2d) => Vector2;
18
19
  declare const solve: {
19
20
  (t: number): (c: LinearCurve2d) => Vector2;
20
21
  (c: LinearCurve2d, t: number): Vector2;
@@ -24,4 +25,4 @@ declare const length: {
24
25
  (i: Interval): (c: LinearCurve2d) => number;
25
26
  };
26
27
 
27
- export { type LinearCurve2d, fromPoints, fromPolynomials, isLinearCurve2d, length, solve };
28
+ export { type LinearCurve2d, derivative, fromPoints, fromPolynomials, isLinearCurve2d, length, solve };
@@ -1,7 +1,7 @@
1
- import { e as TwoDimensional } from '../shared/curvy.CT38g_II.js';
1
+ import { T as TwoDimensional } from '../shared/curvy.Bf5TIk31.js';
2
2
  import { P as Pipeable } from '../shared/curvy.BN-oFBsc.js';
3
3
  import { Interval } from '../interval.js';
4
- import { L as LinearPolynomial } from '../shared/curvy.CO0Wclt0.js';
4
+ import { L as LinearPolynomial } from '../shared/curvy.CkJRVnqj.js';
5
5
  import { Vector2 } from '../vector/vector2.js';
6
6
  import '../vector/vector3.js';
7
7
  import '../vector/vector4.js';
@@ -15,6 +15,7 @@ interface LinearCurve2d extends Pipeable, TwoDimensional<LinearPolynomial> {
15
15
  declare const fromPolynomials: (x: LinearPolynomial, y: LinearPolynomial) => LinearCurve2d;
16
16
  declare const fromPoints: (p0: Vector2, p1: Vector2) => LinearCurve2d;
17
17
  declare const isLinearCurve2d: (c: unknown) => c is LinearCurve2d;
18
+ declare const derivative: (c: LinearCurve2d) => Vector2;
18
19
  declare const solve: {
19
20
  (t: number): (c: LinearCurve2d) => Vector2;
20
21
  (c: LinearCurve2d, t: number): Vector2;
@@ -24,4 +25,4 @@ declare const length: {
24
25
  (i: Interval): (c: LinearCurve2d) => number;
25
26
  };
26
27
 
27
- export { type LinearCurve2d, fromPoints, fromPolynomials, isLinearCurve2d, length, solve };
28
+ export { type LinearCurve2d, derivative, fromPoints, fromPolynomials, isLinearCurve2d, length, solve };
@@ -1,9 +1,9 @@
1
- import { d as dual, r as round, P as Pipeable } from '../shared/curvy.ChkqgKuv.mjs';
1
+ import { d as dual, r as round, P as Pipeable } from '../shared/curvy.DLOeble8.mjs';
2
2
  import { make, solve as solve$2 } from '../polynomial/linear.mjs';
3
3
  import { make as make$1 } from '../vector/vector2.mjs';
4
- import '../shared/curvy.DgRsieUW.mjs';
4
+ import '../shared/curvy.O57gIOmy.mjs';
5
5
  import '../interval.mjs';
6
- import '../shared/curvy.DOLqYbKE.mjs';
6
+ import '../shared/curvy.BPOevbwG.mjs';
7
7
 
8
8
  const LinearCurve2dTypeId = Symbol("curvy/curve/linear2d");
9
9
  class LinearCurve2dImpl extends Pipeable {
@@ -28,6 +28,7 @@ const fromPoints$1 = (p0, p1) => new LinearCurve2dImpl(
28
28
  make(p0.y, p1.y)
29
29
  );
30
30
  const isLinearCurve2d$1 = (c) => typeof c === "object" && c !== null && LinearCurve2dTypeId in c;
31
+ const derivative$1 = (c) => make$1(c.x.c1, c.y.c1);
31
32
  const solve$1 = dual(
32
33
  2,
33
34
  (c, t) => make$1(solve$2(c.x, t), solve$2(c.y, t))
@@ -40,7 +41,8 @@ const length$1 = dual(
40
41
  const fromPolynomials = fromPolynomials$1;
41
42
  const fromPoints = fromPoints$1;
42
43
  const isLinearCurve2d = isLinearCurve2d$1;
44
+ const derivative = derivative$1;
43
45
  const solve = solve$1;
44
46
  const length = length$1;
45
47
 
46
- export { fromPoints, fromPolynomials, isLinearCurve2d, length, solve };
48
+ export { derivative, fromPoints, fromPolynomials, isLinearCurve2d, length, solve };
@@ -1,8 +1,9 @@
1
- import { e as TwoDimensional } from '../shared/curvy.CT38g_II.mjs';
1
+ import { T as TwoDimensional } from '../shared/curvy.Bf5TIk31.mjs';
2
2
  import { P as Pipeable } from '../shared/curvy.BN-oFBsc.mjs';
3
3
  import { Interval } from '../interval.mjs';
4
- import { Q as QuadraticPolynomial } from '../shared/curvy.Bxxwly94.mjs';
4
+ import { Q as QuadraticPolynomial } from '../shared/curvy.DwHW5Fqt.mjs';
5
5
  import { Vector2 } from '../vector/vector2.mjs';
6
+ import { LinearCurve2d } from './linear2d.mjs';
6
7
  import '../vector/vector3.mjs';
7
8
  import '../vector/vector4.mjs';
8
9
 
@@ -23,5 +24,10 @@ declare const length: {
23
24
  (c: QuadraticCurve2d, i: Interval): number;
24
25
  (i: Interval): (c: QuadraticCurve2d) => number;
25
26
  };
27
+ declare const derivative: (c: QuadraticCurve2d) => LinearCurve2d;
28
+ declare const curvature: {
29
+ (c: QuadraticCurve2d, t: number): number;
30
+ (t: number): (c: QuadraticCurve2d) => number;
31
+ };
26
32
 
27
- export { type QuadraticCurve2d, fromPoints, fromPolynomials, isQuadraticCurve2d, length, solve };
33
+ export { type QuadraticCurve2d, curvature, derivative, fromPoints, fromPolynomials, isQuadraticCurve2d, length, solve };
@@ -1,8 +1,9 @@
1
- import { e as TwoDimensional } from '../shared/curvy.CT38g_II.js';
1
+ import { T as TwoDimensional } from '../shared/curvy.Bf5TIk31.js';
2
2
  import { P as Pipeable } from '../shared/curvy.BN-oFBsc.js';
3
3
  import { Interval } from '../interval.js';
4
- import { Q as QuadraticPolynomial } from '../shared/curvy.CO0Wclt0.js';
4
+ import { Q as QuadraticPolynomial } from '../shared/curvy.CkJRVnqj.js';
5
5
  import { Vector2 } from '../vector/vector2.js';
6
+ import { LinearCurve2d } from './linear2d.js';
6
7
  import '../vector/vector3.js';
7
8
  import '../vector/vector4.js';
8
9
 
@@ -23,5 +24,10 @@ declare const length: {
23
24
  (c: QuadraticCurve2d, i: Interval): number;
24
25
  (i: Interval): (c: QuadraticCurve2d) => number;
25
26
  };
27
+ declare const derivative: (c: QuadraticCurve2d) => LinearCurve2d;
28
+ declare const curvature: {
29
+ (c: QuadraticCurve2d, t: number): number;
30
+ (t: number): (c: QuadraticCurve2d) => number;
31
+ };
26
32
 
27
- export { type QuadraticCurve2d, fromPoints, fromPolynomials, isQuadraticCurve2d, length, solve };
33
+ export { type QuadraticCurve2d, curvature, derivative, fromPoints, fromPolynomials, isQuadraticCurve2d, length, solve };
@@ -1,13 +1,13 @@
1
- import { d as dual, r as round, P as Pipeable } from '../shared/curvy.ChkqgKuv.mjs';
1
+ import { d as dual, r as round, P as Pipeable } from '../shared/curvy.DLOeble8.mjs';
2
2
  import { size, scaleShift, biunit } from '../interval.mjs';
3
3
  import { G as GL32_W0, a as GL32_X0, b as GL32_W1, c as GL32_X1, d as GL32_W2, e as GL32_X2, f as GL32_W3, g as GL32_X3, h as GL32_W4, i as GL32_X4, j as GL32_W5, k as GL32_X5, l as GL32_W6, m as GL32_X6, n as GL32_W7, o as GL32_X7, p as GL32_W8, q as GL32_X8, r as GL32_W9, s as GL32_X9, t as GL32_W10, u as GL32_X10, v as GL32_W11, w as GL32_X11, x as GL32_W12, y as GL32_X12, z as GL32_W13, A as GL32_X13, B as GL32_W14, C as GL32_X14, D as GL32_W15, E as GL32_X15 } from '../shared/curvy.DmVFTi0N.mjs';
4
4
  import { make as make$2 } from '../polynomial/linear.mjs';
5
- import { make, solve as solve$2, derivative as derivative$1 } from '../polynomial/quadratic.mjs';
6
- import { make as make$1, magnitude } from '../vector/vector2.mjs';
7
- import { length as length$2, fromPolynomials as fromPolynomials$2, solve as solve$3 } from './linear2d.mjs';
8
- import '../shared/curvy.DgRsieUW.mjs';
9
- import '../shared/curvy.CLzGuqek.mjs';
10
- import '../shared/curvy.DOLqYbKE.mjs';
5
+ import { make, solve as solve$2, derivative as derivative$2 } from '../polynomial/quadratic.mjs';
6
+ import { make as make$1, magnitude, cross } from '../vector/vector2.mjs';
7
+ import { fromPolynomials as fromPolynomials$2, length as length$2, solve as solve$3, derivative as derivative$3 } from './linear2d.mjs';
8
+ import '../shared/curvy.O57gIOmy.mjs';
9
+ import '../shared/curvy.ZjG-q57I.mjs';
10
+ import '../shared/curvy.BPOevbwG.mjs';
11
11
 
12
12
  const QuadraticCurve2dTypeId = Symbol(
13
13
  "curvy/curve/quadratic2d"
@@ -41,9 +41,9 @@ const solve$1 = dual(
41
41
  solve$2(c.y, t)
42
42
  )
43
43
  );
44
- const derivative = (c) => fromPolynomials$2(
45
- derivative$1(c.x),
46
- derivative$1(c.y)
44
+ const derivative$1 = (c) => fromPolynomials$2(
45
+ derivative$2(c.x),
46
+ derivative$2(c.y)
47
47
  );
48
48
  const length$1 = dual(2, (c, i) => {
49
49
  if (size(i) === 0) {
@@ -58,17 +58,29 @@ const length$1 = dual(2, (c, i) => {
58
58
  i
59
59
  );
60
60
  }
61
- const d = derivative(c);
61
+ const d = derivative$1(c);
62
62
  const { scale, shift } = scaleShift(biunit, i);
63
63
  return round(
64
64
  (GL32_W0 * magnitude(solve$3(d, shift + scale * -GL32_X0)) + GL32_W0 * magnitude(solve$3(d, shift + scale * GL32_X0)) + GL32_W1 * magnitude(solve$3(d, shift + scale * -GL32_X1)) + GL32_W1 * magnitude(solve$3(d, shift + scale * GL32_X1)) + GL32_W2 * magnitude(solve$3(d, shift + scale * -GL32_X2)) + GL32_W2 * magnitude(solve$3(d, shift + scale * GL32_X2)) + GL32_W3 * magnitude(solve$3(d, shift + scale * -GL32_X3)) + GL32_W3 * magnitude(solve$3(d, shift + scale * GL32_X3)) + GL32_W4 * magnitude(solve$3(d, shift + scale * -GL32_X4)) + GL32_W4 * magnitude(solve$3(d, shift + scale * GL32_X4)) + GL32_W5 * magnitude(solve$3(d, shift + scale * -GL32_X5)) + GL32_W5 * magnitude(solve$3(d, shift + scale * GL32_X5)) + GL32_W6 * magnitude(solve$3(d, shift + scale * -GL32_X6)) + GL32_W6 * magnitude(solve$3(d, shift + scale * GL32_X6)) + GL32_W7 * magnitude(solve$3(d, shift + scale * -GL32_X7)) + GL32_W7 * magnitude(solve$3(d, shift + scale * GL32_X7)) + GL32_W8 * magnitude(solve$3(d, shift + scale * -GL32_X8)) + GL32_W8 * magnitude(solve$3(d, shift + scale * GL32_X8)) + GL32_W9 * magnitude(solve$3(d, shift + scale * -GL32_X9)) + GL32_W9 * magnitude(solve$3(d, shift + scale * GL32_X9)) + GL32_W10 * magnitude(solve$3(d, shift + scale * -GL32_X10)) + GL32_W10 * magnitude(solve$3(d, shift + scale * GL32_X10)) + GL32_W11 * magnitude(solve$3(d, shift + scale * -GL32_X11)) + GL32_W11 * magnitude(solve$3(d, shift + scale * GL32_X11)) + GL32_W12 * magnitude(solve$3(d, shift + scale * -GL32_X12)) + GL32_W12 * magnitude(solve$3(d, shift + scale * GL32_X12)) + GL32_W13 * magnitude(solve$3(d, shift + scale * -GL32_X13)) + GL32_W13 * magnitude(solve$3(d, shift + scale * GL32_X13)) + GL32_W14 * magnitude(solve$3(d, shift + scale * -GL32_X14)) + GL32_W14 * magnitude(solve$3(d, shift + scale * GL32_X14)) + GL32_W15 * magnitude(solve$3(d, shift + scale * -GL32_X15)) + GL32_W15 * magnitude(solve$3(d, shift + scale * GL32_X15))) * scale
65
65
  );
66
66
  });
67
+ const curvature$1 = dual(2, (c, t) => {
68
+ const d = derivative$1(c);
69
+ const v = solve$3(d, t);
70
+ const a = derivative$3(d);
71
+ const vMag = magnitude(v);
72
+ if (vMag === 0) {
73
+ return 0;
74
+ }
75
+ return round(Math.abs(cross(v, a)) / vMag ** 3);
76
+ });
67
77
 
68
78
  const fromPolynomials = fromPolynomials$1;
69
79
  const fromPoints = fromPoints$1;
70
80
  const isQuadraticCurve2d = isQuadraticCurve2d$1;
71
81
  const solve = solve$1;
72
82
  const length = length$1;
83
+ const derivative = derivative$1;
84
+ const curvature = curvature$1;
73
85
 
74
- export { fromPoints, fromPolynomials, isQuadraticCurve2d, length, solve };
86
+ export { curvature, derivative, fromPoints, fromPolynomials, isQuadraticCurve2d, length, solve };
package/dist/interval.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { d as dual, P as Pipeable, r as round } from './shared/curvy.ChkqgKuv.mjs';
1
+ import { d as dual, P as Pipeable, r as round } from './shared/curvy.DLOeble8.mjs';
2
2
 
3
3
  const TypeId = Symbol.for("curvy/interval");
4
4
  class IntervalImpl extends Pipeable {
@@ -1,4 +1,4 @@
1
- import { c as TwoDimensionalIndex, d as TwoDimensionalComponent } from '../shared/curvy.CT38g_II.mjs';
1
+ import { d as TwoDimensionalIndex, e as TwoDimensionalComponent } from '../shared/curvy.Bf5TIk31.mjs';
2
2
  import { P as Pipeable } from '../shared/curvy.BN-oFBsc.mjs';
3
3
  import { Vector2 } from '../vector/vector2.mjs';
4
4
 
@@ -1,4 +1,4 @@
1
- import { c as TwoDimensionalIndex, d as TwoDimensionalComponent } from '../shared/curvy.CT38g_II.js';
1
+ import { d as TwoDimensionalIndex, e as TwoDimensionalComponent } from '../shared/curvy.Bf5TIk31.js';
2
2
  import { P as Pipeable } from '../shared/curvy.BN-oFBsc.js';
3
3
  import { Vector2 } from '../vector/vector2.js';
4
4
 
@@ -1,6 +1,6 @@
1
- import { i as isMatrix2x2$1, m as make, f as fromRows$1, a as fromColumns$1, s as setRow$1, b as setColumn$1, d as determinant$1, v as vectorProductLeft$1, c as vectorProductRight$1, e as solveSystem$1, t as toRows$1, g as toColumns$1, r as rowVector$1, h as columnVector$1, j as transpose$1, k as reverseRows$1, l as reverseColumns$1 } from '../shared/curvy.C-sUk7ux.mjs';
2
- import '../shared/curvy.ChkqgKuv.mjs';
3
- import '../shared/curvy.DOLqYbKE.mjs';
1
+ import { i as isMatrix2x2$1, m as make, f as fromRows$1, a as fromColumns$1, s as setRow$1, b as setColumn$1, d as determinant$1, v as vectorProductLeft$1, c as vectorProductRight$1, e as solveSystem$1, t as toRows$1, g as toColumns$1, r as rowVector$1, h as columnVector$1, j as transpose$1, k as reverseRows$1, l as reverseColumns$1 } from '../shared/curvy.BrrC9QVB.mjs';
2
+ import '../shared/curvy.DLOeble8.mjs';
3
+ import '../shared/curvy.BPOevbwG.mjs';
4
4
 
5
5
  const isMatrix2x2 = isMatrix2x2$1;
6
6
  const matrix2x2 = make;
@@ -1,4 +1,4 @@
1
- import { T as ThreeDimensionalIndex, b as ThreeDimensionalComponent } from '../shared/curvy.CT38g_II.mjs';
1
+ import { b as ThreeDimensionalIndex, c as ThreeDimensionalComponent } from '../shared/curvy.Bf5TIk31.mjs';
2
2
  import { Vector3 } from '../vector/vector3.mjs';
3
3
  import { Matrix2x2 } from './matrix2x2.mjs';
4
4
  import '../shared/curvy.BN-oFBsc.mjs';
@@ -1,4 +1,4 @@
1
- import { T as ThreeDimensionalIndex, b as ThreeDimensionalComponent } from '../shared/curvy.CT38g_II.js';
1
+ import { b as ThreeDimensionalIndex, c as ThreeDimensionalComponent } from '../shared/curvy.Bf5TIk31.js';
2
2
  import { Vector3 } from '../vector/vector3.js';
3
3
  import { Matrix2x2 } from './matrix2x2.js';
4
4
  import '../shared/curvy.BN-oFBsc.js';
@@ -1,8 +1,8 @@
1
- import { i as isMatrix3x3$1, m as make, f as fromRows$1, a as fromColumns$1, s as setRow$1, b as setColumn$1, d as determinant$1, c as minor$1, v as vectorProductLeft$1, e as vectorProductRight$1, g as solveSystem$1, t as toRows$1, h as toColumns$1, r as rowVector$1, j as columnVector$1, k as transpose$1, l as reverseRows$1, n as reverseColumns$1 } from '../shared/curvy.BAW_cKLu.mjs';
2
- import '../shared/curvy.C-sUk7ux.mjs';
3
- import '../shared/curvy.ChkqgKuv.mjs';
4
- import '../shared/curvy.DOLqYbKE.mjs';
5
- import '../shared/curvy.D7bhnwZy.mjs';
1
+ import { i as isMatrix3x3$1, m as make, f as fromRows$1, a as fromColumns$1, s as setRow$1, b as setColumn$1, d as determinant$1, c as minor$1, v as vectorProductLeft$1, e as vectorProductRight$1, g as solveSystem$1, t as toRows$1, h as toColumns$1, r as rowVector$1, j as columnVector$1, k as transpose$1, l as reverseRows$1, n as reverseColumns$1 } from '../shared/curvy.DTco5vku.mjs';
2
+ import '../shared/curvy.BrrC9QVB.mjs';
3
+ import '../shared/curvy.DLOeble8.mjs';
4
+ import '../shared/curvy.BPOevbwG.mjs';
5
+ import '../shared/curvy.DV4S13Cq.mjs';
6
6
 
7
7
  const isMatrix3x3 = isMatrix3x3$1;
8
8
  const matrix3x3 = make;
@@ -1,4 +1,4 @@
1
- import { F as FourDimensionalIndex, a as FourDimensionalComponent } from '../shared/curvy.CT38g_II.mjs';
1
+ import { F as FourDimensionalIndex, a as FourDimensionalComponent } from '../shared/curvy.Bf5TIk31.mjs';
2
2
  import { P as Pipeable } from '../shared/curvy.BN-oFBsc.mjs';
3
3
  import { Vector4 } from '../vector/vector4.mjs';
4
4
  import { Matrix3x3 } from './matrix3x3.mjs';
@@ -1,4 +1,4 @@
1
- import { F as FourDimensionalIndex, a as FourDimensionalComponent } from '../shared/curvy.CT38g_II.js';
1
+ import { F as FourDimensionalIndex, a as FourDimensionalComponent } from '../shared/curvy.Bf5TIk31.js';
2
2
  import { P as Pipeable } from '../shared/curvy.BN-oFBsc.js';
3
3
  import { Vector4 } from '../vector/vector4.js';
4
4
  import { Matrix3x3 } from './matrix3x3.js';
@@ -1,9 +1,9 @@
1
- import { n as toFourDimensionalIndex } from '../shared/curvy.C-sUk7ux.mjs';
2
- import { d as dual, r as round, i as invariant, P as Pipeable } from '../shared/curvy.ChkqgKuv.mjs';
3
- import { c as components, m as make$3, d as dot } from '../shared/curvy.Cty3LrOR.mjs';
4
- import { d as determinant$2, m as make$2 } from '../shared/curvy.BAW_cKLu.mjs';
5
- import '../shared/curvy.DOLqYbKE.mjs';
6
- import '../shared/curvy.D7bhnwZy.mjs';
1
+ import { n as toFourDimensionalIndex } from '../shared/curvy.BrrC9QVB.mjs';
2
+ import { d as dual, r as round, i as invariant, P as Pipeable } from '../shared/curvy.DLOeble8.mjs';
3
+ import { c as components, m as make$3, d as dot } from '../shared/curvy.B1zfBfvf.mjs';
4
+ import { d as determinant$2, m as make$2 } from '../shared/curvy.DTco5vku.mjs';
5
+ import '../shared/curvy.BPOevbwG.mjs';
6
+ import '../shared/curvy.DV4S13Cq.mjs';
7
7
 
8
8
  const Matrix4x4TypeId = Symbol.for("curvy/matrix4x4");
9
9
  class Matrix4x4Impl extends Pipeable {
@@ -1,9 +1,9 @@
1
1
  import { CubicCurve2d } from '../curve/cubic2d.mjs';
2
2
  import { P as Pipeable } from '../shared/curvy.BN-oFBsc.mjs';
3
3
  import { Vector2 } from '../vector/vector2.mjs';
4
- import '../shared/curvy.CT38g_II.mjs';
4
+ import '../shared/curvy.Bf5TIk31.mjs';
5
5
  import '../interval.mjs';
6
- import '../shared/curvy.Bxxwly94.mjs';
6
+ import '../shared/curvy.DwHW5Fqt.mjs';
7
7
  import '../vector/vector3.mjs';
8
8
  import '../vector/vector4.mjs';
9
9
 
@@ -1,9 +1,9 @@
1
1
  import { CubicCurve2d } from '../curve/cubic2d.js';
2
2
  import { P as Pipeable } from '../shared/curvy.BN-oFBsc.js';
3
3
  import { Vector2 } from '../vector/vector2.js';
4
- import '../shared/curvy.CT38g_II.js';
4
+ import '../shared/curvy.Bf5TIk31.js';
5
5
  import '../interval.js';
6
- import '../shared/curvy.CO0Wclt0.js';
6
+ import '../shared/curvy.CkJRVnqj.js';
7
7
  import '../vector/vector3.js';
8
8
  import '../vector/vector4.js';
9
9
 
@@ -1,22 +1,23 @@
1
1
  import { length as length$2, solve as solve$2 } from '../curve/cubic2d.mjs';
2
- import { d as dual, r as round, P as Pipeable } from '../shared/curvy.ChkqgKuv.mjs';
2
+ import { d as dual, r as round, P as Pipeable, i as invariant } from '../shared/curvy.DLOeble8.mjs';
3
3
  import { unit } from '../interval.mjs';
4
4
  import '../shared/curvy.DmVFTi0N.mjs';
5
5
  import '../polynomial/cubic.mjs';
6
- import '../shared/curvy.CLzGuqek.mjs';
7
- import '../shared/curvy.DgRsieUW.mjs';
6
+ import '../shared/curvy.ZjG-q57I.mjs';
7
+ import '../shared/curvy.O57gIOmy.mjs';
8
8
  import '../polynomial/quadratic.mjs';
9
9
  import '../vector/vector2.mjs';
10
- import '../shared/curvy.DOLqYbKE.mjs';
11
- import '../curve/quadratic2d.mjs';
12
- import '../polynomial/linear.mjs';
10
+ import '../shared/curvy.BPOevbwG.mjs';
13
11
  import '../curve/linear2d.mjs';
12
+ import '../polynomial/linear.mjs';
13
+ import '../curve/quadratic2d.mjs';
14
14
 
15
15
  const CubicPath2dTypeId = Symbol("curvy/path/cubic2d");
16
16
  class CubicPath2dImpl extends Pipeable {
17
17
  [CubicPath2dTypeId] = CubicPath2dTypeId;
18
18
  curves;
19
19
  constructor(curves) {
20
+ invariant(curves.length > 0, "cubic path requires at least one curve");
20
21
  super();
21
22
  this.curves = curves;
22
23
  }
@@ -1,9 +1,9 @@
1
1
  import { LinearCurve2d } from '../curve/linear2d.mjs';
2
2
  import { P as Pipeable } from '../shared/curvy.BN-oFBsc.mjs';
3
3
  import { Vector2 } from '../vector/vector2.mjs';
4
- import '../shared/curvy.CT38g_II.mjs';
4
+ import '../shared/curvy.Bf5TIk31.mjs';
5
5
  import '../interval.mjs';
6
- import '../shared/curvy.Bxxwly94.mjs';
6
+ import '../shared/curvy.DwHW5Fqt.mjs';
7
7
  import '../vector/vector3.mjs';
8
8
  import '../vector/vector4.mjs';
9
9
 
@@ -1,9 +1,9 @@
1
1
  import { LinearCurve2d } from '../curve/linear2d.js';
2
2
  import { P as Pipeable } from '../shared/curvy.BN-oFBsc.js';
3
3
  import { Vector2 } from '../vector/vector2.js';
4
- import '../shared/curvy.CT38g_II.js';
4
+ import '../shared/curvy.Bf5TIk31.js';
5
5
  import '../interval.js';
6
- import '../shared/curvy.CO0Wclt0.js';
6
+ import '../shared/curvy.CkJRVnqj.js';
7
7
  import '../vector/vector3.js';
8
8
  import '../vector/vector4.js';
9
9
 
@@ -1,10 +1,10 @@
1
1
  import { length as length$2, solve as solve$2 } from '../curve/linear2d.mjs';
2
- import { d as dual, r as round, P as Pipeable } from '../shared/curvy.ChkqgKuv.mjs';
2
+ import { d as dual, r as round, P as Pipeable } from '../shared/curvy.DLOeble8.mjs';
3
3
  import { unit } from '../interval.mjs';
4
4
  import '../polynomial/linear.mjs';
5
- import '../shared/curvy.DgRsieUW.mjs';
5
+ import '../shared/curvy.O57gIOmy.mjs';
6
6
  import '../vector/vector2.mjs';
7
- import '../shared/curvy.DOLqYbKE.mjs';
7
+ import '../shared/curvy.BPOevbwG.mjs';
8
8
 
9
9
  const LinearPath2dTypeId = Symbol("curvy/path/linear2d");
10
10
  class LinearPath2dImpl extends Pipeable {
@@ -1,11 +1,12 @@
1
1
  import { QuadraticCurve2d } from '../curve/quadratic2d.mjs';
2
2
  import { P as Pipeable } from '../shared/curvy.BN-oFBsc.mjs';
3
3
  import { Vector2 } from '../vector/vector2.mjs';
4
- import '../shared/curvy.CT38g_II.mjs';
4
+ import '../shared/curvy.Bf5TIk31.mjs';
5
5
  import '../interval.mjs';
6
- import '../shared/curvy.Bxxwly94.mjs';
6
+ import '../shared/curvy.DwHW5Fqt.mjs';
7
7
  import '../vector/vector3.mjs';
8
8
  import '../vector/vector4.mjs';
9
+ import '../curve/linear2d.mjs';
9
10
 
10
11
  declare const QuadraticPath2dTypeId: unique symbol;
11
12
  type QuadraticPath2dTypeId = typeof QuadraticPath2dTypeId;
@@ -1,11 +1,12 @@
1
1
  import { QuadraticCurve2d } from '../curve/quadratic2d.js';
2
2
  import { P as Pipeable } from '../shared/curvy.BN-oFBsc.js';
3
3
  import { Vector2 } from '../vector/vector2.js';
4
- import '../shared/curvy.CT38g_II.js';
4
+ import '../shared/curvy.Bf5TIk31.js';
5
5
  import '../interval.js';
6
- import '../shared/curvy.CO0Wclt0.js';
6
+ import '../shared/curvy.CkJRVnqj.js';
7
7
  import '../vector/vector3.js';
8
8
  import '../vector/vector4.js';
9
+ import '../curve/linear2d.js';
9
10
 
10
11
  declare const QuadraticPath2dTypeId: unique symbol;
11
12
  type QuadraticPath2dTypeId = typeof QuadraticPath2dTypeId;
@@ -1,13 +1,13 @@
1
1
  import { length as length$2, solve as solve$2 } from '../curve/quadratic2d.mjs';
2
- import { d as dual, r as round, P as Pipeable } from '../shared/curvy.ChkqgKuv.mjs';
2
+ import { d as dual, r as round, P as Pipeable } from '../shared/curvy.DLOeble8.mjs';
3
3
  import { unit } from '../interval.mjs';
4
4
  import '../shared/curvy.DmVFTi0N.mjs';
5
5
  import '../polynomial/linear.mjs';
6
- import '../shared/curvy.DgRsieUW.mjs';
6
+ import '../shared/curvy.O57gIOmy.mjs';
7
7
  import '../polynomial/quadratic.mjs';
8
- import '../shared/curvy.CLzGuqek.mjs';
8
+ import '../shared/curvy.ZjG-q57I.mjs';
9
9
  import '../vector/vector2.mjs';
10
- import '../shared/curvy.DOLqYbKE.mjs';
10
+ import '../shared/curvy.BPOevbwG.mjs';
11
11
  import '../curve/linear2d.mjs';
12
12
 
13
13
  const QuadraticPath2dTypeId = Symbol(
@@ -1,7 +1,7 @@
1
1
  import '../shared/curvy.BN-oFBsc.mjs';
2
2
  import '../interval.mjs';
3
3
  import '../vector/vector4.mjs';
4
- export { C as CubicPolynomial, d as derivative, g as domain, e as extrema, f as fromVector, i as isCubicPolynomial, l as length, m as make, c as monotonicity, h as range, r as roots, s as solve, a as solveInverse, b as toInverseSolver, t as toSolver } from '../shared/curvy.Bxxwly94.mjs';
5
- import '../shared/curvy.CT38g_II.mjs';
4
+ export { C as CubicPolynomial, j as curvature, d as derivative, g as domain, e as extrema, f as fromVector, i as isCubicPolynomial, l as length, m as make, c as monotonicity, h as range, r as roots, s as solve, a as solveInverse, b as toInverseSolver, t as toSolver } from '../shared/curvy.DwHW5Fqt.mjs';
5
+ import '../shared/curvy.Bf5TIk31.mjs';
6
6
  import '../vector/vector2.mjs';
7
7
  import '../vector/vector3.mjs';
@@ -1,7 +1,7 @@
1
1
  import '../shared/curvy.BN-oFBsc.js';
2
2
  import '../interval.js';
3
3
  import '../vector/vector4.js';
4
- export { C as CubicPolynomial, d as derivative, g as domain, e as extrema, f as fromVector, i as isCubicPolynomial, l as length, m as make, c as monotonicity, h as range, r as roots, s as solve, a as solveInverse, b as toInverseSolver, t as toSolver } from '../shared/curvy.CO0Wclt0.js';
5
- import '../shared/curvy.CT38g_II.js';
4
+ export { C as CubicPolynomial, j as curvature, d as derivative, g as domain, e as extrema, f as fromVector, i as isCubicPolynomial, l as length, m as make, c as monotonicity, h as range, r as roots, s as solve, a as solveInverse, b as toInverseSolver, t as toSolver } from '../shared/curvy.CkJRVnqj.js';
5
+ import '../shared/curvy.Bf5TIk31.js';
6
6
  import '../vector/vector2.js';
7
7
  import '../vector/vector3.js';
@@ -1,8 +1,8 @@
1
- import { d as dual, r as round } from '../shared/curvy.ChkqgKuv.mjs';
1
+ import { d as dual, r as round } from '../shared/curvy.DLOeble8.mjs';
2
2
  import { size, filter, fromMinMax, scaleShift, biunit } from '../interval.mjs';
3
3
  import { G as GL32_W0, a as GL32_X0, b as GL32_W1, c as GL32_X1, d as GL32_W2, e as GL32_X2, f as GL32_W3, g as GL32_X3, h as GL32_W4, i as GL32_X4, j as GL32_W5, k as GL32_X5, l as GL32_W6, m as GL32_X6, n as GL32_W7, o as GL32_X7, p as GL32_W8, q as GL32_X8, r as GL32_W9, s as GL32_X9, t as GL32_W10, u as GL32_X10, v as GL32_W11, w as GL32_X11, x as GL32_W12, y as GL32_X12, z as GL32_W13, A as GL32_X13, B as GL32_W14, C as GL32_X14, D as GL32_W15, E as GL32_X15 } from '../shared/curvy.DmVFTi0N.mjs';
4
- import { C as CubicPolynomialImpl, a as CubicPolynomialTypeId, s as solveInverse$2, m as make$2, r as roots$2, b as monotonicity$3, g as guaranteedMonotonicityFromComparison, l as length$3, c as solve$2 } from '../shared/curvy.CLzGuqek.mjs';
5
- import { m as monotonicity$2, a as make$3, l as length$2 } from '../shared/curvy.DgRsieUW.mjs';
4
+ import { C as CubicPolynomialImpl, a as CubicPolynomialTypeId, s as solveInverse$2, m as make$2, r as roots$2, b as monotonicity$3, g as guaranteedMonotonicityFromComparison, l as length$3, c as solve$2, d as derivative$2 } from '../shared/curvy.ZjG-q57I.mjs';
5
+ import { m as monotonicity$2, a as make$3, l as length$2, s as solve$3 } from '../shared/curvy.O57gIOmy.mjs';
6
6
 
7
7
  const make$1 = (c0 = 0, c1 = 0, c2 = 0, c3 = 0) => new CubicPolynomialImpl(c0, c1, c2, c3);
8
8
  const isCubicPolynomial$1 = (v) => typeof v === "object" && v !== null && CubicPolynomialTypeId in v;
@@ -120,6 +120,13 @@ const length$1 = dual(2, (p, domain2) => {
120
120
  (GL32_W0 * Math.sqrt(1 + solve$2(d, shift + scale * -GL32_X0) ** 2) + GL32_W0 * Math.sqrt(1 + solve$2(d, shift + scale * GL32_X0) ** 2) + GL32_W1 * Math.sqrt(1 + solve$2(d, shift + scale * -GL32_X1) ** 2) + GL32_W1 * Math.sqrt(1 + solve$2(d, shift + scale * GL32_X1) ** 2) + GL32_W2 * Math.sqrt(1 + solve$2(d, shift + scale * -GL32_X2) ** 2) + GL32_W2 * Math.sqrt(1 + solve$2(d, shift + scale * GL32_X2) ** 2) + GL32_W3 * Math.sqrt(1 + solve$2(d, shift + scale * -GL32_X3) ** 2) + GL32_W3 * Math.sqrt(1 + solve$2(d, shift + scale * GL32_X3) ** 2) + GL32_W4 * Math.sqrt(1 + solve$2(d, shift + scale * -GL32_X4) ** 2) + GL32_W4 * Math.sqrt(1 + solve$2(d, shift + scale * GL32_X4) ** 2) + GL32_W5 * Math.sqrt(1 + solve$2(d, shift + scale * -GL32_X5) ** 2) + GL32_W5 * Math.sqrt(1 + solve$2(d, shift + scale * GL32_X5) ** 2) + GL32_W6 * Math.sqrt(1 + solve$2(d, shift + scale * -GL32_X6) ** 2) + GL32_W6 * Math.sqrt(1 + solve$2(d, shift + scale * GL32_X6) ** 2) + GL32_W7 * Math.sqrt(1 + solve$2(d, shift + scale * -GL32_X7) ** 2) + GL32_W7 * Math.sqrt(1 + solve$2(d, shift + scale * GL32_X7) ** 2) + GL32_W8 * Math.sqrt(1 + solve$2(d, shift + scale * -GL32_X8) ** 2) + GL32_W8 * Math.sqrt(1 + solve$2(d, shift + scale * GL32_X8) ** 2) + GL32_W9 * Math.sqrt(1 + solve$2(d, shift + scale * -GL32_X9) ** 2) + GL32_W9 * Math.sqrt(1 + solve$2(d, shift + scale * GL32_X9) ** 2) + GL32_W10 * Math.sqrt(1 + solve$2(d, shift + scale * -GL32_X10) ** 2) + GL32_W10 * Math.sqrt(1 + solve$2(d, shift + scale * GL32_X10) ** 2) + GL32_W11 * Math.sqrt(1 + solve$2(d, shift + scale * -GL32_X11) ** 2) + GL32_W11 * Math.sqrt(1 + solve$2(d, shift + scale * GL32_X11) ** 2) + GL32_W12 * Math.sqrt(1 + solve$2(d, shift + scale * -GL32_X12) ** 2) + GL32_W12 * Math.sqrt(1 + solve$2(d, shift + scale * GL32_X12) ** 2) + GL32_W13 * Math.sqrt(1 + solve$2(d, shift + scale * -GL32_X13) ** 2) + GL32_W13 * Math.sqrt(1 + solve$2(d, shift + scale * GL32_X13) ** 2) + GL32_W14 * Math.sqrt(1 + solve$2(d, shift + scale * -GL32_X14) ** 2) + GL32_W14 * Math.sqrt(1 + solve$2(d, shift + scale * GL32_X14) ** 2) + GL32_W15 * Math.sqrt(1 + solve$2(d, shift + scale * -GL32_X15) ** 2) + GL32_W15 * Math.sqrt(1 + solve$2(d, shift + scale * GL32_X15) ** 2)) * scale
121
121
  );
122
122
  });
123
+ const curvature$1 = dual(2, (p, x) => {
124
+ const d = derivative$1(p);
125
+ const dd = derivative$2(d);
126
+ return round(
127
+ Math.abs(solve$3(dd, x)) / (1 + solve$2(d, x) ** 2) ** 1.5
128
+ );
129
+ });
123
130
 
124
131
  const isCubicPolynomial = isCubicPolynomial$1;
125
132
  const make = make$1;
@@ -135,5 +142,6 @@ const monotonicity = monotonicity$1;
135
142
  const domain = domain$1;
136
143
  const range = range$1;
137
144
  const length = length$1;
145
+ const curvature = curvature$1;
138
146
 
139
- export { derivative, domain, extrema, fromVector, isCubicPolynomial, length, make, monotonicity, range, roots, solve, solveInverse, toInverseSolver, toSolver };
147
+ export { curvature, derivative, domain, extrema, fromVector, isCubicPolynomial, length, make, monotonicity, range, roots, solve, solveInverse, toInverseSolver, toSolver };
@@ -1,7 +1,7 @@
1
1
  import '../shared/curvy.BN-oFBsc.mjs';
2
2
  import '../interval.mjs';
3
3
  import '../vector/vector2.mjs';
4
- export { L as LinearPolynomial, O as antiderivative, P as domain, G as fromVector, E as isLinearPolynomial, S as length, F as make, N as monotonicity, R as range, M as root, H as solve, J as solveInverse, K as toInverseSolver, I as toSolver } from '../shared/curvy.Bxxwly94.mjs';
5
- import '../shared/curvy.CT38g_II.mjs';
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.DwHW5Fqt.mjs';
5
+ import '../shared/curvy.Bf5TIk31.mjs';
6
6
  import '../vector/vector3.mjs';
7
7
  import '../vector/vector4.mjs';