@fbltd/math 1.0.21 → 1.0.22

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.
@@ -21,6 +21,13 @@ export class Matrix3d {
21
21
  }
22
22
  return matrix;
23
23
  }
24
+ static apply(matrix, point) {
25
+ return [
26
+ point[0] * matrix[0] + point[1] * matrix[3] + point[2] * matrix[6] + matrix[9],
27
+ point[0] * matrix[1] + point[1] * matrix[4] + point[2] * matrix[7] + matrix[10],
28
+ point[0] * matrix[2] + point[1] * matrix[5] + point[2] * matrix[8] + matrix[11],
29
+ ];
30
+ }
24
31
  static isApproximatelyEqual(m1, m2) {
25
32
  return (approximately(m1[0], m2[0]) &&
26
33
  approximately(m1[1], m2[1]) &&
@@ -1,8 +1,10 @@
1
+ import { type IPoint3 } from "../../index.js";
1
2
  import type { IFixedLengthArray, INonEmptyArray } from "../type.utils.js";
2
3
  export type IMatrix3d = IFixedLengthArray<12, number>;
3
4
  export declare const identityMatrix3d: IMatrix3d;
4
5
  export declare class Matrix3d {
5
6
  static multiply(matrix: IMatrix3d, ...rest: INonEmptyArray<IMatrix3d>): [number, number, number, number, number, number, number, number, number, number, number, number];
7
+ static apply(matrix: IMatrix3d, point: IPoint3): IPoint3;
6
8
  static isApproximatelyEqual(m1: IMatrix3d, m2: IMatrix3d): boolean;
7
9
  static isEqual(m1: IMatrix3d, m2: IMatrix3d): number;
8
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"matrix3d.d.ts","sourceRoot":"","sources":["../../../../src/matrices/matrix3d.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE1E,MAAM,MAAM,SAAS,GAAG,iBAAiB,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;AAErD,eAAO,MAAM,gBAAgB,EAAE,SAAgD,CAAC;AAGhF,qBAAa,QAAQ;IACjB,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC;IAyBrE,MAAM,CAAC,oBAAoB,CAAC,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS;IAiBxD,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS;CAgB9C"}
1
+ {"version":3,"file":"matrix3d.d.ts","sourceRoot":"","sources":["../../../../src/matrices/matrix3d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE1E,MAAM,MAAM,SAAS,GAAG,iBAAiB,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;AAErD,eAAO,MAAM,gBAAgB,EAAE,SAAgD,CAAC;AAGhF,qBAAa,QAAQ;IACjB,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC;IAyBrE,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO;IAQxD,MAAM,CAAC,oBAAoB,CAAC,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS;IAiBxD,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS;CAgB9C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fbltd/math",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
4
4
  "description": "Math and geometry utilities",
5
5
  "sideEffects": false,
6
6
  "main": "dist/bin/index.js",