curvy 1.0.6 → 1.0.7

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.
@@ -1,9 +1,9 @@
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.Cnu_4-XZ.mjs';
1
+ import { i as isMatrix3x3$1, m as make, f as fromRows$1, a as fromColumns$1, s as setRow$1, b as setColumn$1, d as determinant$1, c as minor$1, v as vectorProductLeft$1, e as vectorProductRight$1, g as solveSystem$1, t as toRows$1, h as toColumns$1, r as rowVector$1, j as columnVector$1, k as transpose$1, l as reverseRows$1, n as reverseColumns$1 } from '../shared/curvy.NLeFCr-9.mjs';
2
2
  import '../shared/curvy.Cps2R_RU.mjs';
3
3
  import '../utils.mjs';
4
4
  import '../pipe.mjs';
5
5
  import '../shared/curvy.BZ_mTkJe.mjs';
6
- import '../shared/curvy.D4MAcMgx.mjs';
6
+ import '../shared/curvy.Ck0of1PI.mjs';
7
7
 
8
8
  const isMatrix3x3 = isMatrix3x3$1;
9
9
  const matrix3x3 = make;
@@ -2,9 +2,9 @@ import { n as toFourDimensionalIndex } from '../shared/curvy.Cps2R_RU.mjs';
2
2
  import { dual, Pipeable } from '../pipe.mjs';
3
3
  import { round, invariant } from '../utils.mjs';
4
4
  import { c as components, m as make$3, d as dot } from '../shared/curvy.C2XGH0R0.mjs';
5
- import { d as determinant$2, m as make$2 } from '../shared/curvy.Cnu_4-XZ.mjs';
5
+ import { d as determinant$2, m as make$2 } from '../shared/curvy.NLeFCr-9.mjs';
6
6
  import '../shared/curvy.BZ_mTkJe.mjs';
7
- import '../shared/curvy.D4MAcMgx.mjs';
7
+ import '../shared/curvy.Ck0of1PI.mjs';
8
8
 
9
9
  const Matrix4x4TypeId = Symbol.for("curvy/matrix4x4");
