@sarmal/core 0.27.0 → 0.28.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 (79) hide show
  1. package/dist/auto-init.cjs +106 -145
  2. package/dist/auto-init.js +105 -144
  3. package/dist/cli.js +103 -145
  4. package/dist/cli.js.map +1 -1
  5. package/dist/curves/artemis2.cjs +10 -16
  6. package/dist/curves/artemis2.d.cts +1 -1
  7. package/dist/curves/artemis2.d.ts +1 -1
  8. package/dist/curves/artemis2.js +9 -15
  9. package/dist/curves/astroid.cjs +4 -4
  10. package/dist/curves/astroid.d.cts +1 -1
  11. package/dist/curves/astroid.d.ts +1 -1
  12. package/dist/curves/astroid.js +3 -3
  13. package/dist/curves/deltoid.cjs +4 -4
  14. package/dist/curves/deltoid.d.cts +1 -1
  15. package/dist/curves/deltoid.d.ts +1 -1
  16. package/dist/curves/deltoid.js +3 -3
  17. package/dist/curves/epicycloid3.cjs +4 -4
  18. package/dist/curves/epicycloid3.d.cts +1 -1
  19. package/dist/curves/epicycloid3.d.ts +1 -1
  20. package/dist/curves/epicycloid3.js +3 -3
  21. package/dist/curves/epitrochoid7.cjs +5 -5
  22. package/dist/curves/epitrochoid7.d.cts +1 -1
  23. package/dist/curves/epitrochoid7.d.ts +1 -1
  24. package/dist/curves/epitrochoid7.js +4 -4
  25. package/dist/curves/index.cjs +43 -59
  26. package/dist/curves/index.d.cts +29 -29
  27. package/dist/curves/index.d.ts +29 -29
  28. package/dist/curves/index.js +43 -75
  29. package/dist/curves/lame.cjs +5 -6
  30. package/dist/curves/lame.d.cts +1 -1
  31. package/dist/curves/lame.d.ts +1 -1
  32. package/dist/curves/lame.js +4 -5
  33. package/dist/curves/lissajous32.cjs +4 -4
  34. package/dist/curves/lissajous32.d.cts +1 -1
  35. package/dist/curves/lissajous32.d.ts +1 -1
  36. package/dist/curves/lissajous32.js +3 -3
  37. package/dist/curves/lissajous43.cjs +4 -4
  38. package/dist/curves/lissajous43.d.cts +1 -1
  39. package/dist/curves/lissajous43.d.ts +1 -1
  40. package/dist/curves/lissajous43.js +3 -3
  41. package/dist/curves/rose3.cjs +4 -4
  42. package/dist/curves/rose3.d.cts +1 -1
  43. package/dist/curves/rose3.d.ts +1 -1
  44. package/dist/curves/rose3.js +3 -3
  45. package/dist/curves/rose5.cjs +4 -4
  46. package/dist/curves/rose5.d.cts +1 -1
  47. package/dist/curves/rose5.d.ts +1 -1
  48. package/dist/curves/rose5.js +3 -3
  49. package/dist/curves/rose52.cjs +5 -5
  50. package/dist/curves/rose52.d.cts +1 -1
  51. package/dist/curves/rose52.d.ts +1 -1
  52. package/dist/curves/rose52.js +4 -4
  53. package/dist/curves/star.cjs +5 -8
  54. package/dist/curves/star.d.cts +1 -1
  55. package/dist/curves/star.d.ts +1 -1
  56. package/dist/curves/star.js +4 -7
  57. package/dist/curves/star4.cjs +5 -8
  58. package/dist/curves/star4.d.cts +1 -1
  59. package/dist/curves/star4.d.ts +1 -1
  60. package/dist/curves/star4.js +4 -7
  61. package/dist/curves/star7.cjs +5 -8
  62. package/dist/curves/star7.d.cts +1 -1
  63. package/dist/curves/star7.d.ts +1 -1
  64. package/dist/curves/star7.js +4 -7
  65. package/dist/index.cjs +94 -131
  66. package/dist/index.d.cts +30 -78
  67. package/dist/index.d.ts +30 -78
  68. package/dist/index.js +94 -152
  69. package/dist/renderer-shared-OR--cv-t.d.ts +15 -26
  70. package/dist/renderer-shared-jqw_Q1WO.d.cts +15 -26
  71. package/dist/terminal.cjs +52 -75
  72. package/dist/terminal.cjs.map +1 -1
  73. package/dist/terminal.d.cts +14 -31
  74. package/dist/terminal.d.ts +14 -31
  75. package/dist/terminal.js +51 -74
  76. package/dist/terminal.js.map +1 -1
  77. package/dist/types-zbxUgcmZ.d.cts +266 -280
  78. package/dist/types-zbxUgcmZ.d.ts +266 -280
  79. package/package.json +2 -1
