@ac-kit/math-curves 0.2.0 → 0.2.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/CHANGELOG.md +34 -0
- package/README.md +6 -3
- package/dist/spline2.d.ts +29 -16
- package/dist/spline2.d.ts.map +1 -1
- package/dist/spline2.js +164 -98
- package/dist/spline2.js.map +1 -1
- package/package.json +6 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# @ac-kit/math-curves
|
|
2
2
|
|
|
3
|
+
## 0.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0b4fe43: `monotoneCubicSpline2`, `naturalCubicSpline2`, `uniformBSpline2` and
|
|
8
|
+
`cardinalSpline2` allocate nothing: the first two no longer keep tangents and
|
|
9
|
+
moments in arrays of their own. `out` may still share memory with `points`, at
|
|
10
|
+
any offset and even through two wrappers of one `SharedArrayBuffer`; the points
|
|
11
|
+
are then copied into a buffer the module keeps and grows to the largest such
|
|
12
|
+
input, so only an overlapping input larger than any before allocates. The
|
|
13
|
+
samples are unchanged but for the last bits of the natural spline's.
|
|
14
|
+
- Updated dependencies [0b4fe43]
|
|
15
|
+
- Updated dependencies [0b4fe43]
|
|
16
|
+
- Updated dependencies [0b4fe43]
|
|
17
|
+
- Updated dependencies [0b4fe43]
|
|
18
|
+
- Updated dependencies [0b4fe43]
|
|
19
|
+
- Updated dependencies [0b4fe43]
|
|
20
|
+
- Updated dependencies [0b4fe43]
|
|
21
|
+
- Updated dependencies [0b4fe43]
|
|
22
|
+
- Updated dependencies [0b4fe43]
|
|
23
|
+
- Updated dependencies [0b4fe43]
|
|
24
|
+
- Updated dependencies [0b4fe43]
|
|
25
|
+
- Updated dependencies [0b4fe43]
|
|
26
|
+
- Updated dependencies [0b4fe43]
|
|
27
|
+
- Updated dependencies [0b4fe43]
|
|
28
|
+
- Updated dependencies [0b4fe43]
|
|
29
|
+
- Updated dependencies [0b4fe43]
|
|
30
|
+
- Updated dependencies [0b4fe43]
|
|
31
|
+
- Updated dependencies [0b4fe43]
|
|
32
|
+
- Updated dependencies [0b4fe43]
|
|
33
|
+
- Updated dependencies [0b4fe43]
|
|
34
|
+
- @ac-kit/core@0.13.0
|
|
35
|
+
- @ac-kit/math-linear@0.4.0
|
|
36
|
+
|
|
3
37
|
## 0.2.0
|
|
4
38
|
|
|
5
39
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -49,9 +49,12 @@ gives the single chord. Only a bad `offset` or a short `out` throws.
|
|
|
49
49
|
|
|
50
50
|
The spline samplers write the first point, then `samples` points per span, the
|
|
51
51
|
last of each span exactly its end point (`((n − 1) · samples + 1) · 2`
|
|
52
|
-
numbers). Flat runs stay exactly flat
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
numbers). Flat runs stay exactly flat. They allocate nothing: the tangents
|
|
53
|
+
and the natural spline's elimination are kept in `out` until the samples
|
|
54
|
+
replace them. `out` may share memory with `points`, even through two wrappers
|
|
55
|
+
of one `SharedArrayBuffer`; the points are then copied first, into a buffer the
|
|
56
|
+
module keeps and grows to the largest such input, so only a larger
|
|
57
|
+
overlapping input than any before allocates.
|
|
55
58
|
|
|
56
59
|
## Range of the arithmetic
|
|
57
60
|
|
package/dist/spline2.d.ts
CHANGED
|
@@ -16,11 +16,14 @@
|
|
|
16
16
|
* curve; steps whose ratio leaves [1e−150, 1e150] (a subnormal step beside a
|
|
17
17
|
* unit one) can overflow a slope.
|
|
18
18
|
*
|
|
19
|
-
* Complexity: O(n · samples) time,
|
|
19
|
+
* Complexity: O(n · samples) time, no allocation: the tangents are kept in
|
|
20
|
+
* `out` until the samples replace them (see `out` for the overlapping case).
|
|
20
21
|
*
|
|
21
22
|
* @param out - Destination, ((n − 1) · samples + 1) points; longer is allowed
|
|
22
|
-
* and the rest is left untouched. May share memory with `points
|
|
23
|
-
* are then copied
|
|
23
|
+
* and the rest is left untouched. May share memory with `points`, even
|
|
24
|
+
* through two wrappers of one `SharedArrayBuffer`: the points are then copied
|
|
25
|
+
* first, into a buffer this module keeps and grows to the largest such input
|
|
26
|
+
* (the only allocation).
|
|
24
27
|
* @param points - N points, 2 numbers (x, y) each.
|
|
25
28
|
* @param samples - Points per span, a positive integer.
|
|
26
29
|
* @returns `out`.
|
|
@@ -32,16 +35,20 @@ export declare function monotoneCubicSpline2<T extends Float64Array>(out: T, poi
|
|
|
32
35
|
* Samples the natural cubic spline through the points: the `C²` piecewise cubic
|
|
33
36
|
* that interpolates every point with zero second derivative at both ends, as a
|
|
34
37
|
* parametric curve `(x(s), y(s))` with the points at integer parameters (each
|
|
35
|
-
* coordinate is solved separately, the moments by
|
|
36
|
-
*
|
|
37
|
-
* points need not be sorted. It overshoots between points where the data is
|
|
38
|
-
* smooth; use {@link monotoneCubicSpline2} to forbid that.
|
|
38
|
+
* coordinate is solved separately, the moments by the Thomas algorithm on the
|
|
39
|
+
* spline's (1, 4, 1) system; e.g. Burden & Faires, Numerical Analysis, §3.5).
|
|
40
|
+
* The points need not be sorted. It overshoots between points where the data is
|
|
41
|
+
* not smooth; use {@link monotoneCubicSpline2} to forbid that.
|
|
39
42
|
*
|
|
40
|
-
* Complexity: O(n · samples) time,
|
|
43
|
+
* Complexity: O(n · samples) time, no allocation: the elimination's
|
|
44
|
+
* intermediate values are kept in `out` until the samples replace them (see
|
|
45
|
+
* `out` for the overlapping case).
|
|
41
46
|
*
|
|
42
47
|
* @param out - Destination, ((n − 1) · samples + 1) points; longer is allowed
|
|
43
|
-
* and the rest is left untouched. May share memory with `points
|
|
44
|
-
* are then copied
|
|
48
|
+
* and the rest is left untouched. May share memory with `points`, even
|
|
49
|
+
* through two wrappers of one `SharedArrayBuffer`: the points are then copied
|
|
50
|
+
* first, into a buffer this module keeps and grows to the largest such input
|
|
51
|
+
* (the only allocation).
|
|
45
52
|
* @param points - N points, 2 numbers (x, y) each.
|
|
46
53
|
* @param samples - Points per span, a positive integer.
|
|
47
54
|
* @returns `out`.
|
|
@@ -60,11 +67,14 @@ export declare function naturalCubicSpline2<T extends Float64Array>(out: T, poin
|
|
|
60
67
|
* inner points are not interpolated: the curve passes through `(Pᵢ₋₁ + 4·Pᵢ +
|
|
61
68
|
* Pᵢ₊₁) / 6`. De Boor, "On calculating with B-splines", J. Approx. Theory 6, 1972.
|
|
62
69
|
*
|
|
63
|
-
* Complexity: O(n · samples) time, no allocation
|
|
70
|
+
* Complexity: O(n · samples) time, no allocation (see `out` for the overlapping
|
|
71
|
+
* case).
|
|
64
72
|
*
|
|
65
73
|
* @param out - Destination, ((n − 1) · samples + 1) points; longer is allowed
|
|
66
|
-
* and the rest is left untouched. May share memory with `points
|
|
67
|
-
* are then copied
|
|
74
|
+
* and the rest is left untouched. May share memory with `points`, even
|
|
75
|
+
* through two wrappers of one `SharedArrayBuffer`: the points are then copied
|
|
76
|
+
* first, into a buffer this module keeps and grows to the largest such input
|
|
77
|
+
* (the only allocation).
|
|
68
78
|
* @param points - N control points, 2 numbers (x, y) each.
|
|
69
79
|
* @param samples - Points per span, a positive integer.
|
|
70
80
|
* @returns `out`.
|
|
@@ -83,11 +93,14 @@ export declare function uniformBSpline2<T extends Float64Array>(out: T, points:
|
|
|
83
93
|
* points can overshoot or form cusps (there is no centripetal variant yet).
|
|
84
94
|
* Catmull & Rom, "A class of local interpolating splines", 1974.
|
|
85
95
|
*
|
|
86
|
-
* Complexity: O(n · samples) time, no allocation
|
|
96
|
+
* Complexity: O(n · samples) time, no allocation (see `out` for the overlapping
|
|
97
|
+
* case).
|
|
87
98
|
*
|
|
88
99
|
* @param out - Destination, ((n − 1) · samples + 1) points; longer is allowed
|
|
89
|
-
* and the rest is left untouched. May share memory with `points
|
|
90
|
-
* are then copied
|
|
100
|
+
* and the rest is left untouched. May share memory with `points`, even
|
|
101
|
+
* through two wrappers of one `SharedArrayBuffer`: the points are then copied
|
|
102
|
+
* first, into a buffer this module keeps and grows to the largest such input
|
|
103
|
+
* (the only allocation).
|
|
91
104
|
* @param points - N points, 2 numbers (x, y) each.
|
|
92
105
|
* @param samples - Points per span, a positive integer.
|
|
93
106
|
* @param tension - Tangent shrink, usually in [0, 1].
|
package/dist/spline2.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spline2.d.ts","sourceRoot":"","sources":["../src/spline2.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"spline2.d.ts","sourceRoot":"","sources":["../src/spline2.ts"],"names":[],"mappings":"AAkHA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,YAAY,EAC1D,GAAG,EAAE,CAAC,EACN,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,MAAM,GACb,CAAC,CAUH;AAwGD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,YAAY,EACzD,GAAG,EAAE,CAAC,EACN,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,MAAM,GACb,CAAC,CAUH;AAqFD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,YAAY,EACrD,GAAG,EAAE,CAAC,EACN,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,MAAM,GACb,CAAC,CAoDH;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,YAAY,EACrD,GAAG,EAAE,CAAC,EACN,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACb,CAAC,CAiDH"}
|
package/dist/spline2.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { assertInteger, viewsMayOverlap } from "@ac-kit/core";
|
|
2
|
-
import { tridiagonalSolve } from "@ac-kit/math-linear";
|
|
3
2
|
import { cubicHermite2Samples_ } from "./_hermite2-samples.js";
|
|
4
3
|
// Sampled interpolating and approximating splines through `Vec2` buffers (x, y
|
|
5
4
|
// pairs), for the line interpolations of a chart. Every function writes the
|
|
@@ -29,11 +28,58 @@ function expectedLength_(name, out, points, samples) {
|
|
|
29
28
|
}
|
|
30
29
|
return count;
|
|
31
30
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
/**
|
|
32
|
+
* The points copied out of `out`'s memory when the two may overlap: every
|
|
33
|
+
* spline writes samples over a longer run than the points it still has to read
|
|
34
|
+
* (and the first two keep their tangents in `out`), so at some offset of `out`
|
|
35
|
+
* into `points` any evaluation order overwrites a point still to be read. Grown
|
|
36
|
+
* geometrically and kept, so a sampler allocates only for a larger overlapping
|
|
37
|
+
* input than any before; no sampler runs caller code while it holds the copy,
|
|
38
|
+
* so one buffer serves them all.
|
|
39
|
+
*/
|
|
40
|
+
let pointsCopy_ = new Float64Array(0);
|
|
41
|
+
// `points` itself, or its copy in `pointsCopy_` (possibly longer: the samplers
|
|
42
|
+
// read only the first `points.length` numbers) when it may share memory with
|
|
43
|
+
// `out` (the same array, overlapping views, or wrappers of one shared memory).
|
|
35
44
|
function separate_(out, points) {
|
|
36
|
-
|
|
45
|
+
if (!viewsMayOverlap(out, points)) {
|
|
46
|
+
return points;
|
|
47
|
+
}
|
|
48
|
+
if (pointsCopy_.length < points.length) {
|
|
49
|
+
pointsCopy_ = new Float64Array(Math.max(points.length, 2 * pointsCopy_.length));
|
|
50
|
+
}
|
|
51
|
+
pointsCopy_.set(points);
|
|
52
|
+
return pointsCopy_;
|
|
53
|
+
}
|
|
54
|
+
// The first-row coefficients c′ of the Thomas algorithm on the natural
|
|
55
|
+
// spline's (1, 4, 1) system: c′₁ = 1/4, c′ⱼ = 1 / (4 − c′ⱼ₋₁). They depend on
|
|
56
|
+
// nothing else and reach a fixed point in about twenty steps (the ratio is
|
|
57
|
+
// (2 − √3)² per step), so they are tabulated once, the last entry standing for
|
|
58
|
+
// every later one.
|
|
59
|
+
function thomasCoefficients_() {
|
|
60
|
+
const values = [0, 0.25];
|
|
61
|
+
for (;;) {
|
|
62
|
+
const next = 1 / (4 - values.at(-1));
|
|
63
|
+
if (next === values.at(-1)) {
|
|
64
|
+
return Float64Array.from(values);
|
|
65
|
+
}
|
|
66
|
+
values.push(next);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
const THOMAS_COEFFICIENTS_ = thomasCoefficients_();
|
|
70
|
+
function thomasCoefficient_(index) {
|
|
71
|
+
const last = THOMAS_COEFFICIENTS_.length - 1;
|
|
72
|
+
return THOMAS_COEFFICIENTS_[index < last ? index : last];
|
|
73
|
+
}
|
|
74
|
+
// The secant slope of span `index` in the scaled units (y / scaleY) /
|
|
75
|
+
// (x / scaleX), 0 for a vertical step.
|
|
76
|
+
function secant_(points, index, scaleX, scaleY) {
|
|
77
|
+
const dx = points[2 * index + 2] - points[2 * index];
|
|
78
|
+
return dx === 0
|
|
79
|
+
? 0
|
|
80
|
+
: (points[2 * index + 3] - points[2 * index + 1]) /
|
|
81
|
+
scaleY /
|
|
82
|
+
(dx / scaleX);
|
|
37
83
|
}
|
|
38
84
|
/**
|
|
39
85
|
* Samples the monotone cubic interpolant through points sorted by x: a
|
|
@@ -53,11 +99,14 @@ function separate_(out, points) {
|
|
|
53
99
|
* curve; steps whose ratio leaves [1e−150, 1e150] (a subnormal step beside a
|
|
54
100
|
* unit one) can overflow a slope.
|
|
55
101
|
*
|
|
56
|
-
* Complexity: O(n · samples) time,
|
|
102
|
+
* Complexity: O(n · samples) time, no allocation: the tangents are kept in
|
|
103
|
+
* `out` until the samples replace them (see `out` for the overlapping case).
|
|
57
104
|
*
|
|
58
105
|
* @param out - Destination, ((n − 1) · samples + 1) points; longer is allowed
|
|
59
|
-
* and the rest is left untouched. May share memory with `points
|
|
60
|
-
* are then copied
|
|
106
|
+
* and the rest is left untouched. May share memory with `points`, even
|
|
107
|
+
* through two wrappers of one `SharedArrayBuffer`: the points are then copied
|
|
108
|
+
* first, into a buffer this module keeps and grows to the largest such input
|
|
109
|
+
* (the only allocation).
|
|
61
110
|
* @param points - N points, 2 numbers (x, y) each.
|
|
62
111
|
* @param samples - Points per span, a positive integer.
|
|
63
112
|
* @returns `out`.
|
|
@@ -69,17 +118,22 @@ export function monotoneCubicSpline2(out, points, samples) {
|
|
|
69
118
|
if (count === 0) {
|
|
70
119
|
return out;
|
|
71
120
|
}
|
|
72
|
-
|
|
73
|
-
out
|
|
74
|
-
|
|
121
|
+
monotoneSamples_(out, separate_(out, points), count, samples);
|
|
122
|
+
return out;
|
|
123
|
+
}
|
|
124
|
+
// The monotone spline of the first `count` points of `points`, which does not
|
|
125
|
+
// share memory with `out`; no check.
|
|
126
|
+
function monotoneSamples_(out, points, count, samples) {
|
|
75
127
|
if (count === 1) {
|
|
76
|
-
|
|
128
|
+
out[0] = points[0];
|
|
129
|
+
out[1] = points[1];
|
|
130
|
+
return;
|
|
77
131
|
}
|
|
78
132
|
let scaleX = 0;
|
|
79
133
|
let scaleY = 0;
|
|
80
134
|
for (let index = 0; index < count - 1; index++) {
|
|
81
|
-
scaleX = Math.max(scaleX, Math.abs(
|
|
82
|
-
scaleY = Math.max(scaleY, Math.abs(
|
|
135
|
+
scaleX = Math.max(scaleX, Math.abs(points[2 * index + 2] - points[2 * index]));
|
|
136
|
+
scaleY = Math.max(scaleY, Math.abs(points[2 * index + 3] - points[2 * index + 1]));
|
|
83
137
|
}
|
|
84
138
|
if (scaleX === 0) {
|
|
85
139
|
scaleX = 1;
|
|
@@ -87,65 +141,63 @@ export function monotoneCubicSpline2(out, points, samples) {
|
|
|
87
141
|
if (scaleY === 0) {
|
|
88
142
|
scaleY = 1;
|
|
89
143
|
}
|
|
90
|
-
//
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
dx === 0
|
|
96
|
-
? 0
|
|
97
|
-
: (source[2 * index + 3] - source[2 * index + 1]) /
|
|
98
|
-
scaleY /
|
|
99
|
-
(dx / scaleX);
|
|
100
|
-
}
|
|
101
|
-
const tangents = new Float64Array(count);
|
|
102
|
-
tangents[0] = secants[0];
|
|
103
|
-
tangents[count - 1] = secants[count - 2];
|
|
144
|
+
// The tangent at point i is kept in out[2i + 1] until the spans are
|
|
145
|
+
// sampled, last span first: span i writes from out[2(i·samples + 1)] on,
|
|
146
|
+
// past every tangent a span before it still reads.
|
|
147
|
+
let before = secant_(points, 0, scaleX, scaleY);
|
|
148
|
+
out[1] = before;
|
|
104
149
|
for (let index = 1; index < count - 1; index++) {
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
150
|
+
const after = secant_(points, index, scaleX, scaleY);
|
|
151
|
+
out[2 * index + 1] = before * after <= 0 ? 0 : (before + after) / 2;
|
|
152
|
+
before = after;
|
|
108
153
|
}
|
|
154
|
+
out[2 * count - 1] = before;
|
|
109
155
|
for (let index = 0; index < count - 1; index++) {
|
|
110
|
-
const secant =
|
|
156
|
+
const secant = secant_(points, index, scaleX, scaleY);
|
|
111
157
|
if (secant === 0) {
|
|
112
|
-
|
|
113
|
-
|
|
158
|
+
out[2 * index + 1] = 0;
|
|
159
|
+
out[2 * index + 3] = 0;
|
|
114
160
|
continue;
|
|
115
161
|
}
|
|
116
|
-
const alpha =
|
|
117
|
-
const beta =
|
|
162
|
+
const alpha = out[2 * index + 1] / secant;
|
|
163
|
+
const beta = out[2 * index + 3] / secant;
|
|
118
164
|
const radiusSquared = alpha * alpha + beta * beta;
|
|
119
165
|
if (radiusSquared > 9) {
|
|
120
166
|
const scale = (3 / Math.sqrt(radiusSquared)) * secant;
|
|
121
|
-
|
|
122
|
-
|
|
167
|
+
out[2 * index + 1] = scale * alpha;
|
|
168
|
+
out[2 * index + 3] = scale * beta;
|
|
123
169
|
}
|
|
124
170
|
}
|
|
125
|
-
let
|
|
126
|
-
|
|
127
|
-
const
|
|
128
|
-
const x1 = source[2 * index + 2];
|
|
171
|
+
for (let index = count - 2; index >= 0; index--) {
|
|
172
|
+
const x0 = points[2 * index];
|
|
173
|
+
const x1 = points[2 * index + 2];
|
|
129
174
|
const dx = x1 - x0;
|
|
130
175
|
const step = dx / scaleX;
|
|
131
|
-
|
|
176
|
+
const startTangent = out[2 * index + 1];
|
|
177
|
+
const endTangent = out[2 * index + 3];
|
|
178
|
+
cubicHermite2Samples_(out, 2 * (index * samples + 1), samples, x0, points[2 * index + 1], dx, startTangent * step * scaleY, x1, points[2 * index + 3], dx, endTangent * step * scaleY);
|
|
132
179
|
}
|
|
133
|
-
|
|
180
|
+
out[0] = points[0];
|
|
181
|
+
out[1] = points[1];
|
|
134
182
|
}
|
|
135
183
|
/**
|
|
136
184
|
* Samples the natural cubic spline through the points: the `C²` piecewise cubic
|
|
137
185
|
* that interpolates every point with zero second derivative at both ends, as a
|
|
138
186
|
* parametric curve `(x(s), y(s))` with the points at integer parameters (each
|
|
139
|
-
* coordinate is solved separately, the moments by
|
|
140
|
-
*
|
|
141
|
-
* points need not be sorted. It overshoots between points where the data is
|
|
142
|
-
* smooth; use {@link monotoneCubicSpline2} to forbid that.
|
|
187
|
+
* coordinate is solved separately, the moments by the Thomas algorithm on the
|
|
188
|
+
* spline's (1, 4, 1) system; e.g. Burden & Faires, Numerical Analysis, §3.5).
|
|
189
|
+
* The points need not be sorted. It overshoots between points where the data is
|
|
190
|
+
* not smooth; use {@link monotoneCubicSpline2} to forbid that.
|
|
143
191
|
*
|
|
144
|
-
* Complexity: O(n · samples) time,
|
|
192
|
+
* Complexity: O(n · samples) time, no allocation: the elimination's
|
|
193
|
+
* intermediate values are kept in `out` until the samples replace them (see
|
|
194
|
+
* `out` for the overlapping case).
|
|
145
195
|
*
|
|
146
196
|
* @param out - Destination, ((n − 1) · samples + 1) points; longer is allowed
|
|
147
|
-
* and the rest is left untouched. May share memory with `points
|
|
148
|
-
* are then copied
|
|
197
|
+
* and the rest is left untouched. May share memory with `points`, even
|
|
198
|
+
* through two wrappers of one `SharedArrayBuffer`: the points are then copied
|
|
199
|
+
* first, into a buffer this module keeps and grows to the largest such input
|
|
200
|
+
* (the only allocation).
|
|
149
201
|
* @param points - N points, 2 numbers (x, y) each.
|
|
150
202
|
* @param samples - Points per span, a positive integer.
|
|
151
203
|
* @returns `out`.
|
|
@@ -157,56 +209,64 @@ export function naturalCubicSpline2(out, points, samples) {
|
|
|
157
209
|
if (count === 0) {
|
|
158
210
|
return out;
|
|
159
211
|
}
|
|
160
|
-
|
|
161
|
-
out
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
212
|
+
naturalSamples_(out, separate_(out, points), count, samples);
|
|
213
|
+
return out;
|
|
214
|
+
}
|
|
215
|
+
// The natural spline of the first `count` points of `points`, which does not
|
|
216
|
+
// share memory with `out`; no check.
|
|
217
|
+
function naturalSamples_(out, points, count, samples) {
|
|
166
218
|
// The second derivatives M at the inner points satisfy
|
|
167
219
|
// M_{i−1} + 4·M_i + M_{i+1} = 6 · ((P_{i+1} − P_i) − (P_i − P_{i−1})),
|
|
168
220
|
// with M_0 = M_{n−1} = 0: strictly diagonally dominant, so the Thomas
|
|
169
|
-
// algorithm is stable and meets no zero pivot.
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
(
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
221
|
+
// algorithm is stable and meets no zero pivot. Its forward sweep leaves d′ᵢ
|
|
222
|
+
// in out[2i], out[2i + 1]; the back substitution runs with the sampling,
|
|
223
|
+
// last span first, span i writing from out[2(i·samples + 1)] on, past every
|
|
224
|
+
// d′ a span before it still reads.
|
|
225
|
+
let previousX = 0;
|
|
226
|
+
let previousY = 0;
|
|
227
|
+
for (let index = 1; index < count - 1; index++) {
|
|
228
|
+
const coefficient = thomasCoefficient_(index);
|
|
229
|
+
previousX =
|
|
230
|
+
(6 *
|
|
231
|
+
(points[2 * index + 2] -
|
|
232
|
+
points[2 * index] -
|
|
233
|
+
(points[2 * index] - points[2 * index - 2])) -
|
|
234
|
+
previousX) *
|
|
235
|
+
coefficient;
|
|
236
|
+
previousY =
|
|
237
|
+
(6 *
|
|
238
|
+
(points[2 * index + 3] -
|
|
239
|
+
points[2 * index + 1] -
|
|
240
|
+
(points[2 * index + 1] - points[2 * index - 1])) -
|
|
241
|
+
previousY) *
|
|
242
|
+
coefficient;
|
|
243
|
+
out[2 * index] = previousX;
|
|
244
|
+
out[2 * index + 1] = previousY;
|
|
192
245
|
}
|
|
193
|
-
let
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
246
|
+
let endX = 0;
|
|
247
|
+
let endY = 0;
|
|
248
|
+
for (let index = count - 2; index >= 0; index--) {
|
|
249
|
+
let startX = 0;
|
|
250
|
+
let startY = 0;
|
|
251
|
+
if (index > 0) {
|
|
252
|
+
const coefficient = thomasCoefficient_(index);
|
|
253
|
+
startX = out[2 * index] - coefficient * endX;
|
|
254
|
+
startY = out[2 * index + 1] - coefficient * endY;
|
|
255
|
+
}
|
|
256
|
+
const x0 = points[2 * index];
|
|
257
|
+
const y0 = points[2 * index + 1];
|
|
258
|
+
const x1 = points[2 * index + 2];
|
|
259
|
+
const y1 = points[2 * index + 3];
|
|
203
260
|
const dx = x1 - x0;
|
|
204
261
|
const dy = y1 - y0;
|
|
205
262
|
// S(u) = (1 − u)·P_i + u·P_{i+1} + ((1 − u)³ − (1 − u))·M_i / 6 +
|
|
206
263
|
// (u³ − u)·M_{i+1} / 6, whose end derivatives are these tangents.
|
|
207
|
-
|
|
264
|
+
cubicHermite2Samples_(out, 2 * (index * samples + 1), samples, x0, y0, dx - (2 * startX + endX) / 6, dy - (2 * startY + endY) / 6, x1, y1, dx + (startX + 2 * endX) / 6, dy + (startY + 2 * endY) / 6);
|
|
265
|
+
endX = startX;
|
|
266
|
+
endY = startY;
|
|
208
267
|
}
|
|
209
|
-
|
|
268
|
+
out[0] = points[0];
|
|
269
|
+
out[1] = points[1];
|
|
210
270
|
}
|
|
211
271
|
/**
|
|
212
272
|
* Samples the uniform cubic B-spline whose control points are the given points:
|
|
@@ -219,11 +279,14 @@ export function naturalCubicSpline2(out, points, samples) {
|
|
|
219
279
|
* inner points are not interpolated: the curve passes through `(Pᵢ₋₁ + 4·Pᵢ +
|
|
220
280
|
* Pᵢ₊₁) / 6`. De Boor, "On calculating with B-splines", J. Approx. Theory 6, 1972.
|
|
221
281
|
*
|
|
222
|
-
* Complexity: O(n · samples) time, no allocation
|
|
282
|
+
* Complexity: O(n · samples) time, no allocation (see `out` for the overlapping
|
|
283
|
+
* case).
|
|
223
284
|
*
|
|
224
285
|
* @param out - Destination, ((n − 1) · samples + 1) points; longer is allowed
|
|
225
|
-
* and the rest is left untouched. May share memory with `points
|
|
226
|
-
* are then copied
|
|
286
|
+
* and the rest is left untouched. May share memory with `points`, even
|
|
287
|
+
* through two wrappers of one `SharedArrayBuffer`: the points are then copied
|
|
288
|
+
* first, into a buffer this module keeps and grows to the largest such input
|
|
289
|
+
* (the only allocation).
|
|
227
290
|
* @param points - N control points, 2 numbers (x, y) each.
|
|
228
291
|
* @param samples - Points per span, a positive integer.
|
|
229
292
|
* @returns `out`.
|
|
@@ -274,11 +337,14 @@ export function uniformBSpline2(out, points, samples) {
|
|
|
274
337
|
* points can overshoot or form cusps (there is no centripetal variant yet).
|
|
275
338
|
* Catmull & Rom, "A class of local interpolating splines", 1974.
|
|
276
339
|
*
|
|
277
|
-
* Complexity: O(n · samples) time, no allocation
|
|
340
|
+
* Complexity: O(n · samples) time, no allocation (see `out` for the overlapping
|
|
341
|
+
* case).
|
|
278
342
|
*
|
|
279
343
|
* @param out - Destination, ((n − 1) · samples + 1) points; longer is allowed
|
|
280
|
-
* and the rest is left untouched. May share memory with `points
|
|
281
|
-
* are then copied
|
|
344
|
+
* and the rest is left untouched. May share memory with `points`, even
|
|
345
|
+
* through two wrappers of one `SharedArrayBuffer`: the points are then copied
|
|
346
|
+
* first, into a buffer this module keeps and grows to the largest such input
|
|
347
|
+
* (the only allocation).
|
|
282
348
|
* @param points - N points, 2 numbers (x, y) each.
|
|
283
349
|
* @param samples - Points per span, a positive integer.
|
|
284
350
|
* @param tension - Tangent shrink, usually in [0, 1].
|
package/dist/spline2.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spline2.js","sourceRoot":"","sources":["../src/spline2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,+EAA+E;AAC/E,4EAA4E;AAC5E,gFAAgF;AAChF,gEAAgE;AAChE,kCAAkC;AAClC,EAAE;AACF,+EAA+E;AAC/E,8EAA8E;AAC9E,+EAA+E;AAC/E,4EAA4E;AAC5E,6EAA6E;AAC7E,8EAA8E;AAC9E,gFAAgF;AAChF,uEAAuE;AACvE,+EAA+E;AAC/E,SAAS;AAET,SAAS,eAAe,CACvB,IAAY,EACZ,GAAiB,EACjB,MAAoB,EACpB,OAAe;IAEf,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,UAAU,CAAC,GAAG,IAAI,wCAAwC,CAAC,CAAC;IACvE,CAAC;IAED,aAAa,CAAC,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;IAErC,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;IAChC,MAAM,MAAM,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CA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QACnE,MAAM,MAAM,GAAG,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,CAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAEnE,MAAM,GAAG,qBAAqB,CAC7B,GAAG,EACH,MAAM,EACN,OAAO,EACP,EAAE,EACF,EAAE,EACF,KAAK,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC,EACzB,KAAK,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC,EACzB,EAAE,EACF,EAAE,EACF,KAAK,GAAG,CAAC,KAAK,GAAG,MAAM,CAAC,EACxB,KAAK,GAAG,CAAC,KAAK,GAAG,MAAM,CAAC,CACxB,CAAC;IACH,CAAC;IAED,OAAO,GAAG,CAAC;AACZ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ac-kit/math-curves",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Parametric curves: Bezier segments, splines, and evaluation, subdivision, arc length and closest point over them.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bezier",
|
|
@@ -44,13 +44,14 @@
|
|
|
44
44
|
"prepack": "yarn build"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@ac-kit/core": "^0.
|
|
48
|
-
"@ac-kit/math-linear": "^0.
|
|
47
|
+
"@ac-kit/core": "^0.13.0",
|
|
48
|
+
"@ac-kit/math-linear": "^0.4.0",
|
|
49
49
|
"@types/web": "^0.0.367"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@ac-kit/math-geometry": "0.
|
|
53
|
-
"@ac-kit/math-random": "0.4.
|
|
52
|
+
"@ac-kit/math-geometry": "0.4.0",
|
|
53
|
+
"@ac-kit/math-random": "0.4.1",
|
|
54
|
+
"@ac-kit/test-util": "0.5.0",
|
|
54
55
|
"@ac-kit/tsconfig": "0.1.0",
|
|
55
56
|
"@ac-kit/typedoc-config": "0.1.0",
|
|
56
57
|
"@ac-kit/vitest-config": "0.2.0",
|