@sarmal/core 0.25.0 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/dist/auto-init.cjs +94 -95
  2. package/dist/auto-init.cjs.map +1 -1
  3. package/dist/auto-init.js +94 -95
  4. package/dist/auto-init.js.map +1 -1
  5. package/dist/curves/artemis2.cjs +6 -7
  6. package/dist/curves/artemis2.cjs.map +1 -1
  7. package/dist/curves/artemis2.d.cts +1 -1
  8. package/dist/curves/artemis2.d.ts +1 -1
  9. package/dist/curves/artemis2.js +6 -7
  10. package/dist/curves/artemis2.js.map +1 -1
  11. package/dist/curves/astroid.cjs +3 -3
  12. package/dist/curves/astroid.cjs.map +1 -1
  13. package/dist/curves/astroid.d.cts +1 -1
  14. package/dist/curves/astroid.d.ts +1 -1
  15. package/dist/curves/astroid.js +3 -3
  16. package/dist/curves/astroid.js.map +1 -1
  17. package/dist/curves/deltoid.cjs +3 -3
  18. package/dist/curves/deltoid.cjs.map +1 -1
  19. package/dist/curves/deltoid.d.cts +1 -1
  20. package/dist/curves/deltoid.d.ts +1 -1
  21. package/dist/curves/deltoid.js +3 -3
  22. package/dist/curves/deltoid.js.map +1 -1
  23. package/dist/curves/epicycloid3.cjs +3 -3
  24. package/dist/curves/epicycloid3.cjs.map +1 -1
  25. package/dist/curves/epicycloid3.d.cts +1 -1
  26. package/dist/curves/epicycloid3.d.ts +1 -1
  27. package/dist/curves/epicycloid3.js +3 -3
  28. package/dist/curves/epicycloid3.js.map +1 -1
  29. package/dist/curves/epitrochoid7.cjs +7 -7
  30. package/dist/curves/epitrochoid7.cjs.map +1 -1
  31. package/dist/curves/epitrochoid7.d.cts +1 -1
  32. package/dist/curves/epitrochoid7.d.ts +1 -1
  33. package/dist/curves/epitrochoid7.js +7 -7
  34. package/dist/curves/epitrochoid7.js.map +1 -1
  35. package/dist/curves/index.cjs +57 -58
  36. package/dist/curves/index.cjs.map +1 -1
  37. package/dist/curves/index.d.cts +1 -1
  38. package/dist/curves/index.d.ts +1 -1
  39. package/dist/curves/index.js +57 -58
  40. package/dist/curves/index.js.map +1 -1
  41. package/dist/curves/lame.cjs +3 -3
  42. package/dist/curves/lame.cjs.map +1 -1
  43. package/dist/curves/lame.d.cts +1 -1
  44. package/dist/curves/lame.d.ts +1 -1
  45. package/dist/curves/lame.js +3 -3
  46. package/dist/curves/lame.js.map +1 -1
  47. package/dist/curves/lissajous32.cjs +4 -4
  48. package/dist/curves/lissajous32.cjs.map +1 -1
  49. package/dist/curves/lissajous32.d.cts +1 -1
  50. package/dist/curves/lissajous32.d.ts +1 -1
  51. package/dist/curves/lissajous32.js +4 -4
  52. package/dist/curves/lissajous32.js.map +1 -1
  53. package/dist/curves/lissajous43.cjs +4 -4
  54. package/dist/curves/lissajous43.cjs.map +1 -1
  55. package/dist/curves/lissajous43.d.cts +1 -1
  56. package/dist/curves/lissajous43.d.ts +1 -1
  57. package/dist/curves/lissajous43.js +4 -4
  58. package/dist/curves/lissajous43.js.map +1 -1
  59. package/dist/curves/rose3.cjs +4 -4
  60. package/dist/curves/rose3.cjs.map +1 -1
  61. package/dist/curves/rose3.d.cts +1 -1
  62. package/dist/curves/rose3.d.ts +1 -1
  63. package/dist/curves/rose3.js +4 -4
  64. package/dist/curves/rose3.js.map +1 -1
  65. package/dist/curves/rose5.cjs +4 -4
  66. package/dist/curves/rose5.cjs.map +1 -1
  67. package/dist/curves/rose5.d.cts +1 -1
  68. package/dist/curves/rose5.d.ts +1 -1
  69. package/dist/curves/rose5.js +4 -4
  70. package/dist/curves/rose5.js.map +1 -1
  71. package/dist/curves/rose52.cjs +4 -4
  72. package/dist/curves/rose52.cjs.map +1 -1
  73. package/dist/curves/rose52.d.cts +1 -1
  74. package/dist/curves/rose52.d.ts +1 -1
  75. package/dist/curves/rose52.js +4 -4
  76. package/dist/curves/rose52.js.map +1 -1
  77. package/dist/curves/star.cjs +4 -4
  78. package/dist/curves/star.cjs.map +1 -1
  79. package/dist/curves/star.d.cts +1 -1
  80. package/dist/curves/star.d.ts +1 -1
  81. package/dist/curves/star.js +4 -4
  82. package/dist/curves/star.js.map +1 -1
  83. package/dist/curves/star4.cjs +4 -4
  84. package/dist/curves/star4.cjs.map +1 -1
  85. package/dist/curves/star4.d.cts +2 -2
  86. package/dist/curves/star4.d.ts +2 -2
  87. package/dist/curves/star4.js +4 -4
  88. package/dist/curves/star4.js.map +1 -1
  89. package/dist/curves/star7.cjs +4 -4
  90. package/dist/curves/star7.cjs.map +1 -1
  91. package/dist/curves/star7.d.cts +2 -2
  92. package/dist/curves/star7.d.ts +2 -2
  93. package/dist/curves/star7.js +4 -4
  94. package/dist/curves/star7.js.map +1 -1
  95. package/dist/index.cjs +94 -95
  96. package/dist/index.cjs.map +1 -1
  97. package/dist/index.d.cts +7 -7
  98. package/dist/index.d.ts +7 -7
  99. package/dist/index.js +94 -95
  100. package/dist/index.js.map +1 -1
  101. package/dist/{types-BZpzgNau.d.cts → types-zbxUgcmZ.d.cts} +30 -37
  102. package/dist/{types-BZpzgNau.d.ts → types-zbxUgcmZ.d.ts} +30 -37
  103. package/package.json +1 -1
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { B as BaseRendererOptions, E as Engine, S as SarmalInstance, C as CurveDef, P as Point, R as RendererOptions, a as ControlPoint, b as SarmalOptions } from './types-BZpzgNau.cjs';
2
- export { J as JumpOptions, c as RuntimeRenderOptions, d as SeekOptions, T as TrailColor, e as TrailStyle } from './types-BZpzgNau.cjs';
1
+ import { B as BaseRendererOptions, E as Engine, S as SarmalInstance, C as CurveDef, P as Point, R as RendererOptions, a as ControlPoint, b as SarmalOptions } from './types-zbxUgcmZ.cjs';
2
+ export { J as JumpOptions, c as RuntimeRenderOptions, d as SeekOptions, T as TrailColor, e as TrailStyle } from './types-zbxUgcmZ.cjs';
3
3
  export { CurveName, curves } from './curves/index.cjs';
