x_ite 8.7.4 → 8.7.5

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 (92) hide show
  1. package/.vscode/tasks.json +1 -1
  2. package/dist/assets/components/Annotation.js +13 -13
  3. package/dist/assets/components/Annotation.min.js +1 -1
  4. package/dist/assets/components/CADGeometry.js +13 -13
  5. package/dist/assets/components/CADGeometry.min.js +1 -1
  6. package/dist/assets/components/CubeMapTexturing.js +25 -25
  7. package/dist/assets/components/CubeMapTexturing.min.js +1 -1
  8. package/dist/assets/components/DIS.js +13 -13
  9. package/dist/assets/components/DIS.min.js +1 -1
  10. package/dist/assets/components/EventUtilities.js +9 -9
  11. package/dist/assets/components/EventUtilities.min.js +1 -1
  12. package/dist/assets/components/Geometry2D.js +19 -19
  13. package/dist/assets/components/Geometry2D.min.js +1 -1
  14. package/dist/assets/components/Geospatial.js +33 -33
  15. package/dist/assets/components/Geospatial.min.js +1 -1
  16. package/dist/assets/components/HAnim.js +18 -18
  17. package/dist/assets/components/HAnim.min.js +1 -1
  18. package/dist/assets/components/KeyDeviceSensor.js +8 -8
  19. package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
  20. package/dist/assets/components/Layout.js +36 -31
  21. package/dist/assets/components/Layout.min.js +1 -1
  22. package/dist/assets/components/NURBS.js +24 -24
  23. package/dist/assets/components/NURBS.min.js +1 -1
  24. package/dist/assets/components/ParticleSystems.js +22 -22
  25. package/dist/assets/components/ParticleSystems.min.js +1 -1
  26. package/dist/assets/components/Picking.js +18 -18
  27. package/dist/assets/components/Picking.min.js +1 -1
  28. package/dist/assets/components/RigidBodyPhysics.js +18 -18
  29. package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
  30. package/dist/assets/components/Scripting.js +28 -28
  31. package/dist/assets/components/Scripting.min.js +1 -1
  32. package/dist/assets/components/Text.js +24 -24
  33. package/dist/assets/components/Text.min.js +1 -1
  34. package/dist/assets/components/TextureProjector.js +14 -14
  35. package/dist/assets/components/TextureProjector.min.js +1 -1
  36. package/dist/assets/components/Texturing3D.js +30 -30
  37. package/dist/assets/components/Texturing3D.min.js +1 -1
  38. package/dist/assets/components/VolumeRendering.js +19 -19
  39. package/dist/assets/components/VolumeRendering.min.js +1 -1
  40. package/dist/assets/components/X_ITE.js +9 -9
  41. package/dist/assets/components/X_ITE.min.js +1 -1
  42. package/dist/x_ite.css +1 -1
  43. package/dist/x_ite.js +903 -1163
  44. package/dist/x_ite.min.js +1 -1
  45. package/dist/x_ite.zip +0 -0
  46. package/docs/_config.yml +1 -1
  47. package/docs/_posts/reference/field-services-and-objects.md +26 -6
  48. package/package.json +1 -1
  49. package/src/standard/Math/Algorithms/eigen_decomposition.js +9 -9
  50. package/src/standard/Math/Geometry/Box2.js +20 -20
  51. package/src/standard/Math/Geometry/Box3.js +20 -20
  52. package/src/standard/Math/Numbers/Color3.js +10 -18
  53. package/src/standard/Math/Numbers/Color4.js +12 -23
  54. package/src/standard/Math/Numbers/Complex.js +59 -54
  55. package/src/standard/Math/Numbers/Matrix2.js +31 -45
  56. package/src/standard/Math/Numbers/Matrix3.js +59 -94
  57. package/src/standard/Math/Numbers/Matrix4.js +73 -114
  58. package/src/standard/Math/Numbers/Quaternion.js +49 -65
  59. package/src/standard/Math/Numbers/Rotation4.js +15 -13
  60. package/src/standard/Math/Numbers/Vector2.js +12 -14
  61. package/src/standard/Math/Numbers/Vector3.js +17 -22
  62. package/src/standard/Math/Numbers/Vector4.js +22 -30
  63. package/src/x_ite/Base/X3DInfoArray.js +9 -7
  64. package/src/x_ite/Browser/Core/X3DCoreContext.js +3 -3
  65. package/src/x_ite/Browser/Layout/ScreenText.js +9 -4
  66. package/src/x_ite/Browser/VERSION.js +1 -1
  67. package/src/x_ite/Browser/X3DBrowser.js +57 -64
  68. package/src/x_ite/Browser/X3DBrowserContext.js +8 -8
  69. package/src/x_ite/Components/Layering/X3DLayerNode.js +1 -1
  70. package/src/x_ite/Components/Navigation/X3DViewpointNode.js +2 -3
  71. package/src/x_ite/Execution/X3DExecutionContext.js +52 -58
  72. package/src/x_ite/Execution/X3DExportedNode.js +13 -11
  73. package/src/x_ite/Execution/X3DImportedNode.js +25 -25
  74. package/src/x_ite/Execution/X3DScene.js +129 -53
  75. package/src/x_ite/Fields/SFColor.js +10 -15
  76. package/src/x_ite/Fields/SFColorRGBA.js +11 -18
  77. package/src/x_ite/Fields/SFImage.js +38 -33
  78. package/src/x_ite/Fields/SFMatrix3.js +1 -3
  79. package/src/x_ite/Fields/SFMatrix4.js +1 -5
  80. package/src/x_ite/Fields/SFMatrixPrototypeTemplate.js +6 -5
  81. package/src/x_ite/Fields/SFRotation.js +14 -21
  82. package/src/x_ite/Fields/SFString.js +0 -1
  83. package/src/x_ite/Fields/SFVec2.js +8 -15
  84. package/src/x_ite/Fields/SFVec3.js +10 -17
  85. package/src/x_ite/Fields/SFVec4.js +12 -23
  86. package/src/x_ite/Fields/SFVecPrototypeTemplate.js +15 -14
  87. package/src/x_ite/Parser/SVGParser.js +2 -2
  88. package/src/x_ite/Parser/X3DOptimizer.js +1 -1
  89. package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +26 -27
  90. package/src/x_ite/Prototype/X3DProtoDeclaration.js +16 -15
  91. package/src/x_ite/Routing/X3DRoute.js +26 -25
  92. package/src/x_ite/Execution/Scene.js +0 -145
