curvy 1.0.0 → 1.0.1
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.
- package/dist/curve/cubic2d.d.mts +6 -2
- package/dist/curve/cubic2d.d.ts +6 -2
- package/dist/curve/cubic2d.mjs +21 -10
- package/dist/curve/linear2d.d.mts +3 -2
- package/dist/curve/linear2d.d.ts +3 -2
- package/dist/curve/linear2d.mjs +5 -3
- package/dist/curve/quadratic2d.d.mts +8 -2
- package/dist/curve/quadratic2d.d.ts +8 -2
- package/dist/curve/quadratic2d.mjs +23 -11
- package/dist/matrix/matrix2x2.mjs +2 -2
- package/dist/matrix/matrix3x3.mjs +3 -3
- package/dist/matrix/matrix4x4.mjs +3 -3
- package/dist/path/cubic2d.d.mts +1 -1
- package/dist/path/cubic2d.d.ts +1 -1
- package/dist/path/cubic2d.mjs +5 -5
- package/dist/path/linear2d.d.mts +1 -1
- package/dist/path/linear2d.d.ts +1 -1
- package/dist/path/linear2d.mjs +2 -2
- package/dist/path/quadratic2d.d.mts +2 -1
- package/dist/path/quadratic2d.d.ts +2 -1
- package/dist/path/quadratic2d.mjs +3 -3
- package/dist/polynomial/cubic.d.mts +1 -1
- package/dist/polynomial/cubic.d.ts +1 -1
- package/dist/polynomial/cubic.mjs +11 -3
- package/dist/polynomial/linear.d.mts +1 -1
- package/dist/polynomial/linear.d.ts +1 -1
- package/dist/polynomial/linear.mjs +5 -2
- package/dist/polynomial/quadratic.d.mts +1 -1
- package/dist/polynomial/quadratic.d.ts +1 -1
- package/dist/polynomial/quadratic.mjs +4 -3
- package/dist/shared/{curvy.CO0Wclt0.d.ts → curvy.CkJRVnqj.d.ts} +14 -3
- package/dist/shared/{curvy.CLzGuqek.mjs → curvy.D7MEXd5g.mjs} +8 -2
- package/dist/shared/{curvy.DgRsieUW.mjs → curvy.DB7nQmVs.mjs} +4 -1
- package/dist/shared/{curvy.C-sUk7ux.mjs → curvy.DM6AiKbn.mjs} +1 -1
- package/dist/shared/{curvy.DOLqYbKE.mjs → curvy.DOSsf40r.mjs} +2 -1
- package/dist/shared/{curvy.Bxxwly94.d.mts → curvy.DwHW5Fqt.d.mts} +14 -3
- package/dist/shared/{curvy.BAW_cKLu.mjs → curvy.bvP77ZZm.mjs} +1 -1
- package/dist/splines/bezier2d.d.mts +12 -4
- package/dist/splines/bezier2d.d.ts +12 -4
- package/dist/splines/bezier2d.mjs +40 -14
- package/dist/vector/vector2.d.mts +5 -1
- package/dist/vector/vector2.d.ts +5 -1
- package/dist/vector/vector2.mjs +3 -2
- package/package.json +1 -1
package/dist/curve/cubic2d.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { e as TwoDimensional } from '../shared/curvy.CT38g_II.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.
|
|
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 };
|
package/dist/curve/cubic2d.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { e as TwoDimensional } from '../shared/curvy.CT38g_II.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.
|
|
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 };
|
package/dist/curve/cubic2d.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { d as dual, r as round, P as Pipeable } from '../shared/curvy.ChkqgKuv.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$
|
|
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 {
|
|
8
|
-
import '
|
|
9
|
-
import '../shared/curvy.
|
|
10
|
-
import '../shared/curvy.
|
|
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.D7MEXd5g.mjs';
|
|
10
|
+
import '../shared/curvy.DB7nQmVs.mjs';
|
|
11
|
+
import '../shared/curvy.DOSsf40r.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$
|
|
43
|
-
derivative$
|
|
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
1
|
import { e as TwoDimensional } from '../shared/curvy.CT38g_II.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.
|
|
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 };
|
package/dist/curve/linear2d.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { e as TwoDimensional } from '../shared/curvy.CT38g_II.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.
|
|
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 };
|
package/dist/curve/linear2d.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { d as dual, r as round, P as Pipeable } from '../shared/curvy.ChkqgKuv.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.
|
|
4
|
+
import '../shared/curvy.DB7nQmVs.mjs';
|
|
5
5
|
import '../interval.mjs';
|
|
6
|
-
import '../shared/curvy.
|
|
6
|
+
import '../shared/curvy.DOSsf40r.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
1
|
import { e as TwoDimensional } from '../shared/curvy.CT38g_II.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.
|
|
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
1
|
import { e as TwoDimensional } from '../shared/curvy.CT38g_II.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.
|
|
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 };
|
|
@@ -2,12 +2,12 @@ import { d as dual, r as round, P as Pipeable } from '../shared/curvy.ChkqgKuv.m
|
|
|
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$
|
|
6
|
-
import { make as make$1, magnitude } from '../vector/vector2.mjs';
|
|
7
|
-
import {
|
|
8
|
-
import '../shared/curvy.
|
|
9
|
-
import '../shared/curvy.
|
|
10
|
-
import '../shared/curvy.
|
|
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.DB7nQmVs.mjs';
|
|
9
|
+
import '../shared/curvy.D7MEXd5g.mjs';
|
|
10
|
+
import '../shared/curvy.DOSsf40r.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$
|
|
46
|
-
derivative$
|
|
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 };
|
|
@@ -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.
|
|
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.DM6AiKbn.mjs';
|
|
2
2
|
import '../shared/curvy.ChkqgKuv.mjs';
|
|
3
|
-
import '../shared/curvy.
|
|
3
|
+
import '../shared/curvy.DOSsf40r.mjs';
|
|
4
4
|
|
|
5
5
|
const isMatrix2x2 = isMatrix2x2$1;
|
|
6
6
|
const matrix2x2 = make;
|
|
@@ -1,7 +1,7 @@
|
|
|
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.
|
|
2
|
-
import '../shared/curvy.
|
|
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.bvP77ZZm.mjs';
|
|
2
|
+
import '../shared/curvy.DM6AiKbn.mjs';
|
|
3
3
|
import '../shared/curvy.ChkqgKuv.mjs';
|
|
4
|
-
import '../shared/curvy.
|
|
4
|
+
import '../shared/curvy.DOSsf40r.mjs';
|
|
5
5
|
import '../shared/curvy.D7bhnwZy.mjs';
|
|
6
6
|
|
|
7
7
|
const isMatrix3x3 = isMatrix3x3$1;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as toFourDimensionalIndex } from '../shared/curvy.
|
|
1
|
+
import { n as toFourDimensionalIndex } from '../shared/curvy.DM6AiKbn.mjs';
|
|
2
2
|
import { d as dual, r as round, i as invariant, P as Pipeable } from '../shared/curvy.ChkqgKuv.mjs';
|
|
3
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.
|
|
5
|
-
import '../shared/curvy.
|
|
4
|
+
import { d as determinant$2, m as make$2 } from '../shared/curvy.bvP77ZZm.mjs';
|
|
5
|
+
import '../shared/curvy.DOSsf40r.mjs';
|
|
6
6
|
import '../shared/curvy.D7bhnwZy.mjs';
|
|
7
7
|
|
|
8
8
|
const Matrix4x4TypeId = Symbol.for("curvy/matrix4x4");
|
package/dist/path/cubic2d.d.mts
CHANGED
|
@@ -3,7 +3,7 @@ import { P as Pipeable } from '../shared/curvy.BN-oFBsc.mjs';
|
|
|
3
3
|
import { Vector2 } from '../vector/vector2.mjs';
|
|
4
4
|
import '../shared/curvy.CT38g_II.mjs';
|
|
5
5
|
import '../interval.mjs';
|
|
6
|
-
import '../shared/curvy.
|
|
6
|
+
import '../shared/curvy.DwHW5Fqt.mjs';
|
|
7
7
|
import '../vector/vector3.mjs';
|
|
8
8
|
import '../vector/vector4.mjs';
|
|
9
9
|
|
package/dist/path/cubic2d.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { P as Pipeable } from '../shared/curvy.BN-oFBsc.js';
|
|
|
3
3
|
import { Vector2 } from '../vector/vector2.js';
|
|
4
4
|
import '../shared/curvy.CT38g_II.js';
|
|
5
5
|
import '../interval.js';
|
|
6
|
-
import '../shared/curvy.
|
|
6
|
+
import '../shared/curvy.CkJRVnqj.js';
|
|
7
7
|
import '../vector/vector3.js';
|
|
8
8
|
import '../vector/vector4.js';
|
|
9
9
|
|
package/dist/path/cubic2d.mjs
CHANGED
|
@@ -3,14 +3,14 @@ import { d as dual, r as round, P as Pipeable } from '../shared/curvy.ChkqgKuv.m
|
|
|
3
3
|
import { unit } from '../interval.mjs';
|
|
4
4
|
import '../shared/curvy.DmVFTi0N.mjs';
|
|
5
5
|
import '../polynomial/cubic.mjs';
|
|
6
|
-
import '../shared/curvy.
|
|
7
|
-
import '../shared/curvy.
|
|
6
|
+
import '../shared/curvy.D7MEXd5g.mjs';
|
|
7
|
+
import '../shared/curvy.DB7nQmVs.mjs';
|
|
8
8
|
import '../polynomial/quadratic.mjs';
|
|
9
9
|
import '../vector/vector2.mjs';
|
|
10
|
-
import '../shared/curvy.
|
|
11
|
-
import '../curve/quadratic2d.mjs';
|
|
12
|
-
import '../polynomial/linear.mjs';
|
|
10
|
+
import '../shared/curvy.DOSsf40r.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 {
|
package/dist/path/linear2d.d.mts
CHANGED
|
@@ -3,7 +3,7 @@ import { P as Pipeable } from '../shared/curvy.BN-oFBsc.mjs';
|
|
|
3
3
|
import { Vector2 } from '../vector/vector2.mjs';
|
|
4
4
|
import '../shared/curvy.CT38g_II.mjs';
|
|
5
5
|
import '../interval.mjs';
|
|
6
|
-
import '../shared/curvy.
|
|
6
|
+
import '../shared/curvy.DwHW5Fqt.mjs';
|
|
7
7
|
import '../vector/vector3.mjs';
|
|
8
8
|
import '../vector/vector4.mjs';
|
|
9
9
|
|
package/dist/path/linear2d.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { P as Pipeable } from '../shared/curvy.BN-oFBsc.js';
|
|
|
3
3
|
import { Vector2 } from '../vector/vector2.js';
|
|
4
4
|
import '../shared/curvy.CT38g_II.js';
|
|
5
5
|
import '../interval.js';
|
|
6
|
-
import '../shared/curvy.
|
|
6
|
+
import '../shared/curvy.CkJRVnqj.js';
|
|
7
7
|
import '../vector/vector3.js';
|
|
8
8
|
import '../vector/vector4.js';
|
|
9
9
|
|
package/dist/path/linear2d.mjs
CHANGED
|
@@ -2,9 +2,9 @@ import { length as length$2, solve as solve$2 } from '../curve/linear2d.mjs';
|
|
|
2
2
|
import { d as dual, r as round, P as Pipeable } from '../shared/curvy.ChkqgKuv.mjs';
|
|
3
3
|
import { unit } from '../interval.mjs';
|
|
4
4
|
import '../polynomial/linear.mjs';
|
|
5
|
-
import '../shared/curvy.
|
|
5
|
+
import '../shared/curvy.DB7nQmVs.mjs';
|
|
6
6
|
import '../vector/vector2.mjs';
|
|
7
|
-
import '../shared/curvy.
|
|
7
|
+
import '../shared/curvy.DOSsf40r.mjs';
|
|
8
8
|
|
|
9
9
|
const LinearPath2dTypeId = Symbol("curvy/path/linear2d");
|
|
10
10
|
class LinearPath2dImpl extends Pipeable {
|
|
@@ -3,9 +3,10 @@ import { P as Pipeable } from '../shared/curvy.BN-oFBsc.mjs';
|
|
|
3
3
|
import { Vector2 } from '../vector/vector2.mjs';
|
|
4
4
|
import '../shared/curvy.CT38g_II.mjs';
|
|
5
5
|
import '../interval.mjs';
|
|
6
|
-
import '../shared/curvy.
|
|
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;
|
|
@@ -3,9 +3,10 @@ import { P as Pipeable } from '../shared/curvy.BN-oFBsc.js';
|
|
|
3
3
|
import { Vector2 } from '../vector/vector2.js';
|
|
4
4
|
import '../shared/curvy.CT38g_II.js';
|
|
5
5
|
import '../interval.js';
|
|
6
|
-
import '../shared/curvy.
|
|
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;
|
|
@@ -3,11 +3,11 @@ import { d as dual, r as round, P as Pipeable } from '../shared/curvy.ChkqgKuv.m
|
|
|
3
3
|
import { unit } from '../interval.mjs';
|
|
4
4
|
import '../shared/curvy.DmVFTi0N.mjs';
|
|
5
5
|
import '../polynomial/linear.mjs';
|
|
6
|
-
import '../shared/curvy.
|
|
6
|
+
import '../shared/curvy.DB7nQmVs.mjs';
|
|
7
7
|
import '../polynomial/quadratic.mjs';
|
|
8
|
-
import '../shared/curvy.
|
|
8
|
+
import '../shared/curvy.D7MEXd5g.mjs';
|
|
9
9
|
import '../vector/vector2.mjs';
|
|
10
|
-
import '../shared/curvy.
|
|
10
|
+
import '../shared/curvy.DOSsf40r.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.
|
|
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
5
|
import '../shared/curvy.CT38g_II.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.
|
|
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
5
|
import '../shared/curvy.CT38g_II.js';
|
|
6
6
|
import '../vector/vector2.js';
|
|
7
7
|
import '../vector/vector3.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { d as dual, r as round } from '../shared/curvy.ChkqgKuv.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.
|
|
5
|
-
import { m as monotonicity$2, a as make$3, l as length$2 } from '../shared/curvy.
|
|
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.D7MEXd5g.mjs';
|
|
5
|
+
import { m as monotonicity$2, a as make$3, l as length$2, s as solve$3 } from '../shared/curvy.DB7nQmVs.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,
|
|
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
5
|
import '../shared/curvy.CT38g_II.mjs';
|
|
6
6
|
import '../vector/vector3.mjs';
|
|
7
7
|
import '../vector/vector4.mjs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '../shared/curvy.BN-oFBsc.js';
|
|
2
2
|
import '../interval.js';
|
|
3
3
|
import '../vector/vector2.js';
|
|
4
|
-
export { L as LinearPolynomial,
|
|
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';
|
|
5
5
|
import '../shared/curvy.CT38g_II.js';
|
|
6
6
|
import '../vector/vector3.js';
|
|
7
7
|
import '../vector/vector4.js';
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
import { i as isLinearPolynomial$1, a as make$1, f as fromVector$1,
|
|
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.DB7nQmVs.mjs';
|
|
2
2
|
import '../shared/curvy.ChkqgKuv.mjs';
|
|
3
3
|
import '../interval.mjs';
|
|
4
4
|
|
|
5
5
|
const isLinearPolynomial = isLinearPolynomial$1;
|
|
6
6
|
const make = make$1;
|
|
7
7
|
const fromVector = fromVector$1;
|
|
8
|
+
const fromPointSlope = fromPointSlope$1;
|
|
9
|
+
const fromPoints = fromPoints$1;
|
|
8
10
|
const solve = solve$1;
|
|
9
11
|
const toSolver = toSolver$1;
|
|
10
12
|
const solveInverse = solveInverse$1;
|
|
11
13
|
const toInverseSolver = toInverseSolver$1;
|
|
12
14
|
const root = (p) => solveInverse$1(p, 0);
|
|
13
15
|
const monotonicity = monotonicity$1;
|
|
16
|
+
const derivative = derivative$1;
|
|
14
17
|
const antiderivative = antiderivative$1;
|
|
15
18
|
const domain = domain$1;
|
|
16
19
|
const range = range$1;
|
|
17
20
|
const length = length$1;
|
|
18
21
|
|
|
19
|
-
export { antiderivative, domain, fromVector, isLinearPolynomial, length, make, monotonicity, range, root, solve, solveInverse, toInverseSolver, toSolver };
|
|
22
|
+
export { antiderivative, derivative, domain, fromPointSlope, fromPoints, fromVector, isLinearPolynomial, length, make, monotonicity, range, root, 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/vector3.mjs';
|
|
4
|
-
export { Q as QuadraticPolynomial,
|
|
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';
|
|
5
5
|
import '../shared/curvy.CT38g_II.mjs';
|
|
6
6
|
import '../vector/vector2.mjs';
|
|
7
7
|
import '../vector/vector4.mjs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '../shared/curvy.BN-oFBsc.js';
|
|
2
2
|
import '../interval.js';
|
|
3
3
|
import '../vector/vector3.js';
|
|
4
|
-
export { Q as QuadraticPolynomial,
|
|
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';
|
|
5
5
|
import '../shared/curvy.CT38g_II.js';
|
|
6
6
|
import '../vector/vector2.js';
|
|
7
7
|
import '../vector/vector4.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
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,
|
|
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.D7MEXd5g.mjs';
|
|
2
2
|
import '../shared/curvy.ChkqgKuv.mjs';
|
|
3
3
|
import '../interval.mjs';
|
|
4
|
-
import '../shared/curvy.
|
|
4
|
+
import '../shared/curvy.DB7nQmVs.mjs';
|
|
5
5
|
|
|
6
6
|
const isQuadraticPolynomial = isQuadraticPolynomial$1;
|
|
7
7
|
const make = make$1;
|
|
@@ -18,5 +18,6 @@ const antiderivative = antiderivative$1;
|
|
|
18
18
|
const domain = domain$1;
|
|
19
19
|
const range = range$1;
|
|
20
20
|
const length = length$1;
|
|
21
|
+
const curvature = curvature$1;
|
|
21
22
|
|
|
22
|
-
export { antiderivative, derivative, domain, extreme, fromVector, isQuadraticPolynomial, length, make, monotonicity, range, roots, solve, solveInverse, toInverseSolver, toSolver };
|
|
23
|
+
export { antiderivative, curvature, derivative, domain, extreme, fromVector, isQuadraticPolynomial, length, make, monotonicity, range, roots, solve, solveInverse, toInverseSolver, toSolver };
|
|
@@ -35,7 +35,7 @@ declare const solveInverse$2: {
|
|
|
35
35
|
(y: number): (p: CubicPolynomial) => ZeroToThreeSolutions;
|
|
36
36
|
};
|
|
37
37
|
declare const toInverseSolver$2: (p: CubicPolynomial) => (y: number) => ZeroToThreeSolutions;
|
|
38
|
-
declare const derivative$
|
|
38
|
+
declare const derivative$2: (p: CubicPolynomial) => QuadraticPolynomial;
|
|
39
39
|
declare const roots$1: (p: CubicPolynomial) => ZeroToThreeSolutions;
|
|
40
40
|
declare const extrema: (p: CubicPolynomial) => ZeroToTwoSolutions;
|
|
41
41
|
declare const monotonicity$2: {
|
|
@@ -54,6 +54,10 @@ declare const length$2: {
|
|
|
54
54
|
(p: CubicPolynomial, domain: Interval): number;
|
|
55
55
|
(domain: Interval): (p: CubicPolynomial) => number;
|
|
56
56
|
};
|
|
57
|
+
declare const curvature$1: {
|
|
58
|
+
(p: CubicPolynomial, x: number): number;
|
|
59
|
+
(x: number): (p: CubicPolynomial) => number;
|
|
60
|
+
};
|
|
57
61
|
|
|
58
62
|
declare const QuadraticPolynomialTypeId: unique symbol;
|
|
59
63
|
type QuadraticPolynomialTypeId = typeof QuadraticPolynomialTypeId;
|
|
@@ -77,7 +81,7 @@ declare const solveInverse$1: {
|
|
|
77
81
|
(y: number): (p: QuadraticPolynomial) => ZeroToTwoSolutions;
|
|
78
82
|
};
|
|
79
83
|
declare const toInverseSolver$1: (p: QuadraticPolynomial) => (y: number) => ZeroToTwoSolutions;
|
|
80
|
-
declare const derivative: (p: QuadraticPolynomial) => LinearPolynomial;
|
|
84
|
+
declare const derivative$1: (p: QuadraticPolynomial) => LinearPolynomial;
|
|
81
85
|
declare const roots: (p: QuadraticPolynomial) => ZeroToTwoSolutions;
|
|
82
86
|
declare const extreme: (p: QuadraticPolynomial) => ZeroOrOneSolution;
|
|
83
87
|
declare const monotonicity$1: {
|
|
@@ -100,6 +104,10 @@ declare const length$1: {
|
|
|
100
104
|
(p: QuadraticPolynomial, i: Interval): number;
|
|
101
105
|
(i: Interval): (p: QuadraticPolynomial) => number;
|
|
102
106
|
};
|
|
107
|
+
declare const curvature: {
|
|
108
|
+
(p: QuadraticPolynomial, x: number): number;
|
|
109
|
+
(x: number): (p: QuadraticPolynomial) => number;
|
|
110
|
+
};
|
|
103
111
|
|
|
104
112
|
declare const LinearPolynomialTypeId: unique symbol;
|
|
105
113
|
type LinearPolynomialTypeId = typeof LinearPolynomialTypeId;
|
|
@@ -112,6 +120,8 @@ interface LinearPolynomial extends Pipeable {
|
|
|
112
120
|
declare const isLinearPolynomial: (v: unknown) => v is LinearPolynomial;
|
|
113
121
|
declare const make: (c0?: number, c1?: number) => LinearPolynomial;
|
|
114
122
|
declare const fromVector: (v: Vector2) => LinearPolynomial;
|
|
123
|
+
declare const fromPointSlope: (p: Vector2, slope: number) => LinearPolynomial;
|
|
124
|
+
declare const fromPoints: (p1: Vector2, p2: Vector2) => LinearPolynomial;
|
|
115
125
|
declare const solve: {
|
|
116
126
|
(p: LinearPolynomial, x: number): number;
|
|
117
127
|
(x: number): (p: LinearPolynomial) => number;
|
|
@@ -124,6 +134,7 @@ declare const solveInverse: {
|
|
|
124
134
|
declare const toInverseSolver: (p: LinearPolynomial) => (y: number) => ZeroOrOneSolution;
|
|
125
135
|
declare const root: (p: LinearPolynomial) => ZeroOrOneSolution;
|
|
126
136
|
declare const monotonicity: (p: LinearPolynomial) => GuaranteedMonotonicity;
|
|
137
|
+
declare const derivative: (p: LinearPolynomial) => number;
|
|
127
138
|
declare const antiderivative: {
|
|
128
139
|
(p: LinearPolynomial, constant?: number): QuadraticPolynomial;
|
|
129
140
|
(constant: number): (p: LinearPolynomial) => QuadraticPolynomial;
|
|
@@ -141,4 +152,4 @@ declare const length: {
|
|
|
141
152
|
(domain: Interval): (p: LinearPolynomial) => number;
|
|
142
153
|
};
|
|
143
154
|
|
|
144
|
-
export {
|
|
155
|
+
export { antiderivative$1 as A, domain$1 as B, type CubicPolynomial as C, range$1 as D, length$1 as E, curvature as F, isLinearPolynomial as G, make as H, fromVector as I, fromPointSlope as J, fromPoints as K, type LinearPolynomial as L, solve as M, toSolver as N, solveInverse as O, toInverseSolver as P, type QuadraticPolynomial as Q, root as R, monotonicity as S, derivative as T, antiderivative as U, domain as V, range as W, length as X, solveInverse$2 as a, toInverseSolver$2 as b, monotonicity$2 as c, derivative$2 as d, extrema as e, fromVector$2 as f, domain$2 as g, range$2 as h, isCubicPolynomial as i, curvature$1 as j, isQuadraticPolynomial as k, length$2 as l, make$2 as m, make$1 as n, fromVector$1 as o, solve$1 as p, toSolver$1 as q, roots$1 as r, solve$2 as s, toSolver$2 as t, solveInverse$1 as u, toInverseSolver$1 as v, derivative$1 as w, roots as x, extreme as y, monotonicity$1 as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { P as Pipeable, r as round, d as dual } from './curvy.ChkqgKuv.mjs';
|
|
2
2
|
import { size, contains, fromMinMax } from '../interval.mjs';
|
|
3
|
-
import { Q as QuadraticPolynomialImpl, b as QuadraticPolynomialTypeId, a as make$1,
|
|
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.DB7nQmVs.mjs';
|
|
4
4
|
|
|
5
5
|
const CubicPolynomialTypeId = Symbol.for(
|
|
6
6
|
"curvy/polynomial/cubic"
|
|
@@ -120,5 +120,11 @@ const length = dual(2, (p, domain2) => {
|
|
|
120
120
|
const evalEnd = (derivativeEnd * sqrtEnd + Math.log(Math.abs(derivativeEnd + sqrtEnd))) / (4 * p.c2);
|
|
121
121
|
return round(evalEnd - evalStart);
|
|
122
122
|
});
|
|
123
|
+
const curvature = dual(
|
|
124
|
+
2,
|
|
125
|
+
(p, x) => round(
|
|
126
|
+
Math.abs(2 * p.c2) / (1 + (solve$1(derivative(p), x) ** 2) ** 1.5)
|
|
127
|
+
)
|
|
128
|
+
);
|
|
123
129
|
|
|
124
|
-
export { CubicPolynomialImpl as C, CubicPolynomialTypeId as a, monotonicity as b, solve as c,
|
|
130
|
+
export { CubicPolynomialImpl as C, CubicPolynomialTypeId as a, monotonicity as b, solve as c, derivative as d, toInverseSolver as e, fromVector as f, guaranteedMonotonicityFromComparison as g, extreme as h, isQuadraticPolynomial as i, antiderivative as j, domain as k, length as l, make as m, range as n, curvature as o, roots as r, solveInverse as s, toSolver as t };
|
|
@@ -31,6 +31,8 @@ class LinearPolynomialImpl extends Pipeable {
|
|
|
31
31
|
const isLinearPolynomial = (v) => typeof v === "object" && v !== null && LinearPolynomialTypeId in v;
|
|
32
32
|
const make = (c0 = 0, c1 = 0) => new LinearPolynomialImpl(c0, c1);
|
|
33
33
|
const fromVector = (v) => new LinearPolynomialImpl(v.x, v.y);
|
|
34
|
+
const fromPointSlope = (p, slope) => new LinearPolynomialImpl(p.y - slope * p.x, slope);
|
|
35
|
+
const fromPoints = (p1, p2) => fromPointSlope(p1, (p2.y - p1.y) / (p2.x - p1.x));
|
|
34
36
|
const solve = dual(2, (p, x) => round(p.c0 + x * p.c1));
|
|
35
37
|
const toSolver = (p) => (x) => solve(p, x);
|
|
36
38
|
const solveInverse = dual(2, (p, y) => {
|
|
@@ -41,6 +43,7 @@ const solveInverse = dual(2, (p, y) => {
|
|
|
41
43
|
});
|
|
42
44
|
const toInverseSolver = (p) => (y) => solveInverse(p, y);
|
|
43
45
|
const monotonicity = (p) => p.c1 === 0 ? "constant" : p.c1 > 0 ? "increasing" : "decreasing";
|
|
46
|
+
const derivative = (p) => p.c1;
|
|
44
47
|
const antiderivative = dual(
|
|
45
48
|
(args) => isLinearPolynomial(args[0]),
|
|
46
49
|
(p, integrationConstant = 0) => new QuadraticPolynomialImpl(integrationConstant, p.c0, p.c1 / 2)
|
|
@@ -73,4 +76,4 @@ const length = dual(2, (p, domain2) => {
|
|
|
73
76
|
return round(Math.sqrt(1 + p.c1 ** 2) * size(domain2));
|
|
74
77
|
});
|
|
75
78
|
|
|
76
|
-
export { QuadraticPolynomialImpl as Q, make as a, QuadraticPolynomialTypeId as b,
|
|
79
|
+
export { QuadraticPolynomialImpl as Q, make as a, QuadraticPolynomialTypeId as b, solveInverse as c, fromPointSlope as d, fromPoints as e, fromVector as f, toInverseSolver as g, derivative as h, isLinearPolynomial as i, antiderivative as j, domain as k, length as l, monotonicity as m, range as r, solve as s, toSolver as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as invariant, d as dual, r as round, P as Pipeable } from './curvy.ChkqgKuv.mjs';
|
|
2
|
-
import { m as make$1, d as dot } from './curvy.
|
|
2
|
+
import { m as make$1, d as dot } from './curvy.DOSsf40r.mjs';
|
|
3
3
|
|
|
4
4
|
function toIndex(input) {
|
|
5
5
|
if (typeof input === "number") {
|
|
@@ -34,6 +34,7 @@ const normalize = (vector) => {
|
|
|
34
34
|
return make(vector.x / m, vector.y / m);
|
|
35
35
|
};
|
|
36
36
|
const dot = dual(2, (a, b) => round(a.x * b.x + a.y * b.y));
|
|
37
|
+
const cross = dual(2, (a, b) => round(a.x * b.y - a.y * b.x));
|
|
37
38
|
const softmax = (v) => {
|
|
38
39
|
const max = Math.max(v.x, v.y);
|
|
39
40
|
const v0 = Math.exp(v.x - max);
|
|
@@ -45,4 +46,4 @@ const add = dual(2, (a, b) => make(a.x + b.x, a.y + b.y));
|
|
|
45
46
|
const subtract = dual(2, (a, b) => make(a.x - b.x, a.y - b.y));
|
|
46
47
|
const hadamard = dual(2, (a, b) => make(a.x * b.x, a.y * b.y));
|
|
47
48
|
|
|
48
|
-
export { magnitude as a,
|
|
49
|
+
export { magnitude as a, components as b, cross as c, dot as d, add as e, subtract as f, hadamard as h, isVector2 as i, make as m, normalize as n, softmax as s };
|
|
@@ -35,7 +35,7 @@ declare const solveInverse$2: {
|
|
|
35
35
|
(y: number): (p: CubicPolynomial) => ZeroToThreeSolutions;
|
|
36
36
|
};
|
|
37
37
|
declare const toInverseSolver$2: (p: CubicPolynomial) => (y: number) => ZeroToThreeSolutions;
|
|
38
|
-
declare const derivative$
|
|
38
|
+
declare const derivative$2: (p: CubicPolynomial) => QuadraticPolynomial;
|
|
39
39
|
declare const roots$1: (p: CubicPolynomial) => ZeroToThreeSolutions;
|
|
40
40
|
declare const extrema: (p: CubicPolynomial) => ZeroToTwoSolutions;
|
|
41
41
|
declare const monotonicity$2: {
|
|
@@ -54,6 +54,10 @@ declare const length$2: {
|
|
|
54
54
|
(p: CubicPolynomial, domain: Interval): number;
|
|
55
55
|
(domain: Interval): (p: CubicPolynomial) => number;
|
|
56
56
|
};
|
|
57
|
+
declare const curvature$1: {
|
|
58
|
+
(p: CubicPolynomial, x: number): number;
|
|
59
|
+
(x: number): (p: CubicPolynomial) => number;
|
|
60
|
+
};
|
|
57
61
|
|
|
58
62
|
declare const QuadraticPolynomialTypeId: unique symbol;
|
|
59
63
|
type QuadraticPolynomialTypeId = typeof QuadraticPolynomialTypeId;
|
|
@@ -77,7 +81,7 @@ declare const solveInverse$1: {
|
|
|
77
81
|
(y: number): (p: QuadraticPolynomial) => ZeroToTwoSolutions;
|
|
78
82
|
};
|
|
79
83
|
declare const toInverseSolver$1: (p: QuadraticPolynomial) => (y: number) => ZeroToTwoSolutions;
|
|
80
|
-
declare const derivative: (p: QuadraticPolynomial) => LinearPolynomial;
|
|
84
|
+
declare const derivative$1: (p: QuadraticPolynomial) => LinearPolynomial;
|
|
81
85
|
declare const roots: (p: QuadraticPolynomial) => ZeroToTwoSolutions;
|
|
82
86
|
declare const extreme: (p: QuadraticPolynomial) => ZeroOrOneSolution;
|
|
83
87
|
declare const monotonicity$1: {
|
|
@@ -100,6 +104,10 @@ declare const length$1: {
|
|
|
100
104
|
(p: QuadraticPolynomial, i: Interval): number;
|
|
101
105
|
(i: Interval): (p: QuadraticPolynomial) => number;
|
|
102
106
|
};
|
|
107
|
+
declare const curvature: {
|
|
108
|
+
(p: QuadraticPolynomial, x: number): number;
|
|
109
|
+
(x: number): (p: QuadraticPolynomial) => number;
|
|
110
|
+
};
|
|
103
111
|
|
|
104
112
|
declare const LinearPolynomialTypeId: unique symbol;
|
|
105
113
|
type LinearPolynomialTypeId = typeof LinearPolynomialTypeId;
|
|
@@ -112,6 +120,8 @@ interface LinearPolynomial extends Pipeable {
|
|
|
112
120
|
declare const isLinearPolynomial: (v: unknown) => v is LinearPolynomial;
|
|
113
121
|
declare const make: (c0?: number, c1?: number) => LinearPolynomial;
|
|
114
122
|
declare const fromVector: (v: Vector2) => LinearPolynomial;
|
|
123
|
+
declare const fromPointSlope: (p: Vector2, slope: number) => LinearPolynomial;
|
|
124
|
+
declare const fromPoints: (p1: Vector2, p2: Vector2) => LinearPolynomial;
|
|
115
125
|
declare const solve: {
|
|
116
126
|
(p: LinearPolynomial, x: number): number;
|
|
117
127
|
(x: number): (p: LinearPolynomial) => number;
|
|
@@ -124,6 +134,7 @@ declare const solveInverse: {
|
|
|
124
134
|
declare const toInverseSolver: (p: LinearPolynomial) => (y: number) => ZeroOrOneSolution;
|
|
125
135
|
declare const root: (p: LinearPolynomial) => ZeroOrOneSolution;
|
|
126
136
|
declare const monotonicity: (p: LinearPolynomial) => GuaranteedMonotonicity;
|
|
137
|
+
declare const derivative: (p: LinearPolynomial) => number;
|
|
127
138
|
declare const antiderivative: {
|
|
128
139
|
(p: LinearPolynomial, constant?: number): QuadraticPolynomial;
|
|
129
140
|
(constant: number): (p: LinearPolynomial) => QuadraticPolynomial;
|
|
@@ -141,4 +152,4 @@ declare const length: {
|
|
|
141
152
|
(domain: Interval): (p: LinearPolynomial) => number;
|
|
142
153
|
};
|
|
143
154
|
|
|
144
|
-
export {
|
|
155
|
+
export { antiderivative$1 as A, domain$1 as B, type CubicPolynomial as C, range$1 as D, length$1 as E, curvature as F, isLinearPolynomial as G, make as H, fromVector as I, fromPointSlope as J, fromPoints as K, type LinearPolynomial as L, solve as M, toSolver as N, solveInverse as O, toInverseSolver as P, type QuadraticPolynomial as Q, root as R, monotonicity as S, derivative as T, antiderivative as U, domain as V, range as W, length as X, solveInverse$2 as a, toInverseSolver$2 as b, monotonicity$2 as c, derivative$2 as d, extrema as e, fromVector$2 as f, domain$2 as g, range$2 as h, isCubicPolynomial as i, curvature$1 as j, isQuadraticPolynomial as k, length$2 as l, make$2 as m, make$1 as n, fromVector$1 as o, solve$1 as p, toSolver$1 as q, roots$1 as r, solve$2 as s, toSolver$2 as t, solveInverse$1 as u, toInverseSolver$1 as v, derivative$1 as w, roots as x, extreme as y, monotonicity$1 as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as toThreeDimensionalIndex, d as determinant$1, m as make$1 } from './curvy.
|
|
1
|
+
import { o as toThreeDimensionalIndex, d as determinant$1, m as make$1 } from './curvy.DM6AiKbn.mjs';
|
|
2
2
|
import { d as dual, r as round, i as invariant, P as Pipeable } from './curvy.ChkqgKuv.mjs';
|
|
3
3
|
import { c as components, m as make$2, d as dot } from './curvy.D7bhnwZy.mjs';
|
|
4
4
|
|
|
@@ -4,7 +4,7 @@ import { Vector2 } from '../vector/vector2.mjs';
|
|
|
4
4
|
import '../curve/cubic2d.mjs';
|
|
5
5
|
import '../shared/curvy.CT38g_II.mjs';
|
|
6
6
|
import '../interval.mjs';
|
|
7
|
-
import '../shared/curvy.
|
|
7
|
+
import '../shared/curvy.DwHW5Fqt.mjs';
|
|
8
8
|
import '../vector/vector3.mjs';
|
|
9
9
|
import '../vector/vector4.mjs';
|
|
10
10
|
|
|
@@ -22,14 +22,22 @@ declare const append: {
|
|
|
22
22
|
(p1: Vector2, p2: Vector2, p3: Vector2): (p: Bezier2d) => Bezier2d;
|
|
23
23
|
(p: Bezier2d, p1: Vector2, p2: Vector2, p3: Vector2): Bezier2d;
|
|
24
24
|
};
|
|
25
|
-
declare const
|
|
25
|
+
declare const appendTangentAligned: {
|
|
26
26
|
(ratio: number, p2: Vector2, p3: Vector2): (p: Bezier2d) => Bezier2d;
|
|
27
27
|
(p: Bezier2d, ratio: number, p2: Vector2, p3: Vector2): Bezier2d;
|
|
28
28
|
};
|
|
29
|
-
declare const
|
|
29
|
+
declare const appendCurvatureMirrored: {
|
|
30
|
+
(a: number, b: number, p6: Vector2): (p: Bezier2d) => Bezier2d;
|
|
31
|
+
(p: Bezier2d, a: number, b: number, p6: Vector2): Bezier2d;
|
|
32
|
+
};
|
|
33
|
+
declare const appendVelocityAligned: {
|
|
30
34
|
(p2: Vector2, p3: Vector2): (p: Bezier2d) => Bezier2d;
|
|
31
35
|
(p: Bezier2d, p2: Vector2, p3: Vector2): Bezier2d;
|
|
32
36
|
};
|
|
37
|
+
declare const appendAccelerationAligned: {
|
|
38
|
+
(p3: Vector2): (p: Bezier2d) => Bezier2d;
|
|
39
|
+
(p: Bezier2d, p3: Vector2): Bezier2d;
|
|
40
|
+
};
|
|
33
41
|
declare const toPath: (p: Bezier2d) => CubicPath2d;
|
|
34
42
|
|
|
35
|
-
export { type Bezier2d, append,
|
|
43
|
+
export { type Bezier2d, append, appendAccelerationAligned, appendCurvatureMirrored, appendTangentAligned, appendVelocityAligned, fromArray, isCubicBezier2d, make, toPath };
|
|
@@ -4,7 +4,7 @@ import { Vector2 } from '../vector/vector2.js';
|
|
|
4
4
|
import '../curve/cubic2d.js';
|
|
5
5
|
import '../shared/curvy.CT38g_II.js';
|
|
6
6
|
import '../interval.js';
|
|
7
|
-
import '../shared/curvy.
|
|
7
|
+
import '../shared/curvy.CkJRVnqj.js';
|
|
8
8
|
import '../vector/vector3.js';
|
|
9
9
|
import '../vector/vector4.js';
|
|
10
10
|
|
|
@@ -22,14 +22,22 @@ declare const append: {
|
|
|
22
22
|
(p1: Vector2, p2: Vector2, p3: Vector2): (p: Bezier2d) => Bezier2d;
|
|
23
23
|
(p: Bezier2d, p1: Vector2, p2: Vector2, p3: Vector2): Bezier2d;
|
|
24
24
|
};
|
|
25
|
-
declare const
|
|
25
|
+
declare const appendTangentAligned: {
|
|
26
26
|
(ratio: number, p2: Vector2, p3: Vector2): (p: Bezier2d) => Bezier2d;
|
|
27
27
|
(p: Bezier2d, ratio: number, p2: Vector2, p3: Vector2): Bezier2d;
|
|
28
28
|
};
|
|
29
|
-
declare const
|
|
29
|
+
declare const appendCurvatureMirrored: {
|
|
30
|
+
(a: number, b: number, p6: Vector2): (p: Bezier2d) => Bezier2d;
|
|
31
|
+
(p: Bezier2d, a: number, b: number, p6: Vector2): Bezier2d;
|
|
32
|
+
};
|
|
33
|
+
declare const appendVelocityAligned: {
|
|
30
34
|
(p2: Vector2, p3: Vector2): (p: Bezier2d) => Bezier2d;
|
|
31
35
|
(p: Bezier2d, p2: Vector2, p3: Vector2): Bezier2d;
|
|
32
36
|
};
|
|
37
|
+
declare const appendAccelerationAligned: {
|
|
38
|
+
(p3: Vector2): (p: Bezier2d) => Bezier2d;
|
|
39
|
+
(p: Bezier2d, p3: Vector2): Bezier2d;
|
|
40
|
+
};
|
|
33
41
|
declare const toPath: (p: Bezier2d) => CubicPath2d;
|
|
34
42
|
|
|
35
|
-
export { type Bezier2d, append,
|
|
43
|
+
export { type Bezier2d, append, appendAccelerationAligned, appendCurvatureMirrored, appendTangentAligned, appendVelocityAligned, fromArray, isCubicBezier2d, make, toPath };
|
|
@@ -8,15 +8,15 @@ import { make as make$4 } from '../vector/vector4.mjs';
|
|
|
8
8
|
import '../interval.mjs';
|
|
9
9
|
import '../shared/curvy.DmVFTi0N.mjs';
|
|
10
10
|
import '../polynomial/quadratic.mjs';
|
|
11
|
-
import '../shared/curvy.
|
|
12
|
-
import '../shared/curvy.
|
|
13
|
-
import '../curve/quadratic2d.mjs';
|
|
14
|
-
import '../polynomial/linear.mjs';
|
|
11
|
+
import '../shared/curvy.D7MEXd5g.mjs';
|
|
12
|
+
import '../shared/curvy.DB7nQmVs.mjs';
|
|
15
13
|
import '../curve/linear2d.mjs';
|
|
16
|
-
import '../
|
|
17
|
-
import '../
|
|
14
|
+
import '../polynomial/linear.mjs';
|
|
15
|
+
import '../curve/quadratic2d.mjs';
|
|
16
|
+
import '../shared/curvy.DM6AiKbn.mjs';
|
|
17
|
+
import '../shared/curvy.DOSsf40r.mjs';
|
|
18
18
|
import '../shared/curvy.Cty3LrOR.mjs';
|
|
19
|
-
import '../shared/curvy.
|
|
19
|
+
import '../shared/curvy.bvP77ZZm.mjs';
|
|
20
20
|
import '../shared/curvy.D7bhnwZy.mjs';
|
|
21
21
|
|
|
22
22
|
const characteristic = make$2(
|
|
@@ -63,17 +63,41 @@ const append$1 = dual(
|
|
|
63
63
|
(p instanceof Bezier2dImpl ? p.points : Array.from(p)).concat(p1, p2, p3)
|
|
64
64
|
)
|
|
65
65
|
);
|
|
66
|
-
const
|
|
66
|
+
const appendTangentAligned$1 = dual(4, (p, a, p5, p6) => {
|
|
67
67
|
const points = p instanceof Bezier2dImpl ? p.points : Array.from(p);
|
|
68
68
|
const p2 = points[points.length - 2];
|
|
69
69
|
const p3 = points[points.length - 1];
|
|
70
|
-
const p4 = make$3(
|
|
70
|
+
const p4 = make$3(p3.x + (p3.x - p2.x) * a, p3.y + (p3.y - p2.y) * a);
|
|
71
71
|
return append$1(p, p4, p5, p6);
|
|
72
72
|
});
|
|
73
|
-
const
|
|
73
|
+
const appendCurvatureAligned = dual(
|
|
74
|
+
4,
|
|
75
|
+
(p, a, b, p6) => {
|
|
76
|
+
const points = p instanceof Bezier2dImpl ? p.points : Array.from(p);
|
|
77
|
+
const p1 = points[points.length - 3];
|
|
78
|
+
const p2 = points[points.length - 2];
|
|
79
|
+
const p3 = points[points.length - 1];
|
|
80
|
+
const p4 = make$3(p3.x + (p3.x - p2.x) * a, p3.y + (p3.y - p2.y) * a);
|
|
81
|
+
const p5 = make$3(
|
|
82
|
+
p3.x + (p3.x - p2.x) * (2 * a + a ** 2 + b / 2) + (p1.x - p2.x) * a ** 2,
|
|
83
|
+
p3.y + (p3.y - p2.y) * (2 * a + a ** 2 + b / 2) + (p1.y - p2.y) * a ** 2
|
|
84
|
+
);
|
|
85
|
+
return append$1(p, p4, p5, p6);
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
const appendVelocityAligned$1 = dual(
|
|
74
89
|
3,
|
|
75
|
-
(p, p5, p6) =>
|
|
90
|
+
(p, p5, p6) => appendTangentAligned$1(p, 1, p5, p6)
|
|
76
91
|
);
|
|
92
|
+
const appendAccelerationAligned$1 = dual(2, (p, p6) => {
|
|
93
|
+
const points = p instanceof Bezier2dImpl ? p.points : Array.from(p);
|
|
94
|
+
const p1 = points[points.length - 3];
|
|
95
|
+
const p2 = points[points.length - 2];
|
|
96
|
+
const p3 = points[points.length - 1];
|
|
97
|
+
const p4 = make$3(2 * p3.x - p2.x, 2 * p3.y - p2.y);
|
|
98
|
+
const p5 = make$3(p1.x + 4 * (p3.x - p2.x), p1.y + 4 * (p3.y - p2.y));
|
|
99
|
+
return append$1(p, p4, p5, p6);
|
|
100
|
+
});
|
|
77
101
|
function* toCurves(points) {
|
|
78
102
|
let p0;
|
|
79
103
|
let p1;
|
|
@@ -115,8 +139,10 @@ const make = make$1;
|
|
|
115
139
|
const fromArray = fromArray$1;
|
|
116
140
|
const isCubicBezier2d = isCubicBezier2d$1;
|
|
117
141
|
const append = append$1;
|
|
118
|
-
const
|
|
119
|
-
const
|
|
142
|
+
const appendTangentAligned = appendTangentAligned$1;
|
|
143
|
+
const appendCurvatureMirrored = appendCurvatureAligned;
|
|
144
|
+
const appendVelocityAligned = appendVelocityAligned$1;
|
|
145
|
+
const appendAccelerationAligned = appendAccelerationAligned$1;
|
|
120
146
|
const toPath = toPath$1;
|
|
121
147
|
|
|
122
|
-
export { append,
|
|
148
|
+
export { append, appendAccelerationAligned, appendCurvatureMirrored, appendTangentAligned, appendVelocityAligned, fromArray, isCubicBezier2d, make, toPath };
|
|
@@ -18,6 +18,10 @@ declare const dot: {
|
|
|
18
18
|
(a: Vector2, b: Vector2): number;
|
|
19
19
|
(b: Vector2): (a: Vector2) => number;
|
|
20
20
|
};
|
|
21
|
+
declare const cross: {
|
|
22
|
+
(a: Vector2, b: Vector2): number;
|
|
23
|
+
(b: Vector2): (a: Vector2) => number;
|
|
24
|
+
};
|
|
21
25
|
declare const components: (v: Vector2) => [number, number];
|
|
22
26
|
declare const softmax: (v: Vector2) => Vector2;
|
|
23
27
|
declare const zero: Vector2;
|
|
@@ -34,4 +38,4 @@ declare const hadamard: {
|
|
|
34
38
|
(b: Vector2): (a: Vector2) => Vector2;
|
|
35
39
|
};
|
|
36
40
|
|
|
37
|
-
export { type Vector2, add, components, dot, hadamard, isVector2, magnitude, make, normalize, softmax, subtract, zero };
|
|
41
|
+
export { type Vector2, add, components, cross, dot, hadamard, isVector2, magnitude, make, normalize, softmax, subtract, zero };
|
package/dist/vector/vector2.d.ts
CHANGED
|
@@ -18,6 +18,10 @@ declare const dot: {
|
|
|
18
18
|
(a: Vector2, b: Vector2): number;
|
|
19
19
|
(b: Vector2): (a: Vector2) => number;
|
|
20
20
|
};
|
|
21
|
+
declare const cross: {
|
|
22
|
+
(a: Vector2, b: Vector2): number;
|
|
23
|
+
(b: Vector2): (a: Vector2) => number;
|
|
24
|
+
};
|
|
21
25
|
declare const components: (v: Vector2) => [number, number];
|
|
22
26
|
declare const softmax: (v: Vector2) => Vector2;
|
|
23
27
|
declare const zero: Vector2;
|
|
@@ -34,4 +38,4 @@ declare const hadamard: {
|
|
|
34
38
|
(b: Vector2): (a: Vector2) => Vector2;
|
|
35
39
|
};
|
|
36
40
|
|
|
37
|
-
export { type Vector2, add, components, dot, hadamard, isVector2, magnitude, make, normalize, softmax, subtract, zero };
|
|
41
|
+
export { type Vector2, add, components, cross, dot, hadamard, isVector2, magnitude, make, normalize, softmax, subtract, zero };
|
package/dist/vector/vector2.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as isVector2$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,
|
|
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 } from '../shared/curvy.DOSsf40r.mjs';
|
|
2
2
|
import '../shared/curvy.ChkqgKuv.mjs';
|
|
3
3
|
|
|
4
4
|
const isVector2 = isVector2$1;
|
|
@@ -6,6 +6,7 @@ const make = make$1;
|
|
|
6
6
|
const magnitude = magnitude$1;
|
|
7
7
|
const normalize = normalize$1;
|
|
8
8
|
const dot = dot$1;
|
|
9
|
+
const cross = cross$1;
|
|
9
10
|
const components = components$1;
|
|
10
11
|
const softmax = softmax$1;
|
|
11
12
|
const zero = make(0);
|
|
@@ -13,4 +14,4 @@ const add = add$1;
|
|
|
13
14
|
const subtract = subtract$1;
|
|
14
15
|
const hadamard = hadamard$1;
|
|
15
16
|
|
|
16
|
-
export { add, components, dot, hadamard, isVector2, magnitude, make, normalize, softmax, subtract, zero };
|
|
17
|
+
export { add, components, cross, dot, hadamard, isVector2, magnitude, make, normalize, softmax, subtract, zero };
|