@thi.ng/matrices 2.2.11 → 2.2.13
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 +1 -1
- package/README.md +1 -1
- package/add.js +10 -13
- package/addn.js +10 -13
- package/alignment-quat.js +10 -16
- package/api.js +0 -1
- package/column.js +21 -13
- package/compile/emit.js +20 -3
- package/concat.js +4 -11
- package/conjugate.js +4 -1
- package/constants.js +35 -13
- package/determinant.js +51 -27
- package/diag.js +12 -11
- package/div.js +10 -13
- package/divn.js +10 -13
- package/fit.js +16 -24
- package/frustum.js +38 -28
- package/identity.js +12 -8
- package/invert.js +100 -45
- package/lookat.js +26 -15
- package/m22-m23.js +4 -8
- package/m23-m22.js +4 -8
- package/m23-m44.js +26 -16
- package/m33-m44.js +26 -16
- package/m44-m33.js +4 -11
- package/matn.js +10 -4
- package/matv.js +10 -36
- package/mixq.js +18 -28
- package/mul.js +10 -15
- package/mulm.js +67 -45
- package/muln.js +10 -13
- package/mulq.js +13 -12
- package/mulv.js +58 -77
- package/mulvm.js +16 -46
- package/normal-mat.js +10 -23
- package/orthagonal.js +17 -25
- package/ortho.js +26 -17
- package/outer-product.js +48 -10
- package/package.json +10 -8
- package/perspective.js +6 -13
- package/project.js +20 -51
- package/quat-axis-angle.js +13 -23
- package/quat-euler.js +16 -18
- package/quat-m33.js +29 -21
- package/quat-m44.js +36 -22
- package/rotation-around-axis.js +27 -32
- package/rotation.js +41 -79
- package/row.js +12 -13
- package/scale-center.js +16 -16
- package/scale.js +32 -42
- package/set.js +13 -6
- package/shear.js +35 -18
- package/skew.js +52 -17
- package/sub.js +10 -13
- package/subn.js +10 -13
- package/trace.js +4 -6
- package/transform.js +19 -23
- package/translation.js +6 -14
- package/transpose.js +26 -24
- package/viewport.js +9 -16
package/quat-m33.js
CHANGED
|
@@ -1,23 +1,31 @@
|
|
|
1
1
|
import { setC } from "@thi.ng/vectors/setc";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
2
|
+
const quatToMat33 = (out, q) => {
|
|
3
|
+
const [x, y, z, w] = q;
|
|
4
|
+
const x2 = x + x;
|
|
5
|
+
const y2 = y + y;
|
|
6
|
+
const z2 = z + z;
|
|
7
|
+
const xx = x * x2;
|
|
8
|
+
const xy = x * y2;
|
|
9
|
+
const xz = x * z2;
|
|
10
|
+
const yy = y * y2;
|
|
11
|
+
const yz = y * z2;
|
|
12
|
+
const zz = z * z2;
|
|
13
|
+
const wx = w * x2;
|
|
14
|
+
const wy = w * y2;
|
|
15
|
+
const wz = w * z2;
|
|
16
|
+
return setC(
|
|
17
|
+
out || [],
|
|
18
|
+
1 - yy - zz,
|
|
19
|
+
xy + wz,
|
|
20
|
+
xz - wy,
|
|
21
|
+
xy - wz,
|
|
22
|
+
1 - xx - zz,
|
|
23
|
+
yz + wx,
|
|
24
|
+
xz + wy,
|
|
25
|
+
yz - wx,
|
|
26
|
+
1 - xx - yy
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
quatToMat33
|
|
23
31
|
};
|
package/quat-m44.js
CHANGED
|
@@ -1,25 +1,39 @@
|
|
|
1
1
|
import { ZERO3 } from "@thi.ng/vectors/api";
|
|
2
2
|
import { setC } from "@thi.ng/vectors/setc";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
3
|
+
const quatToMat44 = (out, a, t = ZERO3) => {
|
|
4
|
+
const [x, y, z, w] = a;
|
|
5
|
+
const x2 = x + x;
|
|
6
|
+
const y2 = y + y;
|
|
7
|
+
const z2 = z + z;
|
|
8
|
+
const xx = x * x2;
|
|
9
|
+
const xy = x * y2;
|
|
10
|
+
const xz = x * z2;
|
|
11
|
+
const yy = y * y2;
|
|
12
|
+
const yz = y * z2;
|
|
13
|
+
const zz = z * z2;
|
|
14
|
+
const wx = w * x2;
|
|
15
|
+
const wy = w * y2;
|
|
16
|
+
const wz = w * z2;
|
|
17
|
+
return setC(
|
|
18
|
+
out || [],
|
|
19
|
+
1 - yy - zz,
|
|
20
|
+
xy + wz,
|
|
21
|
+
xz - wy,
|
|
22
|
+
0,
|
|
23
|
+
xy - wz,
|
|
24
|
+
1 - xx - zz,
|
|
25
|
+
yz + wx,
|
|
26
|
+
0,
|
|
27
|
+
xz + wy,
|
|
28
|
+
yz - wx,
|
|
29
|
+
1 - xx - yy,
|
|
30
|
+
0,
|
|
31
|
+
t[0],
|
|
32
|
+
t[1],
|
|
33
|
+
t[2],
|
|
34
|
+
1
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
export {
|
|
38
|
+
quatToMat44
|
|
25
39
|
};
|
package/rotation-around-axis.js
CHANGED
|
@@ -2,36 +2,31 @@ import { sincos } from "@thi.ng/math/angle";
|
|
|
2
2
|
import { normalize3 } from "@thi.ng/vectors/normalize";
|
|
3
3
|
import { setC } from "@thi.ng/vectors/setc";
|
|
4
4
|
import { mat33to44 } from "./m33-m44.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
5
|
+
const rotationAroundAxis33 = (out, axis, theta, normalize = false) => {
|
|
6
|
+
const [x, y, z] = normalize ? normalize3([], axis) : axis;
|
|
7
|
+
const [s, c] = sincos(theta);
|
|
8
|
+
const t = 1 - c;
|
|
9
|
+
const xs = x * s;
|
|
10
|
+
const ys = y * s;
|
|
11
|
+
const zs = z * s;
|
|
12
|
+
const xt = x * t;
|
|
13
|
+
const yt = y * t;
|
|
14
|
+
const zt = z * t;
|
|
15
|
+
return setC(
|
|
16
|
+
out || [],
|
|
17
|
+
x * xt + c,
|
|
18
|
+
y * xt + zs,
|
|
19
|
+
z * xt - ys,
|
|
20
|
+
x * yt - zs,
|
|
21
|
+
y * yt + c,
|
|
22
|
+
z * yt + xs,
|
|
23
|
+
x * zt + ys,
|
|
24
|
+
y * zt - xs,
|
|
25
|
+
z * zt + c
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
const rotationAroundAxis44 = (out, axis, theta, normalize = false) => mat33to44(out, rotationAroundAxis33([], axis, theta, normalize));
|
|
29
|
+
export {
|
|
30
|
+
rotationAroundAxis33,
|
|
31
|
+
rotationAroundAxis44
|
|
26
32
|
};
|
|
27
|
-
/**
|
|
28
|
-
* Constructs a 4x4 matrix representing a rotation of `theta` around
|
|
29
|
-
* `axis` and writes result to `out`. If `normalize` is true (default
|
|
30
|
-
* false), non-destructively first normalizes axis vector.
|
|
31
|
-
*
|
|
32
|
-
* @param out -
|
|
33
|
-
* @param axis -
|
|
34
|
-
* @param theta -
|
|
35
|
-
* @param normalize -
|
|
36
|
-
*/
|
|
37
|
-
export const rotationAroundAxis44 = (out, axis, theta, normalize = false) => mat33to44(out, rotationAroundAxis33([], axis, theta, normalize));
|
package/rotation.js
CHANGED
|
@@ -1,82 +1,44 @@
|
|
|
1
1
|
import { sincos } from "@thi.ng/math/angle";
|
|
2
2
|
import { setC, setC4, setC6 } from "@thi.ng/vectors/setc";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
* Constructs a 3x3 matrix Z rotation matrix for given `theta`.
|
|
45
|
-
*
|
|
46
|
-
* @param out -
|
|
47
|
-
* @param theta -
|
|
48
|
-
*/
|
|
49
|
-
export const rotationZ33 = (out, theta) => {
|
|
50
|
-
const [s, c] = sincos(theta);
|
|
51
|
-
return setC(out || [], c, s, 0, -s, c, 0, 0, 0, 1);
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* Constructs a 4x4 matrix X rotation matrix for given `theta`.
|
|
55
|
-
*
|
|
56
|
-
* @param out -
|
|
57
|
-
* @param theta -
|
|
58
|
-
*/
|
|
59
|
-
export const rotationX44 = (out, theta) => {
|
|
60
|
-
const [s, c] = sincos(theta);
|
|
61
|
-
return setC(out || [], 1, 0, 0, 0, 0, c, s, 0, 0, -s, c, 0, 0, 0, 0, 1);
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* Constructs a 4x4 matrix Y rotation matrix for given `theta`.
|
|
65
|
-
*
|
|
66
|
-
* @param out -
|
|
67
|
-
* @param theta -
|
|
68
|
-
*/
|
|
69
|
-
export const rotationY44 = (out, theta) => {
|
|
70
|
-
const [s, c] = sincos(theta);
|
|
71
|
-
return setC(out || [], c, 0, -s, 0, 0, 1, 0, 0, s, 0, c, 0, 0, 0, 0, 1);
|
|
72
|
-
};
|
|
73
|
-
/**
|
|
74
|
-
* Constructs a 4x4 matrix Z rotation matrix for given `theta`.
|
|
75
|
-
*
|
|
76
|
-
* @param out -
|
|
77
|
-
* @param theta -
|
|
78
|
-
*/
|
|
79
|
-
export const rotationZ44 = (out, theta) => {
|
|
80
|
-
const [s, c] = sincos(theta);
|
|
81
|
-
return setC(out || [], c, s, 0, 0, -s, c, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
|
|
3
|
+
const rotation22 = (out, theta) => {
|
|
4
|
+
const [s, c] = sincos(theta);
|
|
5
|
+
return setC4(out || [], c, s, -s, c);
|
|
6
|
+
};
|
|
7
|
+
const rotation23 = (out, theta) => {
|
|
8
|
+
const [s, c] = sincos(theta);
|
|
9
|
+
return setC6(out || [], c, s, -s, c, 0, 0);
|
|
10
|
+
};
|
|
11
|
+
const rotationX33 = (out, theta) => {
|
|
12
|
+
const [s, c] = sincos(theta);
|
|
13
|
+
return setC(out || [], 1, 0, 0, 0, c, s, 0, -s, c);
|
|
14
|
+
};
|
|
15
|
+
const rotationY33 = (out, theta) => {
|
|
16
|
+
const [s, c] = sincos(theta);
|
|
17
|
+
return setC(out || [], c, 0, -s, 0, 1, 0, s, 0, c);
|
|
18
|
+
};
|
|
19
|
+
const rotationZ33 = (out, theta) => {
|
|
20
|
+
const [s, c] = sincos(theta);
|
|
21
|
+
return setC(out || [], c, s, 0, -s, c, 0, 0, 0, 1);
|
|
22
|
+
};
|
|
23
|
+
const rotationX44 = (out, theta) => {
|
|
24
|
+
const [s, c] = sincos(theta);
|
|
25
|
+
return setC(out || [], 1, 0, 0, 0, 0, c, s, 0, 0, -s, c, 0, 0, 0, 0, 1);
|
|
26
|
+
};
|
|
27
|
+
const rotationY44 = (out, theta) => {
|
|
28
|
+
const [s, c] = sincos(theta);
|
|
29
|
+
return setC(out || [], c, 0, -s, 0, 0, 1, 0, 0, s, 0, c, 0, 0, 0, 0, 1);
|
|
30
|
+
};
|
|
31
|
+
const rotationZ44 = (out, theta) => {
|
|
32
|
+
const [s, c] = sincos(theta);
|
|
33
|
+
return setC(out || [], c, s, 0, 0, -s, c, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
rotation22,
|
|
37
|
+
rotation23,
|
|
38
|
+
rotationX33,
|
|
39
|
+
rotationX44,
|
|
40
|
+
rotationY33,
|
|
41
|
+
rotationY44,
|
|
42
|
+
rotationZ33,
|
|
43
|
+
rotationZ44
|
|
82
44
|
};
|
package/row.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { setS2, setS3, setS4 } from "@thi.ng/vectors/sets";
|
|
2
2
|
import { vop } from "@thi.ng/vectors/vop";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export const row44 = row.add(16, (out, m, n) => setS4(out, m, 0, n, 1, 4));
|
|
3
|
+
const row = vop(1);
|
|
4
|
+
const row22 = row.add(4, (out, m, n) => setS2(out, m, 0, n, 1, 2));
|
|
5
|
+
const row23 = row.add(6, (out, m, n) => setS3(out, m, 0, n, 1, 2));
|
|
6
|
+
const row33 = row.add(9, (out, m, n) => setS3(out, m, 0, n, 1, 3));
|
|
7
|
+
const row44 = row.add(16, (out, m, n) => setS4(out, m, 0, n, 1, 4));
|
|
8
|
+
export {
|
|
9
|
+
row,
|
|
10
|
+
row22,
|
|
11
|
+
row23,
|
|
12
|
+
row33,
|
|
13
|
+
row44
|
|
14
|
+
};
|
package/scale-center.js
CHANGED
|
@@ -2,19 +2,19 @@ import { neg } from "@thi.ng/vectors/neg";
|
|
|
2
2
|
import { concat } from "./concat.js";
|
|
3
3
|
import { scale23, scale44 } from "./scale.js";
|
|
4
4
|
import { translation23, translation44 } from "./translation.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
5
|
+
const scaleWithCenter23 = (m, p, s) => concat(
|
|
6
|
+
m,
|
|
7
|
+
translation23([], p),
|
|
8
|
+
scale23([], s),
|
|
9
|
+
translation23([], neg([], p))
|
|
10
|
+
);
|
|
11
|
+
const scaleWithCenter44 = (m, p, s) => concat(
|
|
12
|
+
m,
|
|
13
|
+
translation44([], p),
|
|
14
|
+
scale44([], s),
|
|
15
|
+
translation44([], neg([], p))
|
|
16
|
+
);
|
|
17
|
+
export {
|
|
18
|
+
scaleWithCenter23,
|
|
19
|
+
scaleWithCenter44
|
|
20
|
+
};
|
package/scale.js
CHANGED
|
@@ -1,44 +1,34 @@
|
|
|
1
1
|
import { isNumber } from "@thi.ng/checks/is-number";
|
|
2
2
|
import { setC, setC4, setC6 } from "@thi.ng/vectors/setc";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
export const scale44 = (m, s) => ((s = isNumber(s) ? [s, s, s] : s),
|
|
36
|
-
setC(m || [],
|
|
37
|
-
// x
|
|
38
|
-
s[0], 0, 0, 0,
|
|
39
|
-
// y
|
|
40
|
-
0, s[1], 0, 0,
|
|
41
|
-
// z
|
|
42
|
-
0, 0, s[2], 0,
|
|
43
|
-
// w
|
|
44
|
-
0, 0, 0, s[3] !== undefined ? s[3] : 1));
|
|
3
|
+
const scale22 = (m, s) => (s = isNumber(s) ? [s, s] : s, setC4(m || [], s[0], 0, 0, s[1]));
|
|
4
|
+
const scale23 = (m, s) => (s = isNumber(s) ? [s, s] : s, setC6(m || [], s[0], 0, 0, s[1], 0, 0));
|
|
5
|
+
const scale33 = (m, s) => (s = isNumber(s) ? [s, s, s] : s, setC(m || [], s[0], 0, 0, 0, s[1], 0, 0, 0, s[2]));
|
|
6
|
+
const scale44 = (m, s) => (s = isNumber(s) ? [s, s, s] : s, setC(
|
|
7
|
+
m || [],
|
|
8
|
+
// x
|
|
9
|
+
s[0],
|
|
10
|
+
0,
|
|
11
|
+
0,
|
|
12
|
+
0,
|
|
13
|
+
// y
|
|
14
|
+
0,
|
|
15
|
+
s[1],
|
|
16
|
+
0,
|
|
17
|
+
0,
|
|
18
|
+
// z
|
|
19
|
+
0,
|
|
20
|
+
0,
|
|
21
|
+
s[2],
|
|
22
|
+
0,
|
|
23
|
+
// w
|
|
24
|
+
0,
|
|
25
|
+
0,
|
|
26
|
+
0,
|
|
27
|
+
s[3] !== void 0 ? s[3] : 1
|
|
28
|
+
));
|
|
29
|
+
export {
|
|
30
|
+
scale22,
|
|
31
|
+
scale23,
|
|
32
|
+
scale33,
|
|
33
|
+
scale44
|
|
34
|
+
};
|
package/set.js
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { compile } from "@thi.ng/vectors/compile/emit";
|
|
2
2
|
import { SET } from "@thi.ng/vectors/compile/templates";
|
|
3
3
|
import { set as _set, set4 } from "@thi.ng/vectors/set";
|
|
4
|
-
const $ = (dim) => _set.add(dim, compile(dim, SET, "o,a",
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
const $ = (dim) => _set.add(dim, compile(dim, SET, "o,a", void 0, "o"));
|
|
5
|
+
const set = _set;
|
|
6
|
+
const set22 = set4;
|
|
7
|
+
const set23 = $(6);
|
|
8
|
+
const set33 = $(9);
|
|
9
|
+
const set44 = $(16);
|
|
10
|
+
export {
|
|
11
|
+
set,
|
|
12
|
+
set22,
|
|
13
|
+
set23,
|
|
14
|
+
set33,
|
|
15
|
+
set44
|
|
16
|
+
};
|
package/shear.js
CHANGED
|
@@ -1,23 +1,40 @@
|
|
|
1
1
|
import { identity22, identity23, identity33, identity44 } from "./identity.js";
|
|
2
|
-
const $ = (f) => (i) => (m, x) => (!m && (m = []), f(m),
|
|
2
|
+
const $ = (f) => (i) => (m, x) => (!m && (m = []), f(m), m[i] = x, m);
|
|
3
3
|
const $22 = $(identity22);
|
|
4
4
|
const $23 = $(identity23);
|
|
5
5
|
const $33 = $(identity33);
|
|
6
6
|
const $44 = $(identity44);
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
export
|
|
7
|
+
const shearX22 = $22(2);
|
|
8
|
+
const shearY22 = $22(1);
|
|
9
|
+
const shearX23 = $23(2);
|
|
10
|
+
const shearY23 = $23(1);
|
|
11
|
+
const shearXY33 = $33(3);
|
|
12
|
+
const shearXZ33 = $33(6);
|
|
13
|
+
const shearYX33 = $33(1);
|
|
14
|
+
const shearYZ33 = $33(7);
|
|
15
|
+
const shearZX33 = $33(2);
|
|
16
|
+
const shearZY33 = $33(5);
|
|
17
|
+
const shearXY44 = $44(4);
|
|
18
|
+
const shearXZ44 = $44(8);
|
|
19
|
+
const shearYX44 = $44(1);
|
|
20
|
+
const shearYZ44 = $44(9);
|
|
21
|
+
const shearZX44 = $44(2);
|
|
22
|
+
const shearZY44 = $44(6);
|
|
23
|
+
export {
|
|
24
|
+
shearX22,
|
|
25
|
+
shearX23,
|
|
26
|
+
shearXY33,
|
|
27
|
+
shearXY44,
|
|
28
|
+
shearXZ33,
|
|
29
|
+
shearXZ44,
|
|
30
|
+
shearY22,
|
|
31
|
+
shearY23,
|
|
32
|
+
shearYX33,
|
|
33
|
+
shearYX44,
|
|
34
|
+
shearYZ33,
|
|
35
|
+
shearYZ44,
|
|
36
|
+
shearZX33,
|
|
37
|
+
shearZX44,
|
|
38
|
+
shearZY33,
|
|
39
|
+
shearZY44
|
|
40
|
+
};
|
package/skew.js
CHANGED
|
@@ -1,18 +1,53 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
shearX22,
|
|
3
|
+
shearX23,
|
|
4
|
+
shearXY33,
|
|
5
|
+
shearXY44,
|
|
6
|
+
shearXZ33,
|
|
7
|
+
shearXZ44,
|
|
8
|
+
shearY22,
|
|
9
|
+
shearY23,
|
|
10
|
+
shearYX33,
|
|
11
|
+
shearYX44,
|
|
12
|
+
shearYZ33,
|
|
13
|
+
shearYZ44,
|
|
14
|
+
shearZX33,
|
|
15
|
+
shearZX44,
|
|
16
|
+
shearZY33,
|
|
17
|
+
shearZY44
|
|
18
|
+
} from "./shear.js";
|
|
2
19
|
const $ = (f) => (m, theta) => f(m, Math.tan(theta));
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
const skewX22 = $(shearX22);
|
|
21
|
+
const skewY22 = $(shearY22);
|
|
22
|
+
const skewX23 = $(shearX23);
|
|
23
|
+
const skewY23 = $(shearY23);
|
|
24
|
+
const skewXY33 = $(shearXY33);
|
|
25
|
+
const skewXZ33 = $(shearXZ33);
|
|
26
|
+
const skewYX33 = $(shearYX33);
|
|
27
|
+
const skewYZ33 = $(shearYZ33);
|
|
28
|
+
const skewZX33 = $(shearZX33);
|
|
29
|
+
const skewZY33 = $(shearZY33);
|
|
30
|
+
const skewXY44 = $(shearXY44);
|
|
31
|
+
const skewXZ44 = $(shearXZ44);
|
|
32
|
+
const skewYX44 = $(shearYX44);
|
|
33
|
+
const skewYZ44 = $(shearYZ44);
|
|
34
|
+
const skewZX44 = $(shearZX44);
|
|
35
|
+
const skewZY44 = $(shearZY44);
|
|
36
|
+
export {
|
|
37
|
+
skewX22,
|
|
38
|
+
skewX23,
|
|
39
|
+
skewXY33,
|
|
40
|
+
skewXY44,
|
|
41
|
+
skewXZ33,
|
|
42
|
+
skewXZ44,
|
|
43
|
+
skewY22,
|
|
44
|
+
skewY23,
|
|
45
|
+
skewYX33,
|
|
46
|
+
skewYX44,
|
|
47
|
+
skewYZ33,
|
|
48
|
+
skewYZ44,
|
|
49
|
+
skewZX33,
|
|
50
|
+
skewZX44,
|
|
51
|
+
skewZY33,
|
|
52
|
+
skewZY44
|
|
53
|
+
};
|
package/sub.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { sub as _sub, sub4 } from "@thi.ng/vectors/sub";
|
|
2
2
|
import { defMath } from "./compile/emit.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export const sub = _sub;
|
|
14
|
-
export const sub22 = sub4;
|
|
15
|
-
export const [sub23, sub33, sub44] = defMath(sub, "-");
|
|
3
|
+
const sub = _sub;
|
|
4
|
+
const sub22 = sub4;
|
|
5
|
+
const [sub23, sub33, sub44] = defMath(sub, "-");
|
|
6
|
+
export {
|
|
7
|
+
sub,
|
|
8
|
+
sub22,
|
|
9
|
+
sub23,
|
|
10
|
+
sub33,
|
|
11
|
+
sub44
|
|
12
|
+
};
|
package/subn.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { subN as _subN, subN4 } from "@thi.ng/vectors/subn";
|
|
2
2
|
import { defMathN } from "./compile/emit.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export const subN = _subN;
|
|
14
|
-
export const subN22 = subN4;
|
|
15
|
-
export const [subN23, subN33, subN44] = defMathN(subN, "-");
|
|
3
|
+
const subN = _subN;
|
|
4
|
+
const subN22 = subN4;
|
|
5
|
+
const [subN23, subN33, subN44] = defMathN(subN, "-");
|
|
6
|
+
export {
|
|
7
|
+
subN,
|
|
8
|
+
subN22,
|
|
9
|
+
subN23,
|
|
10
|
+
subN33,
|
|
11
|
+
subN44
|
|
12
|
+
};
|