package/dist/x_ite.zip CHANGED
Binary file
package/docs/_config.yml CHANGED
@@ -20,7 +20,7 @@ timezone:
20
20
  # ↓ --------------------------
21
21
 
22
22
  title: X_ITE X3D Browser # the main title
23
- version: 8.7.4 # x_ite latest version
23
+ version: 8.7.5 # x_ite latest version
24
24
  size: 290 # size in kb
25
25
  x3d_latest_version: 4.0 # x3d latest version
26
26
 
@@ -263,11 +263,21 @@ None
263
263
 
264
264
  #### void **setTransform** (*translation*, *rotation*, *scaleFactor*, *scaleOrientation*, *center*)
265
265
 
266
- Sets the SFMatrix3d/f to the passed values. *translation* is an SFVec2d/f object, *rotation* is a Number, *scaleFactor* is a SFVec2d/f object, *scaleOrientation* is a Number and *center* is a SFVec2d/f object. Any of the rightmost parameters can be omitted. In other words, the method can take from 0 to 5 parameters. For example, you can specify 0 parameters (resulting in a identity matrix), 1 parameter (a translation), 2 parameters (a translation and a rotation), 3 parameters (a translation, rotation and a scaleFactor), etc. Any unspecified parameter is set to its default as specified in the **Transform** node section of the X3D specification.
266
+ Sets the SFMatrix3d/f to the passed values. *translation* is an SFVec2d/f object, *rotation* is a Number, *scaleFactor* is a SFVec2d/f object, *scaleOrientation* is a Number and *center* is a SFVec2d/f object.
267
267
 