4
4
  export { artemis2 } from './curves/artemis2.cjs';
5
5
  export { astroid } from './curves/astroid.cjs';
@@ -97,11 +97,11 @@ declare function createRenderer(options: RendererOptions): SarmalInstance;
97
97
  * and each segment uses a phantom predecessor / successor so the
98
98
  * curve passes exactly through every control point.
99
99
  *
100
- * @param points At least 1 point. An empty array yields `(0, 0)`. A single point returns that point for every `t`
101
- * @param t Parametric position along the closed loop. Wraps into `[0, 2π)` automatically, so values outside that range are remapped rather than rejected
102
- * @returns The `(x, y)` position on the spline at time `t`
100
+ * @param points At least 1 point. An empty array yields `(0, 0)`. A single point returns that point for every `phase`
101
+ * @param phase Parametric position along the closed loop. Wraps into `[0, 2π)` automatically, so values outside that range are remapped rather than rejected
102
+ * @returns The `(x, y)` position on the spline at position `phase`
103
103
  */
104
- declare function evaluateCatmullRom(points: Array<ControlPoint>, t: number): Point;
104
+ declare function evaluateCatmullRom(points: Array<ControlPoint>, phase: number): Point;
105
105
  /**
106
106
  * The returned curve definition produces a closed Catmull-Rom spline that
107
107
  * passes through every point in order, looping back from the last point to the first.
@@ -111,7 +111,7 @@ declare function evaluateCatmullRom(points: Array<ControlPoint>, t: number): Poi
111
111
  * ! Must contain at least 3 points.
112
112
  * @param opts Optional overrides for the returned `CurveDef`.
113
113
  * @param opts.name Display name for the curve. Defaults to `"drawn"`.
114
- * @returns A `CurveDef` with `period: 2π`, `kind: "drawn"`, and the spline evaluator as its `fn`.
114
+ * @returns A `CurveDef` with `period: 2π` and the spline evaluator as its `fn`.
115
115
  * @throws If `points` has fewer than 3 entries.
116
116
  *
117
117
  * @example
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { B as BaseRendererOptions, E as Engine, S as SarmalInstance, C as CurveDef, P as Point, R as RendererOptions, a as ControlPoint, b as SarmalOptions } from './types-BZpzgNau.js';
2
- export { J as JumpOptions, c as RuntimeRenderOptions, d as SeekOptions, T as TrailColor, e as TrailStyle } from './types-BZpzgNau.js';
1
+ import { B as BaseRendererOptions, E as Engine, S as SarmalInstance, C as CurveDef, P as Point, R as RendererOptions, a as ControlPoint, b as SarmalOptions } from './types-zbxUgcmZ.js';
2
+ export { J as JumpOptions, c as RuntimeRenderOptions, d as SeekOptions, T as TrailColor, e as TrailStyle } from './types-zbxUgcmZ.js';
3
3
  export { CurveName, curves } from './curves/index.js';
4
4
  export { artemis2 } from './curves/artemis2.js';
5
5
  export { astroid } from './curves/astroid.js';
@@ -97,11 +97,11 @@ declare function createRenderer(options: RendererOptions): SarmalInstance;
97
97
  * and each segment uses a phantom predecessor / successor so the
98
98
  * curve passes exactly through every control point.
99
99
  *
100
- * @param points At least 1 point. An empty array yields `(0, 0)`. A single point returns that point for every `t`
101
- * @param t Parametric position along the closed loop. Wraps into `[0, 2π)` automatically, so values outside that range are remapped rather than rejected
102
- * @returns The `(x, y)` position on the spline at time `t`
100
+ * @param points At least 1 point. An empty array yields `(0, 0)`. A single point returns that point for every `phase`
101
+ * @param phase Parametric position along the closed loop. Wraps into `[0, 2π)` automatically, so values outside that range are remapped rather than rejected
102
+ * @returns The `(x, y)` position on the spline at position `phase`
103
103
  */
