@vertexvis/geometry 0.24.3-testing.0 → 0.24.3

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.
@@ -13,41 +13,45 @@ export interface Euler {
13
13
  order: EulerOrder;
14
14
  }
15
15
  /**
16
- * Creates a new euler angle where each axis of rotation is defined by an angle,
16
+ * Creates a new set of Euler angles where each axis of rotation is defined by an angle,
17
17
  * in radians. If no value is given, then `{x: 0, y: 0, z: 0, order: 'xyz'}` is
18
18
  * returned.
19
19
  *
20
- * @param value The values to populate the euler angle with.
21
- * @returns A euler angle.
20
+ * @param value The values to populate the Euler angles with.
21
+ * @returns A set of Euler angles.
22
22
  */
23
23
  export declare function create(value?: Partial<Euler>): Euler;
24
24
  /**
25
- * Creates a new euler angle where each axis of rotation is defined by an angle,
25
+ * Creates a new set of Euler angles where each axis of rotation is defined by an angle,
26
26
  * in degrees. If no value is given, then `{x: 0, y: 0, z: 0, order: 'xyz'}` is
27
27
  * returned.
28
28
  *
29
- * @param value The values to populate the euler angle with.
30
- * @returns A euler angle.
29
+ * @param value The values to populate the Euler angles with.
30
+ * @returns A set of Euler angles.
31
31
  */
32
32
  export declare function fromDegrees(value?: Partial<Euler>): Euler;
33
33
  /**
34
- * Creates a euler angle from the rotation components of a 4x4 matrix. The
34
+ * Creates a set of Euler angles from the rotation components of a 4x4 matrix. The
35
35
  * rotation components are represented by the upper 3x3 of the matrix.
36
36
  *
37
+ * Note that there are two solutions for the Euler angle of the 2nd applied
38
+ * rotation (i.e. y for xyz) because sin(theta) = sin(PI-theta).
39
+ * The returned angle will always be the solution between -PI/2 and PI/2.
40
+ *
37
41
  * @param matrix A pure rotation matrix, unscaled.
38
42
  * @param order The order that the rotations are applied.
39
43
  */
40
44
  export declare function fromRotationMatrix(matrix: Matrix4.Matrix4, order?: EulerOrder): Euler;
41
45
  /**
42
- * Returns a euler angle that was decoded from a JSON string. Supports either
46
+ * Returns a set of Euler angles that was decoded from a JSON string. Supports either
43
47
  * extracting values from an array `[x, y, z, order]` or object `{x, y, z,
44
48
  * order}`.
45
49
  *
46
50
  * @param json A JSON object.
47
- * @returns A euler angle.
51
+ * @returns A set of Euler angles.
48
52
  */
49
53
  export declare function fromJson(json: string): Euler;
50
54
  /**
51
- * Type guard that checks if the given type is a Euler.
55
+ * Type guard that checks if the given type is a set of Euler angles.
52
56
  */
53
57
  export declare function isType(obj: unknown): obj is Euler;
package/dist/euler.d.ts CHANGED
@@ -13,41 +13,45 @@ export interface Euler {
13
13
  order: EulerOrder;
14
14
  }
15
15
  /**
16
- * Creates a new euler angle where each axis of rotation is defined by an angle,
16
+ * Creates a new set of Euler angles where each axis of rotation is defined by an angle,
17
17
  * in radians. If no value is given, then `{x: 0, y: 0, z: 0, order: 'xyz'}` is
18
18
  * returned.
19
19
  *
20
- * @param value The values to populate the euler angle with.
21
- * @returns A euler angle.
20
+ * @param value The values to populate the Euler angles with.
21
+ * @returns A set of Euler angles.
22
22
  */
23
23
  export declare function create(value?: Partial<Euler>): Euler;
24
24
  /**
25
- * Creates a new euler angle where each axis of rotation is defined by an angle,
25
+ * Creates a new set of Euler angles where each axis of rotation is defined by an angle,
26
26
  * in degrees. If no value is given, then `{x: 0, y: 0, z: 0, order: 'xyz'}` is
27
27
  * returned.
28
28
  *
29
- * @param value The values to populate the euler angle with.
30
- * @returns A euler angle.
29
+ * @param value The values to populate the Euler angles with.
30
+ * @returns A set of Euler angles.
31
31
  */
32
32
  export declare function fromDegrees(value?: Partial<Euler>): Euler;
33
33
  /**
34
- * Creates a euler angle from the rotation components of a 4x4 matrix. The
34
+ * Creates a set of Euler angles from the rotation components of a 4x4 matrix. The
35
35
  * rotation components are represented by the upper 3x3 of the matrix.
36
36
  *
37
+ * Note that there are two solutions for the Euler angle of the 2nd applied
38
+ * rotation (i.e. y for xyz) because sin(theta) = sin(PI-theta).
39
+ * The returned angle will always be the solution between -PI/2 and PI/2.
40
+ *
37
41
  * @param matrix A pure rotation matrix, unscaled.
38
42
  * @param order The order that the rotations are applied.
39
43
  */
40
44
  export declare function fromRotationMatrix(matrix: Matrix4.Matrix4, order?: EulerOrder): Euler;
41
45
  /**
42
- * Returns a euler angle that was decoded from a JSON string. Supports either
46
+ * Returns a set of Euler angles that was decoded from a JSON string. Supports either
43
47
  * extracting values from an array `[x, y, z, order]` or object `{x, y, z,
44
48
  * order}`.
45
49
  *
46
50
  * @param json A JSON object.
47
- * @returns A euler angle.
51
+ * @returns A set of Euler angles.
48
52
  */
49
53
  export declare function fromJson(json: string): Euler;
50
54
  /**
51
- * Type guard that checks if the given type is a Euler.
55
+ * Type guard that checks if the given type is a set of Euler angles.
52
56
  */
53
57
  export declare function isType(obj: unknown): obj is Euler;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertexvis/geometry",
3
- "version": "0.24.3-testing.0",
3
+ "version": "0.24.3",
4
4
  "description": "Library for 2D and 3D geometric types.",
5
5
  "license": "MIT",
6
6
  "author": "Vertex Developers <support@vertexvis.com> (https://developer.vertexvis.com)",
@@ -40,10 +40,10 @@
40
40
  "@types/jest": "^27.5.1",
41
41
  "@vertexvis/eslint-config-vertexvis-typescript": "^0.5.0",
42
42
  "@vertexvis/jest-config-vertexvis": "^0.5.4",
43
- "@vertexwebsdk/build": "0.24.3-testing.0",
43
+ "@vertexwebsdk/build": "0.24.3",
44
44
  "eslint": "^8.57.1",
45
45
  "jest": "^27.5.1",
46
- "rollup": "^2.75.6",
46
+ "rollup": "^2.80.0",
47
47
  "ts-jest": "^27.1.4",
48
48
  "tslib": "^2.1.0",
49
49
  "typescript": "^4.5.4"
@@ -51,5 +51,5 @@
51
51
  "peerDependencies": {
52
52
  "tslib": ">=2.1.0"
53
53
  },
54
- "gitHead": "bcdd87ddda54e86faeca1ae7ad46c00eda67125f"
54
+ "gitHead": "e542667dfb640e3a27a933f88c11e5681a106fea"
55
55
  }