268
- #### void **getTransform** (*translation*, *rotation*, *scaleFactor*)
268
+ Any of the rightmost parameters can be omitted, or any parameter can be `null`. In other words, the method can take from 0 to 5 parameters. For example, you can specify 0 parameters (resulting in a identity matrix), 1 parameter (a translation), 2 parameters (a translation and a rotation), 3 parameters (a translation, rotation and a scaleFactor), etc. Any unspecified parameter is set to its default as specified in the **Transform** node section of the X3D specification.
269
269
 
270
- Decomposes the SFMatrix3d/f and returns the components in the passed *translation*, *rotation*, and *scaleFactor* objects*. rotation* is a SFVec3d/f where x and y are the complex value of the rotation and z is the rotation angle in radians. The other types of the parameters are the same as in **setTransform**. Any projection or shear information in the matrix is ignored.
270
+ #### void **getTransform** (*translation*, *rotation*, *scaleFactor*, *scaleOrientation*, *center*)
271
+
272
+ Decomposes the SFMatrix3d/f and returns the components in the passed *translation*, *rotation*, and *scaleFactor* objects*. rotation* is a SFVec3d/f, where x and y are the complex value of the rotation and z is the rotation angle in radians. The other types of the parameters are the same as in **setTransform**.
273
+
274
+ Any of the rightmost parameters can be omitted, or any parameter can be `null`. In other words, the method can take from 0 to 5 parameters. For example, you can specify 0 parameters (resulting in a identity matrix), 1 parameter (a translation), 2 parameters (a translation and a rotation), 3 parameters (a translation, rotation and a scaleFactor), etc. Any unspecified parameter is set to its default as specified in the **Transform** node section of the X3D specification.
275
+
276
+ A center of any value can be specified around which the rotation and scaling will take place.
277
+
278
+ #### Number **determinant** ()
279
+
280
+ Returns the determinant of this object's matrix.
271
281
 
272
282
  #### SFMatrix3d/f **inverse** ()
273
283
 
@@ -327,11 +337,21 @@ None
327
337
 
328
338
  #### void **setTransform** (*translation*, *rotation*, *scaleFactor*, *scaleOrientation*, *center*)
329
339
 
330
- Sets the SFMatrix4d/f to the passed values. *translation* is an SFVec3d/f object, *rotation* is a SFRotation object, *scaleFactor* is a SFVec3d/f object, *scaleOrientation* is a SFRotation object and *center* is a SFVec3d/f object. Any of the rightmost parameters can be omitted. In other words, the method can take from 0 to 5 parameters. For example, you can specify 0 parameters (resulting in a identity matrix), 1 parameter (a translation), 2 parameters (a translation and a rotation), 3 parameters (a translation, rotation and a scaleFactor), etc. Any unspecified parameter is set to its default as specified in the **Transform** node section of the X3D specification.
340
+ Sets the SFMatrix4d/f to the passed values. *translation* is an SFVec3d/f object, *rotation* is a SFRotation object, *scaleFactor* is a SFVec3d/f object, *scaleOrientation* is a SFRotation object and *center* is a SFVec3d/f object.
341
+
342
+ Any of the rightmost parameters can be omitted. In other words, the method can take from 0 to 5 parameters. For example, you can specify 0 parameters (resulting in a identity matrix), 1 parameter (a translation), 2 parameters (a translation and a rotation), 3 parameters (a translation, rotation and a scaleFactor), etc. Any unspecified parameter is set to its default as specified in the **Transform** node section of the X3D specification.
343
+
344
+ #### void **getTransform** (*translation*, *rotation*, *scaleFactor*, *scaleOrientation*, *center*)
345
+
346
+ Decomposes the SFMatrix4d/f and returns the components in the passed *translation*, *rotation*, and *scaleFactor* objects. The types of the parameters are the same as in **setTransform**.
347
+
348
+ Any of the rightmost parameters can be omitted. In other words, the method can take from 0 to 5 parameters. For example, you can specify 0 parameters (resulting in a identity matrix), 1 parameter (a translation), 2 parameters (a translation and a rotation), 3 parameters (a translation, rotation and a scaleFactor), etc. Any unspecified parameter is set to its default as specified in the **Transform** node section of the X3D specification.
349
+
350
+ A center of any value can be specified around which the rotation and scaling will take place.
331
351
 