@@ -1,4 +1,4 @@
1
- "use strict";
1
+ 'use strict';
2
2
 
3
3
  // src/curves/astroid.ts
4
4
  var TWO_PI = Math.PI * 2;
@@ -7,16 +7,16 @@ function astroidFn(phase, _elapsed, _params) {
7
7
  const s = Math.sin(phase);
8
8
  return {
9
9
  x: c * c * c,
10
- y: s * s * s,
10
+ y: s * s * s
11
11
  };
12
12
  }
13
13
  var astroid = {
14
14
  name: "Astroid",
15
15
  fn: astroidFn,
16
16
  period: TWO_PI,
17
- speed: 1.1,
17
+ speed: 1.1
18
18
  };
19
19
 
20
20
  exports.astroid = astroid;
21
21
  //# sourceMappingURL=astroid.cjs.map
22
- //# sourceMappingURL=astroid.cjs.map
22
+ //# sourceMappingURL=astroid.cjs.map
@@ -1,4 +1,4 @@
1
- import { C as CurveDef } from "../types-zbxUgcmZ.cjs";
1
+ import { C as CurveDef } from '../types-zbxUgcmZ.cjs';
2
2
 
3
3
  /**
4
4
  * Astroid curve - a 4-cusped hypocycloid
@@ -1,4 +1,4 @@
1
- import { C as CurveDef } from "../types-zbxUgcmZ.js";
1
+ import { C as CurveDef } from '../types-zbxUgcmZ.js';
2
2
 
3
3
  /**
4
4
  * Astroid curve - a 4-cusped hypocycloid
@@ -5,16 +5,16 @@ function astroidFn(phase, _elapsed, _params) {
5
5
  const s = Math.sin(phase);
6
6
  return {
7
7
  x: c * c * c,
8
- y: s * s * s,
8
+ y: s * s * s
9
9
  };
10
10
  }
11
11
  var astroid = {
12
12
  name: "Astroid",
13
13
  fn: astroidFn,
14
14
  period: TWO_PI,
15
- speed: 1.1,
15
+ speed: 1.1
16
16
  };
17
17
 
18
18
  export { astroid };
19
19
  //# sourceMappingURL=astroid.js.map
20
- //# sourceMappingURL=astroid.js.map
20
+ //# sourceMappingURL=astroid.js.map
@@ -1,20 +1,20 @@
1
- "use strict";
1
+ 'use strict';
2
2
 
3
3
  // src/curves/deltoid.ts
4
4
  var TWO_PI = Math.PI * 2;
5
5
  function deltoidFn(phase, _elapsed, _params) {
6
6
  return {
7
7
  x: 2 * Math.cos(phase) + Math.cos(2 * phase),
8
- y: 2 * Math.sin(phase) - Math.sin(2 * phase),
8
+ y: 2 * Math.sin(phase) - Math.sin(2 * phase)
9
9
  };
10
10
  }
11
11
  var deltoid = {
12
12
  name: "Deltoid",
13
13
  fn: deltoidFn,
14
14
  period: TWO_PI,
15
- speed: 0.9,
15
+ speed: 0.9
16
16
  };
17
17
 
18
18
  exports.deltoid = deltoid;
19
19
  //# sourceMappingURL=deltoid.cjs.map
20
- //# sourceMappingURL=deltoid.cjs.map
20
+ //# sourceMappingURL=deltoid.cjs.map
@@ -1,4 +1,4 @@
1
- import { C as CurveDef } from "../types-zbxUgcmZ.cjs";
1
+ import { C as CurveDef } from '../types-zbxUgcmZ.cjs';
2
2
 
3
3
  /**
4
4
  * Deltoid curve - a 3-cusped hypocycloid
@@ -1,4 +1,4 @@
1
- import { C as CurveDef } from "../types-zbxUgcmZ.js";
1
+ import { C as CurveDef } from '../types-zbxUgcmZ.js';
2
2
 
3
3
  /**
4
4
  * Deltoid curve - a 3-cusped hypocycloid
@@ -3,16 +3,16 @@ var TWO_PI = Math.PI * 2;
3
3
  function deltoidFn(phase, _elapsed, _params) {
4
4
  return {
5
5
  x: 2 * Math.cos(phase) + Math.cos(2 * phase),
6
- y: 2 * Math.sin(phase) - Math.sin(2 * phase),
6
+ y: 2 * Math.sin(phase) - Math.sin(2 * phase)
7
7
  };
8
8
  }
9
9
  var deltoid = {
10
10
  name: "Deltoid",
11
11
  fn: deltoidFn,
12
12
  period: TWO_PI,
13
- speed: 0.9,
13
+ speed: 0.9
14
14
  };
15
15
 
16
16
  export { deltoid };
17
17
  //# sourceMappingURL=deltoid.js.map
18
- //# sourceMappingURL=deltoid.js.map
18
+ //# sourceMappingURL=deltoid.js.map
@@ -1,20 +1,20 @@
1
- "use strict";
1
+ 'use strict';
2
2
 
3
3
  // src/curves/epicycloid3.ts
4
4
  var TWO_PI = Math.PI * 2;
5
5
  function epicycloid3Fn(phase, _elapsed, _params) {
6
6
  return {
7
7
  x: 4 * Math.cos(phase) - Math.cos(4 * phase),
8
- y: 4 * Math.sin(phase) - Math.sin(4 * phase),
8
+ y: 4 * Math.sin(phase) - Math.sin(4 * phase)
9
9
  };
10
10
  }
11
11
  var epicycloid3 = {
12
12
  name: "Epicycloid (n=3)",
13
13
  fn: epicycloid3Fn,
14
14
  period: TWO_PI,
15
- speed: 0.75,
15
+ speed: 0.75
16
16
  };
17
17
 
18
18
  exports.epicycloid3 = epicycloid3;
19
19
  //# sourceMappingURL=epicycloid3.cjs.map
20
- //# sourceMappingURL=epicycloid3.cjs.map
20
+ //# sourceMappingURL=epicycloid3.cjs.map
@@ -1,4 +1,4 @@
1
- import { C as CurveDef } from "../types-zbxUgcmZ.cjs";
1
+ import { C as CurveDef } from '../types-zbxUgcmZ.cjs';
2
2
 
3
3
  /**
4
4
  * Epicycloid with 3 cusps
@@ -1,4 +1,4 @@
1
- import { C as CurveDef } from "../types-zbxUgcmZ.js";
1
+ import { C as CurveDef } from '../types-zbxUgcmZ.js';
2
2
 
3
3
  /**
4
4
  * Epicycloid with 3 cusps
@@ -3,16 +3,16 @@ var TWO_PI = Math.PI * 2;
3
3
  function epicycloid3Fn(phase, _elapsed, _params) {
4
4
  return {
5
5
  x: 4 * Math.cos(phase) - Math.cos(4 * phase),
6
- y: 4 * Math.sin(phase) - Math.sin(4 * phase),
6
+ y: 4 * Math.sin(phase) - Math.sin(4 * phase)
7
7
  };
8
8
  }
9
9
  var epicycloid3 = {
10
10
  name: "Epicycloid (n=3)",
11
11
  fn: epicycloid3Fn,
12
12
  period: TWO_PI,
13
- speed: 0.75,
13
+ speed: 0.75
14
14
  };
15
15
 
16
16
  export { epicycloid3 };
17
17
  //# sourceMappingURL=epicycloid3.js.map
18
- //# sourceMappingURL=epicycloid3.js.map
18
+ //# sourceMappingURL=epicycloid3.js.map
@@ -1,4 +1,4 @@
1
- "use strict";
1
+ 'use strict';
2
2
 
3
3
  // src/curves/epitrochoid7.ts
4
4
  var TWO_PI = Math.PI * 2;
@@ -6,14 +6,14 @@ function epitrochoid7Fn(phase, _elapsed, _params) {
6
6
  const d = 1 + 0.55 * Math.sin(phase * 0.5);
7
7
  return {
8
8
  x: 7 * Math.cos(phase) - d * Math.cos(7 * phase),
9
- y: 7 * Math.sin(phase) - d * Math.sin(7 * phase),
9
+ y: 7 * Math.sin(phase) - d * Math.sin(7 * phase)
10
10
  };
11
11
  }
12
12
  function epitrochoid7SkeletonFn(phase) {
13
13
  const d = 1.275;
14
14
  return {
15
15
  x: 7 * Math.cos(phase) - d * Math.cos(7 * phase),
16
- y: 7 * Math.sin(phase) - d * Math.sin(7 * phase),
16
+ y: 7 * Math.sin(phase) - d * Math.sin(7 * phase)
17
17
  };
18
18
  }
19
19
  var epitrochoid7 = {
@@ -21,9 +21,9 @@ var epitrochoid7 = {
21
21
  fn: epitrochoid7Fn,
22
22
  period: TWO_PI,
23
23
  speed: 1.4,
24
- skeletonFn: epitrochoid7SkeletonFn,
24
+ skeletonFn: epitrochoid7SkeletonFn
25
25
  };
26
26
 
27
27
  exports.epitrochoid7 = epitrochoid7;
28
28
  //# sourceMappingURL=epitrochoid7.cjs.map
29
- //# sourceMappingURL=epitrochoid7.cjs.map
29
+ //# sourceMappingURL=epitrochoid7.cjs.map
@@ -1,4 +1,4 @@
1
- import { C as CurveDef } from "../types-zbxUgcmZ.cjs";
1
+ import { C as CurveDef } from '../types-zbxUgcmZ.cjs';
2
2
 
3
3
  /**
4
4
  * Epitrochoid with 7 lobes and dynamic variation
@@ -1,4 +1,4 @@
1
- import { C as CurveDef } from "../types-zbxUgcmZ.js";
1
+ import { C as CurveDef } from '../types-zbxUgcmZ.js';
2
2
 
3
3
  /**
4
4
  * Epitrochoid with 7 lobes and dynamic variation
@@ -4,14 +4,14 @@ function epitrochoid7Fn(phase, _elapsed, _params) {
4
4
  const d = 1 + 0.55 * Math.sin(phase * 0.5);
5
5
  return {
6
6
  x: 7 * Math.cos(phase) - d * Math.cos(7 * phase),
7
- y: 7 * Math.sin(phase) - d * Math.sin(7 * phase),
7
+ y: 7 * Math.sin(phase) - d * Math.sin(7 * phase)
8
8
  };
9
9
  }
10
10
  function epitrochoid7SkeletonFn(phase) {
11
11
  const d = 1.275;
12
12
  return {
13
13
  x: 7 * Math.cos(phase) - d * Math.cos(7 * phase),
14
- y: 7 * Math.sin(phase) - d * Math.sin(7 * phase),
14
+ y: 7 * Math.sin(phase) - d * Math.sin(7 * phase)
15
15
  };
16
16
  }
17
17
  var epitrochoid7 = {
@@ -19,9 +19,9 @@ var epitrochoid7 = {
19
19
  fn: epitrochoid7Fn,
20
20
  period: TWO_PI,
21
21
  speed: 1.4,
22
- skeletonFn: epitrochoid7SkeletonFn,
22
+ skeletonFn: epitrochoid7SkeletonFn
23
23
  };
24
24
 
25
25
  export { epitrochoid7 };
26
26
  //# sourceMappingURL=epitrochoid7.js.map
27
- //# sourceMappingURL=epitrochoid7.js.map
27
+ //# sourceMappingURL=epitrochoid7.js.map
@@ -1,17 +1,11 @@
1
- "use strict";
1
+ 'use strict';
2
2
 
3
3
  // src/catmull-rom.ts
4
4
  var PERIOD = 2 * Math.PI;
5
5
  function catmullRom1D(p0, p1, p2, p3, u) {
6
6
  const u2 = u * u;
7
7
  const u3 = u2 * u;
8
- return (
9
- 0.5 *
10
- (2 * p1 +
11
- (-p0 + p2) * u +
12
- (2 * p0 - 5 * p1 + 4 * p2 - p3) * u2 +
13
- (-p0 + 3 * p1 - 3 * p2 + p3) * u3)
14
- );
8
+ return 0.5 * (2 * p1 + (-p0 + p2) * u + (2 * p0 - 5 * p1 + 4 * p2 - p3) * u2 + (-p0 + 3 * p1 - 3 * p2 + p3) * u3);
15
9
  }
16
10
  function evaluateCatmullRom(points2, phase) {
17
11
  const N = points2.length;
@@ -21,7 +15,7 @@ function evaluateCatmullRom(points2, phase) {
21
15
  if (N === 1) {
22
16
  return { x: points2[0][0], y: points2[0][1] };
23
17
  }
24
- phase = ((phase % PERIOD) + PERIOD) % PERIOD;
18
+ phase = (phase % PERIOD + PERIOD) % PERIOD;
25
19
  const segmentSize = PERIOD / N;
26
20
  let i = Math.floor(phase / segmentSize);
27
21
  if (i >= N) {
@@ -35,7 +29,7 @@ function evaluateCatmullRom(points2, phase) {
35
29
  const p3 = points2[(i + 2) % N];
36
30
  return {
37
31
  x: catmullRom1D(p0[0], p1[0], p2[0], p3[0], u),
38
- y: catmullRom1D(p0[1], p1[1], p2[1], p3[1], u),
32
+ y: catmullRom1D(p0[1], p1[1], p2[1], p3[1], u)
39
33
  };
40
34
  }
41
35
  function drawCurve(points2, opts) {
@@ -45,20 +39,20 @@ function drawCurve(points2, opts) {
45
39
  const first = points2[0];
46
40
  if (points2.every((p) => p[0] === first[0] && p[1] === first[1])) {
47
41
  console.warn(
48
- "[sarmal].drawCurve: all control points are identical. The curve will be a single point.",
42
+ "[sarmal].drawCurve: all control points are identical. The curve will be a single point."
49
43
  );
50
44
  }
51
45
  const maxAbs = points2.reduce((m, p) => Math.max(m, Math.abs(p[0]), Math.abs(p[1])), 0);
52
46
  if (maxAbs > 2) {
53
47
  console.warn(
54
- `[sarmal].drawCurve: control points extend to \xB1${maxAbs.toFixed(1)}, which may render off-screen. Coordinates should be in [-1, 1].`,
48
+ `[sarmal].drawCurve: control points extend to \xB1${maxAbs.toFixed(1)}, which may render off-screen. Coordinates should be in [-1, 1].`
55
49
  );
56
50
  }
57
51
  const pts = points2.map(([x, y]) => [x, y]);
58
52
  return {
59
53
  name: opts?.name ?? "drawn",
60
54
  fn: (phase) => evaluateCatmullRom(pts, phase),
61
- period: PERIOD,
55
+ period: PERIOD
62
56
  };
63
57
  }
64
58
 
@@ -84,11 +78,11 @@ var points = [
84
78
  [-0.69, -0.84],
85
79
  [-0.87, -0.66],
86
80
  [-0.9, -0.47],
87
- [-0.76, -0.35],
81
+ [-0.76, -0.35]
88
82
  ];
89
83
  var artemis2 = {
90
84
  ...drawCurve(points, { name: "Artemis II" }),
91
- speed: 0.7,
85
+ speed: 0.7
92
86
  };
93
87
 
94
88
  // src/curves/astroid.ts
@@ -98,14 +92,14 @@ function astroidFn(phase, _elapsed, _params) {
98
92
  const s = Math.sin(phase);
99
93
  return {
100
94
  x: c * c * c,
101
- y: s * s * s,
95
+ y: s * s * s
102
96
  };
103
97
  }
104
98
  var astroid = {
105
99
  name: "Astroid",
106
100
  fn: astroidFn,
107
101
  period: TWO_PI,
108
- speed: 1.1,
102
+ speed: 1.1
109
103
  };
110
104
 
111
105
  // src/curves/deltoid.ts
@@ -113,14 +107,14 @@ var TWO_PI2 = Math.PI * 2;
113
107
  function deltoidFn(phase, _elapsed, _params) {
114
108
  return {
115
109
  x: 2 * Math.cos(phase) + Math.cos(2 * phase),
116
- y: 2 * Math.sin(phase) - Math.sin(2 * phase),
110
+ y: 2 * Math.sin(phase) - Math.sin(2 * phase)
117
111
  };
118
112
  }
119
113
  var deltoid = {
120
114
  name: "Deltoid",
121
115
  fn: deltoidFn,
122
116
  period: TWO_PI2,
123
- speed: 0.9,
117
+ speed: 0.9
124
118
  };
125
119
 
126
120
  // src/curves/epicycloid3.ts
@@ -128,14 +122,14 @@ var TWO_PI3 = Math.PI * 2;
128
122
  function epicycloid3Fn(phase, _elapsed, _params) {
129
123
  return {
130
124
  x: 4 * Math.cos(phase) - Math.cos(4 * phase),
131
- y: 4 * Math.sin(phase) - Math.sin(4 * phase),
125
+ y: 4 * Math.sin(phase) - Math.sin(4 * phase)
132
126
  };
133
127
  }
134
128
  var epicycloid3 = {
135
129
  name: "Epicycloid (n=3)",
136
130
  fn: epicycloid3Fn,
137
131
  period: TWO_PI3,
138
- speed: 0.75,
132
+ speed: 0.75
139
133
  };
140
134
 
141
135
  // src/curves/epitrochoid7.ts
@@ -144,14 +138,14 @@ function epitrochoid7Fn(phase, _elapsed, _params) {
144
138
  const d = 1 + 0.55 * Math.sin(phase * 0.5);
145
139
  return {
146
140
  x: 7 * Math.cos(phase) - d * Math.cos(7 * phase),
147
- y: 7 * Math.sin(phase) - d * Math.sin(7 * phase),
141
+ y: 7 * Math.sin(phase) - d * Math.sin(7 * phase)
148
142
  };
149
143
  }
150
144
  function epitrochoid7SkeletonFn(phase) {
151
145
  const d = 1.275;
152
146
  return {
153
147
  x: 7 * Math.cos(phase) - d * Math.cos(7 * phase),
154
- y: 7 * Math.sin(phase) - d * Math.sin(7 * phase),
148
+ y: 7 * Math.sin(phase) - d * Math.sin(7 * phase)
155
149
  };
156
150
  }
157
151
  var epitrochoid7 = {
@@ -159,7 +153,7 @@ var epitrochoid7 = {
159
153
  fn: epitrochoid7Fn,
160
154
  period: TWO_PI4,
161
155
  speed: 1.4,
162
- skeletonFn: epitrochoid7SkeletonFn,
156
+ skeletonFn: epitrochoid7SkeletonFn
163
157
  };
164
158
 
165
159
  // src/curves/lissajous32.ts
@@ -168,7 +162,7 @@ function lissajous32Fn(phase, elapsed, _params) {
168
162
  const phi = elapsed * 0.45;
169
163
  return {
170
164
  x: Math.sin(3 * phase + phi),
171
- y: Math.sin(2 * phase),
165
+ y: Math.sin(2 * phase)
172
166
  };
173
167
  }
174
168
  var lissajous32 = {
@@ -176,7 +170,7 @@ var lissajous32 = {
176
170
  fn: lissajous32Fn,
177
171
  period: TWO_PI5,
178
172
  speed: 2,
179
- skeleton: "live",
173
+ skeleton: "live"
180
174
  };
181
175
 
182
176
  // src/curves/lissajous43.ts
@@ -185,7 +179,7 @@ function lissajous43Fn(phase, elapsed, _params) {
185
179
  const phi = elapsed * 0.38;
186
180
  return {
187
181
  x: Math.sin(4 * phase + phi),
188
- y: Math.sin(3 * phase),
182
+ y: Math.sin(3 * phase)
189
183
  };
190
184
  }
191
185
  var lissajous43 = {
@@ -193,18 +187,17 @@ var lissajous43 = {
193
187
  fn: lissajous43Fn,
194
188
  period: TWO_PI6,
195
189
  speed: 1.8,
196
- skeleton: "live",
190
+ skeleton: "live"
197
191
  };
198
192
 
199
193
  // src/curves/lame.ts
200
194
  var TWO_PI7 = Math.PI * 2;
201
195
  function lameFn(phase, elapsed, _params) {
202
196
  const p = 1.75 + 1.25 * Math.sin(elapsed * 0.48);
203
- const c = Math.cos(phase),
204
- s = Math.sin(phase);
197
+ const c = Math.cos(phase), s = Math.sin(phase);
205
198
  return {
206
199
  x: Math.sign(c) * Math.pow(Math.abs(c), p),
207
- y: Math.sign(s) * Math.pow(Math.abs(s), p),
200
+ y: Math.sign(s) * Math.pow(Math.abs(s), p)
208
201
  };
209
202
  }
210
203
  var lame = {
@@ -212,7 +205,7 @@ var lame = {
212
205
  fn: lameFn,
213
206
  period: TWO_PI7,
214
207
  speed: 1,
215
- skeleton: "live",
208
+ skeleton: "live"
216
209
  };
217
210
 
218
211
  // src/curves/rose3.ts
@@ -221,14 +214,14 @@ function rose3Fn(phase, _elapsed, _params) {
221
214
  const r = Math.cos(3 * phase);
222
215
  return {
223
216
  x: r * Math.cos(phase),
224
- y: r * Math.sin(phase),
217
+ y: r * Math.sin(phase)
225
218
  };
226
219
  }
227
220
  var rose3 = {
228
221
  name: "Rose (n=3)",
229
222
  fn: rose3Fn,
230
223
  period: TWO_PI8,
231
- speed: 1.15,
224
+ speed: 1.15
232
225
  };
233
226
 
234
227
  // src/curves/rose5.ts
@@ -237,87 +230,78 @@ function rose5Fn(phase, _elapsed, _params) {
237
230
  const r = Math.cos(5 * phase);
238
231
  return {
239
232
  x: r * Math.cos(phase),
240
- y: r * Math.sin(phase),
233
+ y: r * Math.sin(phase)
241
234
  };
242
235
  }
243
236
  var rose5 = {
244
237
  name: "Rose (n=5)",
245
238
  fn: rose5Fn,
246
239
  period: TWO_PI9,
247
- speed: 1,
240
+ speed: 1
248
241
  };
249
242
 
250
243
  // src/curves/rose52.ts
251
244
  var FOUR_PI = Math.PI * 4;
252
245
  function rose52Fn(phase, _elapsed, _params) {
253
- const r = Math.cos((5 / 2) * phase);
246
+ const r = Math.cos(5 / 2 * phase);
254
247
  return {
255
248
  x: r * Math.cos(phase),
256
- y: r * Math.sin(phase),
249
+ y: r * Math.sin(phase)
257
250
  };
258
251
  }
259
252
  var rose52 = {
260
253
  name: "Rose (n=5/2)",
261
254
  fn: rose52Fn,
262
255
  period: FOUR_PI,
263
- speed: 0.8,
256
+ speed: 0.8
264
257
  };
265
258
 
266
259
  // src/curves/star.ts
267
260
  var TWO_PI10 = Math.PI * 2;
268
261
  function starFn(phase, _elapsed, _params) {
269
- const r =
270
- Math.abs(Math.cos((5 / 2) * phase)) +
271
- 0.35 * Math.abs(Math.cos((15 / 2) * phase)) +
272
- 0.15 * Math.abs(Math.cos((25 / 2) * phase));
262
+ 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));
273
263
  return {
274
264
  x: r * Math.cos(phase),
275
- y: r * Math.sin(phase),
265
+ y: r * Math.sin(phase)
276
266
  };
277
267
  }
278
268
  var star = {
279
269
  name: "Star",
280
270
  fn: starFn,
281
271
  period: TWO_PI10,
282
- speed: 1,
272
+ speed: 1
283
273
  };
284
274
 
285
275
  // src/curves/star4.ts
286
276
  var TWO_PI11 = Math.PI * 2;
287
277
  function star4Fn(phase, _elapsed, _params) {
288
- const r =
289
- Math.abs(Math.cos(2 * phase)) +
290
- 0.35 * Math.abs(Math.cos(6 * phase)) +
291
- 0.15 * Math.abs(Math.cos(10 * phase));
278
+ const r = Math.abs(Math.cos(2 * phase)) + 0.35 * Math.abs(Math.cos(6 * phase)) + 0.15 * Math.abs(Math.cos(10 * phase));
292
279
  return {
293
280
  x: r * Math.cos(phase),
294
- y: r * Math.sin(phase),
281
+ y: r * Math.sin(phase)
295
282
  };
296
283
  }
297
284
  var star4 = {
298
285
  name: "Star (4-arm)",
299
286
  fn: star4Fn,
300
287
  period: TWO_PI11,
301
- speed: 1,
288
+ speed: 1
302
289
  };
303
290
 
304
291
  // src/curves/star7.ts
305
292
  var TWO_PI12 = Math.PI * 2;
306
293
  function star7Fn(phase, _elapsed, _params) {
307
- const r =
308
- Math.abs(Math.cos((7 / 2) * phase)) +
309
- 0.35 * Math.abs(Math.cos((21 / 2) * phase)) +
310
- 0.15 * Math.abs(Math.cos((35 / 2) * phase));
294
+ 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));
311
295
  return {
312
296
  x: r * Math.cos(phase),
313
- y: r * Math.sin(phase),
297
+ y: r * Math.sin(phase)
314
298
  };
315
299
  }
316
300
  var star7 = {
317
301
  name: "Star (7-arm)",
318
302
  fn: star7Fn,
319
303
  period: TWO_PI12,
320
- speed: 1,
304
+ speed: 1
321
305
  };
322
306
 
323
307
  // src/curves/index.ts
@@ -335,7 +319,7 @@ var curves = {
335
319
  lissajous32,
336
320
  lissajous43,
337
321
  epicycloid3,
338
- lame,
322
+ lame
339
323
  };
340
324
 
341
325
  exports.artemis2 = artemis2;
@@ -354,4 +338,4 @@ exports.star = star;
354
338
  exports.star4 = star4;
355
339
  exports.star7 = star7;
356
340
  //# sourceMappingURL=index.cjs.map
357
- //# sourceMappingURL=index.cjs.map
341
+ //# sourceMappingURL=index.cjs.map
@@ -1,38 +1,38 @@
1
- import { C as CurveDef } from "../types-zbxUgcmZ.cjs";
2
- export { artemis2 } from "./artemis2.cjs";
3
- export { astroid } from "./astroid.cjs";
4
- export { deltoid } from "./deltoid.cjs";
5
- export { epicycloid3 } from "./epicycloid3.cjs";
6
- export { epitrochoid7 } from "./epitrochoid7.cjs";
7
- export { lissajous32 } from "./lissajous32.cjs";
8
- export { lissajous43 } from "./lissajous43.cjs";
9
- export { lame } from "./lame.cjs";
10
- export { rose3 } from "./rose3.cjs";
11
- export { rose5 } from "./rose5.cjs";
12
- export { rose52 } from "./rose52.cjs";
13
- export { star } from "./star.cjs";
14
- export { star4 } from "./star4.cjs";
15
- export { star7 } from "./star7.cjs";
1
+ import { C as CurveDef } from '../types-zbxUgcmZ.cjs';
2
+ export { artemis2 } from './artemis2.cjs';
3
+ export { astroid } from './astroid.cjs';
4
+ export { deltoid } from './deltoid.cjs';
5
+ export { epicycloid3 } from './epicycloid3.cjs';
6
+ export { epitrochoid7 } from './epitrochoid7.cjs';
7
+ export { lissajous32 } from './lissajous32.cjs';
8
+ export { lissajous43 } from './lissajous43.cjs';
9
+ export { lame } from './lame.cjs';
10
+ export { rose3 } from './rose3.cjs';
11
+ export { rose5 } from './rose5.cjs';
12
+ export { rose52 } from './rose52.cjs';
13
+ export { star } from './star.cjs';
14
+ export { star4 } from './star4.cjs';
15
+ export { star7 } from './star7.cjs';
16
16
 
17
17
  /**
18
18
  * Collection of all built-in sarmal curves
19
19
  * Import individual curves for better tree-shaking
20
20
  */
