@vertexvis/geometry 0.12.0-canary.9 → 0.12.0

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 CHANGED
@@ -24,7 +24,7 @@ viewer.
24
24
  </head>
25
25
  <body>
26
26
  <script type="module">
27
- import { Vector3 } from 'https://unpkg.com/@vertexvis/geometry@0.11.0/dist/cdn/bundle.esm.js';
27
+ import { Vector3 } from 'https://unpkg.com/@vertexvis/geometry@0.12.0/dist/cdn/bundle.esm.js';
28
28
 
29
29
  async function main() {
30
30
  const viewer = document.querySelector('#viewer');
@@ -250,13 +250,14 @@ function makeTranslation(translation) {
250
250
  * Creates a rotation matrix.
251
251
  *
252
252
  * ```
253
- * 1-2y²-2z², 2xy+2zw, 2xz-2yw, 0,
254
- * 2xy-2zw, 1-2x²-2z², 2yz+2xw, 0,
255
- * 2xz+2yw, 2yz-2xw, 1-2x²-2y², 0,
253
+ * 1-2y²-2z², 2xy-2zw, 2xz+2yw, 0,
254
+ * 2xy+2zw, 1-2x²-2z², 2yz-2xw, 0,
255
+ * 2xz-2yw, 2yz+2xw, 1-2x²-2y², 0,
256
256
  * 0, 0, 0, 1,
257
257
  * ```
258
258
  *
259
259
  * @param rotation A quaternion representing the rotation.
260
+ * @see https://en.wikipedia.org/wiki/Rotation_matrix#Quaternion
260
261
  * @returns A rotation matrix.
261
262
  */
262
263
  function makeRotation(rotation) {
@@ -267,9 +268,9 @@ function makeRotation(rotation) {
267
268
  var wx = w * x2, wy = w * y2, wz = w * z2;
268
269
  /* eslint-disable prettier/prettier */
269
270
  return [
270
- 1 - (yy + zz), xy - wz, xz + wy, 0,
271
- xy + wz, 1 - (xx + zz), yz - wx, 0,
272
- xz - wy, yz + wx, 1 - (xx + yy), 0,
271
+ 1 - (yy + zz), xy + wz, xz - wy, 0,
272
+ xy - wz, 1 - (xx + zz), yz + wx, 0,
273
+ xz + wy, yz - wx, 1 - (xx + yy), 0,
273
274
  0, 0, 0, 1
274
275
  ];
275
276
  /* eslint-enable prettier/prettier */
@@ -1886,7 +1887,7 @@ function intersectLine(plane, line) {
1886
1887
  return undefined;
1887
1888
  }
1888
1889
  else {
1889
- return add(line.start, scale$2(t, direction$1));
1890
+ return add(scale$2(t, direction$1), line.start);
1890
1891
  }
1891
1892
  }
1892
1893
  /**