332
- #### void **getTransform** (*translation*, *rotation*, *scaleFactor*)
352
+ #### Number **determinant** ()
333
353
 
334
- Decomposes the SFMatrix4d/f and returns the components in the passed *translation*, *rotation*, and *scaleFactor* objects*.* The types of the parameters are the same as in **setTransform**. Any projection or shear information in the matrix is ignored.
354
+ Returns the determinant of this object's matrix.
335
355
 
336
356
  #### SFMatrix4d/f **inverse** ()
337
357
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x_ite",
3
- "version": "8.7.4",
3
+ "version": "8.7.5",
4
4
  "description": "X_ITE X3D Browser, view and manipulate X3D and VRML scenes in HTML.",
5
5
  "homepage": "https://create3000.github.io/x_ite/",
6
6
  "author": "Holger Seelig <holger.seelig@gmail.com>",
@@ -55,23 +55,23 @@ function eigen_decomposition (matrix, result)
55
55
  {
56
56
  const
57
57
  ORDER = matrix .order,
58
+ SIZE = matrix .length,
58
59
  values = result .values,
59
60
  vectors = result .vectors;
60
61
 
61
62
  let
62
- sm, // smallest entry
63
- theta, // angle for Jacobi rotation
64
- c, s, t, // cosine, sine, tangent of theta
65
- tau, // sine / (1 + cos)
66
- h, g, // two scrap values
67
- thresh, // threshold below which no rotation done
68
- p, q, i, j,
69
- SIZE = matrix .length;
63
+ sm, // smallest entry
64
+ theta, // angle for Jacobi rotation
65
+ c, s, t, // cosine, sine, tangent of theta
66
+ tau, // sine / (1 + cos)
67
+ h, g, // two scrap values
68
+ thresh, // threshold below which no rotation done
69
+ p, q, i, j; // indices
70
70
 
71
71
  // initializations
72
72
  for (i = 0; i < ORDER; ++ i)
73
73
  {
74
- a [i] = a [i] || new Array (ORDER);
74
+ a [i] = a [i] ?? [ ];
75
75
  b [i] = values [i] = matrix .get1 (i, i);
76
76
  z [i] = 0;
77
77
 
@@ -203,33 +203,33 @@ Box2 .prototype =
203
203
  },
204
204
  };
205
205
 
206
- Object .defineProperty (Box2 .prototype, "size",
206
+ Object .defineProperties (Box2 .prototype,
207
207
  {
208
- get: (function ()
208
+ size:
209
209
  {
210
- const
211
- min = new Vector2 (0, 0),
212
- max = new Vector2 (0, 0);
213
-
214
- return function ()
210
+ get: (function ()
215
211
  {
216
- this .getAbsoluteExtents (min, max);
212
+ const
213
+ min = new Vector2 (0, 0),
214
+ max = new Vector2 (0, 0);
217
215
 
218
- return max .subtract (min);
219
- };
220
- })(),
221
- enumerable: true,
222
- configurable: false
223
- });
216
+ return function ()
217
+ {
218
+ this .getAbsoluteExtents (min, max);
224
219
 
225
- Object .defineProperty (Box2 .prototype, "center",
226
- {
227
- get: function ()
220
+ return max .subtract (min);
221
+ };
222
+ })(),
223
+ enumerable: true,
224
+ },
225
+ center:
228
226
  {
229
- return this .matrix .origin;
227
+ get: function ()
228
+ {
229
+ return this .matrix .origin;
230
+ },
231
+ enumerable: true,
230
232
  },
231
- enumerable: true,
232
- configurable: false
233
233
  });
234
234
 
235
235
  export default Box2;
@@ -611,33 +611,33 @@ Box3 .prototype =
611
611
  },
612
612
  };
613
613
 