21
21
  declare const curves: {
22
- readonly artemis2: CurveDef;
23
- readonly epitrochoid7: CurveDef;
24
- readonly astroid: CurveDef;
25
- readonly deltoid: CurveDef;
26
- readonly rose3: CurveDef;
27
- readonly rose5: CurveDef;
28
- readonly rose52: CurveDef;
29
- readonly star: CurveDef;
30
- readonly star4: CurveDef;
31
- readonly star7: CurveDef;
32
- readonly lissajous32: CurveDef;
33
- readonly lissajous43: CurveDef;
34
- readonly epicycloid3: CurveDef;
35
- readonly lame: CurveDef;
22
+ readonly artemis2: CurveDef;
23
+ readonly epitrochoid7: CurveDef;
24
+ readonly astroid: CurveDef;
25
+ readonly deltoid: CurveDef;
26
+ readonly rose3: CurveDef;
27
+ readonly rose5: CurveDef;
28
+ readonly rose52: CurveDef;
29
+ readonly star: CurveDef;
30
+ readonly star4: CurveDef;
31
+ readonly star7: CurveDef;
32
+ readonly lissajous32: CurveDef;
33
+ readonly lissajous43: CurveDef;
34
+ readonly epicycloid3: CurveDef;
35
+ readonly lame: CurveDef;
36
36
  };
37
37
  type CurveName = keyof typeof curves;
38
38