x_ite 8.6.15 → 8.6.16
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/README.md +1 -0
- package/docs/_posts/getting-started.md +3 -2
- package/package.json +2 -2
- package/.gitmodules +0 -6
- package/docs/assets/lib/.editorconfig +0 -11
- package/docs/assets/lib/.gitignore +0 -4
- package/docs/assets/lib/LICENSE +0 -21
- package/docs/assets/lib/README.md +0 -50
- package/docs/assets/lib/bootstrap-4.6.1/bootstrap.bundle.min.js +0 -7
- package/docs/assets/lib/bootstrap-4.6.1/bootstrap.bundle.min.js.map +0 -1
- package/docs/assets/lib/bootstrap-4.6.1/bootstrap.min.css +0 -7
- package/docs/assets/lib/bootstrap-4.6.1/bootstrap.min.css.map +0 -1
- package/docs/assets/lib/bootstrap-toc-1.0.1/bootstrap-toc.min.css +0 -4
- package/docs/assets/lib/bootstrap-toc-1.0.1/bootstrap-toc.min.js +0 -5
- package/docs/assets/lib/clipboard-2.0.9/clipboard.min.js +0 -7
- package/docs/assets/lib/countup.js-1.9.3/countUp.min.js +0 -1
- package/docs/assets/lib/dayjs-1.10.7/dayjs.min.js +0 -1
- package/docs/assets/lib/dayjs-1.10.7/locale/en.min.js +0 -7
- package/docs/assets/lib/dayjs-1.10.7/plugin/localizedFormat.min.js +0 -5
- package/docs/assets/lib/dayjs-1.10.7/plugin/relativeTime.min.js +0 -5
- package/docs/assets/lib/fontawesome-free-6.2.1/LICENSE.txt +0 -165
- package/docs/assets/lib/fontawesome-free-6.2.1/css/all.min.css +0 -6
- package/docs/assets/lib/fontawesome-free-6.2.1/webfonts/fa-brands-400.ttf +0 -0
- package/docs/assets/lib/fontawesome-free-6.2.1/webfonts/fa-brands-400.woff2 +0 -0
- package/docs/assets/lib/fontawesome-free-6.2.1/webfonts/fa-regular-400.ttf +0 -0
- package/docs/assets/lib/fontawesome-free-6.2.1/webfonts/fa-regular-400.woff2 +0 -0
- package/docs/assets/lib/fontawesome-free-6.2.1/webfonts/fa-solid-900.ttf +0 -0
- package/docs/assets/lib/fontawesome-free-6.2.1/webfonts/fa-solid-900.woff2 +0 -0
- package/docs/assets/lib/fontawesome-free-6.2.1/webfonts/fa-v4compatibility.ttf +0 -0
- package/docs/assets/lib/fontawesome-free-6.2.1/webfonts/fa-v4compatibility.woff2 +0 -0
- package/docs/assets/lib/fonts/Lato/Lato-Regular.ttf +0 -0
- package/docs/assets/lib/fonts/Lato/OFL.txt +0 -93
- package/docs/assets/lib/fonts/Source_Sans_Pro/OFL.txt +0 -93
- package/docs/assets/lib/fonts/Source_Sans_Pro/SourceSansPro-Black.ttf +0 -0
- package/docs/assets/lib/fonts/Source_Sans_Pro/SourceSansPro-Bold.ttf +0 -0
- package/docs/assets/lib/fonts/Source_Sans_Pro/SourceSansPro-Regular.ttf +0 -0
- package/docs/assets/lib/fonts/Source_Sans_Pro/SourceSansPro-SemiBold.ttf +0 -0
- package/docs/assets/lib/fonts/main.css +0 -1
- package/docs/assets/lib/jquery-3.6.0/jquery.min.js +0 -2
- package/docs/assets/lib/lozad-1.16.0/lozad.min.js +0 -10
- package/docs/assets/lib/magnific-popup-1.1.0/jquery.magnific-popup.min.js +0 -4
- package/docs/assets/lib/magnific-popup-1.1.0/magnific-popup.css +0 -2
- package/docs/assets/lib/mathjax-3.2.0/a11y/assistive-mml.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/a11y/complexity.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/a11y/explorer.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/a11y/semantic-enrich.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/adaptors/liteDOM.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/core.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/asciimath.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/mml/entities.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/mml/extensions/mml3.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/mml/extensions/mml3.sef.json +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/mml.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/action.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/all-packages.js +0 -34
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/ams.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/amscd.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/autoload.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/bbox.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/boldsymbol.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/braket.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/bussproofs.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/cancel.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/centernot.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/color.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/colortbl.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/colorv2.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/configmacros.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/enclose.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/extpfeil.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/gensymb.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/html.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/mathtools.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/mhchem.js +0 -34
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/newcommand.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/noerrors.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/noundefined.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/physics.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/require.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/setoptions.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/tagformat.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/textcomp.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/textmacros.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/unicode.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/upgreek.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex/extensions/verb.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex-base.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/input/tex-full.js +0 -34
- package/docs/assets/lib/mathjax-3.2.0/input/tex.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/latest.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/loader.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/mml-chtml.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/mml-svg.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/node-main.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/output/chtml/fonts/tex.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/output/chtml/fonts/woff-v2/MathJax_AMS-Regular.woff +0 -0
- package/docs/assets/lib/mathjax-3.2.0/output/chtml/fonts/woff-v2/MathJax_Calligraphic-Bold.woff +0 -0
- package/docs/assets/lib/mathjax-3.2.0/output/chtml/fonts/woff-v2/MathJax_Calligraphic-Regular.woff +0 -0
- package/docs/assets/lib/mathjax-3.2.0/output/chtml/fonts/woff-v2/MathJax_Fraktur-Bold.woff +0 -0
- package/docs/assets/lib/mathjax-3.2.0/output/chtml/fonts/woff-v2/MathJax_Fraktur-Regular.woff +0 -0
- package/docs/assets/lib/mathjax-3.2.0/output/chtml/fonts/woff-v2/MathJax_Main-Bold.woff +0 -0
- package/docs/assets/lib/mathjax-3.2.0/output/chtml/fonts/woff-v2/MathJax_Main-Italic.woff +0 -0
- package/docs/assets/lib/mathjax-3.2.0/output/chtml/fonts/woff-v2/MathJax_Main-Regular.woff +0 -0
- package/docs/assets/lib/mathjax-3.2.0/output/chtml/fonts/woff-v2/MathJax_Math-BoldItalic.woff +0 -0
- package/docs/assets/lib/mathjax-3.2.0/output/chtml/fonts/woff-v2/MathJax_Math-Italic.woff +0 -0
- package/docs/assets/lib/mathjax-3.2.0/output/chtml/fonts/woff-v2/MathJax_Math-Regular.woff +0 -0
- package/docs/assets/lib/mathjax-3.2.0/output/chtml/fonts/woff-v2/MathJax_SansSerif-Bold.woff +0 -0
- package/docs/assets/lib/mathjax-3.2.0/output/chtml/fonts/woff-v2/MathJax_SansSerif-Italic.woff +0 -0
- package/docs/assets/lib/mathjax-3.2.0/output/chtml/fonts/woff-v2/MathJax_SansSerif-Regular.woff +0 -0
- package/docs/assets/lib/mathjax-3.2.0/output/chtml/fonts/woff-v2/MathJax_Script-Regular.woff +0 -0
- package/docs/assets/lib/mathjax-3.2.0/output/chtml/fonts/woff-v2/MathJax_Size1-Regular.woff +0 -0
- package/docs/assets/lib/mathjax-3.2.0/output/chtml/fonts/woff-v2/MathJax_Size2-Regular.woff +0 -0
- package/docs/assets/lib/mathjax-3.2.0/output/chtml/fonts/woff-v2/MathJax_Size3-Regular.woff +0 -0
- package/docs/assets/lib/mathjax-3.2.0/output/chtml/fonts/woff-v2/MathJax_Size4-Regular.woff +0 -0
- package/docs/assets/lib/mathjax-3.2.0/output/chtml/fonts/woff-v2/MathJax_Typewriter-Regular.woff +0 -0
- package/docs/assets/lib/mathjax-3.2.0/output/chtml/fonts/woff-v2/MathJax_Vector-Bold.woff +0 -0
- package/docs/assets/lib/mathjax-3.2.0/output/chtml/fonts/woff-v2/MathJax_Vector-Regular.woff +0 -0
- package/docs/assets/lib/mathjax-3.2.0/output/chtml/fonts/woff-v2/MathJax_Zero.woff +0 -0
- package/docs/assets/lib/mathjax-3.2.0/output/chtml.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/output/svg/fonts/tex.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/output/svg.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/sre/mathmaps/de.js +0 -125
- package/docs/assets/lib/mathjax-3.2.0/sre/mathmaps/en.js +0 -131
- package/docs/assets/lib/mathjax-3.2.0/sre/mathmaps/es.js +0 -122
- package/docs/assets/lib/mathjax-3.2.0/sre/mathmaps/fr.js +0 -125
- package/docs/assets/lib/mathjax-3.2.0/sre/mathmaps/hi.js +0 -125
- package/docs/assets/lib/mathjax-3.2.0/sre/mathmaps/it.js +0 -125
- package/docs/assets/lib/mathjax-3.2.0/sre/mathmaps/nemeth.js +0 -113
- package/docs/assets/lib/mathjax-3.2.0/sre/sre-node.js +0 -11
- package/docs/assets/lib/mathjax-3.2.0/sre/sre_browser.js +0 -999
- package/docs/assets/lib/mathjax-3.2.0/startup.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/tex-chtml-full.js +0 -34
- package/docs/assets/lib/mathjax-3.2.0/tex-chtml.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/tex-mml-chtml.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/tex-mml-svg.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/tex-svg-full.js +0 -34
- package/docs/assets/lib/mathjax-3.2.0/tex-svg.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/ui/lazy.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/ui/menu.js +0 -1
- package/docs/assets/lib/mathjax-3.2.0/ui/safe.js +0 -1
- package/docs/assets/lib/mermaid-9.1.7/mermaid.min.js +0 -3
- package/docs/assets/lib/mermaid-9.1.7/mermaid.min.js.map +0 -1
- package/docs/assets/lib/polyfill-v3-es6/polyfill.min.js +0 -100
- package/docs/assets/lib/simple-jekyll-search-1.10.0/simple-jekyll-search.min.js +0 -6
- package/tests/.vscode/settings.json +0 -7
- package/tests/README.md +0 -2
- package/tests/package.json +0 -25
- package/tests/tests/X3D.js +0 -16
- package/tests/tests/X_ITE.test.js +0 -6
- package/tests/tests/standard/Math/Algorithm.test.js +0 -85
- package/tests/tests/standard/Math/Numbers/Color3.test.js +0 -162
- package/tests/tests/standard/Math/Numbers/Color4.test.js +0 -186
- package/tests/tests/standard/Math/Numbers/Complex.test.js +0 -199
- package/tests/tests/standard/Math/Numbers/Matrix2.test.js +0 -248
- package/tests/tests/standard/Math/Numbers/Matrix3.test.js +0 -585
- package/tests/tests/standard/Math/Numbers/Matrix4.test.js +0 -663
- package/tests/tests/standard/Math/Numbers/Rotation4.test.js +0 -197
- package/tests/tests/standard/Math/Numbers/Vector2.test.js +0 -259
- package/tests/tests/standard/Math/Numbers/Vector3.test.js +0 -291
- package/tests/tests/standard/Math/Numbers/Vector4.test.js +0 -309
- package/tests/tests/x_ite/Fields/SFDouble.test.js +0 -47
- package/tests/tests/x_ite/Fields/SFFloat.test.js +0 -47
- package/tests/tests/x_ite/Fields/SFInt32.test.js +0 -47
- package/tests/tests/x_ite/Fields/SFString.test.js +0 -47
- package/tests/tests/x_ite/Fields/SFTime.test.js +0 -47
|
@@ -1,585 +0,0 @@
|
|
|
1
|
-
const
|
|
2
|
-
X3D = require ("../../../X3D"),
|
|
3
|
-
Matrix3 = X3D .require ("standard/Math/Numbers/Matrix3"),
|
|
4
|
-
Vector2 = X3D .require ("standard/Math/Numbers/Vector2"),
|
|
5
|
-
Vector3 = X3D .require ("standard/Math/Numbers/Vector3"),
|
|
6
|
-
Complex = X3D .require ("standard/Math/Numbers/Complex")
|
|
7
|
-
|
|
8
|
-
test ("constructor", () =>
|
|
9
|
-
{
|
|
10
|
-
const m1 = new Matrix3 ()
|
|
11
|
-
|
|
12
|
-
expect (m1) .toEqual ({
|
|
13
|
-
0:1, 1:0, 2:0,
|
|
14
|
-
3:0, 4:1, 5:0,
|
|
15
|
-
6:0, 7:0, 8:1,
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
expect ([... m1]) .toEqual ([
|
|
19
|
-
1, 0, 0,
|
|
20
|
-
0, 1, 0,
|
|
21
|
-
0, 0, 1,
|
|
22
|
-
])
|
|
23
|
-
|
|
24
|
-
expect (m1 .length) .toBe (9)
|
|
25
|
-
expect (m1 .order) .toBe (3)
|
|
26
|
-
|
|
27
|
-
const m2 = new Matrix3 (2,3,4, 5,6,7, 8,9,10)
|
|
28
|
-
|
|
29
|
-
expect (m2) .toEqual ({
|
|
30
|
-
0:2, 1:3, 2:4,
|
|
31
|
-
3:5, 4:6, 5:7,
|
|
32
|
-
6:8, 7:9, 8:10,
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
expect ([... m2]) .toEqual ([
|
|
36
|
-
2,3,4, 5,6,7, 8,9,10
|
|
37
|
-
])
|
|
38
|
-
|
|
39
|
-
expect (m2 .length) .toBe (9)
|
|
40
|
-
expect (m2 .order) .toBe (3)
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
test ("get1", () =>
|
|
44
|
-
{
|
|
45
|
-
const
|
|
46
|
-
m1 = new Matrix3 (2,0,0, 0,6,0, 8,9,1),
|
|
47
|
-
t = new Vector2 (0, 0),
|
|
48
|
-
s = new Vector2 (1, 1)
|
|
49
|
-
|
|
50
|
-
m1 .get (t, null, s)
|
|
51
|
-
|
|
52
|
-
expect (t [0]) .toBeCloseTo (8)
|
|
53
|
-
expect (t [1]) .toBeCloseTo (9)
|
|
54
|
-
|
|
55
|
-
expect (s [0]) .toBeCloseTo (2)
|
|
56
|
-
expect (s [1]) .toBeCloseTo (6)
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
m2 = new Matrix3 (),
|
|
60
|
-
r = new Vector3 (0, 0, 0),
|
|
61
|
-
c = new Complex .Polar (1, 5)
|
|
62
|
-
|
|
63
|
-
m2 .rotate (5)
|
|
64
|
-
m2 .get (null, r)
|
|
65
|
-
|
|
66
|
-
expect (r [0]) .toBeCloseTo (c .real)
|
|
67
|
-
expect (r [1]) .toBeCloseTo (c .imag)
|
|
68
|
-
expect (r [0]) .toBeCloseTo (0.2836621854632263)
|
|
69
|
-
expect (r [1]) .toBeCloseTo (-0.9589242746631387)
|
|
70
|
-
expect (r [2]) .toBeCloseTo (-Math.PI * 2 + 5)
|
|
71
|
-
|
|
72
|
-
const
|
|
73
|
-
m3 = new Matrix3 (),
|
|
74
|
-
so = new Vector3 (0, 0, 0)
|
|
75
|
-
|
|
76
|
-
m3 .rotate (5)
|
|
77
|
-
m3 .set (null, null, new Vector2 (1, 2), Math .PI / 4)
|
|
78
|
-
m3 .get (null, null, s, so)
|
|
79
|
-
|
|
80
|
-
expect (s [0]) .toBeCloseTo (2)
|
|
81
|
-
expect (s [1]) .toBeCloseTo (1)
|
|
82
|
-
|
|
83
|
-
expect (so [0]) .toBeCloseTo (Math .SQRT1_2)
|
|
84
|
-
expect (so [1]) .toBeCloseTo (-Math .SQRT1_2)
|
|
85
|
-
expect (so [2]) .toBeCloseTo (-Math .PI / 4)
|
|
86
|
-
|
|
87
|
-
let v1, v2
|
|
88
|
-
|
|
89
|
-
m2 .set ()
|
|
90
|
-
|
|
91
|
-
expect ([... m2]) .toEqual ([1, 0, 0, 0, 1, 0, 0, 0, 1])
|
|
92
|
-
|
|
93
|
-
m2 .set (new Vector2 (1, 2))
|
|
94
|
-
|
|
95
|
-
v1 = m2 .multVecMatrix (new Vector2 (2,3))
|
|
96
|
-
|
|
97
|
-
m2 .get (t)
|
|
98
|
-
m3 .set (t)
|
|
99
|
-
|
|
100
|
-
v2 = m3 .multVecMatrix (new Vector2 (2,3))
|
|
101
|
-
|
|
102
|
-
expect (v1 [0]) .toBeCloseTo (v2 [0])
|
|
103
|
-
expect (v1 [1]) .toBeCloseTo (v2 [1])
|
|
104
|
-
|
|
105
|
-
m2 .set (new Vector2 (1, 2), 1)
|
|
106
|
-
|
|
107
|
-
v1 = m2 .multVecMatrix (new Vector2 (2,3))
|
|
108
|
-
|
|
109
|
-
m2 .get (t, r)
|
|
110
|
-
m3 .set (t, r [2])
|
|
111
|
-
|
|
112
|
-
v2 = m3 .multVecMatrix (new Vector2 (2,3))
|
|
113
|
-
|
|
114
|
-
expect (v1 [0]) .toBeCloseTo (v2 [0])
|
|
115
|
-
expect (v1 [1]) .toBeCloseTo (v2 [1])
|
|
116
|
-
|
|
117
|
-
m2 .set (new Vector2 (1, 2), 1, new Vector2 (1, 2))
|
|
118
|
-
|
|
119
|
-
v1 = m2 .multVecMatrix (new Vector2 (2,3))
|
|
120
|
-
|
|
121
|
-
m2 .get (t, r, s)
|
|
122
|
-
m3 .set (t, r [2], s)
|
|
123
|
-
|
|
124
|
-
v2 = m3 .multVecMatrix (new Vector2 (2,3))
|
|
125
|
-
|
|
126
|
-
expect (v1 [0]) .toBeCloseTo (v2 [0])
|
|
127
|
-
expect (v1 [1]) .toBeCloseTo (v2 [1])
|
|
128
|
-
|
|
129
|
-
m2 .set (new Vector2 (1, 2), 1, new Vector2 (1, 2), 1)
|
|
130
|
-
|
|
131
|
-
v1 = m2 .multVecMatrix (new Vector2 (2,3))
|
|
132
|
-
|
|
133
|
-
m2 .get (t, r, s, so)
|
|
134
|
-
m3 .set (t, r [2], s, so [2])
|
|
135
|
-
|
|
136
|
-
v2 = m3 .multVecMatrix (new Vector2 (2,3))
|
|
137
|
-
|
|
138
|
-
expect (v1 [0]) .toBeCloseTo (v2 [0])
|
|
139
|
-
expect (v1 [1]) .toBeCloseTo (v2 [1])
|
|
140
|
-
|
|
141
|
-
m2 .set (new Vector2 (1, 2), 1, new Vector2 (1, 2), 1, new Vector2 (1, 2))
|
|
142
|
-
|
|
143
|
-
v1 = m2 .multVecMatrix (new Vector2 (2,3))
|
|
144
|
-
|
|
145
|
-
m2 .get (t, r, s, so, new Vector2 (1, 2))
|
|
146
|
-
m3 .set (t, r [2], s, so [2], new Vector2 (1, 2))
|
|
147
|
-
|
|
148
|
-
v2 = m3 .multVecMatrix (new Vector2 (2,3))
|
|
149
|
-
|
|
150
|
-
expect (v1 [0]) .toBeCloseTo (v2 [0])
|
|
151
|
-
expect (v1 [1]) .toBeCloseTo (v2 [1])
|
|
152
|
-
})
|
|
153
|
-
|
|
154
|
-
test ("set1", () =>
|
|
155
|
-
{
|
|
156
|
-
const m1 = new Matrix3 (2,3,4, 5,6,7, 8,9,10)
|
|
157
|
-
|
|
158
|
-
m1 .set ()
|
|
159
|
-
|
|
160
|
-
expect ([... m1]) .toEqual ([
|
|
161
|
-
1, 0, 0,
|
|
162
|
-
0, 1, 0,
|
|
163
|
-
0, 0, 1,
|
|
164
|
-
])
|
|
165
|
-
|
|
166
|
-
m1 .set (2,3,4, 5,6,7, 8,9,10)
|
|
167
|
-
|
|
168
|
-
expect ([... m1]) .toEqual ([
|
|
169
|
-
2,3,4, 5,6,7, 8,9,10
|
|
170
|
-
])
|
|
171
|
-
})
|
|
172
|
-
|
|
173
|
-
test ("set2", () =>
|
|
174
|
-
{
|
|
175
|
-
const
|
|
176
|
-
m1 = new Matrix3 (),
|
|
177
|
-
t = new Vector2 (2, 3),
|
|
178
|
-
s = new Vector2 (5, 6)
|
|
179
|
-
|
|
180
|
-
m1 .set (t, null, s)
|
|
181
|
-
|
|
182
|
-
expect ([... m1]) .toEqual ([
|
|
183
|
-
5, 0, 0,
|
|
184
|
-
0, 6, 0,
|
|
185
|
-
2, 3, 1,
|
|
186
|
-
])
|
|
187
|
-
|
|
188
|
-
m1 .set (t, 2, s)
|
|
189
|
-
|
|
190
|
-
expect (m1 [0]) .toBeCloseTo (-2.080734182735712)
|
|
191
|
-
expect (m1 [1]) .toBeCloseTo (4.546487134128409)
|
|
192
|
-
expect (m1 [2]) .toBeCloseTo (0)
|
|
193
|
-
expect (m1 [3]) .toBeCloseTo (-5.45578456095409)
|
|
194
|
-
expect (m1 [4]) .toBeCloseTo (-2.4968810192828546)
|
|
195
|
-
expect (m1 [5]) .toBeCloseTo (0)
|
|
196
|
-
expect (m1 [6]) .toBeCloseTo (2)
|
|
197
|
-
expect (m1 [7]) .toBeCloseTo (3)
|
|
198
|
-
expect (m1 [8]) .toBeCloseTo (1)
|
|
199
|
-
|
|
200
|
-
m1 .set (null, 5, null)
|
|
201
|
-
|
|
202
|
-
expect (m1 [0]) .toBeCloseTo ( Math .cos (5))
|
|
203
|
-
expect (m1 [1]) .toBeCloseTo ( Math .sin (5))
|
|
204
|
-
expect (m1 [2]) .toBeCloseTo (0)
|
|
205
|
-
expect (m1 [3]) .toBeCloseTo (-Math .sin (5))
|
|
206
|
-
expect (m1 [4]) .toBeCloseTo ( Math .cos (5))
|
|
207
|
-
expect (m1 [5]) .toBeCloseTo (0)
|
|
208
|
-
expect (m1 [6]) .toBeCloseTo (0)
|
|
209
|
-
expect (m1 [7]) .toBeCloseTo (0)
|
|
210
|
-
expect (m1 [8]) .toBeCloseTo (1)
|
|
211
|
-
|
|
212
|
-
m1 .set (null, Math .PI / 4, null)
|
|
213
|
-
|
|
214
|
-
expect (m1 [0]) .toBeCloseTo (Math .sqrt (1/2))
|
|
215
|
-
expect (m1 [1]) .toBeCloseTo (Math .sqrt (1/2))
|
|
216
|
-
expect (m1 [2]) .toBeCloseTo (0)
|
|
217
|
-
expect (m1 [3]) .toBeCloseTo (-Math .sqrt (1/2))
|
|
218
|
-
expect (m1 [4]) .toBeCloseTo ( Math .sqrt (1/2))
|
|
219
|
-
expect (m1 [5]) .toBeCloseTo (0)
|
|
220
|
-
expect (m1 [6]) .toBeCloseTo (0)
|
|
221
|
-
expect (m1 [7]) .toBeCloseTo (0)
|
|
222
|
-
expect (m1 [8]) .toBeCloseTo (1)
|
|
223
|
-
|
|
224
|
-
})
|
|
225
|
-
|
|
226
|
-
test ("inverse", () =>
|
|
227
|
-
{
|
|
228
|
-
// https://www.wolframalpha.com/calculators/matrix-inverse-calculator
|
|
229
|
-
|
|
230
|
-
const m = new Matrix3 (1,2,3, 3,2,1, 2,1,3) .inverse ()
|
|
231
|
-
|
|
232
|
-
expect (m [0]) .toBeCloseTo (-5 / 12)
|
|
233
|
-
expect (m [1]) .toBeCloseTo ( 3 / 12)
|
|
234
|
-
expect (m [2]) .toBeCloseTo ( 4 / 12)
|
|
235
|
-
expect (m [3]) .toBeCloseTo ( 7 / 12)
|
|
236
|
-
expect (m [4]) .toBeCloseTo ( 3 / 12)
|
|
237
|
-
expect (m [5]) .toBeCloseTo (-8 / 12)
|
|
238
|
-
expect (m [6]) .toBeCloseTo ( 1 / 12)
|
|
239
|
-
expect (m [7]) .toBeCloseTo (-3 / 12)
|
|
240
|
-
expect (m [8]) .toBeCloseTo ( 4 / 12)
|
|
241
|
-
|
|
242
|
-
const m2 = new Matrix3 (1,3,0.3, 4,5,0.6, 7,8,0.9) .inverse ()
|
|
243
|
-
|
|
244
|
-
expect (m2 [0]) .toBeCloseTo (-1/2)
|
|
245
|
-
expect (m2 [1]) .toBeCloseTo (-1/2)
|
|
246
|
-
expect (m2 [2]) .toBeCloseTo (1/2)
|
|
247
|
-
expect (m2 [3]) .toBeCloseTo (1)
|
|
248
|
-
expect (m2 [4]) .toBeCloseTo (-2)
|
|
249
|
-
expect (m2 [5]) .toBeCloseTo (1)
|
|
250
|
-
expect (m2 [6]) .toBeCloseTo (-5)
|
|
251
|
-
expect (m2 [7]) .toBeCloseTo (65/3)
|
|
252
|
-
expect (m2 [8]) .toBeCloseTo (-35/3)
|
|
253
|
-
|
|
254
|
-
const m3 = new Matrix3 (1,3,0.3, 4,5,0.6, 7,8,0.9) .inverse () .inverse ()
|
|
255
|
-
|
|
256
|
-
expect (m3 [0]) .toBeCloseTo (1)
|
|
257
|
-
expect (m3 [1]) .toBeCloseTo (3)
|
|
258
|
-
expect (m3 [2]) .toBeCloseTo (0.3)
|
|
259
|
-
expect (m3 [3]) .toBeCloseTo (4)
|
|
260
|
-
expect (m3 [4]) .toBeCloseTo (5)
|
|
261
|
-
expect (m3 [5]) .toBeCloseTo (0.6)
|
|
262
|
-
expect (m3 [6]) .toBeCloseTo (7)
|
|
263
|
-
expect (m3 [7]) .toBeCloseTo (8)
|
|
264
|
-
expect (m3 [8]) .toBeCloseTo (0.9)
|
|
265
|
-
|
|
266
|
-
const m4 = new Matrix3 (1,3,0.3, 4,5,0.6, 7,8,0.9)
|
|
267
|
-
|
|
268
|
-
m4 .multRight (m4 .copy () .inverse ())
|
|
269
|
-
|
|
270
|
-
expect (m4 [0]) .toBeCloseTo (1)
|
|
271
|
-
expect (m4 [1]) .toBeCloseTo (0)
|
|
272
|
-
expect (m4 [2]) .toBeCloseTo (0)
|
|
273
|
-
expect (m4 [3]) .toBeCloseTo (0)
|
|
274
|
-
expect (m4 [4]) .toBeCloseTo (1)
|
|
275
|
-
expect (m4 [5]) .toBeCloseTo (0)
|
|
276
|
-
expect (m4 [6]) .toBeCloseTo (0)
|
|
277
|
-
expect (m4 [7]) .toBeCloseTo (0)
|
|
278
|
-
expect (m4 [8]) .toBeCloseTo (1)
|
|
279
|
-
})
|
|
280
|
-
|
|
281
|
-
test ("multRight", () =>
|
|
282
|
-
{
|
|
283
|
-
// https://www.matopt.de/werkzeuge/grundlagen/matrixmultiplikation.html
|
|
284
|
-
|
|
285
|
-
const
|
|
286
|
-
m1 = new Matrix3 (1, 2, 3, 4, 5, 6, 7, 8, 9),
|
|
287
|
-
m2 = new Matrix3 (10, 11, 12, 13, 14, 15, 16, 17, 18),
|
|
288
|
-
m = m1 .multRight (m2)
|
|
289
|
-
|
|
290
|
-
expect (m [0]) .toBe (84)
|
|
291
|
-
expect (m [1]) .toBe (90)
|
|
292
|
-
expect (m [2]) .toBe (96)
|
|
293
|
-
expect (m [3]) .toBe (201)
|
|
294
|
-
expect (m [4]) .toBe (216)
|
|
295
|
-
expect (m [5]) .toBe (231)
|
|
296
|
-
expect (m [6]) .toBe (318)
|
|
297
|
-
expect (m [7]) .toBe (342)
|
|
298
|
-
expect (m [8]) .toBe (366)
|
|
299
|
-
})
|
|
300
|
-
|
|
301
|
-
test ("multLeft", () =>
|
|
302
|
-
{
|
|
303
|
-
// https://www.matopt.de/werkzeuge/grundlagen/matrixmultiplikation.html
|
|
304
|
-
|
|
305
|
-
const
|
|
306
|
-
m1 = new Matrix3 (10, 11, 12, 13, 14, 15, 16, 17, 18),
|
|
307
|
-
m2 = new Matrix3 (1, 2, 3, 4, 5, 6, 7, 8, 9),
|
|
308
|
-
m = m1 .multLeft (m2)
|
|
309
|
-
|
|
310
|
-
expect (m [0]) .toBe (84)
|
|
311
|
-
expect (m [1]) .toBe (90)
|
|
312
|
-
expect (m [2]) .toBe (96)
|
|
313
|
-
expect (m [3]) .toBe (201)
|
|
314
|
-
expect (m [4]) .toBe (216)
|
|
315
|
-
expect (m [5]) .toBe (231)
|
|
316
|
-
expect (m [6]) .toBe (318)
|
|
317
|
-
expect (m [7]) .toBe (342)
|
|
318
|
-
expect (m [8]) .toBe (366)
|
|
319
|
-
})
|
|
320
|
-
|
|
321
|
-
test ("transpose", () =>
|
|
322
|
-
{
|
|
323
|
-
const m = new Matrix3 (1, 2, 3, 4, 5, 6, 7, 8, 9) .transpose ()
|
|
324
|
-
|
|
325
|
-
expect (m [0]) .toBe (1)
|
|
326
|
-
expect (m [1]) .toBe (4)
|
|
327
|
-
expect (m [2]) .toBe (7)
|
|
328
|
-
expect (m [3]) .toBe (2)
|
|
329
|
-
expect (m [4]) .toBe (5)
|
|
330
|
-
expect (m [5]) .toBe (8)
|
|
331
|
-
expect (m [6]) .toBe (3)
|
|
332
|
-
expect (m [7]) .toBe (6)
|
|
333
|
-
expect (m [8]) .toBe (9)
|
|
334
|
-
|
|
335
|
-
const m1 = new Matrix3 (1, 2, 3, 4, 5, 6, 7, 8, 9) .transpose () .transpose ()
|
|
336
|
-
|
|
337
|
-
expect (m1 [0]) .toBe (1)
|
|
338
|
-
expect (m1 [1]) .toBe (2)
|
|
339
|
-
expect (m1 [2]) .toBe (3)
|
|
340
|
-
expect (m1 [3]) .toBe (4)
|
|
341
|
-
expect (m1 [4]) .toBe (5)
|
|
342
|
-
expect (m1 [5]) .toBe (6)
|
|
343
|
-
expect (m1 [6]) .toBe (7)
|
|
344
|
-
expect (m1 [7]) .toBe (8)
|
|
345
|
-
expect (m1 [8]) .toBe (9)
|
|
346
|
-
})
|
|
347
|
-
|
|
348
|
-
test ("determinant", () =>
|
|
349
|
-
{
|
|
350
|
-
// https://www.wolframalpha.com/calculators/determinant-calculator
|
|
351
|
-
|
|
352
|
-
const d = new Matrix3 (1,2,3, 3,2,1, 2,1,3) .determinant ()
|
|
353
|
-
|
|
354
|
-
expect (d) .toBe (-12)
|
|
355
|
-
})
|
|
356
|
-
|
|
357
|
-
test ("determinant2", () =>
|
|
358
|
-
{
|
|
359
|
-
// https://www.wolframalpha.com/calculators/determinant-calculator
|
|
360
|
-
|
|
361
|
-
const d = new Matrix3 (1,2,3, 4,3,1, 2,1,3) .determinant2 ()
|
|
362
|
-
|
|
363
|
-
expect (d) .toBe (-5)
|
|
364
|
-
})
|
|
365
|
-
|
|
366
|
-
test ("multVecMatrix2", () =>
|
|
367
|
-
{
|
|
368
|
-
// https://www.wolframalpha.com/calculators/determinant-calculator
|
|
369
|
-
|
|
370
|
-
const v = new Matrix3 (1, 2, 3, 4, 5, 6, 7, 8, 9) .multVecMatrix (new Vector2 (10, 11))
|
|
371
|
-
|
|
372
|
-
expect (v [0]) .toBeCloseTo (61 / 105)
|
|
373
|
-
expect (v [1]) .toBeCloseTo (83 / 105)
|
|
374
|
-
|
|
375
|
-
const v1 = new Matrix3 (1, 2, 3, 4, 5, 6, 7, 8, 9) .transpose () .multVecMatrix (new Vector2 (10, 11))
|
|
376
|
-
|
|
377
|
-
expect (v1 [0]) .toBeCloseTo (35 / 167)
|
|
378
|
-
expect (v1 [1]) .toBeCloseTo (101 / 167)
|
|
379
|
-
})
|
|
380
|
-
|
|
381
|
-
test ("multVecMatrix3", () =>
|
|
382
|
-
{
|
|
383
|
-
// https://www.wolframalpha.com/calculators/determinant-calculator
|
|
384
|
-
|
|
385
|
-
const v = new Matrix3 (1, 2, 3, 4, 5, 6, 7, 8, 9) .multVecMatrix (new Vector3 (10, 11, 12))
|
|
386
|
-
|
|
387
|
-
expect (v [0]) .toBe (138)
|
|
388
|
-
expect (v [1]) .toBe (171)
|
|
389
|
-
expect (v [2]) .toBe (204)
|
|
390
|
-
|
|
391
|
-
const v1 = new Matrix3 (1, 2, 3, 4, 5, 6, 7, 8, 9) .transpose () .multVecMatrix (new Vector3 (10, 11, 12))
|
|
392
|
-
|
|
393
|
-
expect (v1 [0]) .toBe (68)
|
|
394
|
-
expect (v1 [1]) .toBe (167)
|
|
395
|
-
expect (v1 [2]) .toBe (266)
|
|
396
|
-
})
|
|
397
|
-
|
|
398
|
-
test ("multMatrixVec2", () =>
|
|
399
|
-
{
|
|
400
|
-
// https://www.wolframalpha.com/calculators/determinant-calculator
|
|
401
|
-
|
|
402
|
-
const v = new Matrix3 (1, 2, 3, 4, 5, 6, 7, 8, 9) .multMatrixVec (new Vector2 (10, 11))
|
|
403
|
-
|
|
404
|
-
expect (v [0]) .toBeCloseTo (35 / 167)
|
|
405
|
-
expect (v [1]) .toBeCloseTo (101 / 167)
|
|
406
|
-
|
|
407
|
-
const v1 = new Matrix3 (1, 2, 3, 4, 5, 6, 7, 8, 9) .transpose () .multMatrixVec (new Vector2 (10, 11))
|
|
408
|
-
|
|
409
|
-
expect (v1 [0]) .toBeCloseTo (61 / 105)
|
|
410
|
-
expect (v1 [1]) .toBeCloseTo (83 / 105)
|
|
411
|
-
})
|
|
412
|
-
|
|
413
|
-
test ("multMatrixVec3", () =>
|
|
414
|
-
{
|
|
415
|
-
// https://www.wolframalpha.com/calculators/determinant-calculator
|
|
416
|
-
|
|
417
|
-
const v = new Matrix3 (1, 2, 3, 4, 5, 6, 7, 8, 9) .multMatrixVec (new Vector3 (10, 11, 12))
|
|
418
|
-
|
|
419
|
-
expect (v [0]) .toBe (68)
|
|
420
|
-
expect (v [1]) .toBe (167)
|
|
421
|
-
expect (v [2]) .toBe (266)
|
|
422
|
-
|
|
423
|
-
const v1 = new Matrix3 (1, 2, 3, 4, 5, 6, 7, 8, 9) .transpose () .multMatrixVec (new Vector3 (10, 11, 12))
|
|
424
|
-
|
|
425
|
-
expect (v1 [0]) .toBe (138)
|
|
426
|
-
expect (v1 [1]) .toBe (171)
|
|
427
|
-
expect (v1 [2]) .toBe (204)
|
|
428
|
-
})
|
|
429
|
-
|
|
430
|
-
test ("multDirMatrix", () =>
|
|
431
|
-
{
|
|
432
|
-
// https://www.wolframalpha.com/calculators/determinant-calculator
|
|
433
|
-
|
|
434
|
-
const v = new Matrix3 (1, 2, 0, 3, 4, 0, 0, 0, 1) .multDirMatrix (new Vector2 (5, 6))
|
|
435
|
-
|
|
436
|
-
expect (v [0]) .toBe (23)
|
|
437
|
-
expect (v [1]) .toBe (34)
|
|
438
|
-
|
|
439
|
-
const v1 = new Matrix3 (1, 2, 0, 3, 4, 0, 0, 0, 1) .transpose () .multDirMatrix (new Vector2 (5, 6))
|
|
440
|
-
|
|
441
|
-
expect (v1 [0]) .toBe (17)
|
|
442
|
-
expect (v1 [1]) .toBe (39)
|
|
443
|
-
})
|
|
444
|
-
|
|
445
|
-
test ("multMatrixDir", () =>
|
|
446
|
-
{
|
|
447
|
-
// https://www.wolframalpha.com/calculators/determinant-calculator
|
|
448
|
-
|
|
449
|
-
const v = new Matrix3 (1, 2, 0, 3, 4, 0, 0, 0, 1) .multMatrixDir (new Vector2 (5, 6))
|
|
450
|
-
|
|
451
|
-
expect (v [0]) .toBe (17)
|
|
452
|
-
expect (v [1]) .toBe (39)
|
|
453
|
-
|
|
454
|
-
const v1 = new Matrix3 (1, 2, 0, 3, 4, 0, 0, 0, 1) .transpose () .multMatrixDir (new Vector2 (5, 6))
|
|
455
|
-
|
|
456
|
-
expect (v1 [0]) .toBe (23)
|
|
457
|
-
expect (v1 [1]) .toBe (34)
|
|
458
|
-
})
|
|
459
|
-
|
|
460
|
-
test ("translate", () =>
|
|
461
|
-
{
|
|
462
|
-
// https://www.wolframalpha.com/calculators/determinant-calculator
|
|
463
|
-
|
|
464
|
-
const m = new Matrix3 (1, 2, 0, 4, 5, 0, 7, 8, 1) .translate (new Vector2 (10, 11))
|
|
465
|
-
|
|
466
|
-
expect (m [0]) .toBe (1)
|
|
467
|
-
expect (m [1]) .toBe (2)
|
|
468
|
-
expect (m [2]) .toBe (0)
|
|
469
|
-
expect (m [3]) .toBe (4)
|
|
470
|
-
expect (m [4]) .toBe (5)
|
|
471
|
-
expect (m [5]) .toBe (0)
|
|
472
|
-
expect (m [6]) .toBe (61)
|
|
473
|
-
expect (m [7]) .toBe (83)
|
|
474
|
-
expect (m [8]) .toBe (1)
|
|
475
|
-
})
|
|
476
|
-
|
|
477
|
-
test ("rotate", () =>
|
|
478
|
-
{
|
|
479
|
-
const m = new Matrix3 (1, 2, 0, 4, 5, 0, 7, 8, 1) .rotate (Math .PI / 4)
|
|
480
|
-
|
|
481
|
-
expect (m [0]) .toBeCloseTo (3.5355339059327373)
|
|
482
|
-
expect (m [1]) .toBeCloseTo (4.949747468305833)
|
|
483
|
-
expect (m [2]) .toBeCloseTo (0)
|
|
484
|
-
expect (m [3]) .toBeCloseTo (2.121320343559643)
|
|
485
|
-
expect (m [4]) .toBeCloseTo (2.121320343559643)
|
|
486
|
-
expect (m [5]) .toBeCloseTo (0)
|
|
487
|
-
expect (m [6]) .toBeCloseTo (7)
|
|
488
|
-
expect (m [7]) .toBeCloseTo (8)
|
|
489
|
-
expect (m [8]) .toBeCloseTo (1)
|
|
490
|
-
})
|
|
491
|
-
|
|
492
|
-
test ("scale", () =>
|
|
493
|
-
{
|
|
494
|
-
// https://www.wolframalpha.com/calculators/determinant-calculator
|
|
495
|
-
|
|
496
|
-
const m = new Matrix3 (1, 2, 0, 4, 5, 0, 7, 8, 1) .scale (new Vector2 (10, 11))
|
|
497
|
-
|
|
498
|
-
expect (m [0]) .toBe (10)
|
|
499
|
-
expect (m [1]) .toBe (20)
|
|
500
|
-
expect (m [2]) .toBe (0)
|
|
501
|
-
expect (m [3]) .toBe (44)
|
|
502
|
-
expect (m [4]) .toBe (55)
|
|
503
|
-
expect (m [5]) .toBe (0)
|
|
504
|
-
expect (m [6]) .toBe (7)
|
|
505
|
-
expect (m [7]) .toBe (8)
|
|
506
|
-
expect (m [8]) .toBe (1)
|
|
507
|
-
})
|
|
508
|
-
|
|
509
|
-
test ("skewX", () =>
|
|
510
|
-
{
|
|
511
|
-
const m = new Matrix3 (1, 2, 0, 4, 5, 0, 7, 8, 1) .skewX (Math .PI / 2)
|
|
512
|
-
|
|
513
|
-
expect (m [0]) .toBeCloseTo (1)
|
|
514
|
-
expect (m [1]) .toBeCloseTo (2)
|
|
515
|
-
expect (m [2]) .toBeCloseTo (0)
|
|
516
|
-
expect (m [3]) .toBeCloseTo (16331239353195374)
|
|
517
|
-
expect (m [4]) .toBeCloseTo (32662478706390744)
|
|
518
|
-
expect (m [5]) .toBeCloseTo (0)
|
|
519
|
-
expect (m [6]) .toBeCloseTo (7)
|
|
520
|
-
expect (m [7]) .toBeCloseTo (8)
|
|
521
|
-
expect (m [8]) .toBeCloseTo (1)
|
|
522
|
-
})
|
|
523
|
-
|
|
524
|
-
test ("skewY", () =>
|
|
525
|
-
{
|
|
526
|
-
const m = new Matrix3 (1, 2, 0, 4, 5, 0, 7, 8, 1) .skewY (Math .PI / 2)
|
|
527
|
-
|
|
528
|
-
expect (m [0]) .toBeCloseTo (65324957412781480)
|
|
529
|
-
expect (m [1]) .toBeCloseTo (81656196765976850)
|
|
530
|
-
expect (m [2]) .toBeCloseTo (0)
|
|
531
|
-
expect (m [3]) .toBeCloseTo (4)
|
|
532
|
-
expect (m [4]) .toBeCloseTo (5)
|
|
533
|
-
expect (m [5]) .toBeCloseTo (0)
|
|
534
|
-
expect (m [6]) .toBeCloseTo (7)
|
|
535
|
-
expect (m [7]) .toBeCloseTo (8)
|
|
536
|
-
expect (m [8]) .toBeCloseTo (1)
|
|
537
|
-
})
|
|
538
|
-
|
|
539
|
-
test ("copy", () =>
|
|
540
|
-
{
|
|
541
|
-
const m = new Matrix3 (2,3,4, 5,6,7, 8,9,10) .copy ()
|
|
542
|
-
|
|
543
|
-
expect (m [0]) .toBe (2)
|
|
544
|
-
expect (m [1]) .toBe (3)
|
|
545
|
-
expect (m [2]) .toBe (4)
|
|
546
|
-
expect (m [3]) .toBe (5)
|
|
547
|
-
expect (m [4]) .toBe (6)
|
|
548
|
-
expect (m [5]) .toBe (7)
|
|
549
|
-
expect (m [6]) .toBe (8)
|
|
550
|
-
expect (m [7]) .toBe (9)
|
|
551
|
-
expect (m [8]) .toBe (10)
|
|
552
|
-
})
|
|
553
|
-
|
|
554
|
-
test ("assign", () =>
|
|
555
|
-
{
|
|
556
|
-
const m = new Matrix3 () .assign (new Matrix3 (2,3,4, 5,6,7, 8,9,10))
|
|
557
|
-
|
|
558
|
-
expect (m [0]) .toBe (2)
|
|
559
|
-
expect (m [1]) .toBe (3)
|
|
560
|
-
expect (m [2]) .toBe (4)
|
|
561
|
-
expect (m [3]) .toBe (5)
|
|
562
|
-
expect (m [4]) .toBe (6)
|
|
563
|
-
expect (m [5]) .toBe (7)
|
|
564
|
-
expect (m [6]) .toBe (8)
|
|
565
|
-
expect (m [7]) .toBe (9)
|
|
566
|
-
expect (m [8]) .toBe (10)
|
|
567
|
-
})
|
|
568
|
-
|
|
569
|
-
test ("equals", () =>
|
|
570
|
-
{
|
|
571
|
-
const
|
|
572
|
-
a = new Matrix3 (2,3,4, 5,6,7, 8,9,10),
|
|
573
|
-
b = new Matrix3 (2,3,4, 5,6,7, 8,9,10)
|
|
574
|
-
|
|
575
|
-
expect (a .equals (b)) .toBe (true)
|
|
576
|
-
|
|
577
|
-
for (let i = 0; i < a .length; ++ i)
|
|
578
|
-
{
|
|
579
|
-
const c = a .copy ()
|
|
580
|
-
|
|
581
|
-
c [i] = 0
|
|
582
|
-
|
|
583
|
-
expect (a .equals (c)) .toBe (false)
|
|
584
|
-
}
|
|
585
|
-
})
|