614
- Object .defineProperty (Box3 .prototype, "size",
614
+ Object .defineProperties (Box3 .prototype,
615
615
  {
616
- get: (function ()
616
+ size:
617
617
  {
618
- const
619
- min = new Vector3 (0, 0, 0),
620
- max = new Vector3 (0, 0, 0);
621
-
622
- return function ()
618
+ get: (function ()
623
619
  {
624
- this .getAbsoluteExtents (min, max);
620
+ const
621
+ min = new Vector3 (0, 0, 0),
622
+ max = new Vector3 (0, 0, 0);
625
623
 
626
- return max .subtract (min);
627
- };
628
- })(),
629
- enumerable: true,
630
- configurable: false
631
- });
624
+ return function ()
625
+ {
626
+ this .getAbsoluteExtents (min, max);
632
627
 
633
- Object .defineProperty (Box3 .prototype, "center",
634
- {
635
- get: function ()
628
+ return max .subtract (min);
629
+ };
630
+ })(),
631
+ enumerable: true,
632
+ },
633
+ center:
636
634
  {
637
- return this .matrix .origin;
635
+ get: function ()
636
+ {
637
+ return this .matrix .origin;
638
+ },
639
+ enumerable: true,
638
640
  },
639
- enumerable: true,
640
- configurable: false
641
641
  });
642
642
 
643
643
  export default Box3;
@@ -64,7 +64,6 @@ function Color3 (r, g, b)
64
64
  Color3 .prototype =
