curvy 1.0.4 → 1.0.6
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.mjs +1 -1
- package/dist/curve/linear2d.mjs +1 -1
- package/dist/curve/quadratic2d.mjs +1 -1
- package/dist/matrix/matrix2x2.mjs +2 -2
- package/dist/matrix/matrix3x3.mjs +4 -4
- package/dist/matrix/matrix4x4.mjs +4 -4
- package/dist/path/cubic2d.mjs +1 -1
- package/dist/path/linear2d.mjs +1 -1
- package/dist/path/quadratic2d.mjs +1 -1
- package/dist/shared/{curvy.DSxnsSFS.mjs → curvy.BZ_mTkJe.mjs} +12 -1
- package/dist/shared/{curvy.BvJuXVua.mjs → curvy.Cnu_4-XZ.mjs} +2 -2
- package/dist/shared/{curvy.BYDuJMHv.mjs → curvy.Cps2R_RU.mjs} +1 -1
- package/dist/shared/{curvy.D7YvJAMV.mjs → curvy.D4MAcMgx.mjs} +24 -2
- package/dist/splines/basis2d.mjs +4 -4
- package/dist/splines/bezier2d.mjs +4 -4
- package/dist/splines/cardinal2d.mjs +4 -4
- package/dist/splines/hermite2d.mjs +4 -4
- package/dist/vector/vector2.d.mts +22 -1
- package/dist/vector/vector2.d.ts +22 -1
- package/dist/vector/vector2.mjs +11 -2
- package/dist/vector/vector3.d.mts +31 -1
- package/dist/vector/vector3.d.ts +31 -1
- package/dist/vector/vector3.mjs +14 -2
- package/package.json +1 -1
package/dist/curve/cubic2d.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import { solve as solve$4 } from './linear2d.mjs';
|
|
|
9
9
|
import { length as length$2, fromPolynomials as fromPolynomials$2, solve as solve$3, derivative as derivative$1 } from './quadratic2d.mjs';
|
|
10
10
|
import '../shared/curvy.BzVmUIKm.mjs';
|
|
11
11
|
import '../shared/curvy.BDhiZ7He.mjs';
|
|
12
|
-
import '../shared/curvy.
|
|
12
|
+
import '../shared/curvy.BZ_mTkJe.mjs';
|
|
13
13
|
import '../polynomial/linear.mjs';
|
|
14
14
|
|
|
15
15
|
const CubicCurve2dTypeId = Symbol("curvy/curve/cubic2d");
|
package/dist/curve/linear2d.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { round } from '../utils.mjs';
|
|
|
4
4
|
import { make as make$1 } from '../vector/vector2.mjs';
|
|
5
5
|
import '../shared/curvy.BDhiZ7He.mjs';
|
|
6
6
|
import '../interval.mjs';
|
|
7
|
-
import '../shared/curvy.
|
|
7
|
+
import '../shared/curvy.BZ_mTkJe.mjs';
|
|
8
8
|
|
|
9
9
|
const LinearCurve2dTypeId = Symbol("curvy/curve/linear2d");
|
|
10
10
|
class LinearCurve2dImpl extends Pipeable {
|
|
@@ -8,7 +8,7 @@ import { make as make$1, magnitude, cross } from '../vector/vector2.mjs';
|
|
|
8
8
|
import { fromPolynomials as fromPolynomials$2, length as length$2, solve as solve$3, derivative as derivative$3 } from './linear2d.mjs';
|
|
9
9
|
import '../shared/curvy.BDhiZ7He.mjs';
|
|
10
10
|
import '../shared/curvy.BzVmUIKm.mjs';
|
|
11
|
-
import '../shared/curvy.
|
|
11
|
+
import '../shared/curvy.BZ_mTkJe.mjs';
|
|
12
12
|
|
|
13
13
|
const QuadraticCurve2dTypeId = Symbol(
|
|
14
14
|
"curvy/curve/quadratic2d"
|
|
@@ -1,7 +1,7 @@
|
|
|
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.Cps2R_RU.mjs';
|
|
2
2
|
import '../utils.mjs';
|
|
3
3
|
import '../pipe.mjs';
|
|
4
|
-
import '../shared/curvy.
|
|
4
|
+
import '../shared/curvy.BZ_mTkJe.mjs';
|
|
5
5
|
|
|
6
6
|
const isMatrix2x2 = isMatrix2x2$1;
|
|
7
7
|
const matrix2x2 = make;
|
|
@@ -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.
|
|
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.Cnu_4-XZ.mjs';
|
|
2
|
+
import '../shared/curvy.Cps2R_RU.mjs';
|
|
3
3
|
import '../utils.mjs';
|
|
4
4
|
import '../pipe.mjs';
|
|
5
|
-
import '../shared/curvy.
|
|
6
|
-
import '../shared/curvy.
|
|
5
|
+
import '../shared/curvy.BZ_mTkJe.mjs';
|
|
6
|
+
import '../shared/curvy.D4MAcMgx.mjs';
|
|
7
7
|
|
|
8
8
|
const isMatrix3x3 = isMatrix3x3$1;
|
|
9
9
|
const matrix3x3 = make;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { n as toFourDimensionalIndex } from '../shared/curvy.
|
|
1
|
+
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.
|
|
6
|
-
import '../shared/curvy.
|
|
7
|
-
import '../shared/curvy.
|
|
5
|
+
import { d as determinant$2, m as make$2 } from '../shared/curvy.Cnu_4-XZ.mjs';
|
|
6
|
+
import '../shared/curvy.BZ_mTkJe.mjs';
|
|
7
|
+
import '../shared/curvy.D4MAcMgx.mjs';
|
|
8
8
|
|
|
9
9
|
const Matrix4x4TypeId = Symbol.for("curvy/matrix4x4");
|
|
10
10
|
class Matrix4x4Impl extends Pipeable {
|
package/dist/path/cubic2d.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import '../shared/curvy.BzVmUIKm.mjs';
|
|
|
8
8
|
import '../shared/curvy.BDhiZ7He.mjs';
|
|
9
9
|
import '../polynomial/quadratic.mjs';
|
|
10
10
|
import '../vector/vector2.mjs';
|
|
11
|
-
import '../shared/curvy.
|
|
11
|
+
import '../shared/curvy.BZ_mTkJe.mjs';
|
|
12
12
|
import '../curve/linear2d.mjs';
|
|
13
13
|
import '../polynomial/linear.mjs';
|
|
14
14
|
import '../curve/quadratic2d.mjs';
|
package/dist/path/linear2d.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { round } from '../utils.mjs';
|
|
|
5
5
|
import '../polynomial/linear.mjs';
|
|
6
6
|
import '../shared/curvy.BDhiZ7He.mjs';
|
|
7
7
|
import '../vector/vector2.mjs';
|
|
8
|
-
import '../shared/curvy.
|
|
8
|
+
import '../shared/curvy.BZ_mTkJe.mjs';
|
|
9
9
|
|
|
10
10
|
const LinearPath2dTypeId = Symbol("curvy/path/linear2d");
|
|
11
11
|
class LinearPath2dImpl extends Pipeable {
|
|
@@ -8,7 +8,7 @@ import '../shared/curvy.BDhiZ7He.mjs';
|
|
|
8
8
|
import '../polynomial/quadratic.mjs';
|
|
9
9
|
import '../shared/curvy.BzVmUIKm.mjs';
|
|
10
10
|
import '../vector/vector2.mjs';
|
|
11
|
-
import '../shared/curvy.
|
|
11
|
+
import '../shared/curvy.BZ_mTkJe.mjs';
|
|
12
12
|
import '../curve/linear2d.mjs';
|
|
13
13
|
|
|
14
14
|
const QuadraticPath2dTypeId = Symbol(
|
|
@@ -26,6 +26,7 @@ class Vector2Impl extends Pipeable {
|
|
|
26
26
|
}
|
|
27
27
|
const isVector2 = (v) => typeof v === "object" && v !== null && Vector2TypeId in v;
|
|
28
28
|
const make = (v0, v1 = v0) => new Vector2Impl(v0, v1);
|
|
29
|
+
const fromPolar = (r, theta) => make(r * Math.cos(theta), r * Math.sin(theta));
|
|
29
30
|
const components = (v) => [v.x, v.y];
|
|
30
31
|
const magnitude = (vector) => round(Math.hypot(vector.x, vector.y));
|
|
31
32
|
const normalize = (vector) => {
|
|
@@ -45,5 +46,15 @@ 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
|
const scale = dual(2, (v, s) => s === 1 ? v : make(v.x * s, v.y * s));
|
|
49
|
+
const getX = (v) => v.x;
|
|
50
|
+
const setX = dual(2, (v, x) => make(x, v.y));
|
|
51
|
+
const getY = (v) => v.y;
|
|
52
|
+
const setY = dual(2, (v, y) => make(v.x, y));
|
|
53
|
+
const setR = dual(2, (v, r) => scale(r / magnitude(v))(v));
|
|
54
|
+
const getTheta = (v) => round(Math.atan2(v.y, v.x));
|
|
55
|
+
const setTheta = dual(2, (v, theta) => {
|
|
56
|
+
const r = magnitude(v);
|
|
57
|
+
return make(r * Math.cos(theta), r * Math.sin(theta));
|
|
58
|
+
});
|
|
48
59
|
|
|
49
|
-
export { magnitude as a, components as b, cross as c, dot as d, add as e,
|
|
60
|
+
export { magnitude as a, components as b, cross as c, dot as d, add as e, fromPolar as f, subtract as g, hadamard as h, isVector2 as i, scale as j, getX as k, setX as l, make as m, normalize as n, getY as o, setY as p, setR as q, getTheta as r, softmax as s, setTheta as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
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.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.
|
|
4
|
+
import { c as components, m as make$2, d as dot } from './curvy.D4MAcMgx.mjs';
|
|
5
5
|
|
|
6
6
|
const Matrix3x3TypeId = Symbol.for("curvy/matrix3x3");
|
|
7
7
|
class Matrix3x3Impl extends Pipeable {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { invariant, round } from '../utils.mjs';
|
|
2
2
|
import { dual, Pipeable } from '../pipe.mjs';
|
|
3
|
-
import { m as make$1, d as dot } from './curvy.
|
|
3
|
+
import { m as make$1, d as dot } from './curvy.BZ_mTkJe.mjs';
|
|
4
4
|
|
|
5
5
|
function toIndex(input) {
|
|
6
6
|
if (typeof input === "number") {
|
|
@@ -30,6 +30,7 @@ class Vector3Impl extends Pipeable {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
const isVector3 = (v) => typeof v === "object" && v !== null && Vector3TypeId in v;
|
|
33
|
+
const make = (v0, v1 = v0, v2 = v1) => new Vector3Impl(v0, v1, v2);
|
|
33
34
|
const magnitude = (vector) => round(Math.hypot(vector.x, vector.y, vector.z));
|
|
34
35
|
const normalize = (vector) => {
|
|
35
36
|
const m = magnitude(vector);
|
|
@@ -45,10 +46,31 @@ const softmax = (v) => {
|
|
|
45
46
|
const sum = v0 + v1 + v2;
|
|
46
47
|
return make(v0 / sum, v1 / sum, v2 / sum);
|
|
47
48
|
};
|
|
48
|
-
const make = (v0, v1 = v0, v2 = v1) => new Vector3Impl(v0, v1, v2);
|
|
49
49
|
const add = dual(2, (a, b) => make(a.x + b.x, a.y + b.y, a.z + b.z));
|
|
50
50
|
const subtract = dual(2, (a, b) => make(a.x - b.x, a.y - b.y, a.z - b.z));
|
|
51
51
|
const hadamard = dual(2, (a, b) => make(a.x * b.x, a.y * b.y, a.z * b.z));
|
|
52
52
|
const scale = dual(2, (v, s) => s === 1 ? v : make(v.x * s, v.y * s, v.z * s));
|
|
53
|
+
const getX = (v) => v.x;
|
|
54
|
+
const setX = dual(2, (v, x) => make(x, v.y, v.z));
|
|
55
|
+
const getY = (v) => v.y;
|
|
56
|
+
const setY = dual(2, (v, y) => make(v.x, y, v.z));
|
|
57
|
+
const getZ = (v) => v.z;
|
|
58
|
+
const setZ = dual(2, (v, z) => make(v.x, v.y, z));
|
|
59
|
+
const setR = dual(2, (v, r) => scale(r / magnitude(v))(v));
|
|
60
|
+
const getPhi = (v) => Math.acos(v.z / magnitude(v));
|
|
61
|
+
const setPhi = dual(2, (v, phi) => {
|
|
62
|
+
const m = magnitude(v);
|
|
63
|
+
const sinPhi = Math.sin(phi);
|
|
64
|
+
return make(
|
|
65
|
+
m * sinPhi * Math.cos(v.y),
|
|
66
|
+
m * sinPhi * Math.sin(v.y),
|
|
67
|
+
m * Math.cos(phi)
|
|
68
|
+
);
|
|
69
|
+
});
|
|
70
|
+
const getTheta = (v) => round(Math.atan2(v.y, v.x));
|
|
71
|
+
const setTheta = dual(2, (v, theta) => {
|
|
72
|
+
const m = magnitude(v);
|
|
73
|
+
return make(m * Math.cos(theta), m * Math.sin(theta), v.z);
|
|
74
|
+
});
|
|
53
75
|
|
|
54
|
-
export { magnitude as a, add as b, components as c, dot as d, subtract as e, scale as f, hadamard as h, isVector3 as i, make as m, normalize as n, softmax as s };
|
|
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 };
|
package/dist/splines/basis2d.mjs
CHANGED
|
@@ -3,11 +3,11 @@ import { fromCurves } from '../path/cubic2d.mjs';
|
|
|
3
3
|
import { dual, Pipeable } from '../pipe.mjs';
|
|
4
4
|
import { roundDown, invariant } from '../utils.mjs';
|
|
5
5
|
import { t as toCurves, f as fromSpline } from '../shared/curvy.CE4X6_Is.mjs';
|
|
6
|
-
import '../shared/curvy.
|
|
7
|
-
import '../shared/curvy.
|
|
6
|
+
import '../shared/curvy.Cps2R_RU.mjs';
|
|
7
|
+
import '../shared/curvy.BZ_mTkJe.mjs';
|
|
8
8
|
import '../shared/curvy.C2XGH0R0.mjs';
|
|
9
|
-
import '../shared/curvy.
|
|
10
|
-
import '../shared/curvy.
|
|
9
|
+
import '../shared/curvy.Cnu_4-XZ.mjs';
|
|
10
|
+
import '../shared/curvy.D4MAcMgx.mjs';
|
|
11
11
|
import '../curve/cubic2d.mjs';
|
|
12
12
|
import '../interval.mjs';
|
|
13
13
|
import '../shared/curvy.DmVFTi0N.mjs';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export { b as append, h as appendAccelerationAligned, e as appendCurvatureMirrored, d as appendTangentAligned, g as appendVelocityAligned, c as characteristic, a as fromArray, f as fromSpline, i as isCubicBezier2d, m as make, j as toPath } from '../shared/curvy.CE4X6_Is.mjs';
|
|
2
2
|
import '../matrix/matrix4x4.mjs';
|
|
3
|
-
import '../shared/curvy.
|
|
3
|
+
import '../shared/curvy.Cps2R_RU.mjs';
|
|
4
4
|
import '../utils.mjs';
|
|
5
5
|
import '../pipe.mjs';
|
|
6
|
-
import '../shared/curvy.
|
|
6
|
+
import '../shared/curvy.BZ_mTkJe.mjs';
|
|
7
7
|
import '../shared/curvy.C2XGH0R0.mjs';
|
|
8
|
-
import '../shared/curvy.
|
|
9
|
-
import '../shared/curvy.
|
|
8
|
+
import '../shared/curvy.Cnu_4-XZ.mjs';
|
|
9
|
+
import '../shared/curvy.D4MAcMgx.mjs';
|
|
10
10
|
import '../path/cubic2d.mjs';
|
|
11
11
|
import '../curve/cubic2d.mjs';
|
|
12
12
|
import '../interval.mjs';
|
|
@@ -4,11 +4,11 @@ import { dual, Pipeable } from '../pipe.mjs';
|
|
|
4
4
|
import { invariant } from '../utils.mjs';
|
|
5
5
|
import { subtract, scale, add } from '../vector/vector2.mjs';
|
|
6
6
|
import { t as toCurves, f as fromSpline } from '../shared/curvy.CE4X6_Is.mjs';
|
|
7
|
-
import '../shared/curvy.
|
|
8
|
-
import '../shared/curvy.
|
|
7
|
+
import '../shared/curvy.Cps2R_RU.mjs';
|
|
8
|
+
import '../shared/curvy.BZ_mTkJe.mjs';
|
|
9
9
|
import '../shared/curvy.C2XGH0R0.mjs';
|
|
10
|
-
import '../shared/curvy.
|
|
11
|
-
import '../shared/curvy.
|
|
10
|
+
import '../shared/curvy.Cnu_4-XZ.mjs';
|
|
11
|
+
import '../shared/curvy.D4MAcMgx.mjs';
|
|
12
12
|
import '../curve/cubic2d.mjs';
|
|
13
13
|
import '../interval.mjs';
|
|
14
14
|
import '../shared/curvy.DmVFTi0N.mjs';
|
|
@@ -3,11 +3,11 @@ import { fromCurves } from '../path/cubic2d.mjs';
|
|
|
3
3
|
import { dual, Pipeable } from '../pipe.mjs';
|
|
4
4
|
import { invariant } from '../utils.mjs';
|
|
5
5
|
import { t as toCurves, f as fromSpline } from '../shared/curvy.CE4X6_Is.mjs';
|
|
6
|
-
import '../shared/curvy.
|
|
7
|
-
import '../shared/curvy.
|
|
6
|
+
import '../shared/curvy.Cps2R_RU.mjs';
|
|
7
|
+
import '../shared/curvy.BZ_mTkJe.mjs';
|
|
8
8
|
import '../shared/curvy.C2XGH0R0.mjs';
|
|
9
|
-
import '../shared/curvy.
|
|
10
|
-
import '../shared/curvy.
|
|
9
|
+
import '../shared/curvy.Cnu_4-XZ.mjs';
|
|
10
|
+
import '../shared/curvy.D4MAcMgx.mjs';
|
|
11
11
|
import '../curve/cubic2d.mjs';
|
|
12
12
|
import '../interval.mjs';
|
|
13
13
|
import '../shared/curvy.DmVFTi0N.mjs';
|
|
@@ -12,6 +12,7 @@ declare const make: {
|
|
|
12
12
|
(xy: number): Vector2;
|
|
13
13
|
(x: number, y: number): Vector2;
|
|
14
14
|
};
|
|
15
|
+
declare const fromPolar: (r: number, theta: number) => Vector2;
|
|
15
16
|
declare const magnitude: (vector: Vector2) => number;
|
|
16
17
|
declare const normalize: (vector: Vector2) => Vector2;
|
|
17
18
|
declare const dot: {
|
|
@@ -41,5 +42,25 @@ declare const scale: {
|
|
|
41
42
|
(s: number): (v: Vector2) => Vector2;
|
|
42
43
|
(v: Vector2, s: number): Vector2;
|
|
43
44
|
};
|
|
45
|
+
declare const getX: (v: Vector2) => number;
|
|
46
|
+
declare const setX: {
|
|
47
|
+
(v: Vector2, x: number): Vector2;
|
|
48
|
+
(x: number): (v: Vector2) => Vector2;
|
|
49
|
+
};
|
|
50
|
+
declare const getY: (v: Vector2) => number;
|
|
51
|
+
declare const setY: {
|
|
52
|
+
(v: Vector2, y: number): Vector2;
|
|
53
|
+
(y: number): (v: Vector2) => Vector2;
|
|
54
|
+
};
|
|
55
|
+
declare const getR: (v: Vector2) => number;
|
|
56
|
+
declare const setR: {
|
|
57
|
+
(v: Vector2, r: number): Vector2;
|
|
58
|
+
(r: number): (v: Vector2) => Vector2;
|
|
59
|
+
};
|
|
60
|
+
declare const getTheta: (v: Vector2) => number;
|
|
61
|
+
declare const setTheta: {
|
|
62
|
+
(v: Vector2, theta: number): Vector2;
|
|
63
|
+
(theta: number): (v: Vector2) => Vector2;
|
|
64
|
+
};
|
|
44
65
|
|
|
45
|
-
export { type Vector2, add, components, cross, dot, hadamard, isVector2, magnitude, make, normalize, scale, softmax, subtract, zero };
|
|
66
|
+
export { type Vector2, add, components, cross, dot, fromPolar, getR, getTheta, getX, getY, hadamard, isVector2, magnitude, make, normalize, scale, setR, setTheta, setX, setY, softmax, subtract, zero };
|
package/dist/vector/vector2.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ declare const make: {
|
|
|
12
12
|
(xy: number): Vector2;
|
|
13
13
|
(x: number, y: number): Vector2;
|
|
14
14
|
};
|
|
15
|
+
declare const fromPolar: (r: number, theta: number) => Vector2;
|
|
15
16
|
declare const magnitude: (vector: Vector2) => number;
|
|
16
17
|
declare const normalize: (vector: Vector2) => Vector2;
|
|
17
18
|
declare const dot: {
|
|
@@ -41,5 +42,25 @@ declare const scale: {
|
|
|
41
42
|
(s: number): (v: Vector2) => Vector2;
|
|
42
43
|
(v: Vector2, s: number): Vector2;
|
|
43
44
|
};
|
|
45
|
+
declare const getX: (v: Vector2) => number;
|
|
46
|
+
declare const setX: {
|
|
47
|
+
(v: Vector2, x: number): Vector2;
|
|
48
|
+
(x: number): (v: Vector2) => Vector2;
|
|
49
|
+
};
|
|
50
|
+
declare const getY: (v: Vector2) => number;
|
|
51
|
+
declare const setY: {
|
|
52
|
+
(v: Vector2, y: number): Vector2;
|
|
53
|
+
(y: number): (v: Vector2) => Vector2;
|
|
54
|
+
};
|
|
55
|
+
declare const getR: (v: Vector2) => number;
|
|
56
|
+
declare const setR: {
|
|
57
|
+
(v: Vector2, r: number): Vector2;
|
|
58
|
+
(r: number): (v: Vector2) => Vector2;
|
|
59
|
+
};
|
|
60
|
+
declare const getTheta: (v: Vector2) => number;
|
|
61
|
+
declare const setTheta: {
|
|
62
|
+
(v: Vector2, theta: number): Vector2;
|
|
63
|
+
(theta: number): (v: Vector2) => Vector2;
|
|
64
|
+
};
|
|
44
65
|
|
|
45
|
-
export { type Vector2, add, components, cross, dot, hadamard, isVector2, magnitude, make, normalize, scale, softmax, subtract, zero };
|
|
66
|
+
export { type Vector2, add, components, cross, dot, fromPolar, getR, getTheta, getX, getY, hadamard, isVector2, magnitude, make, normalize, scale, setR, setTheta, setX, setY, softmax, subtract, zero };
|
package/dist/vector/vector2.mjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
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,
|
|
1
|
+
import { i as isVector2$1, m as make$1, f as fromPolar$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, g as subtract$1, h as hadamard$1, j as scale$1, k as getX$1, l as setX$1, o as getY$1, p as setY$1, q as setR$1, r as getTheta$1, t as setTheta$1 } from '../shared/curvy.BZ_mTkJe.mjs';
|
|
2
2
|
import '../pipe.mjs';
|
|
3
3
|
import '../utils.mjs';
|
|
4
4
|
|
|
5
5
|
const isVector2 = isVector2$1;
|
|
6
6
|
const make = make$1;
|
|
7
|
+
const fromPolar = fromPolar$1;
|
|
7
8
|
const magnitude = magnitude$1;
|
|
8
9
|
const normalize = normalize$1;
|
|
9
10
|
const dot = dot$1;
|
|
@@ -15,5 +16,13 @@ const add = add$1;
|
|
|
15
16
|
const subtract = subtract$1;
|
|
16
17
|
const hadamard = hadamard$1;
|
|
17
18
|
const scale = scale$1;
|
|
19
|
+
const getX = getX$1;
|
|
20
|
+
const setX = setX$1;
|
|
21
|
+
const getY = getY$1;
|
|
22
|
+
const setY = setY$1;
|
|
23
|
+
const getR = magnitude;
|
|
24
|
+
const setR = setR$1;
|
|
25
|
+
const getTheta = getTheta$1;
|
|
26
|
+
const setTheta = setTheta$1;
|
|
18
27
|
|
|
19
|
-
export { add, components, cross, dot, hadamard, isVector2, magnitude, make, normalize, scale, softmax, subtract, zero };
|
|
28
|
+
export { add, components, cross, dot, fromPolar, getR, getTheta, getX, getY, hadamard, isVector2, magnitude, make, normalize, scale, setR, setTheta, setX, setY, softmax, subtract, zero };
|
|
@@ -38,5 +38,35 @@ declare const scale: {
|
|
|
38
38
|
(s: number): (v: Vector3) => Vector3;
|
|
39
39
|
(v: Vector3, s: number): Vector3;
|
|
40
40
|
};
|
|
41
|
+
declare const getX: (v: Vector3) => number;
|
|
42
|
+
declare const setX: {
|
|
43
|
+
(v: Vector3, x: number): Vector3;
|
|
44
|
+
(x: number): (v: Vector3) => Vector3;
|
|
45
|
+
};
|
|
46
|
+
declare const getY: (v: Vector3) => number;
|
|
47
|
+
declare const setY: {
|
|
48
|
+
(v: Vector3, y: number): Vector3;
|
|
49
|
+
(y: number): (v: Vector3) => Vector3;
|
|
50
|
+
};
|
|
51
|
+
declare const getZ: (v: Vector3) => number;
|
|
52
|
+
declare const setZ: {
|
|
53
|
+
(v: Vector3, z: number): Vector3;
|
|
54
|
+
(z: number): (v: Vector3) => Vector3;
|
|
55
|
+
};
|
|
56
|
+
declare const getR: (v: Vector3) => number;
|
|
57
|
+
declare const setR: {
|
|
58
|
+
(v: Vector3, r: number): Vector3;
|
|
59
|
+
(r: number): (v: Vector3) => Vector3;
|
|
60
|
+
};
|
|
61
|
+
declare const getTheta: (v: Vector3) => number;
|
|
62
|
+
declare const setTheta: {
|
|
63
|
+
(v: Vector3, theta: number): Vector3;
|
|
64
|
+
(theta: number): (v: Vector3) => Vector3;
|
|
65
|
+
};
|
|
66
|
+
declare const getPhi: (v: Vector3) => number;
|
|
67
|
+
declare const setPhi: {
|
|
68
|
+
(v: Vector3, phi: number): Vector3;
|
|
69
|
+
(phi: number): (v: Vector3) => Vector3;
|
|
70
|
+
};
|
|
41
71
|
|
|
42
|
-
export { type Vector3, add, components, dot, hadamard, isVector3, magnitude, make, normalize, scale, softmax, subtract, zero };
|
|
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 };
|
package/dist/vector/vector3.d.ts
CHANGED
|
@@ -38,5 +38,35 @@ declare const scale: {
|
|
|
38
38
|
(s: number): (v: Vector3) => Vector3;
|
|
39
39
|
(v: Vector3, s: number): Vector3;
|
|
40
40
|
};
|
|
41
|
+
declare const getX: (v: Vector3) => number;
|
|
42
|
+
declare const setX: {
|
|
43
|
+
(v: Vector3, x: number): Vector3;
|
|
44
|
+
(x: number): (v: Vector3) => Vector3;
|
|
45
|
+
};
|
|
46
|
+
declare const getY: (v: Vector3) => number;
|
|
47
|
+
declare const setY: {
|
|
48
|
+
(v: Vector3, y: number): Vector3;
|
|
49
|
+
(y: number): (v: Vector3) => Vector3;
|
|
50
|
+
};
|
|
51
|
+
declare const getZ: (v: Vector3) => number;
|
|
52
|
+
declare const setZ: {
|
|
53
|
+
(v: Vector3, z: number): Vector3;
|
|
54
|
+
(z: number): (v: Vector3) => Vector3;
|
|
55
|
+
};
|
|
56
|
+
declare const getR: (v: Vector3) => number;
|
|
57
|
+
declare const setR: {
|
|
58
|
+
(v: Vector3, r: number): Vector3;
|
|
59
|
+
(r: number): (v: Vector3) => Vector3;
|
|
60
|
+
};
|
|
61
|
+
declare const getTheta: (v: Vector3) => number;
|
|
62
|
+
declare const setTheta: {
|
|
63
|
+
(v: Vector3, theta: number): Vector3;
|
|
64
|
+
(theta: number): (v: Vector3) => Vector3;
|
|
65
|
+
};
|
|
66
|
+
declare const getPhi: (v: Vector3) => number;
|
|
67
|
+
declare const setPhi: {
|
|
68
|
+
(v: Vector3, phi: number): Vector3;
|
|
69
|
+
(phi: number): (v: Vector3) => Vector3;
|
|
70
|
+
};
|
|
41
71
|
|
|
42
|
-
export { type Vector3, add, components, dot, hadamard, isVector3, magnitude, make, normalize, scale, softmax, subtract, zero };
|
|
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 };
|
package/dist/vector/vector3.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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 } from '../shared/curvy.
|
|
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';
|
|
2
2
|
import '../pipe.mjs';
|
|
3
3
|
import '../utils.mjs';
|
|
4
4
|
|
|
@@ -14,5 +14,17 @@ const add = add$1;
|
|
|
14
14
|
const subtract = subtract$1;
|
|
15
15
|
const hadamard = hadamard$1;
|
|
16
16
|
const scale = scale$1;
|
|
17
|
+
const getX = getX$1;
|
|
18
|
+
const setX = setX$1;
|
|
19
|
+
const getY = getY$1;
|
|
20
|
+
const setY = setY$1;
|
|
21
|
+
const getZ = getZ$1;
|
|
22
|
+
const setZ = setZ$1;
|
|
23
|
+
const getR = magnitude;
|
|
24
|
+
const setR = setR$1;
|
|
25
|
+
const getTheta = getTheta$1;
|
|
26
|
+
const setTheta = setTheta$1;
|
|
27
|
+
const getPhi = getPhi$1;
|
|
28
|
+
const setPhi = setPhi$1;
|
|
17
29
|
|
|
18
|
-
export { add, components, dot, hadamard, isVector3, magnitude, make, normalize, scale, softmax, subtract, zero };
|
|
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 };
|