104
- declare function evaluateCatmullRom(points: Array<ControlPoint>, t: number): Point;
104
+ declare function evaluateCatmullRom(points: Array<ControlPoint>, phase: number): Point;
105
105
  /**
106
106
  * The returned curve definition produces a closed Catmull-Rom spline that
107
107
  * passes through every point in order, looping back from the last point to the first.
@@ -111,7 +111,7 @@ declare function evaluateCatmullRom(points: Array<ControlPoint>, t: number): Poi
111
111
  * ! Must contain at least 3 points.
112
112
  * @param opts Optional overrides for the returned `CurveDef`.
113
113
  * @param opts.name Display name for the curve. Defaults to `"drawn"`.
114
- * @returns A `CurveDef` with `period: 2π`, `kind: "drawn"`, and the spline evaluator as its `fn`.
114
+ * @returns A `CurveDef` with `period: 2π` and the spline evaluator as its `fn`.
115
115
  * @throws If `points` has fewer than 3 entries.
116
116
  *
117
117
  * @example
package/dist/index.js CHANGED
@@ -72,21 +72,21 @@ function createEngine(curveDef, trailLength = 120) {
72
72
  }
73
73
  let curve = resolveCurve(curveDef);
74
74
  const trail = new CircularBuffer(trailLength);
75
- let t = 0;
75
+ let phase = 0;
76
76
  let actualTime = 0;
77
77
  let userSpeedOverride = null;
78
78
  let morphCurveB = null;
79
79
  let _morphAlpha = null;
80
80
  let _morphStrategy = "normalized";
81
81
  let _speedTransition = null;
82
- function sampleSkeleton(c, sampleT) {
82
+ function sampleSkeleton(c, samplePhase) {
83
83
  if (c.skeletonFn) {
84
- return c.skeletonFn(sampleT);
84
+ return c.skeletonFn(samplePhase);
85
85
  }
86
86
  if (c.skeleton === "live") {
87
- return c.fn(sampleT, actualTime, EMPTY_PARAMS);
87
+ return c.fn(samplePhase, actualTime, EMPTY_PARAMS);
88
88
  }
89
- return c.fn(sampleT, 0, EMPTY_PARAMS);
89
+ return c.fn(samplePhase, 0, EMPTY_PARAMS);
90
90
  }
91
91
  return {
92
92
  tick(deltaTime) {
@@ -104,15 +104,15 @@ function createEngine(curveDef, trailLength = 120) {
104
104
  if (morphCurveB !== null && _morphAlpha !== null) {
105
105
  effectiveSpeed = lerp(effectiveSpeed, morphCurveB.speed, _morphAlpha);
106
106
  }
107
- t = (t + effectiveSpeed * deltaTime) % curve.period;
107
+ phase = (phase + effectiveSpeed * deltaTime) % curve.period;
108
108
  actualTime += deltaTime;
109
109
  if (morphCurveB !== null && _morphAlpha !== null) {
110
- const a = curve.fn(t, actualTime, EMPTY_PARAMS);
111
- const tB = _morphStrategy === "normalized" ? t / curve.period * morphCurveB.period : t;
112
- const b = morphCurveB.fn(tB, actualTime, EMPTY_PARAMS);
110
+ const a = curve.fn(phase, actualTime, EMPTY_PARAMS);
111
+ const phaseB = _morphStrategy === "normalized" ? phase / curve.period * morphCurveB.period : phase;
112
+ const b = morphCurveB.fn(phaseB, actualTime, EMPTY_PARAMS);
113
113
  trail.push(a.x + (b.x - a.x) * _morphAlpha, a.y + (b.y - a.y) * _morphAlpha);
114
114
  } else {
115
- const point = curve.fn(t, actualTime, EMPTY_PARAMS);
115
+ const point = curve.fn(phase, actualTime, EMPTY_PARAMS);
116
116
  trail.push(point.x, point.y);
117
117
  }
118
118
  return trail.toArray();
@@ -130,30 +130,30 @@ function createEngine(curveDef, trailLength = 120) {
130
130
  return _morphAlpha;
131
131
  },
132
132
  reset() {
133
- t = 0;
133
+ phase = 0;
134
134
  actualTime = 0;
135
135
  trail.clear();
136
136
  },
137
- jump(newT, { clearTrail = false } = {}) {
138
- t = (newT % curve.period + curve.period) % curve.period;
137
+ jump(newPhase, { clearTrail = false } = {}) {
138
+ phase = (newPhase % curve.period + curve.period) % curve.period;
139
139
  if (clearTrail) {
140
140
  trail.clear();
141
141
  }
142
142
  },
143
- seek(targetT, { wrap = false, step = curve.period / trailLength } = {}) {
143
+ seek(targetPhase, { wrap = false, step = curve.period / trailLength } = {}) {
144
144
  const advance = curve.speed * step;
145
- const target = (targetT % curve.period + curve.period) % curve.period;
145
+ const target = (targetPhase % curve.period + curve.period) % curve.period;
146
146
  const targetTime = target / curve.speed;
147
- t = target;
147
+ phase = target;
148
148
  actualTime = targetTime;
149
149
  trail.clear();
150
150
  const pointsFromStart = Math.floor(target / advance) + 1;
151
151
  const count = wrap ? trailLength : Math.min(trailLength, pointsFromStart);
152
152
  for (let i = count - 1; i >= 0; i--) {
153
- const sampleT = target - i * advance;
154
- const wrappedT = (sampleT % curve.period + curve.period) % curve.period;
155
- const time = targetTime - i * step;
156
- const point = curve.fn(wrappedT, time, EMPTY_PARAMS);
153
+ const samplePhase = target - i * advance;
154
+ const wrappedPhase = (samplePhase % curve.period + curve.period) % curve.period;
155
+ const elapsed = targetTime - i * step;
156
+ const point = curve.fn(wrappedPhase, elapsed, EMPTY_PARAMS);
157
157
  trail.push(point.x, point.y);
158
158
  }
159
159
  },
@@ -166,10 +166,10 @@ function createEngine(curveDef, trailLength = 120) {
166
166
  const frozenStrategy = _morphStrategy;
167
167
  curve = {
168
168
  ...frozenB,
169
- fn: (sampleT, time, params) => {
170
- const a = frozenA.fn(sampleT, time, params);
171
- const tB = frozenStrategy === "normalized" ? sampleT / frozenA.period * frozenB.period : sampleT;
172
- const b = frozenB.fn(tB, time, params);
169
+ fn: (samplePhase, elapsed, params) => {
170
+ const a = frozenA.fn(samplePhase, elapsed, params);
171
+ const phaseB = frozenStrategy === "normalized" ? samplePhase / frozenA.period * frozenB.period : samplePhase;
172
+ const b = frozenB.fn(phaseB, elapsed, params);
173
173
  return {
174
174
  x: a.x + (b.x - a.x) * frozenAlpha,
175
175
  y: a.y + (b.y - a.y) * frozenAlpha
@@ -187,7 +187,7 @@ function createEngine(curveDef, trailLength = 120) {
187
187
  completeMorph() {
188
188
  if (morphCurveB !== null) {
189
189
  if (_morphStrategy === "normalized" && curve.period !== morphCurveB.period) {
190
- t = t / curve.period * morphCurveB.period;
190
+ phase = phase / curve.period * morphCurveB.period;
191
191
  }
192
192
  curve = morphCurveB;
193
193
  }
@@ -199,10 +199,10 @@ function createEngine(curveDef, trailLength = 120) {
199
199
  const points2 = new Array(steps);
200
200
  if (morphCurveB !== null && _morphAlpha !== null) {
201
201
  for (let i = 0; i < steps; i++) {
202
- const sampleT = i / (steps - 1) * curve.period;
203
- const a = sampleSkeleton(curve, sampleT);
204
- const tB = _morphStrategy === "normalized" ? sampleT / curve.period * morphCurveB.period : sampleT;
205
- const b = sampleSkeleton(morphCurveB, tB);
202
+ const samplePhase = i / (steps - 1) * curve.period;
203
+ const a = sampleSkeleton(curve, samplePhase);
204
+ const phaseB = _morphStrategy === "normalized" ? samplePhase / curve.period * morphCurveB.period : samplePhase;
205
+ const b = sampleSkeleton(morphCurveB, phaseB);
206
206
  points2[i] = {
207
207
  x: a.x + (b.x - a.x) * _morphAlpha,
208
208
  y: a.y + (b.y - a.y) * _morphAlpha
@@ -211,8 +211,8 @@ function createEngine(curveDef, trailLength = 120) {
211
211
  return points2;
212
212
  }
213
213
  for (let i = 0; i < steps; i++) {
214
- const sampleT = i / (steps - 1) * curve.period;
215
- points2[i] = sampleSkeleton(curve, sampleT);
214
+ const samplePhase = i / (steps - 1) * curve.period;
215
+ points2[i] = sampleSkeleton(curve, samplePhase);
216
216
  }
217
217
  return points2;
218
218
  },
@@ -743,8 +743,8 @@ function createRenderer(options) {
743
743
  if (!engine.isLiveSkeleton) {
744
744
  buildSkeletonCanvas();
745
745
  }
746
- if (options.initialT !== void 0) {
747
- engine.seek(options.initialT);
746
+ if (options.initialPhase !== void 0) {
747
+ engine.seek(options.initialPhase);
748
748
  }
749
749
  renderFrame(0);
750
750
  const shouldAutoStart = options.autoStart !== false;
@@ -878,8 +878,8 @@ function sampleCurveSkeleton(curveDef) {
878
878
  const samples = Math.ceil(period * 50);
879
879
  const pts = Array.from({ length: samples });
880
880
  for (let i = 0; i < samples; i++) {
881
- const t = i / (samples - 1) * period;
882
- pts[i] = curveDef.skeletonFn ? curveDef.skeletonFn(t) : curveDef.fn(t, 0, EMPTY_PARAMS2);
881
+ const phase = i / (samples - 1) * period;
882
+ pts[i] = curveDef.skeletonFn ? curveDef.skeletonFn(phase) : curveDef.fn(phase, 0, EMPTY_PARAMS2);
883
883
  }
884
884
  return pts;
885
885
  }
@@ -1089,8 +1089,8 @@ function createSVGRenderer(options) {
1089
1089
  animationId = requestAnimationFrame(loop);
1090
1090
  }
1091
1091
  }
1092
- if (options.initialT !== void 0) {
1093
- engine.seek(options.initialT);
1092
+ if (options.initialPhase !== void 0) {
1093
+ engine.seek(options.initialPhase);
1094
1094
  }
1095
1095
  renderFrame(0);
1096
1096
  const shouldAutoStart = options.autoStart !== false;
@@ -1240,7 +1240,7 @@ function catmullRom1D(p0, p1, p2, p3, u) {
1240
1240
  const u3 = u2 * u;
1241
1241
  return 0.5 * (2 * p1 + (-p0 + p2) * u + (2 * p0 - 5 * p1 + 4 * p2 - p3) * u2 + (-p0 + 3 * p1 - 3 * p2 + p3) * u3);
1242
1242
  }
1243
- function evaluateCatmullRom(points2, t) {
1243
+ function evaluateCatmullRom(points2, phase) {
1244
1244
  const N = points2.length;
1245
1245
  if (N === 0) {
1246
1246
  return { x: 0, y: 0 };
@@ -1248,13 +1248,13 @@ function evaluateCatmullRom(points2, t) {
1248
1248
  if (N === 1) {
1249
1249
  return { x: points2[0][0], y: points2[0][1] };
1250
1250
  }
1251
- t = (t % PERIOD + PERIOD) % PERIOD;
1251
+ phase = (phase % PERIOD + PERIOD) % PERIOD;
1252
1252
  const segmentSize = PERIOD / N;
1253
- let i = Math.floor(t / segmentSize);
1253
+ let i = Math.floor(phase / segmentSize);
1254
1254
  if (i >= N) {
1255
1255
  i = N - 1;
1256
1256
  }
1257
- let u = (t - i * segmentSize) / segmentSize;
1257
+ let u = (phase - i * segmentSize) / segmentSize;
1258
1258
  u = Math.max(0, Math.min(1, u));
1259
1259
  const p0 = points2[(i - 1 + N) % N];
1260
1260
  const p1 = points2[i];
@@ -1284,9 +1284,8 @@ function drawCurve(points2, opts) {
1284
1284
  const pts = points2.map(([x, y]) => [x, y]);
1285
1285
  return {
1286
1286
  name: opts?.name ?? "drawn",
1287
- fn: (t) => evaluateCatmullRom(pts, t),
1288
- period: PERIOD,
1289
- kind: "drawn"
1287
+ fn: (phase) => evaluateCatmullRom(pts, phase),
1288
+ period: PERIOD
1290
1289
  };
1291
1290
  }
1292
1291
 
@@ -1321,9 +1320,9 @@ var artemis2 = {
1321
1320
 
1322
1321
  // src/curves/astroid.ts
1323
1322
  var TWO_PI2 = Math.PI * 2;
1324
- function astroidFn(t, _time, _params) {
1325
- const c = Math.cos(t);
1326
- const s = Math.sin(t);
1323
+ function astroidFn(phase, _elapsed, _params) {
1324
+ const c = Math.cos(phase);
1325
+ const s = Math.sin(phase);
1327
1326
  return {
1328
1327
  x: c * c * c,
1329
1328
  y: s * s * s
@@ -1338,10 +1337,10 @@ var astroid = {
1338
1337
 
1339
1338
  // src/curves/deltoid.ts
1340
1339
  var TWO_PI3 = Math.PI * 2;
1341
- function deltoidFn(t, _time, _params) {
1340
+ function deltoidFn(phase, _elapsed, _params) {
1342
1341
  return {
1343
- x: 2 * Math.cos(t) + Math.cos(2 * t),
1344
- y: 2 * Math.sin(t) - Math.sin(2 * t)
1342
+ x: 2 * Math.cos(phase) + Math.cos(2 * phase),
1343
+ y: 2 * Math.sin(phase) - Math.sin(2 * phase)
1345
1344
  };
1346
1345
  }
1347
1346
  var deltoid = {
@@ -1353,10 +1352,10 @@ var deltoid = {
1353
1352
 
1354
1353
  // src/curves/epicycloid3.ts
1355
1354
  var TWO_PI4 = Math.PI * 2;
1356
- function epicycloid3Fn(t, _time, _params) {
1355
+ function epicycloid3Fn(phase, _elapsed, _params) {
1357
1356
  return {
1358
- x: 4 * Math.cos(t) - Math.cos(4 * t),
1359
- y: 4 * Math.sin(t) - Math.sin(4 * t)
1357
+ x: 4 * Math.cos(phase) - Math.cos(4 * phase),
1358
+ y: 4 * Math.sin(phase) - Math.sin(4 * phase)
1360
1359
  };
1361
1360
  }
1362
1361
  var epicycloid3 = {
@@ -1368,18 +1367,18 @@ var epicycloid3 = {
1368
1367
 
1369
1368
  // src/curves/epitrochoid7.ts
1370
1369
  var TWO_PI5 = Math.PI * 2;
1371
- function epitrochoid7Fn(t, _time, _params) {
1372
- const d = 1 + 0.55 * Math.sin(t * 0.5);
1370
+ function epitrochoid7Fn(phase, _elapsed, _params) {
1371
+ const d = 1 + 0.55 * Math.sin(phase * 0.5);
1373
1372
  return {
1374
- x: 7 * Math.cos(t) - d * Math.cos(7 * t),
1375
- y: 7 * Math.sin(t) - d * Math.sin(7 * t)
1373
+ x: 7 * Math.cos(phase) - d * Math.cos(7 * phase),
1374
+ y: 7 * Math.sin(phase) - d * Math.sin(7 * phase)
1376
1375
  };
1377
1376
  }
1378
- function epitrochoid7SkeletonFn(t) {
1377
+ function epitrochoid7SkeletonFn(phase) {
1379
1378
  const d = 1.275;
1380
1379
  return {
1381
- x: 7 * Math.cos(t) - d * Math.cos(7 * t),
1382
- y: 7 * Math.sin(t) - d * Math.sin(7 * t)
1380
+ x: 7 * Math.cos(phase) - d * Math.cos(7 * phase),
1381
+ y: 7 * Math.sin(phase) - d * Math.sin(7 * phase)
1383
1382
  };
1384
1383
  }
1385
1384
  var epitrochoid7 = {
@@ -1392,11 +1391,11 @@ var epitrochoid7 = {
1392
1391
 
1393
1392
  // src/curves/lissajous32.ts
1394
1393
  var TWO_PI6 = Math.PI * 2;
1395
- function lissajous32Fn(t, time, _params) {
1396
- const phi = time * 0.45;
1394
+ function lissajous32Fn(phase, elapsed, _params) {
1395
+ const phi = elapsed * 0.45;
1397
1396
  return {
1398
- x: Math.sin(3 * t + phi),
1399
- y: Math.sin(2 * t)
1397
+ x: Math.sin(3 * phase + phi),
1398
+ y: Math.sin(2 * phase)
1400
1399
  };
1401
1400
  }
1402
1401
  var lissajous32 = {
@@ -1409,11 +1408,11 @@ var lissajous32 = {
1409
1408
 
1410
1409
  // src/curves/lissajous43.ts
1411
1410
  var TWO_PI7 = Math.PI * 2;
1412
- function lissajous43Fn(t, time, _params) {
1413
- const phi = time * 0.38;
1411
+ function lissajous43Fn(phase, elapsed, _params) {
1412
+ const phi = elapsed * 0.38;
1414
1413
  return {
1415
- x: Math.sin(4 * t + phi),
1416
- y: Math.sin(3 * t)
1414
+ x: Math.sin(4 * phase + phi),
1415
+ y: Math.sin(3 * phase)
1417
1416
  };
1418
1417
  }
1419
1418
  var lissajous43 = {
@@ -1426,9 +1425,9 @@ var lissajous43 = {
1426
1425
 
1427
1426
  // src/curves/lame.ts
1428
1427
  var TWO_PI8 = Math.PI * 2;
1429
- function lameFn(t, time, _params) {
1430
- const p = 1.75 + 1.25 * Math.sin(time * 0.48);
1431
- const c = Math.cos(t), s = Math.sin(t);
1428
+ function lameFn(phase, elapsed, _params) {
1429
+ const p = 1.75 + 1.25 * Math.sin(elapsed * 0.48);
1430
+ const c = Math.cos(phase), s = Math.sin(phase);
1432
1431
  return {
1433
1432
  x: Math.sign(c) * Math.pow(Math.abs(c), p),
1434
1433
  y: Math.sign(s) * Math.pow(Math.abs(s), p)
@@ -1444,11 +1443,11 @@ var lame = {
1444
1443
 
1445
1444
  // src/curves/rose3.ts
1446
1445
  var TWO_PI9 = Math.PI * 2;
1447
- function rose3Fn(t, _time, _params) {
1448
- const r = Math.cos(3 * t);
1446
+ function rose3Fn(phase, _elapsed, _params) {
1447
+ const r = Math.cos(3 * phase);
1449
1448
  return {
1450
- x: r * Math.cos(t),
1451
- y: r * Math.sin(t)
1449
+ x: r * Math.cos(phase),
1450
+ y: r * Math.sin(phase)
1452
1451
  };
1453
1452
  }
1454
1453
  var rose3 = {
@@ -1460,11 +1459,11 @@ var rose3 = {
1460
1459
 
1461
1460
  // src/curves/rose5.ts
1462
1461
  var TWO_PI10 = Math.PI * 2;
1463
- function rose5Fn(t, _time, _params) {
1464
- const r = Math.cos(5 * t);
1462
+ function rose5Fn(phase, _elapsed, _params) {
1463
+ const r = Math.cos(5 * phase);
1465
1464
  return {
1466
- x: r * Math.cos(t),
1467
- y: r * Math.sin(t)
1465
+ x: r * Math.cos(phase),
1466
+ y: r * Math.sin(phase)
1468
1467
  };
1469
1468
  }
1470
1469
  var rose5 = {
@@ -1476,11 +1475,11 @@ var rose5 = {
1476
1475
 
1477
1476
  // src/curves/rose52.ts
1478
1477
  var FOUR_PI = Math.PI * 4;
1479
- function rose52Fn(t, _time, _params) {
1480
- const r = Math.cos(5 / 2 * t);
1478
+ function rose52Fn(phase, _elapsed, _params) {
1479
+ const r = Math.cos(5 / 2 * phase);
1481
1480
  return {
1482
- x: r * Math.cos(t),
1483
- y: r * Math.sin(t)
1481
+ x: r * Math.cos(phase),
1482
+ y: r * Math.sin(phase)
1484
1483
  };
1485
1484
  }
1486
1485
  var rose52 = {
@@ -1492,11 +1491,11 @@ var rose52 = {
1492
1491
 
1493
1492
  // src/curves/star.ts
1494
1493
  var TWO_PI11 = Math.PI * 2;
1495
- function starFn(t, _time, _params) {
1496
- const r = Math.abs(Math.cos(5 / 2 * t)) + 0.35 * Math.abs(Math.cos(15 / 2 * t)) + 0.15 * Math.abs(Math.cos(25 / 2 * t));
1494
+ function starFn(phase, _elapsed, _params) {
1495
+ const r = Math.abs(Math.cos(5 / 2 * phase)) + 0.35 * Math.abs(Math.cos(15 / 2 * phase)) + 0.15 * Math.abs(Math.cos(25 / 2 * phase));
1497
1496
  return {
1498
- x: r * Math.cos(t),
1499
- y: r * Math.sin(t)
1497
+ x: r * Math.cos(phase),
1498
+ y: r * Math.sin(phase)
1500
1499
  };
1501
1500
  }
1502
1501
  var star = {
@@ -1508,11 +1507,11 @@ var star = {
1508
1507
 
1509
1508
  // src/curves/star4.ts
1510
1509
  var TWO_PI12 = Math.PI * 2;
1511
- function star4Fn(t, _time, _params) {
1512
- const r = Math.abs(Math.cos(2 * t)) + 0.35 * Math.abs(Math.cos(6 * t)) + 0.15 * Math.abs(Math.cos(10 * t));
1510
+ function star4Fn(phase, _elapsed, _params) {
1511
+ const r = Math.abs(Math.cos(2 * phase)) + 0.35 * Math.abs(Math.cos(6 * phase)) + 0.15 * Math.abs(Math.cos(10 * phase));
1513
1512
  return {
1514
- x: r * Math.cos(t),
1515
- y: r * Math.sin(t)
1513
+ x: r * Math.cos(phase),
1514
+ y: r * Math.sin(phase)
1516
1515
  };
1517
1516
  }
1518
1517
  var star4 = {
@@ -1524,11 +1523,11 @@ var star4 = {
1524
1523
 
1525
1524
  // src/curves/star7.ts
1526
1525
  var TWO_PI13 = Math.PI * 2;
1527
- function star7Fn(t, _time, _params) {
1528
- const r = Math.abs(Math.cos(7 / 2 * t)) + 0.35 * Math.abs(Math.cos(21 / 2 * t)) + 0.15 * Math.abs(Math.cos(35 / 2 * t));
1526
+ function star7Fn(phase, _elapsed, _params) {
1527
+ const r = Math.abs(Math.cos(7 / 2 * phase)) + 0.35 * Math.abs(Math.cos(21 / 2 * phase)) + 0.15 * Math.abs(Math.cos(35 / 2 * phase));
1529
1528
  return {
1530
- x: r * Math.cos(t),
1531
- y: r * Math.sin(t)
1529
+ x: r * Math.cos(phase),
1530
+ y: r * Math.sin(phase)
1532
1531
  };
1533
1532
  }
1534
1533
  var star7 = {