65
65
  {
66
66
  constructor: Color3,
67
- length: 3,
68
67
  [Symbol .iterator]: function* ()
69
68
  {
70
69
  yield this [_r];
@@ -180,35 +179,28 @@ Color3 .prototype =
180
179
  const r = {
181
180
  get: function () { return this [_r]; },
182
181
  set: function (value) { this [_r] = clamp (value, 0, 1); },
183
- enumerable: true,
184
- configurable: false
185
182
  };
186
183
 
187
184
  const g = {
188
185
  get: function () { return this [_g]; },
189
186
  set: function (value) { this [_g] = clamp (value, 0, 1); },
190
- enumerable: true,
191
- configurable: false
192
187
  };
193
188
 
194
189
  const b = {
195
190
  get: function () { return this [_b]; },
196
191
  set: function (value) { this [_b] = clamp (value, 0, 1); },
197
- enumerable: true,
198
- configurable: false
199
192
  };
200
193
 
201
- Object .defineProperty (Color3 .prototype, "r", r);
202
- Object .defineProperty (Color3 .prototype, "g", g);
203
- Object .defineProperty (Color3 .prototype, "b", b);
204
-
205
- r .enumerable = false;
206
- g .enumerable = false;
207
- b .enumerable = false;
208
-
209
- Object .defineProperty (Color3 .prototype, "0", r);
210
- Object .defineProperty (Color3 .prototype, "1", g);
211
- Object .defineProperty (Color3 .prototype, "2", b);
194
+ Object .defineProperties (Color3 .prototype,
195
+ {
196
+ length: { value: 3 },
197
+ 0: r,
198
+ 1: g,
199
+ 2: b,
200
+ r: Object .assign ({ enumerable: true }, r),
201
+ g: Object .assign ({ enumerable: true }, g),
202
+ b: Object .assign ({ enumerable: true }, b),
203
+ });
212
204
 
213
205
  Object .assign (Color3,
214
206
  {
@@ -67,7 +67,6 @@ function Color4 (r, g, b, a)
67
67
  Color4 .prototype =
68
68
  {
69
69
  constructor: Color4,
70
- length: 4,
71
70
  [Symbol .iterator]: function* ()
72
71
  {
73
72
  yield this [_r];
@@ -135,45 +134,35 @@ Color4 .prototype =
135
134
  const r = {
136
135
  get: function () { return this [_r]; },
137
136
  set: function (value) { this [_r] = clamp (value, 0, 1); },
138
- enumerable: true,
139
- configurable: false
140
137
  };
141
138
 
142
139
  const g = {
143
140
  get: function () { return this [_g]; },
144
141
  set: function (value) { this [_g] = clamp (value, 0, 1); },
145
- enumerable: true,
146
- configurable: false
147
142
  };
148
143
 
149
144
  const b = {
150
145
  get: function () { return this [_b]; },
151
146
  set: function (value) { this [_b] = clamp (value, 0, 1); },
152
- enumerable: true,
153
- configurable: false
154
147
  };
155
148
 
156
149
  const a = {
157
150
  get: function () { return this [_a]; },
158
151
  set: function (value) { this [_a] = clamp (value, 0, 1); },
159
- enumerable: true,
160
- configurable: false
161
152
  };
162
153
 
163
- Object .defineProperty (Color4 .prototype, "r", r);
164
- Object .defineProperty (Color4 .prototype, "g", g);
165
- Object .defineProperty (Color4 .prototype, "b", b);
166
- Object .defineProperty (Color4 .prototype, "a", a);
167
-
168
- r .enumerable = false;
169
- g .enumerable = false;
170
- b .enumerable = false;
171
- a .enumerable = false;
172
-
173
- Object .defineProperty (Color4 .prototype, "0", r);
174
- Object .defineProperty (Color4 .prototype, "1", g);
175
- Object .defineProperty (Color4 .prototype, "2", b);
176
- Object .defineProperty (Color4 .prototype, "3", a);
154
+ Object .defineProperties (Color4 .prototype,
155
+ {
156
+ length: { value: 4 },
157
+ 0: r,
158
+ 1: g,
159
+ 2: b,
160
+ 3: a,
161
+ r: Object .assign ({ enumerable: true }, r),
162
+ g: Object .assign ({ enumerable: true }, g),
163
+ b: Object .assign ({ enumerable: true }, b),
164
+ a: Object .assign ({ enumerable: true }, a),
165
+ });
177
166
 
178
167
  Object .assign (Color4,
179
168
  {
@@ -54,7 +54,6 @@ function Complex (real, imag)
54
54
  Complex .prototype =
55
55
  {
56
56
  constructor: Complex,
57
- length: 2,
58
57
  [Symbol .iterator]: function* ()
59
58
  {
60
59
  yield this .real;
@@ -156,75 +155,81 @@ Complex .prototype =
156
155
  },
157
156
  toString: function ()
158
157
  {
159
- if (this .imag)
160
- return this .real + " " + this .imag + "i";
158
+ let string = "";
161
159
 
162
- return String (this .real);
163
- },
164
- };
160
+ string += this .real;
165
161
 
166
- Object .defineProperty (Complex .prototype, "0",
167
- {
168
- get: function ()
169
- {
170
- return this .real;
171
- },
172
- set: function (value)
173
- {
174
- this .real = value;
162
+ if (this .imag < 0)
163
+ {
164
+ string += this .imag;
165
+ string += "i";
166
+ }
167
+ else if (this .imag > 0)
168
+ {
169
+ string += "+";
170
+ string += this .imag;
171
+ string += "i";
172
+ }
173
+
174
+ return string;
175
175
  },
176
- enumerable: false,
177
- configurable: false
178
- });
176
+ };
179
177
 
180
- Object .defineProperty (Complex .prototype, "1",
178
+ Object .defineProperties (Complex .prototype,
181
179
  {
182
- get: function ()
180
+ length: { value: 2 },
181
+ 0:
183
182
  {
184
- return this .imag;
183
+ get: function ()
184
+ {
185
+ return this .real;
186
+ },
187
+ set: function (value)
188
+ {
189
+ this .real = value;
190
+ },
185
191
  },
186
- set: function (value)
192
+ 1:
187
193
  {
188
- this .imag = value;
194
+ get: function ()
195
+ {
196
+ return this .imag;
197
+ },
198
+ set: function (value)
199
+ {
200
+ this .imag = value;
201
+ },
189
202
  },
190
- enumerable: false,
191
- configurable: false
192
- });
193
-
194
- Object .defineProperty (Complex .prototype, "magnitude",
195
- {
196
- get: function ()
203
+ magnitude:
197
204
  {
198
- if (this .real)
205
+ get: function ()
199
206
  {
200
- if (this .imag)
201
- return Math .hypot (this .real, this .imag);
207
+ if (this .real)
208
+ {
209
+ if (this .imag)
210
+ return Math .hypot (this .real, this .imag);
202
211
 
203
- return Math .abs (this .real);
204
- }
212
+ return Math .abs (this .real);
213
+ }
205
214
 
206
- return Math .abs (this .imag);
207
- },
208
- set: function (magnitude)
209
- {
210
- this .setPolar (magnitude, this .angle);
211
- },
212
- enumerable: false,
213
- configurable: false
214
- });
215
-
216
- Object .defineProperty (Complex .prototype, "angle",
217
- {
218
- get: function ()
219
- {
220
- return Math .atan2 (this .imag, this .real);
215
+ return Math .abs (this .imag);
216
+ },
217
+ set: function (magnitude)
218
+ {
219
+ this .setPolar (magnitude, this .angle);
220
+ },
221
221
  },
222
- set: function (angle)
222
+ angle:
223
223
  {
224
- this .setPolar (this .magnitude, angle);
224
+ get: function ()
225
+ {
226
+ return Math .atan2 (this .imag, this .real);
227
+ },
228
+ set: function (angle)
229
+ {
230
+ this .setPolar (this .magnitude, angle);
231
+ },
225
232
  },
226
- enumerable: false,
227
- configurable: false
228
233
  });
229
234
 
230
235
  Object .assign (Complex,
@@ -45,8 +45,7 @@
45
45
  *
46
46
  ******************************************************************************/
47
47
 
48
- import Vector2 from "./Vector2.js";
49
- import Algorithm from "../Algorithm.js";
48
+ import Vector2 from "./Vector2.js";
50
49
 
51
50
  function Matrix2 ()
52
51
  {
@@ -64,13 +63,9 @@ function Matrix2 ()
64
63
  Matrix2 .prototype =
65
64
  {
66
65
  constructor: Matrix2,
67
- order: 2,
68
- length: 4,
69
66
  [Symbol .iterator]: function* ()
70
67
  {
71
- const length = this .length;
72
-
73
- for (let i = 0; i < length; ++ i)
68
+ for (let i = 0; i < 4; ++ i)
74
69
  yield this [i];
75
70
  },
76
71
  copy: function ()
@@ -236,49 +231,40 @@ Matrix2 .prototype =
236
231
  },
237
232
  };
238
233
 
239
- Object .defineProperty (Matrix2 .prototype, "x",
234
+ Object .defineProperties (Matrix2 .prototype,
240
235
  {
241
- get: (function ()
236
+ order: { value: 2 },
237
+ length: { value: 4 },
238
+ x:
242
239
  {
243
- const vector = new Vector2 (0, 0);
244
-
245
- return function () { return vector .set (this [0], this [1]); };
246
- })(),
247
- enumerable: false,
248
- configurable: false
249
- });
240
+ get: (function ()
241
+ {
242
+ const vector = new Vector2 (0, 0);
250
243
 
251
- Object .defineProperty (Matrix2 .prototype, "y",
252
- {
253
- get: (function ()
244
+ return function () { return vector .set (this [0], this [1]); };
245
+ })(),
246
+ },
247
+ y:
254
248
  {
255
- const vector = new Vector2 (0, 0);
256
-
257
- return function () { return vector .set (this [2], this [3]); };
258
- })(),
259
- enumerable: false,
260
- configurable: false
261
- });
262
-
263
- Object .defineProperty (Matrix2 .prototype, "xAxis",
264
- {
265
- get: function () { return this [0]; },
266
- enumerable: false,
267
- configurable: false
268
- });
269
-
270
- Object .defineProperty (Matrix2 .prototype, "origin",
271
- {
272
- get: function () { return this [2]; },
273
- enumerable: false,
274
- configurable: false
275
- });
249
+ get: (function ()
250
+ {
251
+ const vector = new Vector2 (0, 0);
276
252
 
277
- Object .defineProperty (Matrix2 .prototype, "submatrix",
278
- {
279
- get: function () { return this [0]; },
280
- enumerable: false,
281
- configurable: false
253
+ return function () { return vector .set (this [2], this [3]); };
254
+ })(),
255
+ },
256
+ xAxis:
257
+ {
258
+ get: function () { return this [0]; },
259
+ },
260
+ origin:
261
+ {
262
+ get: function () { return this [2]; },
263
+ },
264
+ submatrix:
265
+ {
266
+ get: function () { return this [0]; },
267
+ },
282
268
  });
283
269
 
284
270
  Object .assign (Matrix2,