10
10
  class Matrix4x4Impl extends Pipeable {
@@ -31,6 +31,11 @@ class Vector3Impl extends Pipeable {
31
31
  }
32
32
  const isVector3 = (v) => typeof v === "object" && v !== null && Vector3TypeId in v;
33
33
  const make = (v0, v1 = v0, v2 = v1) => new Vector3Impl(v0, v1, v2);
34
+ const fromSpherical = (r, theta, phi) => make(
35
+ r * Math.sin(phi) * Math.cos(theta),
36
+ r * Math.sin(phi) * Math.sin(theta),
37
+ r * Math.cos(phi)
38
+ );
34
39
  const magnitude = (vector) => round(Math.hypot(vector.x, vector.y, vector.z));
35
40
  const normalize = (vector) => {
36
41
  const m = magnitude(vector);
@@ -73,4 +78,4 @@ const setTheta = dual(2, (v, theta) => {
73
78
  return make(m * Math.cos(theta), m * Math.sin(theta), v.z);
74
79
  });
75
80
 
76
- export { magnitude as a, add as b, components as c, dot as d, subtract as e, scale as f, getX as g, hadamard as h, isVector3 as i, setX as j, getY as k, setY as l, make as m, normalize as n, getZ as o, setZ as p, setR as q, getTheta as r, softmax as s, setTheta as t, getPhi as u, setPhi as v };
81
+ export { magnitude as a, add as b, components as c, dot as d, subtract as e, fromSpherical as f, scale as g, hadamard as h, isVector3 as i, getX as j, setX as k, getY as l, make as m, normalize as n, setY as o, getZ as p, setZ as q, setR as r, softmax as s, getTheta as t, setTheta as u, getPhi as v, setPhi as w };
@@ -1,7 +1,7 @@
1
1
  import { o as toThreeDimensionalIndex, d as determinant$1, m as make$1 } from './curvy.Cps2R_RU.mjs';
2
2
  import { dual, Pipeable } from '../pipe.mjs';
3
3
  import { round, invariant } from '../utils.mjs';
4
- import { c as components, m as make$2, d as dot } from './curvy.D4MAcMgx.mjs';
4
+ import { c as components, m as make$2, d as dot } from './curvy.Ck0of1PI.mjs';
5
5
 
6
6
  const Matrix3x3TypeId = Symbol.for("curvy/matrix3x3");
7
7
  class Matrix3x3Impl extends Pipeable {
@@ -6,8 +6,8 @@ import { t as toCurves, f as fromSpline } from '../shared/curvy.CE4X6_Is.mjs';
6
6
  import '../shared/curvy.Cps2R_RU.mjs';
7
7
  import '../shared/curvy.BZ_mTkJe.mjs';
8
8
  import '../shared/curvy.C2XGH0R0.mjs';
9
- import '../shared/curvy.Cnu_4-XZ.mjs';
10
- import '../shared/curvy.D4MAcMgx.mjs';
9
+ import '../shared/curvy.NLeFCr-9.mjs';
10
+ import '../shared/curvy.Ck0of1PI.mjs';
11
11
  import '../curve/cubic2d.mjs';
12
12
  import '../interval.mjs';
13
13
  import '../shared/curvy.DmVFTi0N.mjs';
@@ -5,8 +5,8 @@ import '../utils.mjs';
5
5
  import '../pipe.mjs';
6
6
  import '../shared/curvy.BZ_mTkJe.mjs';
7
7
  import '../shared/curvy.C2XGH0R0.mjs';
8
- import '../shared/curvy.Cnu_4-XZ.mjs';
9
- import '../shared/curvy.D4MAcMgx.mjs';
8
+ import '../shared/curvy.NLeFCr-9.mjs';
9
+ import '../shared/curvy.Ck0of1PI.mjs';
10
10
  import '../path/cubic2d.mjs';
11
11
  import '../curve/cubic2d.mjs';
12
12
  import '../interval.mjs';
@@ -7,8 +7,8 @@ import { t as toCurves, f as fromSpline } from '../shared/curvy.CE4X6_Is.mjs';
7
7
  import '../shared/curvy.Cps2R_RU.mjs';
8
8
  import '../shared/curvy.BZ_mTkJe.mjs';
9
9
  import '../shared/curvy.C2XGH0R0.mjs';
10
- import '../shared/curvy.Cnu_4-XZ.mjs';
11
- import '../shared/curvy.D4MAcMgx.mjs';
10
+ import '../shared/curvy.NLeFCr-9.mjs';
11
+ import '../shared/curvy.Ck0of1PI.mjs';
12
12
  import '../curve/cubic2d.mjs';
13
13
  import '../interval.mjs';
14
14
  import '../shared/curvy.DmVFTi0N.mjs';
@@ -6,8 +6,8 @@ import { t as toCurves, f as fromSpline } from '../shared/curvy.CE4X6_Is.mjs';
6
6
  import '../shared/curvy.Cps2R_RU.mjs';
7
7
  import '../shared/curvy.BZ_mTkJe.mjs';
8
8
  import '../shared/curvy.C2XGH0R0.mjs';
9
- import '../shared/curvy.Cnu_4-XZ.mjs';
10
- import '../shared/curvy.D4MAcMgx.mjs';
9
+ import '../shared/curvy.NLeFCr-9.mjs';
10
+ import '../shared/curvy.Ck0of1PI.mjs';
11
11
  import '../curve/cubic2d.mjs';
12
12
  import '../interval.mjs';
13
13
  import '../shared/curvy.DmVFTi0N.mjs';
@@ -13,6 +13,7 @@ declare const make: {
13
13
  (x: number, yz: number): Vector3;
14
14
  (x: number, y: number, z: number): Vector3;
15
15
  };
16
+ declare const fromSpherical: (r: number, theta: number, phi: number) => Vector3;
16
17
  declare const magnitude: (vector: Vector3) => number;
17
18
  declare const normalize: (vector: Vector3) => Vector3;
18
19
  declare const dot: {
@@ -69,4 +70,4 @@ declare const setPhi: {
69
70
  (phi: number): (v: Vector3) => Vector3;
70
71
  };
71
72
 
72
- export { type Vector3, add, components, dot, getPhi, getR, getTheta, getX, getY, getZ, hadamard, isVector3, magnitude, make, normalize, scale, setPhi, setR, setTheta, setX, setY, setZ, softmax, subtract, zero };
73
+ export { type Vector3, add, components, dot, fromSpherical, getPhi, getR, getTheta, getX, getY, getZ, hadamard, isVector3, magnitude, make, normalize, scale, setPhi, setR, setTheta, setX, setY, setZ, softmax, subtract, zero };
@@ -13,6 +13,7 @@ declare const make: {
13
13
  (x: number, yz: number): Vector3;
14
14
  (x: number, y: number, z: number): Vector3;
15
15
  };
16
+ declare const fromSpherical: (r: number, theta: number, phi: number) => Vector3;
16
17
  declare const magnitude: (vector: Vector3) => number;
17
18
  declare const normalize: (vector: Vector3) => Vector3;
18
19
  declare const dot: {
@@ -69,4 +70,4 @@ declare const setPhi: {
69
70
  (phi: number): (v: Vector3) => Vector3;
70
71
  };
71
72
 
72
- export { type Vector3, add, components, dot, getPhi, getR, getTheta, getX, getY, getZ, hadamard, isVector3, magnitude, make, normalize, scale, setPhi, setR, setTheta, setX, setY, setZ, softmax, subtract, zero };
73
+ export { type Vector3, add, components, dot, fromSpherical, getPhi, getR, getTheta, getX, getY, getZ, hadamard, isVector3, magnitude, make, normalize, scale, setPhi, setR, setTheta, setX, setY, setZ, softmax, subtract, zero };
@@ -1,9 +1,10 @@
1
- import { i as isVector3$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, b as add$1, e as subtract$1, h as hadamard$1, f as scale$1, g as getX$1, j as setX$1, k as getY$1, l as setY$1, o as getZ$1, p as setZ$1, q as setR$1, r as getTheta$1, t as setTheta$1, u as getPhi$1, v as setPhi$1 } from '../shared/curvy.D4MAcMgx.mjs';
1
+ import { i as isVector3$1, m as make$1, f as fromSpherical$1, a as magnitude$1, n as normalize$1, d as dot$1, c as components$1, s as softmax$1, b as add$1, e as subtract$1, h as hadamard$1, g as scale$1, j as getX$1, k as setX$1, l as getY$1, o as setY$1, p as getZ$1, q as setZ$1, r as setR$1, t as getTheta$1, u as setTheta$1, v as getPhi$1, w as setPhi$1 } from '../shared/curvy.Ck0of1PI.mjs';
2
2
  import '../pipe.mjs';
3
3
  import '../utils.mjs';
4
4
 
5
5
  const isVector3 = isVector3$1;
6
6
  const make = make$1;
7
+ const fromSpherical = fromSpherical$1;
7
8
  const magnitude = magnitude$1;
8
9
  const normalize = normalize$1;
9
10
  const dot = dot$1;
@@ -27,4 +28,4 @@ const setTheta = setTheta$1;
27
28
  const getPhi = getPhi$1;
28
29
  const setPhi = setPhi$1;
29
30
 
30
- export { add, components, dot, getPhi, getR, getTheta, getX, getY, getZ, hadamard, isVector3, magnitude, make, normalize, scale, setPhi, setR, setTheta, setX, setY, setZ, softmax, subtract, zero };
31
+ export { add, components, dot, fromSpherical, getPhi, getR, getTheta, getX, getY, getZ, hadamard, isVector3, magnitude, make, normalize, scale, setPhi, setR, setTheta, setX, setY, setZ, softmax, subtract, zero };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "curvy",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Spline and Curve utilities",
5
5
  "author": "Tim Morris <timthewebguy@gmail.com>",
6
6
  "homepage": "https://github.com/tkofh/curvy#readme",