@itwin/core-geometry 3.6.0-dev.8 → 4.0.0-dev.10
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/CHANGELOG.md +28 -1
- package/LICENSE.md +1 -1
- package/lib/cjs/Geometry.d.ts +28 -17
- package/lib/cjs/Geometry.d.ts.map +1 -1
- package/lib/cjs/Geometry.js +52 -25
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +10 -6
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js +29 -31
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurveCurve.d.ts +11 -8
- package/lib/cjs/curve/CurveCurve.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCurve.js +16 -12
- package/lib/cjs/curve/CurveCurve.js.map +1 -1
- package/lib/cjs/curve/CurveCurveIntersectXY.d.ts +5 -1
- package/lib/cjs/curve/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCurveIntersectXY.js +11 -10
- package/lib/cjs/curve/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/geometry3d/Angle.d.ts +19 -0
- package/lib/cjs/geometry3d/Angle.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Angle.js +39 -0
- package/lib/cjs/geometry3d/Angle.js.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.d.ts +1 -0
- package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js +1 -0
- package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
- package/lib/cjs/geometry3d/CoincidentGeometryOps.d.ts +1 -0
- package/lib/cjs/geometry3d/CoincidentGeometryOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/CoincidentGeometryOps.js +3 -0
- package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.d.ts +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts +369 -254
- package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +807 -660
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/OrderedRotationAngles.d.ts +71 -14
- package/lib/cjs/geometry3d/OrderedRotationAngles.d.ts.map +1 -1
- package/lib/cjs/geometry3d/OrderedRotationAngles.js +204 -114
- package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.d.ts +1 -0
- package/lib/cjs/geometry3d/Point2dVector2d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.js +1 -0
- package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +16 -16
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +21 -18
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/Segment1d.d.ts +1 -1
- package/lib/cjs/geometry3d/Segment1d.js +1 -1
- package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
- package/lib/cjs/geometry3d/YawPitchRollAngles.d.ts +49 -25
- package/lib/cjs/geometry3d/YawPitchRollAngles.d.ts.map +1 -1
- package/lib/cjs/geometry3d/YawPitchRollAngles.js +146 -50
- package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/cjs/numerics/Polynomials.d.ts +12 -0
- package/lib/cjs/numerics/Polynomials.d.ts.map +1 -1
- package/lib/cjs/numerics/Polynomials.js +14 -0
- package/lib/cjs/numerics/Polynomials.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts +5 -4
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js +50 -10
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.d.ts +82 -0
- package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js +150 -1
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/polyface/multiclip/OffsetMeshContext.d.ts +202 -0
- package/lib/cjs/polyface/multiclip/OffsetMeshContext.d.ts.map +1 -0
- package/lib/cjs/polyface/multiclip/OffsetMeshContext.js +1038 -0
- package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -0
- package/lib/cjs/serialization/GeometrySamples.d.ts +4 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js +14 -6
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.d.ts +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/cjs/topology/Graph.d.ts +113 -7
- package/lib/cjs/topology/Graph.d.ts.map +1 -1
- package/lib/cjs/topology/Graph.js +185 -7
- package/lib/cjs/topology/Graph.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts +38 -0
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts.map +1 -0
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js +82 -0
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -0
- package/lib/esm/Geometry.d.ts +28 -17
- package/lib/esm/Geometry.d.ts.map +1 -1
- package/lib/esm/Geometry.js +52 -25
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +10 -6
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js +30 -32
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/CurveCurve.d.ts +11 -8
- package/lib/esm/curve/CurveCurve.d.ts.map +1 -1
- package/lib/esm/curve/CurveCurve.js +16 -12
- package/lib/esm/curve/CurveCurve.js.map +1 -1
- package/lib/esm/curve/CurveCurveIntersectXY.d.ts +5 -1
- package/lib/esm/curve/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/esm/curve/CurveCurveIntersectXY.js +11 -10
- package/lib/esm/curve/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/geometry3d/Angle.d.ts +19 -0
- package/lib/esm/geometry3d/Angle.d.ts.map +1 -1
- package/lib/esm/geometry3d/Angle.js +39 -0
- package/lib/esm/geometry3d/Angle.js.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.d.ts +1 -0
- package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.js +1 -0
- package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
- package/lib/esm/geometry3d/CoincidentGeometryOps.d.ts +1 -0
- package/lib/esm/geometry3d/CoincidentGeometryOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/CoincidentGeometryOps.js +3 -0
- package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.d.ts +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts +369 -254
- package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +807 -660
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/OrderedRotationAngles.d.ts +71 -14
- package/lib/esm/geometry3d/OrderedRotationAngles.d.ts.map +1 -1
- package/lib/esm/geometry3d/OrderedRotationAngles.js +205 -115
- package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.d.ts +1 -0
- package/lib/esm/geometry3d/Point2dVector2d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.js +1 -0
- package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +16 -16
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +21 -18
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/Segment1d.d.ts +1 -1
- package/lib/esm/geometry3d/Segment1d.js +1 -1
- package/lib/esm/geometry3d/Segment1d.js.map +1 -1
- package/lib/esm/geometry3d/YawPitchRollAngles.d.ts +49 -25
- package/lib/esm/geometry3d/YawPitchRollAngles.d.ts.map +1 -1
- package/lib/esm/geometry3d/YawPitchRollAngles.js +146 -50
- package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/esm/numerics/Polynomials.d.ts +12 -0
- package/lib/esm/numerics/Polynomials.d.ts.map +1 -1
- package/lib/esm/numerics/Polynomials.js +14 -0
- package/lib/esm/numerics/Polynomials.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts +5 -4
- package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js +50 -10
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.d.ts +82 -0
- package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js +148 -0
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/polyface/multiclip/OffsetMeshContext.d.ts +202 -0
- package/lib/esm/polyface/multiclip/OffsetMeshContext.d.ts.map +1 -0
- package/lib/esm/polyface/multiclip/OffsetMeshContext.js +1032 -0
- package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -0
- package/lib/esm/serialization/GeometrySamples.d.ts +4 -1
- package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js +14 -6
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.d.ts +1 -1
- package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/esm/topology/Graph.d.ts +113 -7
- package/lib/esm/topology/Graph.d.ts.map +1 -1
- package/lib/esm/topology/Graph.js +185 -7
- package/lib/esm/topology/Graph.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts +38 -0
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts.map +1 -0
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js +78 -0
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -0
- package/package.json +4 -4
|
@@ -33,54 +33,60 @@ export declare class PackedMatrix3dOps {
|
|
|
33
33
|
*/
|
|
34
34
|
static loadMatrix(dest: Float64Array, a00: number, a01: number, a02: number, a10: number, a11: number, a12: number, a20: number, a21: number, a22: number): void;
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* Multiply 3x3 matrix `a*b`, store in `result`.
|
|
37
37
|
* * All params assumed length 9, allocated by caller.
|
|
38
38
|
* * c may alias either input.
|
|
39
39
|
*/
|
|
40
40
|
static multiplyMatrixMatrix(a: Float64Array, b: Float64Array, result?: Float64Array): Float64Array;
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
42
|
+
* Multiply 3x3 matrix `a*bTranspose`, store in `result`.
|
|
43
43
|
* * All params assumed length 9, allocated by caller.
|
|
44
44
|
* * c may alias either input.
|
|
45
45
|
*/
|
|
46
46
|
static multiplyMatrixMatrixTranspose(a: Float64Array, b: Float64Array, result?: Float64Array): Float64Array;
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
48
|
+
* Multiply 3x3 matrix `aTranspose*b`, store in `result`.
|
|
49
49
|
* * All params assumed length 9, allocated by caller.
|
|
50
50
|
* * c may alias either input.
|
|
51
51
|
*/
|
|
52
52
|
static multiplyMatrixTransposeMatrix(a: Float64Array, b: Float64Array, result?: Float64Array): Float64Array;
|
|
53
|
-
/**
|
|
53
|
+
/** Transpose 3x3 matrix `a` in place */
|
|
54
54
|
static transposeInPlace(a: Float64Array): void;
|
|
55
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* Returns the transpose of 3x3 matrix `a`
|
|
57
|
+
* * If `dest` is passed as argument, then the function copies the transpose of 3x3 matrix `a` into `dest`
|
|
58
|
+
* * `a` is not changed unless also passed as the dest, i.e., copyTransposed(a,a) transposes `a` in place
|
|
59
|
+
*/
|
|
56
60
|
static copyTransposed(a: Float64Array, dest?: Float64Array): Float64Array;
|
|
57
|
-
/**
|
|
61
|
+
/** Copy matrix `a` entries into `dest` */
|
|
58
62
|
static copy(a: Float64Array, dest: Float64Array): Float64Array;
|
|
59
63
|
}
|
|
60
64
|
/** A Matrix3d is tagged indicating one of the following states:
|
|
61
65
|
* * unknown: it is not know if the matrix is invertible.
|
|
62
|
-
* * inverseStored: the matrix has its inverse stored
|
|
66
|
+
* * inverseStored: the matrix has its inverse stored.
|
|
63
67
|
* * singular: the matrix is known to be singular.
|
|
64
68
|
* @public
|
|
65
69
|
*/
|
|
66
70
|
export declare enum InverseMatrixState {
|
|
67
71
|
/**
|
|
68
|
-
*
|
|
69
|
-
*
|
|
72
|
+
* The invertibility of the `coffs` array has not been determined.
|
|
73
|
+
* Any `inverseCoffs` contents are random.
|
|
70
74
|
*/
|
|
71
75
|
unknown = 0,
|
|
72
|
-
/**
|
|
76
|
+
/**
|
|
77
|
+
* An inverse was computed and stored as the `inverseCoffs`
|
|
78
|
+
*/
|
|
73
79
|
inverseStored = 1,
|
|
74
80
|
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
81
|
+
* The `coffs` array is known to be singular.
|
|
82
|
+
* Any `inverseCoffs` contents are random.
|
|
77
83
|
*/
|
|
78
84
|
singular = 2
|
|
79
85
|
}
|
|
80
86
|
/** A Matrix3d is a 3x3 matrix.
|
|
81
87
|
* * A very common use is to hold a rigid body rotation (which has no scaling or skew), but the 3x3 contents can
|
|
82
88
|
* also hold scaling and skewing.
|
|
83
|
-
* * The matrix with 2-dimensional layout
|
|
89
|
+
* * The matrix with 2-dimensional layout (note: a 2d array can be shown by a matrix)
|
|
84
90
|
* ```
|
|
85
91
|
* equation
|
|
86
92
|
* \matrixXY{A}
|
|
@@ -92,42 +98,43 @@ export declare enum InverseMatrixState {
|
|
|
92
98
|
* ```
|
|
93
99
|
* * If the matrix inverse is known it is stored in the inverseCoffs array.
|
|
94
100
|
* * The inverse status (`unknown`, `inverseStored`, `singular`) status is indicated by the `inverseState` property.
|
|
95
|
-
* *
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
101
|
+
* * Construction methods that are able to trivially construct the inverse, store it immediately and note that in
|
|
102
|
+
* the inverseState.
|
|
103
|
+
* * Constructions (e.g. createRowValues) for which the inverse is not immediately known mark the inverseState as
|
|
104
|
+
* unknown.
|
|
105
|
+
* * Later queries for the inverse, trigger full computation if needed at that time.
|
|
99
106
|
* * Most matrix queries are present with both "column" and "row" variants.
|
|
100
|
-
* * Usage elsewhere in the library is typically "column" based. For example, in a Transform
|
|
101
|
-
*
|
|
107
|
+
* * Usage elsewhere in the library is typically "column" based. For example, in a Transform that carries a
|
|
108
|
+
* coordinate frame, the matrix columns are the unit vectors for the axes.
|
|
102
109
|
* @public
|
|
103
110
|
*/
|
|
104
111
|
export declare class Matrix3d implements BeJSONFunctions {
|
|
105
112
|
/** Control flag for whether this class uses cached inverse of matrices. */
|
|
106
113
|
static useCachedInverse: boolean;
|
|
107
|
-
/**
|
|
114
|
+
/** Total number of times a cached inverse was used to avoid recompute */
|
|
108
115
|
static numUseCache: number;
|
|
109
|
-
/**
|
|
116
|
+
/** Total number of times a cached inverse was computed. */
|
|
110
117
|
static numComputeCache: number;
|
|
111
|
-
/**
|
|
118
|
+
/**
|
|
119
|
+
* Matrix contents as a flat array of numbers in row-major order.
|
|
112
120
|
* ```
|
|
113
121
|
* equation
|
|
114
122
|
* \mxy{B}
|
|
115
123
|
* \mij{B}
|
|
116
124
|
* ```
|
|
117
|
-
* * DO NOT directly modify this array.
|
|
125
|
+
* * DO NOT directly modify this array. It will destroy safety of the cached inverse state.
|
|
118
126
|
*/
|
|
119
127
|
coffs: Float64Array;
|
|
120
|
-
/**
|
|
121
|
-
*
|
|
128
|
+
/**
|
|
129
|
+
* Matrix inverse contents.
|
|
122
130
|
* ```
|
|
123
131
|
* equation
|
|
124
132
|
* \mxy{A}
|
|
125
133
|
* ```
|
|
126
|
-
*
|
|
127
|
-
*
|
|
134
|
+
* * DO NOT directly modify this array. It will destroy integrity of the cached inverse state.
|
|
128
135
|
*/
|
|
129
136
|
inverseCoffs: Float64Array | undefined;
|
|
130
|
-
/**
|
|
137
|
+
/** Indicates if inverse is unknown, available, or known singular */
|
|
131
138
|
inverseState: InverseMatrixState;
|
|
132
139
|
private static _identity;
|
|
133
140
|
/** The identity Matrix3d. Value is frozen and cannot be modified. */
|
|
@@ -135,40 +142,61 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
135
142
|
/** Freeze this Matrix3d. */
|
|
136
143
|
freeze(): Readonly<this>;
|
|
137
144
|
/**
|
|
138
|
-
*
|
|
139
|
-
* @param coffs optional coefficient array.
|
|
145
|
+
* Constructor
|
|
146
|
+
* @param coffs optional coefficient array.
|
|
147
|
+
* * **WARNING:** coffs is captured (i.e., is now owned by the Matrix3d object and can be modified by it).
|
|
140
148
|
*/
|
|
141
149
|
constructor(coffs?: Float64Array);
|
|
142
|
-
/**
|
|
150
|
+
/**
|
|
151
|
+
* Return a json object containing the 9 numeric entries as a single array in row major order,
|
|
143
152
|
* `[ [1, 2, 3],[ 4, 5, 6], [7, 8, 9] ]`
|
|
144
153
|
*/
|
|
145
154
|
toJSON(): Matrix3dProps;
|
|
146
|
-
/**
|
|
155
|
+
/**
|
|
156
|
+
* Copy data from various input forms to this matrix.
|
|
147
157
|
* The source can be:
|
|
148
158
|
* * Another `Matrix3d`
|
|
149
159
|
* * An array of 3 arrays, each of which has the 3 numbers for a row of the matrix.
|
|
150
|
-
* * An array of 9 numbers in row major order.
|
|
160
|
+
* * An array of 4 or 9 numbers in row major order.
|
|
161
|
+
* * **WARNING:** if json is an array of numbers but size is not 4 or 9, the matrix is set to zeros.
|
|
151
162
|
*/
|
|
152
163
|
setFromJSON(json?: Matrix3dProps | Matrix3d): void;
|
|
153
|
-
/** Return a new Matrix3d constructed from contents of the json value.
|
|
164
|
+
/** Return a new Matrix3d constructed from contents of the json value. See `setFromJSON` for layout rules */
|
|
154
165
|
static fromJSON(json?: Matrix3dProps): Matrix3d;
|
|
155
|
-
/**
|
|
166
|
+
/**
|
|
167
|
+
* Test if `this` and `other` are within tolerance in all numeric entries.
|
|
156
168
|
* @param tol optional tolerance for comparisons by Geometry.isDistanceWithinTol
|
|
157
169
|
*/
|
|
158
170
|
isAlmostEqual(other: Matrix3d, tol?: number): boolean;
|
|
159
|
-
/**
|
|
171
|
+
/**
|
|
172
|
+
* Test if `this` and `other` are within tolerance in the column entries specified by `columnIndex`.
|
|
160
173
|
* @param tol optional tolerance for comparisons by Geometry.isDistanceWithinTol
|
|
161
174
|
*/
|
|
162
|
-
isAlmostEqualAllowZRotation(other: Matrix3d, tol?: number): boolean;
|
|
163
175
|
isAlmostEqualColumn(columnIndex: AxisIndex, other: Matrix3d, tol?: number): boolean;
|
|
176
|
+
/**
|
|
177
|
+
* Test if column (specified by `columnIndex`) entries of `this` and [ax,ay,az] are within tolerance.
|
|
178
|
+
* @param tol optional tolerance for comparisons by Geometry.isDistanceWithinTol
|
|
179
|
+
*/
|
|
164
180
|
isAlmostEqualColumnXYZ(columnIndex: AxisIndex, ax: number, ay: number, az: number, tol?: number): boolean;
|
|
181
|
+
/**
|
|
182
|
+
* Test if `this` and `other` have almost equal Z column and have X and Y columns differing only by a
|
|
183
|
+
* rotation of the same angle around that Z.
|
|
184
|
+
* * **WARNING:** X and Y columns have to be perpendicular to Z column in both `this` and `other`.
|
|
185
|
+
* @param tol optional tolerance for comparisons by Geometry.isDistanceWithinTol
|
|
186
|
+
*/
|
|
187
|
+
isAlmostEqualAllowZRotation(other: Matrix3d, tol?: number): boolean;
|
|
165
188
|
/** Test for exact (bitwise) equality with other. */
|
|
166
189
|
isExactEqual(other: Matrix3d): boolean;
|
|
167
190
|
/** test if all entries in the z row and column are exact 001, i.e. the matrix only acts in 2d */
|
|
168
191
|
get isXY(): boolean;
|
|
192
|
+
/**
|
|
193
|
+
* If result is not provided, then the method returns a new (zeroed) matrix; otherwise the result is
|
|
194
|
+
* not zeroed first and is just returned as-is.
|
|
195
|
+
*/
|
|
169
196
|
private static _create;
|
|
170
|
-
/**
|
|
171
|
-
*
|
|
197
|
+
/**
|
|
198
|
+
* Returns a Matrix3d populated by numeric values given in row-major order.
|
|
199
|
+
* Sets all entries in the matrix from call parameters appearing in row-major order, i.e.
|
|
172
200
|
* ```
|
|
173
201
|
* equation
|
|
174
202
|
* \begin{bmatrix}a_{xx}\ a_{xy}\ a_{xz}\\ a_{yx}\ a_{yy}\ a_{yz}\\ a_{zx}\ a_{zy}\ a_{zz}\end{bmatrix}
|
|
@@ -186,7 +214,7 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
186
214
|
static createRowValues(axx: number, axy: number, axz: number, ayx: number, ayy: number, ayz: number, azx: number, azy: number, azz: number, result?: Matrix3d): Matrix3d;
|
|
187
215
|
/**
|
|
188
216
|
* Create a Matrix3d with caller-supplied coefficients and optional inverse coefficients.
|
|
189
|
-
* * The inputs are captured into the new Matrix3d.
|
|
217
|
+
* * The inputs are captured into (i.e., owned by) the new Matrix3d.
|
|
190
218
|
* * The caller is responsible for validity of the inverse coefficients.
|
|
191
219
|
* @param coffs (required) array of 9 coefficients.
|
|
192
220
|
* @param inverseCoffs (optional) array of 9 coefficients.
|
|
@@ -194,16 +222,24 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
194
222
|
*/
|
|
195
223
|
static createCapture(coffs: Float64Array, inverseCoffs?: Float64Array): Matrix3d;
|
|
196
224
|
/**
|
|
197
|
-
*
|
|
225
|
+
* Create a matrix by distributing vectors to columns in one of 6 orders.
|
|
198
226
|
* @param axisOrder identifies where the columns are placed.
|
|
199
|
-
* @param columnA vector to place in the
|
|
200
|
-
* @param columnB vector to place in the
|
|
201
|
-
* @param columnC vector to place in the
|
|
202
|
-
* @param result
|
|
203
|
-
|
|
204
|
-
|
|
227
|
+
* @param columnA vector to place in the column specified by first letter in the AxisOrder name.
|
|
228
|
+
* @param columnB vector to place in the column specified by second letter in the AxisOrder name.
|
|
229
|
+
* @param columnC vector to place in the column specified by third letter in the AxisOrder name.
|
|
230
|
+
* @param result optional result matrix3d
|
|
231
|
+
* * Example: If you pass AxisOrder.YZX, then result will be [columnC, columnA, columnB] because
|
|
232
|
+
* first letter Y means columnA should go to the second column, second letter Z means columnB should
|
|
233
|
+
* go to the third column, and third letter X means columnC should go to the first column.
|
|
234
|
+
*/
|
|
235
|
+
static createColumnsInAxisOrder(axisOrder: AxisOrder, columnA: Vector3d | undefined, columnB: Vector3d | undefined, columnC: Vector3d | undefined, result?: Matrix3d): Matrix3d;
|
|
236
|
+
/**
|
|
237
|
+
* Copy the transpose of the coffs to the inverseCoffs.
|
|
238
|
+
* * Mark the matrix as inverseStored.
|
|
239
|
+
*/
|
|
240
|
+
private setupInverseTranspose;
|
|
205
241
|
/**
|
|
206
|
-
*
|
|
242
|
+
* Set all entries in the matrix from call parameters appearing in row-major order.
|
|
207
243
|
* @param axx Row x, column x (0,0) entry
|
|
208
244
|
* @param axy Row x, column y (0,1) entry
|
|
209
245
|
* @param axz Row x, column z (0,2) entry
|
|
@@ -219,38 +255,47 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
219
255
|
setIdentity(): void;
|
|
220
256
|
/** Set the matrix to all zeros. */
|
|
221
257
|
setZero(): void;
|
|
222
|
-
/**
|
|
258
|
+
/** Copy contents from another matrix. */
|
|
223
259
|
setFrom(other: Matrix3d | undefined): void;
|
|
224
|
-
/**
|
|
225
|
-
*
|
|
226
|
-
* *
|
|
227
|
-
* * inverse status
|
|
260
|
+
/**
|
|
261
|
+
* Return a clone of this matrix.
|
|
262
|
+
* * Coefficients are copied.
|
|
263
|
+
* * Inverse coefficients and inverse status are copied if stored by `this`.
|
|
228
264
|
*/
|
|
229
265
|
clone(result?: Matrix3d): Matrix3d;
|
|
230
|
-
/**
|
|
266
|
+
/**
|
|
267
|
+
* Create a matrix with all zeros.
|
|
231
268
|
* * Note that for geometry transformations "all zeros" is not a useful default state.
|
|
232
|
-
* * Hence almost always use `createIdentity` for graphics transformations.
|
|
233
|
-
* * "
|
|
269
|
+
* * Hence, almost always use `createIdentity` for graphics transformations.
|
|
270
|
+
* * "All zeros" is appropriate for summing moment data.
|
|
234
271
|
* ```
|
|
235
272
|
* equation
|
|
236
|
-
* \begin{bmatrix}0 0 0 \\ 0 0 0 \\ 0 0 0\end{bmatrix}
|
|
273
|
+
* \begin{bmatrix}0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0\end{bmatrix}
|
|
237
274
|
* ```
|
|
238
275
|
*/
|
|
239
276
|
static createZero(): Matrix3d;
|
|
240
|
-
/**
|
|
241
|
-
*
|
|
242
|
-
* *
|
|
243
|
-
* *
|
|
277
|
+
/**
|
|
278
|
+
* Create an identity matrix.
|
|
279
|
+
* * All diagonal entries (xx,yy,zz) are one
|
|
280
|
+
* * All others are zero.
|
|
281
|
+
* * This (rather than "all zeros") is the useful state for most graphics transformations.
|
|
244
282
|
* ```
|
|
245
283
|
* equation
|
|
246
|
-
* \begin{bmatrix}1 0 0 \\ 0 1 0 \\ 0 0 1\end{bmatrix}
|
|
284
|
+
* \begin{bmatrix}1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1\end{bmatrix}
|
|
247
285
|
* ```
|
|
248
286
|
*
|
|
249
287
|
*/
|
|
250
288
|
static createIdentity(result?: Matrix3d): Matrix3d;
|
|
251
289
|
/**
|
|
252
|
-
* Create a matrix with
|
|
253
|
-
*
|
|
290
|
+
* Create a matrix with distinct x,y,z diagonal (scale) entries.
|
|
291
|
+
* ```
|
|
292
|
+
* equation
|
|
293
|
+
* \begin{bmatrix}s_x & 0 & 0 \\ 0 & s_y & 0\\ 0 & 0 & s_z\end{bmatrix}
|
|
294
|
+
* ```
|
|
295
|
+
*/
|
|
296
|
+
static createScale(scaleFactorX: number, scaleFactorY: number, scaleFactorZ: number, result?: Matrix3d): Matrix3d;
|
|
297
|
+
/**
|
|
298
|
+
* Create a matrix with uniform scale factors for scale factor "s"
|
|
254
299
|
* ```
|
|
255
300
|
* equation
|
|
256
301
|
* \begin{bmatrix}s & 0 & 0 \\ 0 & s & 0\\ 0 & 0 & s\end{bmatrix}
|
|
@@ -258,96 +303,208 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
258
303
|
*/
|
|
259
304
|
static createUniformScale(scaleFactor: number): Matrix3d;
|
|
260
305
|
/**
|
|
261
|
-
*
|
|
262
|
-
* *
|
|
306
|
+
* Return a vector that is perpendicular to the input `vectorA`.
|
|
307
|
+
* * Among the infinite number of perpendiculars possible, this method favors having one in the xy plane.
|
|
308
|
+
* * Hence, when `vectorA` is close to the Z axis, the returned vector is `vectorA cross -unitY`
|
|
309
|
+
* but when `vectorA` is NOT close to the Z axis, the returned vector is `unitZ cross vectorA`.
|
|
263
310
|
*/
|
|
264
|
-
static
|
|
311
|
+
static createPerpendicularVectorFavorXYPlane(vectorA: Vector3d, result?: Vector3d): Vector3d;
|
|
265
312
|
/**
|
|
266
|
-
*
|
|
267
|
-
* * Among the infinite number of perpendiculars possible, this method
|
|
268
|
-
*
|
|
269
|
-
*
|
|
270
|
-
* * But vectorA is close to the Z axis, the returned vector is unitY cross vectorA.
|
|
313
|
+
* Return a vector that is perpendicular to the input `vectorA`.
|
|
314
|
+
* * Among the infinite number of perpendiculars possible, this method favors having one near the plane
|
|
315
|
+
* containing Z.
|
|
316
|
+
* That is achieved by cross product of `this` vector with the result of createPerpendicularVectorFavorXYPlane.
|
|
271
317
|
*/
|
|
272
|
-
static
|
|
318
|
+
static createPerpendicularVectorFavorPlaneContainingZ(vectorA: Vector3d, result?: Vector3d): Vector3d;
|
|
273
319
|
/**
|
|
274
|
-
*
|
|
275
|
-
*
|
|
276
|
-
*
|
|
277
|
-
*
|
|
320
|
+
* Create a matrix from column vectors, shuffled into place per axisOrder
|
|
321
|
+
* For example, if axisOrder = XYZ then it returns [vectorU, vectorV, vectorW]
|
|
322
|
+
* Another example, if axisOrder = YZX then it returns [vectorW, vectorU, vectorV] because
|
|
323
|
+
* Y is at index 0 so vectorU goes to the column Y (column 2), Z is at index 1 so vectorV goes
|
|
324
|
+
* to the column Z (column 3), and X is at index 2 so vectorW goes to the column X (column 1)
|
|
278
325
|
*/
|
|
279
|
-
static
|
|
280
|
-
/**
|
|
281
|
-
*
|
|
282
|
-
*
|
|
283
|
-
*
|
|
284
|
-
*
|
|
326
|
+
static createShuffledColumns(vectorU: Vector3d, vectorV: Vector3d, vectorW: Vector3d, axisOrder: AxisOrder, result?: Matrix3d): Matrix3d;
|
|
327
|
+
/**
|
|
328
|
+
* Create a new orthogonal matrix (perpendicular columns, unit length, transpose is inverse).
|
|
329
|
+
* * `vectorA1 = Normalized vectorA` is placed in the column specified by **first** letter in
|
|
330
|
+
* the AxisOrder name.
|
|
331
|
+
* * Normalized `vectorC1 = vectorA1 cross vectorB` is placed in the column specified by **third**
|
|
332
|
+
* letter in the AxisOrder name.
|
|
333
|
+
* * Normalized `vectorC1 cross vectorA` is placed in the column specified by **second**
|
|
334
|
+
* letter in the AxisOrder name.
|
|
335
|
+
* * This function internally uses createShuffledColumns.
|
|
285
336
|
*/
|
|
286
|
-
static
|
|
287
|
-
/**
|
|
337
|
+
static createRigidFromColumns(vectorA: Vector3d, vectorB: Vector3d, axisOrder: AxisOrder, result?: Matrix3d): Matrix3d | undefined;
|
|
338
|
+
/**
|
|
339
|
+
* Construct a rigid matrix (orthogonal matrix with +1 determinant) using vectorA and its 2 perpendicular.
|
|
340
|
+
* * If axisOrder is not passed then `AxisOrder = AxisOrder.ZXY` is used as default.
|
|
341
|
+
* * This function internally uses createPerpendicularVectorFavorXYPlane and createRigidFromColumns.
|
|
342
|
+
*/
|
|
343
|
+
static createRigidHeadsUp(vectorA: Vector3d, axisOrder?: AxisOrder, result?: Matrix3d): Matrix3d;
|
|
344
|
+
/** Return the matrix for rotation of `angle` around desired `axis` */
|
|
288
345
|
static createRotationAroundVector(axis: Vector3d, angle: Angle, result?: Matrix3d): Matrix3d | undefined;
|
|
289
|
-
/** Returns a rotation of specified angle around
|
|
346
|
+
/** Returns a rotation of specified angle around one of the main axis (X,Y,Z).
|
|
290
347
|
* @param axisIndex index of axis (AxisIndex.X, AxisIndex.Y, AxisIndex.Z) kept fixed by the rotation.
|
|
291
348
|
* @param angle angle of rotation
|
|
292
349
|
* @param result optional result matrix.
|
|
350
|
+
* * Math details of 3d rotation matrices derivation can be found at docs/learning/geometry/Angle.md
|
|
293
351
|
*/
|
|
294
352
|
static createRotationAroundAxisIndex(axisIndex: AxisIndex, angle: Angle, result?: Matrix3d): Matrix3d;
|
|
353
|
+
/**
|
|
354
|
+
* Replace current rows Ui and Uj with (c*Ui + s*Uj) and (c*Uj - s*Ui).
|
|
355
|
+
* * There is no checking for i,j being 0,1,2.
|
|
356
|
+
* @param i first row index. **must be 0,1,2** (unchecked)
|
|
357
|
+
* @param j second row index. **must be 0,1,2** (unchecked)
|
|
358
|
+
* @param c fist coefficient
|
|
359
|
+
* @param s second coefficient
|
|
360
|
+
*/
|
|
361
|
+
private applyGivensRowOp;
|
|
362
|
+
/**
|
|
363
|
+
* Replace current columns Ui and Uj with (c*Ui + s*Uj) and (c*Uj - s*Ui).
|
|
364
|
+
* * There is no checking for i,j being 0,1,2.
|
|
365
|
+
* * This is used in compute intensive inner loops
|
|
366
|
+
* @param i first row index. **must be 0,1,2** (unchecked)
|
|
367
|
+
* @param j second row index. **must be 0,1,2** (unchecked)
|
|
368
|
+
* @param c fist coefficient
|
|
369
|
+
* @param s second coefficient
|
|
370
|
+
*/
|
|
371
|
+
applyGivensColumnOp(i: number, j: number, c: number, s: number): void;
|
|
372
|
+
/**
|
|
373
|
+
* Create a matrix from column vectors.
|
|
374
|
+
* ```
|
|
375
|
+
* equation
|
|
376
|
+
* \begin{bmatrix}U_x & V_x & W_x \\ U_y & V_y & W_y \\ U_z & V_z & W_z \end{bmatrix}
|
|
377
|
+
* ```
|
|
378
|
+
*/
|
|
379
|
+
static createColumns(vectorU: Vector3d, vectorV: Vector3d, vectorW: Vector3d, result?: Matrix3d): Matrix3d;
|
|
380
|
+
/** Create a matrix with each column's _x,y_ parts given `XAndY` and separate numeric z values.
|
|
381
|
+
* ```
|
|
382
|
+
* equation
|
|
383
|
+
* \begin{bmatrix}U_x & V_x & W_x \\ U_y & V_y & W_y \\ u & v & w \end{bmatrix}
|
|
384
|
+
* ```
|
|
385
|
+
*/
|
|
386
|
+
static createColumnsXYW(vectorU: XAndY, u: number, vectorV: XAndY, v: number, vectorW: XAndY, w: number, result?: Matrix3d): Matrix3d;
|
|
295
387
|
/** Create a matrix from "as viewed" right and up vectors.
|
|
296
388
|
* * ColumnX points in the rightVector direction
|
|
297
|
-
* * ColumnY points in
|
|
298
|
-
* * ColumnZ is a unit cross product.
|
|
299
|
-
* Optionally rotate
|
|
300
|
-
* *
|
|
301
|
-
*
|
|
302
|
-
* This is expected to be used with various principal unit vectors that are perpendicular to each other.
|
|
303
|
-
*
|
|
304
|
-
*
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
*
|
|
308
|
-
*
|
|
309
|
-
*
|
|
310
|
-
*
|
|
389
|
+
* * ColumnY points in the upVector direction
|
|
390
|
+
* * ColumnZ is a unit cross product of ColumnX and ColumnY.
|
|
391
|
+
* * Optionally rotate by 45 degrees around `upVector` to bring its left or right vertical edge to center.
|
|
392
|
+
* * Optionally rotate by arctan(1/sqrt(2)) ~ 35.264 degrees around `rightVector` to bring the top or bottom
|
|
393
|
+
* horizontal edge of the view to the center (for isometric views).
|
|
394
|
+
* * This is expected to be used with various principal unit vectors that are perpendicular to each other.
|
|
395
|
+
* * STANDARD TOP VIEW: createViewedAxes(Vector3d.unitX(), Vector3d.unitY(), 0, 0)
|
|
396
|
+
* * STANDARD FRONT VIEW: createViewedAxes(Vector3d.unitX(), Vector3d.unitZ(), 0, 0)
|
|
397
|
+
* * STANDARD BACK VIEW: createViewedAxes(Vector3d.unitX(-1), Vector3d.unitZ(), 0, 0)
|
|
398
|
+
* * STANDARD RIGHT VIEW: createViewedAxes(Vector3d.unitY(), Vector3d.unitZ(), 0, 0)
|
|
399
|
+
* * STANDARD LEFT VIEW: createViewedAxes(Vector3d.unitY(-1), Vector3d.unitZ(), 0, 0)
|
|
400
|
+
* * STANDARD BOTTOM VIEW: createViewedAxes(Vector3d.unitX(), Vector3d.unitY(-1), 0, 0)
|
|
401
|
+
* * STANDARD ISO VIEW: createViewedAxes(Vector3d.unitX(), Vector3d.unitZ(), -1, 1)
|
|
402
|
+
* * STANDARD RIGHT ISO VIEW: createViewedAxes(Vector3d.unitX(), Vector3d.unitZ(), 1, 1)
|
|
403
|
+
* * Front, right, back, left, top, and bottom standard views are views from faces of the cube
|
|
404
|
+
* and iso and right iso standard views are views from corners of the cube.
|
|
405
|
+
* * Note: createViewedAxes is column-based so always returns local to world
|
|
406
|
+
*
|
|
407
|
+
* @param rightVector ColumnX of the returned matrix. Expected to be perpendicular to upVector.
|
|
408
|
+
* @param upVector ColumnY of the returned matrix. Expected to be perpendicular to rightVector.
|
|
409
|
+
* @param leftNoneRight Specifies the ccw rotation around `upVector` axis. Normally one of "-1", "0", and "1",
|
|
410
|
+
* where "-1" indicates rotation by 45 degrees to bring the left vertical edge to center, "0" means no rotation,
|
|
411
|
+
* and "1" indicates rotation by 45 degrees to bring the right vertical edge to center. Other numbers are
|
|
412
|
+
* used as multiplier for this 45 degree rotation.
|
|
413
|
+
* @param topNoneBottom Specifies the ccw rotation around `rightVector` axis. Normally one of "-1", "0", and "1",
|
|
414
|
+
* where "-1" indicates isometric rotation (35.264 degrees) to bring the bottom upward, "0" means no rotation,
|
|
415
|
+
* and "1" indicates isometric rotation (35.264 degrees) to bring the top downward. Other numbers are
|
|
416
|
+
* used as multiplier for the 35.264 degree rotation.
|
|
417
|
+
* @returns matrix = [rightVector, upVector, rightVector cross upVector] with the applied rotations specified
|
|
418
|
+
* by leftNoneRight and topNoneBottom. Returns undefined if rightVector and upVector are parallel.
|
|
311
419
|
*/
|
|
312
420
|
static createViewedAxes(rightVector: Vector3d, upVector: Vector3d, leftNoneRight?: number, topNoneBottom?: number): Matrix3d | undefined;
|
|
313
421
|
/**
|
|
314
422
|
* Create a rotation matrix for one of the 8 standard views.
|
|
315
|
-
* *
|
|
316
|
-
* *
|
|
423
|
+
* * Default is TOP view (`local X = world X`, `local Y = world Y`, `local Z = world Z`).
|
|
424
|
+
* * To change view from the TOP to one of the other 7 standard views, we need to multiply "world data" to
|
|
425
|
+
* the corresponding matrix1 provided by `createStandardWorldToView(index, false)` and then
|
|
426
|
+
* `matrix1.multiply(world data)` will return "local data".
|
|
427
|
+
* * To change view back to the TOP, we need to multiply "local data" to the corresponding matrix2 provided
|
|
428
|
+
* by `createStandardWorldToView(index, true)` and then `matrix2.multiply(local data)` will returns "world data".
|
|
429
|
+
* * Note: No matter how you rotate the world axis, local X is always pointing right, local Y is always pointing up,
|
|
430
|
+
* and local Z is always pointing toward you.
|
|
317
431
|
*
|
|
318
|
-
* @param index standard view index `StandardViewIndex.Top, Bottom,
|
|
319
|
-
* @param invert if false (default), the
|
|
432
|
+
* @param index standard view index `StandardViewIndex.Top, Bottom, Left, Right, Front, Back, Iso, RightIso`
|
|
433
|
+
* @param invert if false (default), the return matrix is world to local (view) and if true, the the return
|
|
434
|
+
* matrix is local (view) to world.
|
|
320
435
|
* @param result optional result.
|
|
321
436
|
*/
|
|
322
437
|
static createStandardWorldToView(index: StandardViewIndex, invert?: boolean, result?: Matrix3d): Matrix3d;
|
|
438
|
+
/**
|
|
439
|
+
* Apply (in place) a jacobi update that zeros out this.at(i,j).
|
|
440
|
+
* @param i row index of zeroed member
|
|
441
|
+
* @param j column index of zeroed member
|
|
442
|
+
* @param k other row/column index (different from i and j)
|
|
443
|
+
* @param leftEigenVectors a matrix that its columns will be filled by eigenvectors of this Matrix3d
|
|
444
|
+
* (allocated by caller, computed and filled by this function)
|
|
445
|
+
*/
|
|
446
|
+
private applyFastSymmetricJacobiUpdate;
|
|
447
|
+
/**
|
|
448
|
+
* Factor this (symmetrized) as a product U * lambda * UT where U is orthogonal, lambda is diagonal.
|
|
449
|
+
* The upper triangle is mirrored to lower triangle to enforce symmetry.
|
|
450
|
+
* @param leftEigenvectors a matrix that its columns will be filled by eigenvectors of this Matrix3d
|
|
451
|
+
* (allocated by caller, computed and filled by this function)
|
|
452
|
+
* @param lambda a vector that its entries will be filled by eigenvalues of this Matrix3d
|
|
453
|
+
* (allocated by caller, computed and filled by this function)
|
|
454
|
+
*/
|
|
455
|
+
fastSymmetricEigenvalues(leftEigenvectors: Matrix3d, lambda: Vector3d): boolean;
|
|
323
456
|
/**
|
|
324
457
|
* Compute the (unit vector) axis and angle of rotation.
|
|
325
|
-
*
|
|
458
|
+
* * math details can be found at docs/learning/geometry/Angle.md
|
|
459
|
+
* @returns Returns axis and angle of rotation with result.ok === true when the conversion succeeded.
|
|
326
460
|
*/
|
|
327
461
|
getAxisAndAngleOfRotation(): {
|
|
328
462
|
axis: Vector3d;
|
|
329
463
|
angle: Angle;
|
|
330
464
|
ok: boolean;
|
|
331
465
|
};
|
|
466
|
+
/** Rotate so columns i and j become perpendicular */
|
|
467
|
+
private applyJacobiColumnRotation;
|
|
332
468
|
/**
|
|
333
|
-
*
|
|
469
|
+
* Factor this as a product C * U where C has mutually perpendicular columns and
|
|
470
|
+
* U is orthogonal.
|
|
471
|
+
* @param matrixC (allocate by caller, computed here)
|
|
472
|
+
* @param matrixU (allocate by caller, computed here)
|
|
334
473
|
*/
|
|
335
|
-
|
|
474
|
+
factorPerpendicularColumns(matrixC: Matrix3d, matrixU: Matrix3d): boolean;
|
|
475
|
+
/**
|
|
476
|
+
* Factor this matrix M as a product M = V * D * U where V and U are orthogonal, and D is diagonal (scale matrix).
|
|
477
|
+
* @param matrixV left orthogonal factor (allocate by caller, computed here)
|
|
478
|
+
* @param scale diagonal entries of D (allocate by caller, computed here)
|
|
479
|
+
* @param matrixU right orthogonal factor (allocate by caller, computed here)
|
|
480
|
+
*/
|
|
481
|
+
factorOrthogonalScaleOrthogonal(matrixV: Matrix3d, scale: Point3d, matrixU: Matrix3d): boolean;
|
|
482
|
+
/** Apply a jacobi step to lambda which evolves towards diagonal. */
|
|
483
|
+
private applySymmetricJacobi;
|
|
484
|
+
/**
|
|
485
|
+
* Factor this (symmetrized) as a product U * lambda * UT where U is orthogonal, lambda is diagonal.
|
|
486
|
+
* The upper triangle is mirrored to lower triangle to enforce symmetry.
|
|
487
|
+
* @param matrixC (allocate by caller, computed here)
|
|
488
|
+
* @param factor (allocate by caller, computed here)
|
|
489
|
+
*/
|
|
490
|
+
symmetricEigenvalues(leftEigenvectors: Matrix3d, lambda: Vector3d): boolean;
|
|
336
491
|
/**
|
|
337
492
|
* Return a matrix that rotates a fraction of the angular sweep from vectorA to vectorB.
|
|
338
493
|
* @param vectorA initial vector position
|
|
339
|
-
* @param fraction fractional rotation
|
|
494
|
+
* @param fraction fractional rotation (1 means rotate all the way)
|
|
340
495
|
* @param vectorB final vector position
|
|
341
496
|
* @param result optional result matrix.
|
|
342
497
|
*/
|
|
343
498
|
static createPartialRotationVectorToVector(vectorA: Vector3d, fraction: number, vectorB: Vector3d, result?: Matrix3d): Matrix3d | undefined;
|
|
499
|
+
/** Returns a matrix that rotates from vectorA to vectorB. */
|
|
500
|
+
static createRotationVectorToVector(vectorA: Vector3d, vectorB: Vector3d, result?: Matrix3d): Matrix3d | undefined;
|
|
344
501
|
/** Create a 90 degree rotation around a principal axis */
|
|
345
502
|
static create90DegreeRotationAroundAxis(axisIndex: number): Matrix3d;
|
|
346
503
|
/** Return (a copy of) the X column */
|
|
347
504
|
columnX(result?: Vector3d): Vector3d;
|
|
348
|
-
/** Return (a copy of)the Y column */
|
|
505
|
+
/** Return (a copy of) the Y column */
|
|
349
506
|
columnY(result?: Vector3d): Vector3d;
|
|
350
|
-
/** Return (a copy of)the Z column */
|
|
507
|
+
/** Return (a copy of) the Z column */
|
|
351
508
|
columnZ(result?: Vector3d): Vector3d;
|
|
352
509
|
/** Return the X column magnitude squared */
|
|
353
510
|
columnXMagnitudeSquared(): number;
|
|
@@ -363,18 +520,17 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
363
520
|
columnZMagnitude(): number;
|
|
364
521
|
/** Return magnitude of columnX cross columnY. */
|
|
365
522
|
columnXYCrossProductMagnitude(): number;
|
|
366
|
-
/** Return the X row magnitude
|
|
523
|
+
/** Return the X row magnitude */
|
|
367
524
|
rowXMagnitude(): number;
|
|
368
525
|
/** Return the Y row magnitude */
|
|
369
526
|
rowYMagnitude(): number;
|
|
370
527
|
/** Return the Z row magnitude */
|
|
371
528
|
rowZMagnitude(): number;
|
|
372
529
|
/** Return the dot product of column X with column Y */
|
|
373
|
-
/** Return the dot product of column X with column Y */
|
|
374
530
|
columnXDotColumnY(): number;
|
|
375
531
|
/**
|
|
376
532
|
* Dot product of an indexed column with a vector given as x,y,z
|
|
377
|
-
* @param columnIndex index of column.
|
|
533
|
+
* @param columnIndex index of column. Must be 0,1,2.
|
|
378
534
|
* @param x x component of vector
|
|
379
535
|
* @param y y component of vector
|
|
380
536
|
* @param z z component of vector
|
|
@@ -404,133 +560,67 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
404
560
|
dotRowYXYZ(x: number, y: number, z: number): number;
|
|
405
561
|
/** Return the dot product of the x,y,z with the Z row. */
|
|
406
562
|
dotRowZXYZ(x: number, y: number, z: number): number;
|
|
407
|
-
/** Return the
|
|
563
|
+
/** Return the cross product of the Z column with the vector parameter. */
|
|
408
564
|
columnZCrossVector(vector: XYZ, result?: Vector3d): Vector3d;
|
|
409
|
-
/**
|
|
410
|
-
* Replace current rows Ui Uj with (c*Ui - s*Uj) and (c*Uj + s*Ui).
|
|
411
|
-
* @param i first row index. must be 0,1,2 (unchecked)
|
|
412
|
-
* @param j second row index. must be 0,1,2 (unchecked)
|
|
413
|
-
* @param c fist coefficient
|
|
414
|
-
* @param s second coefficient
|
|
415
|
-
*/
|
|
416
|
-
private applyGivensRowOp;
|
|
417
|
-
/**
|
|
418
|
-
* Replace current columns Ui Uj with (c*Ui - s*Uj) and (c*Uj + s*Ui).
|
|
419
|
-
* * This is used in compute intensive inner loops -- there is no checking for i,j being 0,1,2.
|
|
420
|
-
* @param i first row index. must be 0,1,2 (unchecked)
|
|
421
|
-
* @param j second row index. must be 0,1,2 (unchecked)
|
|
422
|
-
* @param c fist coefficient
|
|
423
|
-
* @param s second coefficient
|
|
424
|
-
*/
|
|
425
|
-
applyGivensColumnOp(i: number, j: number, c: number, s: number): void;
|
|
426
|
-
/**
|
|
427
|
-
* create a rigid coordinate frame column z parallel to (_x_,_y_,_z_) and column x in the xy plane.
|
|
428
|
-
* * column z points from origin to x,y,z
|
|
429
|
-
* * column x is perpendicular and in the xy plane
|
|
430
|
-
* * column y is perpendicular to both. It is the "up" vector on the view plane.
|
|
431
|
-
* * Multiplying a world vector times the transpose of this matrix transforms into the view xy
|
|
432
|
-
* * Multiplying the matrix times the an in-view vector transforms the vector to world.
|
|
433
|
-
* @param x eye x coordinate
|
|
434
|
-
* @param y eye y coordinate
|
|
435
|
-
* @param z eye z coordinate
|
|
436
|
-
* @param result
|
|
437
|
-
*/
|
|
438
|
-
static createRigidViewAxesZTowardsEye(x: number, y: number, z: number, result?: Matrix3d): Matrix3d;
|
|
439
|
-
/** Rotate so columns i and j become perpendicular */
|
|
440
|
-
private applyJacobiColumnRotation;
|
|
441
|
-
/**
|
|
442
|
-
* Factor this as a product C * U where C has mutually perpendicular columns and
|
|
443
|
-
* U is orthogonal.
|
|
444
|
-
* @param matrixC (allocate by caller, computed here)
|
|
445
|
-
* @param matrixU (allocate by caller, computed here)
|
|
446
|
-
*/
|
|
447
|
-
factorPerpendicularColumns(matrixC: Matrix3d, matrixU: Matrix3d): boolean;
|
|
448
|
-
/**
|
|
449
|
-
* Factor this matrix M as a product M = V * D * U where V and U are orthogonal, and D is diagonal (scale matrix).
|
|
450
|
-
* @param matrixV left orthogonal factor (allocate by caller, computed here)
|
|
451
|
-
* @param scale diagonal entries of D (allocate by caller, computed here)
|
|
452
|
-
* @param matrixU right orthogonal factor (allocate by caller, computed here)
|
|
453
|
-
*/
|
|
454
|
-
factorOrthogonalScaleOrthogonal(matrixV: Matrix3d, scale: Point3d, matrixU: Matrix3d): boolean;
|
|
455
|
-
/** Apply a jacobi step to lambda which evolves towards diagonal. */
|
|
456
|
-
private applySymmetricJacobi;
|
|
457
|
-
/**
|
|
458
|
-
* Factor this (symmetrized) as a product U * lambda * UT where U is orthogonal, lambda is diagonal.
|
|
459
|
-
* The upper triangle is mirrored to lower triangle to enforce symmetry.
|
|
460
|
-
* @param matrixC (allocate by caller, computed here)
|
|
461
|
-
* @param factor (allocate by caller, computed here)
|
|
462
|
-
*/
|
|
463
|
-
symmetricEigenvalues(leftEigenvectors: Matrix3d, lambda: Vector3d): boolean;
|
|
464
|
-
/** Apply (in place a jacobi update that zeros out this.at(i,j).
|
|
465
|
-
*
|
|
466
|
-
*/
|
|
467
|
-
private applyFastSymmetricJacobiUpdate;
|
|
468
|
-
/**
|
|
469
|
-
* Factor this (symmetrized) as a product U * lambda * UT where U is orthogonal, lambda is diagonal.
|
|
470
|
-
* The upper triangle is mirrored to lower triangle to enforce symmetry.
|
|
471
|
-
* @param matrixC (allocate by caller, computed here)
|
|
472
|
-
* @param factor (allocate by caller, computed here)
|
|
473
|
-
*/
|
|
474
|
-
fastSymmetricEigenvalues(leftEigenvectors: Matrix3d, lambda: Vector3d): boolean;
|
|
475
|
-
/**
|
|
476
|
-
* Create a matrix from column vectors.
|
|
477
|
-
* ```
|
|
478
|
-
* equation
|
|
479
|
-
* \begin{bmatrix}U_x & V_x & W_x \\ U_y & V_y & W_y \\ U_z & V_z & W_z \end{bmatrix}
|
|
480
|
-
* ```
|
|
481
|
-
*/
|
|
482
|
-
static createColumns(vectorU: Vector3d, vectorV: Vector3d, vectorW: Vector3d, result?: Matrix3d): Matrix3d;
|
|
483
|
-
/** Create a matrix with each column's _x,y_ parts given `XAndY` and separate numeric z values.
|
|
484
|
-
* ```
|
|
485
|
-
* equation
|
|
486
|
-
* \begin{bmatrix}U_x & V_x & W_x \\ U_y & V_y & W_y \\ u & v & w \end{bmatrix}
|
|
487
|
-
* ```
|
|
488
|
-
*/
|
|
489
|
-
static createColumnsXYW(vectorU: XAndY, u: number, vectorV: XAndY, v: number, vectorW: XAndY, w: number, result?: Matrix3d): Matrix3d;
|
|
490
|
-
/** Install data from xyz parts of Point4d (w part of Point4d ignored) */
|
|
565
|
+
/** Set data from xyz parts of Point4d (w part of Point4d ignored) */
|
|
491
566
|
setColumnsPoint4dXYZ(vectorU: Point4d, vectorV: Point4d, vectorW: Point4d): void;
|
|
492
567
|
/**
|
|
493
|
-
*
|
|
494
|
-
* @param columnIndex column index
|
|
568
|
+
* Set entries in one column of the matrix.
|
|
569
|
+
* @param columnIndex column index (this is interpreted cyclically. See Geometry.cyclic3dAxis for more info).
|
|
495
570
|
* @param value x,yz, values for column. If undefined, zeros are installed.
|
|
496
571
|
*/
|
|
497
572
|
setColumn(columnIndex: number, value: Vector3d | undefined): void;
|
|
498
|
-
/** Set all columns of the matrix. Any undefined vector is zeros. */
|
|
499
|
-
setColumns(vectorX: Vector3d | undefined, vectorY: Vector3d | undefined, vectorZ?: Vector3d | undefined): void;
|
|
500
573
|
/**
|
|
501
|
-
*
|
|
502
|
-
* @param
|
|
503
|
-
* @param
|
|
574
|
+
* Set all columns of the matrix. Any undefined vector is zeros.
|
|
575
|
+
* @param vectorX values for column 0
|
|
576
|
+
* @param vectorY values for column 1
|
|
577
|
+
* @param vectorZ optional values for column 2 (it's optional in case column 2 is 000, which is a
|
|
578
|
+
* projection onto the xy-plane)
|
|
579
|
+
*/
|
|
580
|
+
setColumns(vectorX: Vector3d | undefined, vectorY: Vector3d | undefined, vectorZ?: Vector3d): void;
|
|
581
|
+
/**
|
|
582
|
+
* Set entries in one row of the matrix.
|
|
583
|
+
* @param rowIndex row index. This is interpreted cyclically (using Geometry.cyclic3dAxis).
|
|
584
|
+
* @param value x,y,z values for row.
|
|
504
585
|
*/
|
|
505
586
|
setRow(rowIndex: number, value: Vector3d): void;
|
|
506
|
-
/**
|
|
507
|
-
*
|
|
587
|
+
/**
|
|
588
|
+
* Return (a copy of) a column of the matrix.
|
|
589
|
+
* @param i column index. This is interpreted cyclically (using Geometry.cyclic3dAxis).
|
|
590
|
+
* @param result optional preallocated result.
|
|
508
591
|
*/
|
|
509
592
|
getColumn(columnIndex: number, result?: Vector3d): Vector3d;
|
|
510
|
-
/**
|
|
511
|
-
*
|
|
593
|
+
/**
|
|
594
|
+
* Return a (copy of) a row of the matrix.
|
|
595
|
+
* @param i row index. This is interpreted cyclically (using Geometry.cyclic3dAxis).
|
|
596
|
+
* @param result optional preallocated result.
|
|
512
597
|
*/
|
|
513
598
|
getRow(columnIndex: number, result?: Vector3d): Vector3d;
|
|
514
|
-
/**
|
|
515
|
-
|
|
516
|
-
/** Create a matrix from row vectors.
|
|
599
|
+
/**
|
|
600
|
+
* Create a matrix from row vectors.
|
|
517
601
|
* ```
|
|
518
602
|
* equation
|
|
519
603
|
* \begin{bmatrix}U_x & U_y & U_z \\ V_x & V_y & V_z \\ W_x & W_y & W_z \end{bmatrix}
|
|
520
604
|
* ```
|
|
521
605
|
*/
|
|
522
606
|
static createRows(vectorU: Vector3d, vectorV: Vector3d, vectorW: Vector3d, result?: Matrix3d): Matrix3d;
|
|
523
|
-
/**
|
|
524
|
-
*
|
|
525
|
-
*
|
|
607
|
+
/**
|
|
608
|
+
* Create a matrix that scales along a specified `direction`. This means if you multiply the returned matrix
|
|
609
|
+
* by a `vector`, you get `directional scale` of that `vector`. Suppose `plane` is the plane perpendicular
|
|
610
|
+
* to the `direction`. When scale = 0, `directional scale` is projection of the `vector` to the `plane`.
|
|
611
|
+
* When scale = 1, `directional scale` is the `vector` itself. When scale = -1, `directional scale` is
|
|
612
|
+
* mirror of the `vector` across the `plane`. In general, When scale != 0, the result is computed by first
|
|
613
|
+
* projecting the `vector` to the `plane`, then translating that projection along the `direction` (if scale > 0)
|
|
614
|
+
* or in opposite direction (if scale < 0).
|
|
526
615
|
* ```
|
|
527
616
|
* equation
|
|
528
|
-
* \text{The matrix is } I
|
|
529
|
-
* \\ \text{with }
|
|
617
|
+
* \text{The matrix is } I + (s-1) D D^T
|
|
618
|
+
* \\ \text{with }D\text{ being the normalized direction vector and }s\text{ being the scale.}
|
|
530
619
|
* ```
|
|
531
620
|
*/
|
|
532
621
|
static createDirectionalScale(direction: Vector3d, scale: number, result?: Matrix3d): Matrix3d;
|
|
533
|
-
/**
|
|
622
|
+
/**
|
|
623
|
+
* Multiply `matrix * vector`, treating the vector is a column vector on the right.
|
|
534
624
|
* ```
|
|
535
625
|
* equation
|
|
536
626
|
* \matrixXY{A}\columnSubXYZ{U}
|
|
@@ -538,54 +628,67 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
538
628
|
* @return the vector result
|
|
539
629
|
*/
|
|
540
630
|
multiplyVector(vectorU: XYAndZ, result?: Vector3d): Vector3d;
|
|
541
|
-
/**
|
|
542
|
-
*
|
|
631
|
+
/**
|
|
632
|
+
* Multiply `matrix * vector` in place for vector in the array, i.e. treating the vector is a column
|
|
633
|
+
* vector on the right.
|
|
634
|
+
* * Each `vector` is updated to be `matrix * vector`
|
|
543
635
|
*/
|
|
544
636
|
multiplyVectorArrayInPlace(data: XYZ[]): void;
|
|
545
|
-
/**
|
|
637
|
+
/** Compute `origin - matrix * vector` */
|
|
546
638
|
static xyzMinusMatrixTimesXYZ(origin: XYAndZ, matrix: Matrix3d, vector: XYAndZ, result?: Point3d): Point3d;
|
|
547
|
-
/**
|
|
639
|
+
/** Compute `origin + matrix * vector` using only the xy parts of the inputs. */
|
|
548
640
|
static xyPlusMatrixTimesXY(origin: XAndY, matrix: Matrix3d, vector: XAndY, result?: Point2d): Point2d;
|
|
549
|
-
/**
|
|
641
|
+
/** Compute `origin + matrix * vector` using all xyz parts of the inputs. */
|
|
550
642
|
static xyzPlusMatrixTimesXYZ(origin: XYZ, matrix: Matrix3d, vector: XYAndZ, result?: Point3d): Point3d;
|
|
551
|
-
/**
|
|
643
|
+
/** Updates vector to be `origin + matrix * vector` using all xyz parts of the inputs. */
|
|
552
644
|
static xyzPlusMatrixTimesXYZInPlace(origin: XYZ, matrix: Matrix3d, vector: WritableXYAndZ): void;
|
|
553
|
-
/**
|
|
645
|
+
/** Compute `origin + matrix * vector` where the final vector is given as direct x,y,z coordinates */
|
|
554
646
|
static xyzPlusMatrixTimesCoordinates(origin: XYZ, matrix: Matrix3d, x: number, y: number, z: number, result?: Point3d): Point3d;
|
|
555
647
|
/**
|
|
556
648
|
* Treat the 3x3 matrix and origin as upper 3x4 part of a 4x4 matrix, with 0001 as the final row.
|
|
557
|
-
* Multiply
|
|
649
|
+
* Multiply the 4x4 matrix by `[x,y,z,w]`
|
|
650
|
+
* ```
|
|
651
|
+
* equation
|
|
652
|
+
* \begin{bmatrix}M_0 & M_1 & M_2 & Ox \\ M_3 & M_4 & M_5 & Oy \\ M_6 & M_7 & M_8 & Oz \\ 0 & 0 & 0 & 1\end{bmatrix} * \begin{bmatrix}x \\ y \\ z \\ w\end{bmatrix}
|
|
653
|
+
* ```
|
|
558
654
|
* @param origin translation part (xyz in column 3)
|
|
559
655
|
* @param matrix matrix part (leading 3x3)
|
|
560
656
|
* @param x x part of multiplied point
|
|
561
657
|
* @param y y part of multiplied point
|
|
562
658
|
* @param z z part of multiplied point
|
|
563
659
|
* @param w w part of multiplied point
|
|
564
|
-
* @param result optional result.
|
|
660
|
+
* @param result optional preallocated result.
|
|
565
661
|
*/
|
|
566
662
|
static xyzPlusMatrixTimesWeightedCoordinates(origin: XYZ, matrix: Matrix3d, x: number, y: number, z: number, w: number, result?: Point4d): Point4d;
|
|
567
663
|
/**
|
|
568
664
|
* Treat the 3x3 matrix and origin as upper 3x4 part of a 4x4 matrix, with 0001 as the final row.
|
|
569
|
-
* Multiply
|
|
665
|
+
* Multiply the 4x4 matrix by `[x,y,z,w]`
|
|
666
|
+
* ```
|
|
667
|
+
* equation
|
|
668
|
+
* \begin{bmatrix}M_0 & M_1 & M_2 & Ox \\ M_3 & M_4 & M_5 & Oy \\ M_6 & M_7 & M_8 & Oz \\ 0 & 0 & 0 & 1\end{bmatrix} * \begin{bmatrix}x \\ y \\ z \\ w\end{bmatrix}
|
|
669
|
+
* ```
|
|
570
670
|
* @param origin translation part (xyz in column 3)
|
|
571
671
|
* @param matrix matrix part (leading 3x3)
|
|
572
672
|
* @param x x part of multiplied point
|
|
573
673
|
* @param y y part of multiplied point
|
|
574
674
|
* @param z z part of multiplied point
|
|
575
675
|
* @param w w part of multiplied point
|
|
576
|
-
* @param result optional result.
|
|
676
|
+
* @param result optional preallocated result.
|
|
577
677
|
*/
|
|
578
678
|
static xyzPlusMatrixTimesWeightedCoordinatesToFloat64Array(origin: XYZ, matrix: Matrix3d, x: number, y: number, z: number, w: number, result?: Float64Array): Float64Array;
|
|
579
679
|
/**
|
|
580
|
-
* Treat the 3x3 matrix and origin as
|
|
581
|
-
* Multiply
|
|
680
|
+
* Treat the 3x3 matrix and origin as a 3x4 matrix.
|
|
681
|
+
* * Multiply the 3x4 matrix by `[x,y,z,1]`
|
|
682
|
+
* ```
|
|
683
|
+
* equation
|
|
684
|
+
* \begin{bmatrix}M_0 & M_1 & M_2 & Ox \\ M_3 & M_4 & M_5 & Oy \\ M_6 & M_7 & M_8 & Oz\end{bmatrix} * \begin{bmatrix}x \\ y \\ z \\ 1\end{bmatrix}
|
|
685
|
+
* ```
|
|
582
686
|
* @param origin translation part (xyz in column 3)
|
|
583
687
|
* @param matrix matrix part (leading 3x3)
|
|
584
688
|
* @param x x part of multiplied point
|
|
585
689
|
* @param y y part of multiplied point
|
|
586
690
|
* @param z z part of multiplied point
|
|
587
|
-
* @param
|
|
588
|
-
* @param result optional result.
|
|
691
|
+
* @param result optional preallocated result.
|
|
589
692
|
*/
|
|
590
693
|
static xyzPlusMatrixTimesCoordinatesToFloat64Array(origin: XYZ, matrix: Matrix3d, x: number, y: number, z: number, result?: Float64Array): Float64Array;
|
|
591
694
|
/**
|
|
@@ -713,10 +816,14 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
713
816
|
* @param result optional preallocated result to reuse.
|
|
714
817
|
*/
|
|
715
818
|
multiplyMatrixTransform(other: Transform, result?: Transform): Transform;
|
|
716
|
-
/**
|
|
819
|
+
/**
|
|
820
|
+
* Return the transpose of `this` matrix.
|
|
821
|
+
* If `result` is passed as argument, then the function copies the transpose of `this` into `result`
|
|
822
|
+
* `this` is not changed unless also passed as the result, i.e., this.transpose(this) transposes `this` in place
|
|
823
|
+
*/
|
|
717
824
|
transpose(result?: Matrix3d): Matrix3d;
|
|
718
|
-
/**
|
|
719
|
-
*
|
|
825
|
+
/**
|
|
826
|
+
* Transpose this matrix in place.
|
|
720
827
|
*/
|
|
721
828
|
transposeInPlace(): void;
|
|
722
829
|
/** return the inverse matrix.
|
|
@@ -725,10 +832,6 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
725
832
|
* * Hence explicitly constructing this new inverse object is rarely necessary.
|
|
726
833
|
*/
|
|
727
834
|
inverse(result?: Matrix3d): Matrix3d | undefined;
|
|
728
|
-
/** copy the transpose of the coffs to the inverseCoffs.
|
|
729
|
-
* * mark the matrix as inverseStored.
|
|
730
|
-
*/
|
|
731
|
-
private setupInverseTranspose;
|
|
732
835
|
private static indexedRowCrossProduct;
|
|
733
836
|
private indexedColumnCrossProductInPlace;
|
|
734
837
|
/** Form cross products among columns in axisOrder.
|
|
@@ -759,8 +862,10 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
759
862
|
* Mark this matrix as singular.
|
|
760
863
|
*/
|
|
761
864
|
markSingular(): void;
|
|
762
|
-
/**
|
|
763
|
-
*
|
|
865
|
+
/**
|
|
866
|
+
* Create the inverseCoffs member (filled with zeros)
|
|
867
|
+
* This is for use by matrix * matrix multiplications which need to be sure the member is there to be
|
|
868
|
+
* filled with method-specific content.
|
|
764
869
|
*/
|
|
765
870
|
private createInverseCoffsWithZeros;
|
|
766
871
|
/** compute the inverse of this Matrix3d. The inverse is stored for later use.
|
|
@@ -779,7 +884,7 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
779
884
|
* @param scaleX scale factor for column x
|
|
780
885
|
* @param scaleY scale factor for column y
|
|
781
886
|
* @param scaleZ scale factor for column z
|
|
782
|
-
* @param result optional result.
|
|
887
|
+
* @param result optional preallocated result.
|
|
783
888
|
*/
|
|
784
889
|
scaleColumns(scaleX: number, scaleY: number, scaleZ: number, result?: Matrix3d): Matrix3d;
|
|
785
890
|
/** Scale the columns of this Matrix3d.
|
|
@@ -792,13 +897,13 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
792
897
|
* @param scaleX scale factor for row x
|
|
793
898
|
* @param scaleY scale factor for row y
|
|
794
899
|
* @param scaleZ scale factor for row z
|
|
795
|
-
* @param result optional result.
|
|
900
|
+
* @param result optional preallocated result.
|
|
796
901
|
*/
|
|
797
902
|
scaleRows(scaleX: number, scaleY: number, scaleZ: number, result?: Matrix3d): Matrix3d;
|
|
798
903
|
/**
|
|
799
904
|
* add scaled values from other Matrix3d to this Matrix3d
|
|
800
905
|
* @param other Matrix3d with values to be added
|
|
801
|
-
* @param scale scale factor to apply to
|
|
906
|
+
* @param scale scale factor to apply to the added values.
|
|
802
907
|
*/
|
|
803
908
|
addScaledInPlace(other: Matrix3d, scale: number): void;
|
|
804
909
|
/**
|
|
@@ -819,10 +924,25 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
819
924
|
addScaledOuterProductInPlace(vectorU: Vector3d, vectorV: Vector3d, scale: number): void;
|
|
820
925
|
/** create a Matrix3d whose values are uniformly scaled from this.
|
|
821
926
|
* @param scale scale factor to apply.
|
|
822
|
-
* @param result optional result.
|
|
927
|
+
* @param result optional preallocated result.
|
|
823
928
|
* @returns Return the new or repopulated matrix
|
|
824
929
|
*/
|
|
825
930
|
scale(scale: number, result?: Matrix3d): Matrix3d;
|
|
931
|
+
/**
|
|
932
|
+
* Create a rigid matrix (columns and rows are unit length and pairwise perpendicular) for
|
|
933
|
+
* the given eye coordinate.
|
|
934
|
+
* * column z is parallel to x,y,z
|
|
935
|
+
* * column x is perpendicular to column z and is in the xy plane
|
|
936
|
+
* * column y is perpendicular to both. It is the "up" vector on the view plane.
|
|
937
|
+
* * Multiplying the returned matrix times a local (view) vector gives the world vector.
|
|
938
|
+
* * Multiplying transpose of the returned matrix times a world vector gives the local
|
|
939
|
+
* (view) vector.
|
|
940
|
+
* @param x eye x coordinate
|
|
941
|
+
* @param y eye y coordinate
|
|
942
|
+
* @param z eye z coordinate
|
|
943
|
+
* @param result optional preallocated result
|
|
944
|
+
*/
|
|
945
|
+
static createRigidViewAxesZTowardsEye(x: number, y: number, z: number, result?: Matrix3d): Matrix3d;
|
|
826
946
|
/** Return the determinant of this matrix. */
|
|
827
947
|
determinant(): number;
|
|
828
948
|
/** Return an estimate of how independent the columns are. Near zero is bad. Near 1 is good
|
|
@@ -836,7 +956,7 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
836
956
|
sumDiagonal(): number;
|
|
837
957
|
/** Return the Maximum absolute value of any single entry */
|
|
838
958
|
maxAbs(): number;
|
|
839
|
-
/** Return the maximum absolute difference between corresponding entries */
|
|
959
|
+
/** Return the maximum absolute difference between corresponding entries of `this` and `other` */
|
|
840
960
|
maxDiff(other: Matrix3d): number;
|
|
841
961
|
/** Test if the matrix is (very near to) an identity */
|
|
842
962
|
get isIdentity(): boolean;
|
|
@@ -868,11 +988,6 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
868
988
|
get isSignedPermutation(): boolean;
|
|
869
989
|
/** Test if all rows and columns are length 1 and are perpendicular to each other. (I.e. the matrix is either a pure rotation with uniform scale factor of 1 or -1) */
|
|
870
990
|
testPerpendicularUnitRowsAndColumns(): boolean;
|
|
871
|
-
/** create a new orthogonal matrix (perpendicular columns, unit length, transpose is inverse).
|
|
872
|
-
* vectorA is placed in the first column of the axis order.
|
|
873
|
-
* vectorB is projected perpendicular to vectorA within their plane and placed in the second column.
|
|
874
|
-
*/
|
|
875
|
-
static createRigidFromColumns(vectorA: Vector3d, vectorB: Vector3d, axisOrder: AxisOrder, result?: Matrix3d): Matrix3d | undefined;
|
|
876
991
|
/** Adjust the matrix in place so that:
|
|
877
992
|
* * columns are perpendicular and have unit length
|
|
878
993
|
* * transpose equals inverse
|
|
@@ -888,14 +1003,14 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
888
1003
|
static createRigidFromMatrix3d(source: Matrix3d, axisOrder?: AxisOrder, result?: Matrix3d): Matrix3d | undefined;
|
|
889
1004
|
private static computeQuatTerm;
|
|
890
1005
|
/** create a matrix from a quaternion.
|
|
891
|
-
* WARNING
|
|
892
|
-
* WARNING
|
|
1006
|
+
* **WARNING:** There is frequent confusion over whether a "from quaternion" matrix is organized by rows and columns.
|
|
1007
|
+
* **WARNING:** If you find that the matrix seems to rotate by the opposite angle expect it, transpose it.
|
|
893
1008
|
*/
|
|
894
1009
|
static createFromQuaternion(quat: Point4d): Matrix3d;
|
|
895
1010
|
/** convert the matrix to a quaternion.
|
|
896
1011
|
* @note This calculation requires the matrix to have unit length rows and columns.
|
|
897
|
-
* WARNING
|
|
898
|
-
* WARNING
|
|
1012
|
+
* **WARNING:** There is frequent confusion over whether a "from quaternion" matrix is organized by rows and columns.
|
|
1013
|
+
* **WARNING:** If you find that the matrix seems to rotate by the opposite angle expect it, transpose it.
|
|
899
1014
|
*/
|
|
900
1015
|
toQuaternion(): Point4d;
|
|
901
1016
|
}
|