@itwin/core-geometry 4.0.0-dev.55 → 4.0.0-dev.56
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/lib/cjs/Geometry.d.ts +5 -1
- package/lib/cjs/Geometry.d.ts.map +1 -1
- package/lib/cjs/Geometry.js +5 -1
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/geometry3d/Angle.d.ts +29 -34
- package/lib/cjs/geometry3d/Angle.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Angle.js +31 -36
- package/lib/cjs/geometry3d/Angle.js.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.d.ts +48 -43
- package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js +48 -43
- package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts +5 -8
- package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +5 -8
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/OrderedRotationAngles.d.ts +3 -3
- package/lib/cjs/geometry3d/OrderedRotationAngles.d.ts.map +1 -1
- package/lib/cjs/geometry3d/OrderedRotationAngles.js +3 -3
- package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dArrayCarrier.d.ts +8 -10
- package/lib/cjs/geometry3d/Point2dArrayCarrier.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point2dArrayCarrier.js +8 -10
- package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.d.ts +37 -34
- package/lib/cjs/geometry3d/Point2dVector2d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.js +38 -35
- package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.d.ts +17 -21
- package/lib/cjs/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js +16 -20
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +84 -67
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +84 -67
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.d.ts +76 -66
- package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Transform.js +88 -77
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/geometry3d/YawPitchRollAngles.d.ts +15 -16
- package/lib/cjs/geometry3d/YawPitchRollAngles.d.ts.map +1 -1
- package/lib/cjs/geometry3d/YawPitchRollAngles.js +14 -15
- package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts +72 -58
- package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js +132 -108
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/Geometry.d.ts +5 -1
- package/lib/esm/Geometry.d.ts.map +1 -1
- package/lib/esm/Geometry.js +5 -1
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/geometry3d/Angle.d.ts +29 -34
- package/lib/esm/geometry3d/Angle.d.ts.map +1 -1
- package/lib/esm/geometry3d/Angle.js +31 -36
- package/lib/esm/geometry3d/Angle.js.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.d.ts +48 -43
- package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.js +48 -43
- package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts +5 -8
- package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +5 -8
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/OrderedRotationAngles.d.ts +3 -3
- package/lib/esm/geometry3d/OrderedRotationAngles.d.ts.map +1 -1
- package/lib/esm/geometry3d/OrderedRotationAngles.js +3 -3
- package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/esm/geometry3d/Point2dArrayCarrier.d.ts +8 -10
- package/lib/esm/geometry3d/Point2dArrayCarrier.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point2dArrayCarrier.js +8 -10
- package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.d.ts +37 -34
- package/lib/esm/geometry3d/Point2dVector2d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.js +38 -35
- package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.d.ts +17 -21
- package/lib/esm/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.js +16 -20
- package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +84 -67
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +84 -67
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/Transform.d.ts +76 -66
- package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
- package/lib/esm/geometry3d/Transform.js +88 -77
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/geometry3d/YawPitchRollAngles.d.ts +15 -16
- package/lib/esm/geometry3d/YawPitchRollAngles.d.ts.map +1 -1
- package/lib/esm/geometry3d/YawPitchRollAngles.js +14 -15
- package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/esm/serialization/GeometrySamples.d.ts +72 -58
- package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js +132 -108
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/package.json +3 -3
|
@@ -6,10 +6,11 @@
|
|
|
6
6
|
* @module CartesianGeometry
|
|
7
7
|
*/
|
|
8
8
|
// cspell:word JSONXY
|
|
9
|
-
// cspell:word CWXY
|
|
9
|
+
// cspell:word CWXY CCWXY
|
|
10
10
|
import { Geometry } from "../Geometry";
|
|
11
11
|
import { Angle } from "./Angle";
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Minimal object containing x,y and operations that are meaningful without change in both point and vector.
|
|
13
14
|
* * `XY` is not instantiable.
|
|
14
15
|
* * The derived (instantiable) classes are
|
|
15
16
|
* * `Point2d`
|
|
@@ -54,11 +55,11 @@ export class XY {
|
|
|
54
55
|
isAlmostEqualXY(x, y, tol) {
|
|
55
56
|
return Geometry.isSameCoordinate(this.x, x, tol) && Geometry.isSameCoordinate(this.y, y, tol);
|
|
56
57
|
}
|
|
57
|
-
/**
|
|
58
|
+
/** Return a json array `[x,y]` */
|
|
58
59
|
toJSON() {
|
|
59
60
|
return [this.x, this.y];
|
|
60
61
|
}
|
|
61
|
-
/**
|
|
62
|
+
/** Return a json object `{x: 1, y:2}` */
|
|
62
63
|
toJSONXY() {
|
|
63
64
|
return { x: this.x, y: this.y };
|
|
64
65
|
}
|
|
@@ -66,7 +67,7 @@ export class XY {
|
|
|
66
67
|
* Set x and y from a JSON input such as `[1,2]` or `{x:1, y:2}`
|
|
67
68
|
* * If no JSON input is provided, 0 would be used as default values for x and y.
|
|
68
69
|
* @param json the JSON input
|
|
69
|
-
|
|
70
|
+
*/
|
|
70
71
|
setFromJSON(json) {
|
|
71
72
|
if (Array.isArray(json)) {
|
|
72
73
|
this.set(json[0] || 0, json[1] || 0);
|
|
@@ -94,17 +95,13 @@ export class XY {
|
|
|
94
95
|
maxDiff(other) {
|
|
95
96
|
return Math.max(Math.abs(this.x - other.x), Math.abs(this.y - other.y));
|
|
96
97
|
}
|
|
97
|
-
/**
|
|
98
|
-
* Return the x,y component corresponding to 0,1.
|
|
99
|
-
*/
|
|
98
|
+
/** Return the x,y component corresponding to 0,1 */
|
|
100
99
|
at(index) {
|
|
101
100
|
if (index < 0.5)
|
|
102
101
|
return this.x;
|
|
103
102
|
return this.y;
|
|
104
103
|
}
|
|
105
|
-
/**
|
|
106
|
-
* Set value at index 0 or 1.
|
|
107
|
-
*/
|
|
104
|
+
/** Set value at index 0 or 1 */
|
|
108
105
|
setAt(index, value) {
|
|
109
106
|
if (index < 0.5)
|
|
110
107
|
this.x = value;
|
|
@@ -121,7 +118,7 @@ export class XY {
|
|
|
121
118
|
}
|
|
122
119
|
return index;
|
|
123
120
|
}
|
|
124
|
-
/**
|
|
121
|
+
/** Returns true if the x,y components are both small by metric metric tolerance */
|
|
125
122
|
get isAlmostZero() {
|
|
126
123
|
return Geometry.isSmallMetricDistance(this.x) && Geometry.isSmallMetricDistance(this.y);
|
|
127
124
|
}
|
|
@@ -137,11 +134,11 @@ export class XY {
|
|
|
137
134
|
magnitudeSquared() {
|
|
138
135
|
return this.x * this.x + this.y * this.y;
|
|
139
136
|
}
|
|
140
|
-
/**
|
|
137
|
+
/** Returns true if the x,y components are exactly equal. */
|
|
141
138
|
isExactEqual(other) {
|
|
142
139
|
return this.x === other.x && this.y === other.y;
|
|
143
140
|
}
|
|
144
|
-
/**
|
|
141
|
+
/** Returns true if x,y match `other` within metric tolerance */
|
|
145
142
|
isAlmostEqualMetric(other, distanceTol = Geometry.smallMetricDistance) {
|
|
146
143
|
return this.maxDiff(other) <= distanceTol;
|
|
147
144
|
}
|
|
@@ -153,7 +150,7 @@ export class XY {
|
|
|
153
150
|
unitVectorTo(other, result) {
|
|
154
151
|
return this.vectorTo(other, result).normalize(result);
|
|
155
152
|
}
|
|
156
|
-
/**
|
|
153
|
+
/** Cross product of vectors from origin to targets */
|
|
157
154
|
static crossProductToPoints(origin, targetA, targetB) {
|
|
158
155
|
return Geometry.crossProductXYXY(targetA.x - origin.x, targetA.y - origin.y, targetB.x - origin.x, targetB.y - origin.y);
|
|
159
156
|
}
|
|
@@ -166,7 +163,7 @@ export class Point2d extends XY {
|
|
|
166
163
|
constructor(x = 0, y = 0) {
|
|
167
164
|
super(x, y);
|
|
168
165
|
}
|
|
169
|
-
/**
|
|
166
|
+
/** Return a new Point2d with x,y coordinates from this. */
|
|
170
167
|
clone(result) {
|
|
171
168
|
return Point2d.create(this.x, this.y, result);
|
|
172
169
|
}
|
|
@@ -188,7 +185,7 @@ export class Point2d extends XY {
|
|
|
188
185
|
* Set x and y from a JSON input such as `[1,2]` or `{x:1, y:2}`
|
|
189
186
|
* * If no JSON input is provided, 0 would be used as default values for x and y.
|
|
190
187
|
* @param json the JSON input
|
|
191
|
-
|
|
188
|
+
*/
|
|
192
189
|
static fromJSON(json) {
|
|
193
190
|
const val = new Point2d();
|
|
194
191
|
val.setFromJSON(json);
|
|
@@ -204,7 +201,8 @@ export class Point2d extends XY {
|
|
|
204
201
|
static createZero(result) {
|
|
205
202
|
return Point2d.create(0, 0, result);
|
|
206
203
|
}
|
|
207
|
-
/**
|
|
204
|
+
/**
|
|
205
|
+
* Starting at this point, move along vector by tangentFraction of the vector length, and then
|
|
208
206
|
* to the left by leftFraction of the perpendicular vector length.
|
|
209
207
|
* @param tangentFraction distance to move along the vector, as a fraction of vector
|
|
210
208
|
* @param leftFraction distance to move perpendicular to the vector, as a fraction of the rotated vector
|
|
@@ -215,7 +213,8 @@ export class Point2d extends XY {
|
|
|
215
213
|
const dy = vector.y;
|
|
216
214
|
return Point2d.create(this.x + tangentFraction * dx - leftFraction * dy, this.y + tangentFraction * dy + leftFraction * dx);
|
|
217
215
|
}
|
|
218
|
-
/**
|
|
216
|
+
/**
|
|
217
|
+
* Interpolate at tangentFraction between this instance and point, and then Move by leftFraction
|
|
219
218
|
* along the xy perpendicular of the vector between the points.
|
|
220
219
|
*/
|
|
221
220
|
forwardLeftInterpolate(tangentFraction, leftFraction, point) {
|
|
@@ -278,7 +277,8 @@ export class Point2d extends XY {
|
|
|
278
277
|
const y2 = target2.y - this.y;
|
|
279
278
|
return x1 * y2 - y1 * x2;
|
|
280
279
|
}
|
|
281
|
-
/**
|
|
280
|
+
/**
|
|
281
|
+
* Return the fractional coordinate of the projection of this instance x,y onto the
|
|
282
282
|
* line from startPoint to endPoint.
|
|
283
283
|
* @param startPoint start point of line
|
|
284
284
|
* @param endPoint end point of line
|
|
@@ -292,7 +292,8 @@ export class Point2d extends XY {
|
|
|
292
292
|
return numerator / denominator;
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
|
-
/**
|
|
295
|
+
/**
|
|
296
|
+
* 2D vector with `x`,`y` as properties
|
|
296
297
|
* @public
|
|
297
298
|
*/
|
|
298
299
|
export class Vector2d extends XY {
|
|
@@ -330,7 +331,7 @@ export class Vector2d extends XY {
|
|
|
330
331
|
static createZero(result) {
|
|
331
332
|
return Vector2d.create(0, 0, result);
|
|
332
333
|
}
|
|
333
|
-
/**
|
|
334
|
+
/** Copy contents from another Point3d, Point2d, Vector2d, or Vector3d, or leading entries of Float64Array */
|
|
334
335
|
static createFrom(data, result) {
|
|
335
336
|
if (data instanceof Float64Array) {
|
|
336
337
|
if (data.length >= 2)
|
|
@@ -345,7 +346,7 @@ export class Vector2d extends XY {
|
|
|
345
346
|
* Set x and y from a JSON input such as `[1,2]` or `{x:1, y:2}`
|
|
346
347
|
* * If no JSON input is provided, 0 would be used as default values for x and y.
|
|
347
348
|
* @param json the JSON input
|
|
348
|
-
|
|
349
|
+
*/
|
|
349
350
|
static fromJSON(json) {
|
|
350
351
|
const val = new Vector2d();
|
|
351
352
|
val.setFromJSON(json);
|
|
@@ -377,7 +378,8 @@ export class Vector2d extends XY {
|
|
|
377
378
|
}
|
|
378
379
|
return undefined;
|
|
379
380
|
}
|
|
380
|
-
/**
|
|
381
|
+
/**
|
|
382
|
+
* Return a (new or optionally reused) vector which is `this` divided by `denominator`
|
|
381
383
|
* * return undefined if denominator is zero.
|
|
382
384
|
*/
|
|
383
385
|
safeDivideOrNull(denominator, result) {
|
|
@@ -398,7 +400,7 @@ export class Vector2d extends XY {
|
|
|
398
400
|
* it's returning the length of the projection as a fraction of the target magnitude.
|
|
399
401
|
* @param target the target vector
|
|
400
402
|
* @param defaultFraction the returned value in case magnitude square of target vector is very small
|
|
401
|
-
|
|
403
|
+
*/
|
|
402
404
|
fractionOfProjectionToVector(target, defaultFraction) {
|
|
403
405
|
/*
|
|
404
406
|
* projection length is (this.target)/||target||
|
|
@@ -453,7 +455,7 @@ export class Vector2d extends XY {
|
|
|
453
455
|
}
|
|
454
456
|
return result;
|
|
455
457
|
}
|
|
456
|
-
/**
|
|
458
|
+
/** Return a new Vector2d rotated CCW by given angle */
|
|
457
459
|
rotateXY(angle, result) {
|
|
458
460
|
const s = angle.sin();
|
|
459
461
|
const c = angle.cos();
|
|
@@ -465,7 +467,8 @@ export class Vector2d extends XY {
|
|
|
465
467
|
result.y = xx * s + yy * c;
|
|
466
468
|
return result;
|
|
467
469
|
}
|
|
468
|
-
/**
|
|
470
|
+
/**
|
|
471
|
+
* Return a vector computed at fractional position between this vector and vectorB
|
|
469
472
|
* @param fraction fractional position. 0 is at `this`. 1 is at `vectorB`.
|
|
470
473
|
* True fractions are "between", negatives are "before this", beyond 1 is "beyond vectorB".
|
|
471
474
|
* @param vectorB second vector
|
|
@@ -488,14 +491,14 @@ export class Vector2d extends XY {
|
|
|
488
491
|
}
|
|
489
492
|
return result;
|
|
490
493
|
}
|
|
491
|
-
/**
|
|
494
|
+
/** Return {this + vector}. */
|
|
492
495
|
plus(vector, result) {
|
|
493
496
|
result = result ? result : new Vector2d();
|
|
494
497
|
result.x = this.x + vector.x;
|
|
495
498
|
result.y = this.y + vector.y;
|
|
496
499
|
return result;
|
|
497
500
|
}
|
|
498
|
-
/**
|
|
501
|
+
/** Return {this - vector}. */
|
|
499
502
|
minus(vector, result) {
|
|
500
503
|
result = result ? result : new Vector2d();
|
|
501
504
|
result.x = this.x - vector.x;
|
|
@@ -530,34 +533,34 @@ export class Vector2d extends XY {
|
|
|
530
533
|
result.y = this.y * scale;
|
|
531
534
|
return result;
|
|
532
535
|
}
|
|
533
|
-
/**
|
|
536
|
+
/** Return a vector parallel to this but with specified length */
|
|
534
537
|
scaleToLength(length, result) {
|
|
535
538
|
const mag = Geometry.correctSmallMetricDistance(this.magnitude());
|
|
536
539
|
if (mag === 0)
|
|
537
540
|
return undefined;
|
|
538
541
|
return this.scale(length / mag, result);
|
|
539
542
|
}
|
|
540
|
-
/**
|
|
543
|
+
/** Return the dot product of this with vectorB */
|
|
541
544
|
dotProduct(vectorB) {
|
|
542
545
|
return this.x * vectorB.x + this.y * vectorB.y;
|
|
543
546
|
}
|
|
544
|
-
/**
|
|
547
|
+
/** Dot product with vector from pointA to pointB */
|
|
545
548
|
dotProductStartEnd(pointA, pointB) {
|
|
546
549
|
return this.x * (pointB.x - pointA.x) + this.y * (pointB.y - pointA.y);
|
|
547
550
|
}
|
|
548
|
-
/**
|
|
551
|
+
/** Vector cross product {this CROSS vectorB} */
|
|
549
552
|
crossProduct(vectorB) {
|
|
550
553
|
return this.x * vectorB.y - this.y * vectorB.x;
|
|
551
554
|
}
|
|
552
555
|
/**
|
|
553
|
-
*
|
|
556
|
+
* Return the radians (as a simple number, not strongly typed Angle) signed angle from this to vectorB.
|
|
554
557
|
* This is positive if the shortest turn is counterclockwise, negative if clockwise.
|
|
555
558
|
*/
|
|
556
559
|
radiansTo(vectorB) {
|
|
557
560
|
return Math.atan2(this.crossProduct(vectorB), this.dotProduct(vectorB));
|
|
558
561
|
}
|
|
559
562
|
/**
|
|
560
|
-
*
|
|
563
|
+
* Return the (strongly typed) signed angle from this to vectorB.
|
|
561
564
|
* This is positive if the shortest turn is counterclockwise, negative if clockwise.
|
|
562
565
|
*/
|
|
563
566
|
angleTo(vectorB) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Point2dVector2d.js","sourceRoot":"","sources":["../../../src/geometry3d/Point2dVector2d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,qBAAqB;AACrB,mBAAmB;AAEnB,OAAO,EAAmB,QAAQ,EAAuB,MAAM,aAAa,CAAC;AAC7E,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC;;;;;;GAMG;AACH,MAAM,OAAO,EAAE;IAKb,wBAAwB;IACjB,GAAG,CAAC,IAAY,CAAC,EAAE,IAAY,CAAC;QACrC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;IACD,+BAA+B;IACxB,OAAO;QACZ,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;IACD,YAAsB,IAAY,CAAC,EAAE,IAAY,CAAC;QAChD,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;IACD,mCAAmC;IAC5B,OAAO,CAAC,KAAa;QAC1B,IAAI,KAAK,EAAE;YACT,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;YACjB,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;SAClB;aAAM;YACL,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;YACX,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;SACZ;IACH,CAAC;IACD,8CAA8C;IACvC,MAAM;QACX,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IACD,+FAA+F;IACxF,aAAa,CAAC,KAAY,EAAE,GAAY;QAC7C,OAAO,QAAQ,CAAC,gBAAgB,CAAC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AiB,CAAC,KAAe,EAAE,mCAA4C,KAAK,EAAE,OAA6B;QACxH,MAAM,gBAAgB,GAAW,OAAO,EAAE,gBAAgB,IAAI,QAAQ,CAAC,wBAAwB,CAAC;QAChG,MAAM,kBAAkB,GAAW,OAAO,EAAE,kBAAkB,IAAI,QAAQ,CAAC,0BAA0B,CAAC;QACtG,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACnC,MAAM,EAAE,GAAG,KAAK,CAAC,gBAAgB,EAAE,CAAC;QACpC,IAAI,EAAE,GAAG,kBAAkB,IAAI,EAAE,GAAG,kBAAkB;YACpD,OAAO,gCAAgC,CAAC;QAC1C,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAClC,OAAO,EAAE,GAAG,EAAE,IAAI,gBAAgB,GAAG,EAAE,GAAG,EAAE,CAAC;IAC/C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\n// cspell:word JSONXY\r\n// cspell:word CWXY\r\n\r\nimport { BeJSONFunctions, Geometry, PerpParallelOptions } from \"../Geometry\";\r\nimport { Angle } from \"./Angle\";\r\nimport { XAndY, XYProps } from \"./XYZProps\";\r\n\r\n/** Minimal object containing x,y and operations that are meaningful without change in both point and vector.\r\n * * `XY` is not instantiable.\r\n * * The derived (instantiable) classes are\r\n * * `Point2d`\r\n * * `Vector2d`\r\n * @public\r\n */\r\nexport class XY implements XAndY {\r\n /** x component */\r\n public x: number;\r\n /** y component */\r\n public y: number;\r\n /** Set both x and y. */\r\n public set(x: number = 0, y: number = 0) {\r\n this.x = x;\r\n this.y = y;\r\n }\r\n /** Set both x and y to zero */\r\n public setZero() {\r\n this.x = 0;\r\n this.y = 0;\r\n }\r\n protected constructor(x: number = 0, y: number = 0) {\r\n this.x = x;\r\n this.y = y;\r\n }\r\n /** Set both x and y from other. */\r\n public setFrom(other?: XAndY) {\r\n if (other) {\r\n this.x = other.x;\r\n this.y = other.y;\r\n } else {\r\n this.x = 0;\r\n this.y = 0;\r\n }\r\n }\r\n /** Freeze this instance so it is read-only */\r\n public freeze(): Readonly<this> {\r\n return Object.freeze(this);\r\n }\r\n /** Returns true if this and other have equal x,y parts within Geometry.smallMetricDistance. */\r\n public isAlmostEqual(other: XAndY, tol?: number): boolean {\r\n return Geometry.isSameCoordinate(this.x, other.x, tol) && Geometry.isSameCoordinate(this.y, other.y, tol);\r\n }\r\n /** Returns true if this and other have equal x,y parts within Geometry.smallMetricDistance. */\r\n public isAlmostEqualXY(x: number, y: number, tol?: number): boolean {\r\n return Geometry.isSameCoordinate(this.x, x, tol) && Geometry.isSameCoordinate(this.y, y, tol);\r\n }\r\n /** return a json array `[x,y]` */\r\n public toJSON(): XYProps {\r\n return [this.x, this.y];\r\n }\r\n /** return a json object `{x: 1, y:2}` */\r\n public toJSONXY(): XYProps {\r\n return { x: this.x, y: this.y };\r\n }\r\n /**\r\n * Set x and y from a JSON input such as `[1,2]` or `{x:1, y:2}`\r\n * * If no JSON input is provided, 0 would be used as default values for x and y.\r\n * @param json the JSON input\r\n * */\r\n public setFromJSON(json?: XYProps): void {\r\n if (Array.isArray(json)) {\r\n this.set(json[0] || 0, json[1] || 0);\r\n return;\r\n }\r\n if (json) {\r\n this.set(json.x || 0, json.y || 0);\r\n return;\r\n }\r\n this.set(0, 0);\r\n }\r\n /** Return the distance from this point to other */\r\n public distance(other: XAndY): number {\r\n const xDist = other.x - this.x;\r\n const yDist = other.y - this.y;\r\n return Math.sqrt(xDist * xDist + yDist * yDist);\r\n }\r\n /** Return squared distance from this point to other */\r\n public distanceSquared(other: XAndY): number {\r\n const xDist = other.x - this.x;\r\n const yDist = other.y - this.y;\r\n return xDist * xDist + yDist * yDist;\r\n }\r\n /** Return the largest absolute distance between corresponding components */\r\n public maxDiff(other: XAndY): number {\r\n return Math.max(Math.abs(this.x - other.x), Math.abs(this.y - other.y));\r\n }\r\n /**\r\n * Return the x,y component corresponding to 0,1.\r\n */\r\n public at(index: number): number {\r\n if (index < 0.5)\r\n return this.x;\r\n return this.y;\r\n }\r\n /**\r\n * Set value at index 0 or 1.\r\n */\r\n public setAt(index: number, value: number): void {\r\n if (index < 0.5)\r\n this.x = value;\r\n else\r\n this.y = value;\r\n }\r\n /** Return the index (0,1) of the x,y component with largest absolute value */\r\n public indexOfMaxAbs(): number {\r\n let index = 0;\r\n const a = Math.abs(this.x);\r\n const b = Math.abs(this.y);\r\n if (b > a) {\r\n index = 1;\r\n }\r\n return index;\r\n }\r\n /** returns true if the x,y components are both small by metric metric tolerance */\r\n public get isAlmostZero(): boolean {\r\n return Geometry.isSmallMetricDistance(this.x) && Geometry.isSmallMetricDistance(this.y);\r\n }\r\n /** Return the largest absolute value of any component */\r\n public maxAbs(): number {\r\n return Math.max(Math.abs(this.x), Math.abs(this.y));\r\n }\r\n /** Return the magnitude of the vector */\r\n public magnitude(): number {\r\n return Math.sqrt(this.x * this.x + this.y * this.y);\r\n }\r\n /** Return the squared magnitude of the vector. */\r\n public magnitudeSquared(): number {\r\n return this.x * this.x + this.y * this.y;\r\n }\r\n /** returns true if the x,y components are exactly equal. */\r\n public isExactEqual(other: XAndY): boolean {\r\n return this.x === other.x && this.y === other.y;\r\n }\r\n /** returns true if x,y match `other` within metric tolerance */\r\n public isAlmostEqualMetric(other: XAndY, distanceTol: number = Geometry.smallMetricDistance): boolean {\r\n return this.maxDiff(other) <= distanceTol;\r\n }\r\n /** Return a (full length) vector from this point to other */\r\n public vectorTo(other: XAndY, result?: Vector2d): Vector2d {\r\n return Vector2d.create(\r\n other.x - this.x,\r\n other.y - this.y,\r\n result);\r\n }\r\n /** Return a unit vector from this point to other */\r\n public unitVectorTo(other: XAndY, result?: Vector2d): Vector2d | undefined {\r\n return this.vectorTo(other, result).normalize(result);\r\n }\r\n /** cross product of vectors from origin to targets */\r\n public static crossProductToPoints(origin: XAndY, targetA: XAndY, targetB: XAndY): number {\r\n return Geometry.crossProductXYXY(\r\n targetA.x - origin.x, targetA.y - origin.y, targetB.x - origin.x, targetB.y - origin.y);\r\n }\r\n}\r\n\r\n/** 2D point with `x`,`y` as properties\r\n * @public\r\n */\r\nexport class Point2d extends XY implements BeJSONFunctions {\r\n /** Constructor for Point2d */\r\n constructor(x: number = 0, y: number = 0) {\r\n super(x, y);\r\n }\r\n /** return a new Point2d with x,y coordinates from this. */\r\n public clone(result?: Point2d): Point2d {\r\n return Point2d.create(this.x, this.y, result);\r\n }\r\n /**\r\n * Return a point (newly created unless result provided) with given x,y coordinates\r\n * @param x x coordinate\r\n * @param y y coordinate\r\n * @param result optional result\r\n */\r\n public static create(x: number = 0, y: number = 0, result?: Point2d): Point2d {\r\n if (result) {\r\n result.x = x;\r\n result.y = y;\r\n return result;\r\n }\r\n return new Point2d(x, y);\r\n }\r\n /**\r\n * Set x and y from a JSON input such as `[1,2]` or `{x:1, y:2}`\r\n * * If no JSON input is provided, 0 would be used as default values for x and y.\r\n * @param json the JSON input\r\n * */\r\n public static fromJSON(json?: XYProps): Point2d {\r\n const val = new Point2d();\r\n val.setFromJSON(json);\r\n return val;\r\n }\r\n /** Create (or optionally reuse) a Point2d from another object with fields x and y */\r\n public static createFrom(xy: XAndY | undefined, result?: Point2d): Point2d {\r\n if (xy)\r\n return Point2d.create(xy.x, xy.y, result);\r\n return Point2d.create(0, 0, result);\r\n }\r\n /** Create a Point2d with both coordinates zero. */\r\n public static createZero(result?: Point2d): Point2d {\r\n return Point2d.create(0, 0, result);\r\n }\r\n /** Starting at this point, move along vector by tangentFraction of the vector length, and then\r\n * to the left by leftFraction of the perpendicular vector length.\r\n * @param tangentFraction distance to move along the vector, as a fraction of vector\r\n * @param leftFraction distance to move perpendicular to the vector, as a fraction of the rotated vector\r\n * @param vector the other vector\r\n */\r\n public addForwardLeft(tangentFraction: number, leftFraction: number, vector: Vector2d): Point2d {\r\n const dx = vector.x;\r\n const dy = vector.y;\r\n return Point2d.create(\r\n this.x + tangentFraction * dx - leftFraction * dy,\r\n this.y + tangentFraction * dy + leftFraction * dx\r\n );\r\n }\r\n /** Interpolate at tangentFraction between this instance and point, and then Move by leftFraction\r\n * along the xy perpendicular of the vector between the points.\r\n */\r\n public forwardLeftInterpolate(tangentFraction: number, leftFraction: number, point: XAndY): Point2d {\r\n const dx = point.x - this.x;\r\n const dy = point.y - this.y;\r\n return Point2d.create(\r\n this.x + tangentFraction * dx - leftFraction * dy,\r\n this.y + tangentFraction * dy + leftFraction * dx\r\n );\r\n }\r\n /** Return a point interpolated between this point and the right param. */\r\n public interpolate(fraction: number, other: XAndY, result?: Point2d): Point2d {\r\n if (fraction <= 0.5)\r\n return Point2d.create(\r\n this.x + fraction * (other.x - this.x),\r\n this.y + fraction * (other.y - this.y),\r\n result\r\n );\r\n const t: number = fraction - 1.0;\r\n return Point2d.create(\r\n other.x + t * (other.x - this.x),\r\n other.y + t * (other.y - this.y),\r\n result\r\n );\r\n }\r\n /** Return a point with independent x,y fractional interpolation. */\r\n public interpolateXY(fractionX: number, fractionY: number, other: XAndY, result?: Point2d): Point2d {\r\n return Point2d.create(\r\n Geometry.interpolate(this.x, fractionX, other.x),\r\n Geometry.interpolate(this.y, fractionY, other.y),\r\n result\r\n );\r\n }\r\n /** Return this point minus vector */\r\n public minus(vector: XAndY, result?: Point2d): Point2d {\r\n return Point2d.create(\r\n this.x - vector.x,\r\n this.y - vector.y,\r\n result\r\n );\r\n }\r\n /** Return point plus vector */\r\n public plus(vector: XAndY, result?: Point2d): Point2d {\r\n return Point2d.create(\r\n this.x + vector.x,\r\n this.y + vector.y,\r\n result\r\n );\r\n }\r\n /** Return point plus vector */\r\n public plusXY(dx: number = 0, dy: number = 0, result?: Point2d): Point2d {\r\n return Point2d.create(\r\n this.x + dx,\r\n this.y + dy, result\r\n );\r\n }\r\n /** Return point + vector * scalar */\r\n public plusScaled(vector: XAndY, scaleFactor: number, result?: Point2d): Point2d {\r\n return Point2d.create(\r\n this.x + vector.x * scaleFactor,\r\n this.y + vector.y * scaleFactor,\r\n result\r\n );\r\n }\r\n /** Return point + vectorA * scalarA + vectorB * scalarB */\r\n public plus2Scaled(vectorA: XAndY, scalarA: number, vectorB: XAndY, scalarB: number, result?: Point2d): Point2d {\r\n return Point2d.create(\r\n this.x + vectorA.x * scalarA + vectorB.x * scalarB,\r\n this.y + vectorA.y * scalarA + vectorB.y * scalarB,\r\n result\r\n );\r\n }\r\n /** Return point + vectorA * scalarA + vectorB * scalarB + vectorC * scalarC */\r\n public plus3Scaled(vectorA: XAndY, scalarA: number, vectorB: XAndY, scalarB: number,\r\n vectorC: XAndY, scalarC: number, result?: Point2d): Point2d {\r\n return Point2d.create(\r\n this.x + vectorA.x * scalarA + vectorB.x * scalarB + vectorC.x * scalarC,\r\n this.y + vectorA.y * scalarA + vectorB.y * scalarB + vectorC.y * scalarC,\r\n result\r\n );\r\n }\r\n /**\r\n * Return the dot product of vector from this to targetA and vector from this to targetB\r\n * @param targetA target of first vector\r\n * @param targetB target of second vector\r\n */\r\n public dotVectorsToTargets(targetA: XAndY, targetB: XAndY): number {\r\n return (targetA.x - this.x) * (targetB.x - this.x) + (targetA.y - this.y) * (targetB.y - this.y);\r\n }\r\n /**\r\n * Returns the (scalar) cross product of vector from this to targetA and vector from this to targetB\r\n * @param target1 target of first vector\r\n * @param target2 target of second vector\r\n */\r\n public crossProductToPoints(target1: XAndY, target2: XAndY): number {\r\n const x1 = target1.x - this.x;\r\n const y1 = target1.y - this.y;\r\n const x2 = target2.x - this.x;\r\n const y2 = target2.y - this.y;\r\n return x1 * y2 - y1 * x2;\r\n }\r\n /** Return the fractional coordinate of the projection of this instance x,y onto the\r\n * line from startPoint to endPoint.\r\n * @param startPoint start point of line\r\n * @param endPoint end point of line\r\n * @param defaultFraction fraction to return if startPoint and endPoint are equal.\r\n */\r\n public fractionOfProjectionToLine(startPoint: Point2d, endPoint: Point2d, defaultFraction: number = 0): number {\r\n const denominator = startPoint.distanceSquared(endPoint);\r\n if (denominator < Geometry.smallMetricDistanceSquared)\r\n return defaultFraction;\r\n const numerator = startPoint.dotVectorsToTargets(endPoint, this);\r\n return numerator / denominator;\r\n }\r\n}\r\n\r\n/** 2D vector with `x`,`y` as properties\r\n * @public\r\n */\r\nexport class Vector2d extends XY implements BeJSONFunctions {\r\n constructor(x: number = 0, y: number = 0) {\r\n super(x, y);\r\n }\r\n /** Return a new Vector2d with the same x,y */\r\n public clone(result?: Vector2d): Vector2d {\r\n return Vector2d.create(this.x, this.y, result);\r\n }\r\n /** Return a new Vector2d with given x and y */\r\n public static create(x: number = 0, y: number = 0, result?: Vector2d): Vector2d {\r\n if (result) {\r\n result.x = x;\r\n result.y = y;\r\n return result;\r\n }\r\n return new Vector2d(x, y);\r\n }\r\n /**\r\n * Return a (new) Vector2d with components scale,0\r\n * If scale is not given default value 1 is used.\r\n */\r\n public static unitX(scale: number = 1): Vector2d {\r\n return new Vector2d(scale, 0);\r\n }\r\n /**\r\n * Return a (new) Vector2d with components 0,scale\r\n * If scale is not given default value 1 is used.\r\n */\r\n public static unitY(scale: number = 1): Vector2d {\r\n return new Vector2d(0, scale);\r\n }\r\n /** Return a Vector2d with components 0,0 */\r\n public static createZero(result?: Vector2d): Vector2d {\r\n return Vector2d.create(0, 0, result);\r\n }\r\n /** copy contents from another Point3d, Point2d, Vector2d, or Vector3d, or leading entries of Float64Array */\r\n public static createFrom(data: XAndY | Float64Array, result?: Vector2d): Vector2d {\r\n if (data instanceof Float64Array) {\r\n if (data.length >= 2)\r\n return Vector2d.create(data[0], data[1]);\r\n if (data.length >= 1)\r\n return Vector2d.create(data[0], 0);\r\n return Vector2d.create(0, 0);\r\n }\r\n return Vector2d.create(data.x, data.y, result);\r\n }\r\n /**\r\n * Set x and y from a JSON input such as `[1,2]` or `{x:1, y:2}`\r\n * * If no JSON input is provided, 0 would be used as default values for x and y.\r\n * @param json the JSON input\r\n * */\r\n public static fromJSON(json?: XYProps): Vector2d {\r\n const val = new Vector2d();\r\n val.setFromJSON(json);\r\n return val;\r\n }\r\n /** Return a new Vector2d from polar coordinates for radius and Angle from x axis */\r\n public static createPolar(r: number, theta: Angle): Vector2d {\r\n return Vector2d.create(r * theta.cos(), r * theta.sin());\r\n }\r\n /** Return a new Vector2d extending from point0 to point1 */\r\n public static createStartEnd(point0: XAndY, point1: XAndY, result?: Vector2d): Vector2d {\r\n return Vector2d.create(point1.x - point0.x, point1.y - point0.y, result);\r\n }\r\n /**\r\n * Return a vector that bisects the angle between two normals and extends to the intersection of two offset lines\r\n * * returns `undefined` if `unitPerpA = -unitPerpB` (i.e., are opposite)\r\n * * math details can be found at docs/learning/geometry/PointVector.md\r\n * @param unitPerpA unit perpendicular to incoming direction\r\n * @param unitPerpB unit perpendicular to outgoing direction\r\n * @param offset offset distance\r\n */\r\n public static createOffsetBisector(unitPerpA: Vector2d, unitPerpB: Vector2d, offset: number): Vector2d | undefined {\r\n let bisector: Vector2d | undefined = unitPerpA.plus(unitPerpB);\r\n bisector = bisector.normalize();\r\n if (bisector) {\r\n const c = bisector.dotProduct(unitPerpA);\r\n bisector.scale(offset, bisector);\r\n return bisector.safeDivideOrNull(c);\r\n }\r\n return undefined;\r\n }\r\n /** Return a (new or optionally reused) vector which is `this` divided by `denominator`\r\n * * return undefined if denominator is zero.\r\n */\r\n public safeDivideOrNull(denominator: number, result?: Vector2d): Vector2d | undefined {\r\n if (denominator !== 0.0) {\r\n return this.scale(1.0 / denominator, result);\r\n }\r\n return undefined;\r\n }\r\n /** Return a unit vector in direction of this instance (undefined if this instance has near zero length) */\r\n public normalize(result?: Vector2d): Vector2d | undefined {\r\n const mag = Geometry.correctSmallMetricDistance(this.magnitude());\r\n result = result ? result : new Vector2d();\r\n return this.safeDivideOrNull(mag, result);\r\n }\r\n /**\r\n * Return fractional projection of target vector onto this\r\n * * It's returning the signed projection magnitude divided by the target magnitude. In other words,\r\n * it's returning the length of the projection as a fraction of the target magnitude.\r\n * @param target the target vector\r\n * @param defaultFraction the returned value in case magnitude square of target vector is very small\r\n * */\r\n public fractionOfProjectionToVector(target: Vector2d, defaultFraction?: number): number {\r\n /*\r\n * projection length is (this.target)/||target||\r\n * but here we return (this.target)/||target||^2\r\n */\r\n const denominator = target.magnitudeSquared();\r\n if (denominator < Geometry.smallMetricDistanceSquared)\r\n return defaultFraction ? defaultFraction : 0;\r\n const numerator = this.dotProduct(target);\r\n return numerator / denominator;\r\n }\r\n /** Return a new vector with components negated from this instance. */\r\n public negate(result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n result.x = -this.x;\r\n result.y = -this.y;\r\n return result;\r\n }\r\n /** Return a vector same length as this but rotated 90 degrees counter clockwise */\r\n public rotate90CCWXY(result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n // save x,y to allow aliasing (\"this\" can be passed to the function as \"result\")\r\n const xx: number = this.x;\r\n const yy: number = this.y;\r\n result.x = -yy;\r\n result.y = xx;\r\n return result;\r\n }\r\n /** Return a vector same length as this but rotated 90 degrees clockwise */\r\n public rotate90CWXY(result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n // save x,y to allow aliasing (\"this\" can be passed to the function as \"result\")\r\n const xx: number = this.x;\r\n const yy: number = this.y;\r\n result.x = yy;\r\n result.y = -xx;\r\n return result;\r\n }\r\n /** Return a unit vector perpendicular to this instance. */\r\n public unitPerpendicularXY(result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n const xx: number = this.x;\r\n const yy: number = this.y;\r\n // save x,y to allow aliasing (\"this\" can be passed to the function as \"result\")\r\n result.x = -yy;\r\n result.y = xx;\r\n const d2: number = xx * xx + yy * yy;\r\n if (d2 !== 0.0) {\r\n const a = 1.0 / Math.sqrt(d2);\r\n result.x *= a;\r\n result.y *= a;\r\n }\r\n return result;\r\n }\r\n /** return a new Vector2d rotated CCW by given angle */\r\n public rotateXY(angle: Angle, result?: Vector2d): Vector2d {\r\n const s = angle.sin();\r\n const c = angle.cos();\r\n // save x,y to allow aliasing (\"this\" can be passed to the function as \"result\")\r\n const xx: number = this.x;\r\n const yy: number = this.y;\r\n result = result ? result : new Vector2d();\r\n result.x = xx * c - yy * s;\r\n result.y = xx * s + yy * c;\r\n return result;\r\n }\r\n /** Return a vector computed at fractional position between this vector and vectorB\r\n * @param fraction fractional position. 0 is at `this`. 1 is at `vectorB`.\r\n * True fractions are \"between\", negatives are \"before this\", beyond 1 is \"beyond vectorB\".\r\n * @param vectorB second vector\r\n * @param result optional preallocated result.\r\n */\r\n public interpolate(fraction: number, vectorB: Vector2d, result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n /*\r\n * For best last-bit behavior, if fraction is below 0.5, use this as base point.\r\n * If above 0.5, use vectorB as base point.\r\n */\r\n if (fraction <= 0.5) {\r\n result.x = this.x + fraction * (vectorB.x - this.x);\r\n result.y = this.y + fraction * (vectorB.y - this.y);\r\n } else {\r\n const t: number = fraction - 1.0;\r\n result.x = vectorB.x + t * (vectorB.x - this.x);\r\n result.y = vectorB.y + t * (vectorB.y - this.y);\r\n }\r\n return result;\r\n }\r\n /** return {this + vector}. */\r\n public plus(vector: XAndY, result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n result.x = this.x + vector.x;\r\n result.y = this.y + vector.y;\r\n return result;\r\n }\r\n /** return {this - vector}. */\r\n public minus(vector: XAndY, result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n result.x = this.x - vector.x;\r\n result.y = this.y - vector.y;\r\n return result;\r\n }\r\n /** Return {point + vector \\* scalar} */\r\n public plusScaled(vector: XAndY, scaleFactor: number, result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n result.x = this.x + vector.x * scaleFactor;\r\n result.y = this.y + vector.y * scaleFactor;\r\n return result;\r\n }\r\n /** Return {point + vectorA \\* scalarA + vectorB \\* scalarB} */\r\n public plus2Scaled(vectorA: XAndY, scalarA: number, vectorB: XAndY, scalarB: number, result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n result.x = this.x + vectorA.x * scalarA + vectorB.x * scalarB;\r\n result.y = this.y + vectorA.y * scalarA + vectorB.y * scalarB;\r\n return result;\r\n }\r\n /** Return {this + vectorA \\* scalarA + vectorB \\* scalarB + vectorC \\* scalarC} */\r\n public plus3Scaled(vectorA: XAndY, scalarA: number, vectorB: XAndY, scalarB: number, vectorC: XAndY, scalarC: number, result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n result.x = this.x + vectorA.x * scalarA + vectorB.x * scalarB + vectorC.x * scalarC;\r\n result.y = this.y + vectorA.y * scalarA + vectorB.y * scalarB + vectorC.y * scalarC;\r\n return result;\r\n }\r\n /** Return {this * scale} */\r\n public scale(scale: number, result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n result.x = this.x * scale;\r\n result.y = this.y * scale;\r\n return result;\r\n }\r\n /** return a vector parallel to this but with specified length */\r\n public scaleToLength(length: number, result?: Vector2d): Vector2d | undefined {\r\n const mag = Geometry.correctSmallMetricDistance(this.magnitude());\r\n if (mag === 0)\r\n return undefined;\r\n return this.scale(length / mag, result);\r\n }\r\n /** return the dot product of this with vectorB */\r\n public dotProduct(vectorB: XAndY): number {\r\n return this.x * vectorB.x + this.y * vectorB.y;\r\n }\r\n /** dot product with vector from pointA to pointB */\r\n public dotProductStartEnd(pointA: XAndY, pointB: XAndY): number {\r\n return this.x * (pointB.x - pointA.x) + this.y * (pointB.y - pointA.y);\r\n }\r\n /** vector cross product {this CROSS vectorB} */\r\n public crossProduct(vectorB: XAndY): number {\r\n return this.x * vectorB.y - this.y * vectorB.x;\r\n }\r\n /**\r\n * return the radians (as a simple number, not strongly typed Angle) signed angle from this to vectorB.\r\n * This is positive if the shortest turn is counterclockwise, negative if clockwise.\r\n */\r\n public radiansTo(vectorB: XAndY): number {\r\n return Math.atan2(this.crossProduct(vectorB), this.dotProduct(vectorB));\r\n }\r\n /**\r\n * return the (strongly typed) signed angle from this to vectorB.\r\n * This is positive if the shortest turn is counterclockwise, negative if clockwise.\r\n */\r\n public angleTo(vectorB: XAndY): Angle {\r\n return Angle.createRadians(this.radiansTo(vectorB));\r\n }\r\n /**\r\n * Test if this vector is parallel to other.\r\n * * The input tolerances in `options`, if given, are considered to be squared for efficiency's sake,\r\n * so if you have a distance or angle tolerance t, you should pass in t * t.\r\n * @param other second vector for comparison.\r\n * @param oppositeIsParallel whether to consider diametrically opposed vectors as parallel.\r\n * @param options optional radian and distance tolerances.\r\n */\r\n public isParallelTo(other: Vector2d, oppositeIsParallel: boolean = false,\r\n returnValueIfAnInputIsZeroLength: boolean = false, options?: PerpParallelOptions): boolean {\r\n const radianSquaredTol: number = options?.radianSquaredTol ?? Geometry.smallAngleRadiansSquared;\r\n const distanceSquaredTol: number = options?.distanceSquaredTol ?? Geometry.smallMetricDistanceSquared;\r\n const a2 = this.magnitudeSquared();\r\n const b2 = other.magnitudeSquared();\r\n if (a2 < distanceSquaredTol || b2 < distanceSquaredTol)\r\n return returnValueIfAnInputIsZeroLength;\r\n const dot = this.dotProduct(other);\r\n if (dot < 0.0 && !oppositeIsParallel)\r\n return false;\r\n const cross = this.crossProduct(other);\r\n /* a2,b2,cross2 are squared lengths of respective vectors */\r\n /* cross2 = sin^2(theta) * a2 * b2 */\r\n /* For small theta, sin^2(theta)~~theta^2 */\r\n return cross * cross <= radianSquaredTol * a2 * b2;\r\n }\r\n /**\r\n * Test if this vector is perpendicular to other.\r\n * * The input tolerances in `options`, if given, are considered to be squared for efficiency's sake,\r\n * so if you have a distance or angle tolerance t, you should pass in t * t.\r\n * @param other second vector in comparison.\r\n * @param returnValueIfAnInputIsZeroLength if either vector is near zero length, return this value.\r\n * @param options optional radian and distance tolerances.\r\n */\r\n public isPerpendicularTo(other: Vector2d, returnValueIfAnInputIsZeroLength: boolean = false, options?: PerpParallelOptions): boolean {\r\n const radianSquaredTol: number = options?.radianSquaredTol ?? Geometry.smallAngleRadiansSquared;\r\n const distanceSquaredTol: number = options?.distanceSquaredTol ?? Geometry.smallMetricDistanceSquared;\r\n const aa = this.magnitudeSquared();\r\n const bb = other.magnitudeSquared();\r\n if (aa < distanceSquaredTol || bb < distanceSquaredTol)\r\n return returnValueIfAnInputIsZeroLength;\r\n const ab = this.dotProduct(other);\r\n return ab * ab <= radianSquaredTol * aa * bb;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"Point2dVector2d.js","sourceRoot":"","sources":["../../../src/geometry3d/Point2dVector2d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,qBAAqB;AACrB,yBAAyB;AAEzB,OAAO,EAAmB,QAAQ,EAAuB,MAAM,aAAa,CAAC;AAC7E,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC;;;;;;;GAOG;AACH,MAAM,OAAO,EAAE;IAKb,wBAAwB;IACjB,GAAG,CAAC,IAAY,CAAC,EAAE,IAAY,CAAC;QACrC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;IACD,+BAA+B;IACxB,OAAO;QACZ,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;IACD,YAAsB,IAAY,CAAC,EAAE,IAAY,CAAC;QAChD,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;IACD,mCAAmC;IAC5B,OAAO,CAAC,KAAa;QAC1B,IAAI,KAAK,EAAE;YACT,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;YACjB,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;SAClB;aAAM;YACL,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;YACX,IAAI,CA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,KAAK,CAAC;QACf,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QACvC,4DAA4D;QAC5D,qCAAqC;QACrC,4CAA4C;QAC5C,OAAO,KAAK,GAAG,KAAK,IAAI,gBAAgB,GAAG,EAAE,GAAG,EAAE,CAAC;IACrD,CAAC;IACD;;;;;;;OAOG;IACI,iBAAiB,CACtB,KAAe,EAAE,mCAA4C,KAAK,EAAE,OAA6B;QAEjG,MAAM,gBAAgB,GAAW,OAAO,EAAE,gBAAgB,IAAI,QAAQ,CAAC,wBAAwB,CAAC;QAChG,MAAM,kBAAkB,GAAW,OAAO,EAAE,kBAAkB,IAAI,QAAQ,CAAC,0BAA0B,CAAC;QACtG,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACnC,MAAM,EAAE,GAAG,KAAK,CAAC,gBAAgB,EAAE,CAAC;QACpC,IAAI,EAAE,GAAG,kBAAkB,IAAI,EAAE,GAAG,kBAAkB;YACpD,OAAO,gCAAgC,CAAC;QAC1C,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAClC,OAAO,EAAE,GAAG,EAAE,IAAI,gBAAgB,GAAG,EAAE,GAAG,EAAE,CAAC;IAC/C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\n// cspell:word JSONXY\r\n// cspell:word CWXY CCWXY\r\n\r\nimport { BeJSONFunctions, Geometry, PerpParallelOptions } from \"../Geometry\";\r\nimport { Angle } from \"./Angle\";\r\nimport { XAndY, XYProps } from \"./XYZProps\";\r\n\r\n/**\r\n * Minimal object containing x,y and operations that are meaningful without change in both point and vector.\r\n * * `XY` is not instantiable.\r\n * * The derived (instantiable) classes are\r\n * * `Point2d`\r\n * * `Vector2d`\r\n * @public\r\n */\r\nexport class XY implements XAndY {\r\n /** x component */\r\n public x: number;\r\n /** y component */\r\n public y: number;\r\n /** Set both x and y. */\r\n public set(x: number = 0, y: number = 0) {\r\n this.x = x;\r\n this.y = y;\r\n }\r\n /** Set both x and y to zero */\r\n public setZero() {\r\n this.x = 0;\r\n this.y = 0;\r\n }\r\n protected constructor(x: number = 0, y: number = 0) {\r\n this.x = x;\r\n this.y = y;\r\n }\r\n /** Set both x and y from other. */\r\n public setFrom(other?: XAndY) {\r\n if (other) {\r\n this.x = other.x;\r\n this.y = other.y;\r\n } else {\r\n this.x = 0;\r\n this.y = 0;\r\n }\r\n }\r\n /** Freeze this instance so it is read-only */\r\n public freeze(): Readonly<this> {\r\n return Object.freeze(this);\r\n }\r\n /** Returns true if this and other have equal x,y parts within Geometry.smallMetricDistance. */\r\n public isAlmostEqual(other: XAndY, tol?: number): boolean {\r\n return Geometry.isSameCoordinate(this.x, other.x, tol) && Geometry.isSameCoordinate(this.y, other.y, tol);\r\n }\r\n /** Returns true if this and other have equal x,y parts within Geometry.smallMetricDistance. */\r\n public isAlmostEqualXY(x: number, y: number, tol?: number): boolean {\r\n return Geometry.isSameCoordinate(this.x, x, tol) && Geometry.isSameCoordinate(this.y, y, tol);\r\n }\r\n /** Return a json array `[x,y]` */\r\n public toJSON(): XYProps {\r\n return [this.x, this.y];\r\n }\r\n /** Return a json object `{x: 1, y:2}` */\r\n public toJSONXY(): XYProps {\r\n return { x: this.x, y: this.y };\r\n }\r\n /**\r\n * Set x and y from a JSON input such as `[1,2]` or `{x:1, y:2}`\r\n * * If no JSON input is provided, 0 would be used as default values for x and y.\r\n * @param json the JSON input\r\n */\r\n public setFromJSON(json?: XYProps): void {\r\n if (Array.isArray(json)) {\r\n this.set(json[0] || 0, json[1] || 0);\r\n return;\r\n }\r\n if (json) {\r\n this.set(json.x || 0, json.y || 0);\r\n return;\r\n }\r\n this.set(0, 0);\r\n }\r\n /** Return the distance from this point to other */\r\n public distance(other: XAndY): number {\r\n const xDist = other.x - this.x;\r\n const yDist = other.y - this.y;\r\n return Math.sqrt(xDist * xDist + yDist * yDist);\r\n }\r\n /** Return squared distance from this point to other */\r\n public distanceSquared(other: XAndY): number {\r\n const xDist = other.x - this.x;\r\n const yDist = other.y - this.y;\r\n return xDist * xDist + yDist * yDist;\r\n }\r\n /** Return the largest absolute distance between corresponding components */\r\n public maxDiff(other: XAndY): number {\r\n return Math.max(Math.abs(this.x - other.x), Math.abs(this.y - other.y));\r\n }\r\n /** Return the x,y component corresponding to 0,1 */\r\n public at(index: number): number {\r\n if (index < 0.5)\r\n return this.x;\r\n return this.y;\r\n }\r\n /** Set value at index 0 or 1 */\r\n public setAt(index: number, value: number): void {\r\n if (index < 0.5)\r\n this.x = value;\r\n else\r\n this.y = value;\r\n }\r\n /** Return the index (0,1) of the x,y component with largest absolute value */\r\n public indexOfMaxAbs(): number {\r\n let index = 0;\r\n const a = Math.abs(this.x);\r\n const b = Math.abs(this.y);\r\n if (b > a) {\r\n index = 1;\r\n }\r\n return index;\r\n }\r\n /** Returns true if the x,y components are both small by metric metric tolerance */\r\n public get isAlmostZero(): boolean {\r\n return Geometry.isSmallMetricDistance(this.x) && Geometry.isSmallMetricDistance(this.y);\r\n }\r\n /** Return the largest absolute value of any component */\r\n public maxAbs(): number {\r\n return Math.max(Math.abs(this.x), Math.abs(this.y));\r\n }\r\n /** Return the magnitude of the vector */\r\n public magnitude(): number {\r\n return Math.sqrt(this.x * this.x + this.y * this.y);\r\n }\r\n /** Return the squared magnitude of the vector. */\r\n public magnitudeSquared(): number {\r\n return this.x * this.x + this.y * this.y;\r\n }\r\n /** Returns true if the x,y components are exactly equal. */\r\n public isExactEqual(other: XAndY): boolean {\r\n return this.x === other.x && this.y === other.y;\r\n }\r\n /** Returns true if x,y match `other` within metric tolerance */\r\n public isAlmostEqualMetric(other: XAndY, distanceTol: number = Geometry.smallMetricDistance): boolean {\r\n return this.maxDiff(other) <= distanceTol;\r\n }\r\n /** Return a (full length) vector from this point to other */\r\n public vectorTo(other: XAndY, result?: Vector2d): Vector2d {\r\n return Vector2d.create(\r\n other.x - this.x,\r\n other.y - this.y,\r\n result);\r\n }\r\n /** Return a unit vector from this point to other */\r\n public unitVectorTo(other: XAndY, result?: Vector2d): Vector2d | undefined {\r\n return this.vectorTo(other, result).normalize(result);\r\n }\r\n /** Cross product of vectors from origin to targets */\r\n public static crossProductToPoints(origin: XAndY, targetA: XAndY, targetB: XAndY): number {\r\n return Geometry.crossProductXYXY(\r\n targetA.x - origin.x, targetA.y - origin.y, targetB.x - origin.x, targetB.y - origin.y);\r\n }\r\n}\r\n\r\n/** 2D point with `x`,`y` as properties\r\n * @public\r\n */\r\nexport class Point2d extends XY implements BeJSONFunctions {\r\n /** Constructor for Point2d */\r\n constructor(x: number = 0, y: number = 0) {\r\n super(x, y);\r\n }\r\n /** Return a new Point2d with x,y coordinates from this. */\r\n public clone(result?: Point2d): Point2d {\r\n return Point2d.create(this.x, this.y, result);\r\n }\r\n /**\r\n * Return a point (newly created unless result provided) with given x,y coordinates\r\n * @param x x coordinate\r\n * @param y y coordinate\r\n * @param result optional result\r\n */\r\n public static create(x: number = 0, y: number = 0, result?: Point2d): Point2d {\r\n if (result) {\r\n result.x = x;\r\n result.y = y;\r\n return result;\r\n }\r\n return new Point2d(x, y);\r\n }\r\n /**\r\n * Set x and y from a JSON input such as `[1,2]` or `{x:1, y:2}`\r\n * * If no JSON input is provided, 0 would be used as default values for x and y.\r\n * @param json the JSON input\r\n */\r\n public static fromJSON(json?: XYProps): Point2d {\r\n const val = new Point2d();\r\n val.setFromJSON(json);\r\n return val;\r\n }\r\n /** Create (or optionally reuse) a Point2d from another object with fields x and y */\r\n public static createFrom(xy: XAndY | undefined, result?: Point2d): Point2d {\r\n if (xy)\r\n return Point2d.create(xy.x, xy.y, result);\r\n return Point2d.create(0, 0, result);\r\n }\r\n /** Create a Point2d with both coordinates zero. */\r\n public static createZero(result?: Point2d): Point2d {\r\n return Point2d.create(0, 0, result);\r\n }\r\n /**\r\n * Starting at this point, move along vector by tangentFraction of the vector length, and then\r\n * to the left by leftFraction of the perpendicular vector length.\r\n * @param tangentFraction distance to move along the vector, as a fraction of vector\r\n * @param leftFraction distance to move perpendicular to the vector, as a fraction of the rotated vector\r\n * @param vector the other vector\r\n */\r\n public addForwardLeft(tangentFraction: number, leftFraction: number, vector: Vector2d): Point2d {\r\n const dx = vector.x;\r\n const dy = vector.y;\r\n return Point2d.create(\r\n this.x + tangentFraction * dx - leftFraction * dy,\r\n this.y + tangentFraction * dy + leftFraction * dx\r\n );\r\n }\r\n /**\r\n * Interpolate at tangentFraction between this instance and point, and then Move by leftFraction\r\n * along the xy perpendicular of the vector between the points.\r\n */\r\n public forwardLeftInterpolate(tangentFraction: number, leftFraction: number, point: XAndY): Point2d {\r\n const dx = point.x - this.x;\r\n const dy = point.y - this.y;\r\n return Point2d.create(\r\n this.x + tangentFraction * dx - leftFraction * dy,\r\n this.y + tangentFraction * dy + leftFraction * dx\r\n );\r\n }\r\n /** Return a point interpolated between this point and the right param. */\r\n public interpolate(fraction: number, other: XAndY, result?: Point2d): Point2d {\r\n if (fraction <= 0.5)\r\n return Point2d.create(\r\n this.x + fraction * (other.x - this.x),\r\n this.y + fraction * (other.y - this.y),\r\n result\r\n );\r\n const t: number = fraction - 1.0;\r\n return Point2d.create(\r\n other.x + t * (other.x - this.x),\r\n other.y + t * (other.y - this.y),\r\n result\r\n );\r\n }\r\n /** Return a point with independent x,y fractional interpolation. */\r\n public interpolateXY(fractionX: number, fractionY: number, other: XAndY, result?: Point2d): Point2d {\r\n return Point2d.create(\r\n Geometry.interpolate(this.x, fractionX, other.x),\r\n Geometry.interpolate(this.y, fractionY, other.y),\r\n result\r\n );\r\n }\r\n /** Return this point minus vector */\r\n public minus(vector: XAndY, result?: Point2d): Point2d {\r\n return Point2d.create(\r\n this.x - vector.x,\r\n this.y - vector.y,\r\n result\r\n );\r\n }\r\n /** Return point plus vector */\r\n public plus(vector: XAndY, result?: Point2d): Point2d {\r\n return Point2d.create(\r\n this.x + vector.x,\r\n this.y + vector.y,\r\n result\r\n );\r\n }\r\n /** Return point plus vector */\r\n public plusXY(dx: number = 0, dy: number = 0, result?: Point2d): Point2d {\r\n return Point2d.create(\r\n this.x + dx,\r\n this.y + dy, result\r\n );\r\n }\r\n /** Return point + vector * scalar */\r\n public plusScaled(vector: XAndY, scaleFactor: number, result?: Point2d): Point2d {\r\n return Point2d.create(\r\n this.x + vector.x * scaleFactor,\r\n this.y + vector.y * scaleFactor,\r\n result\r\n );\r\n }\r\n /** Return point + vectorA * scalarA + vectorB * scalarB */\r\n public plus2Scaled(vectorA: XAndY, scalarA: number, vectorB: XAndY, scalarB: number, result?: Point2d): Point2d {\r\n return Point2d.create(\r\n this.x + vectorA.x * scalarA + vectorB.x * scalarB,\r\n this.y + vectorA.y * scalarA + vectorB.y * scalarB,\r\n result\r\n );\r\n }\r\n /** Return point + vectorA * scalarA + vectorB * scalarB + vectorC * scalarC */\r\n public plus3Scaled(vectorA: XAndY, scalarA: number, vectorB: XAndY, scalarB: number,\r\n vectorC: XAndY, scalarC: number, result?: Point2d): Point2d {\r\n return Point2d.create(\r\n this.x + vectorA.x * scalarA + vectorB.x * scalarB + vectorC.x * scalarC,\r\n this.y + vectorA.y * scalarA + vectorB.y * scalarB + vectorC.y * scalarC,\r\n result\r\n );\r\n }\r\n /**\r\n * Return the dot product of vector from this to targetA and vector from this to targetB\r\n * @param targetA target of first vector\r\n * @param targetB target of second vector\r\n */\r\n public dotVectorsToTargets(targetA: XAndY, targetB: XAndY): number {\r\n return (targetA.x - this.x) * (targetB.x - this.x) + (targetA.y - this.y) * (targetB.y - this.y);\r\n }\r\n /**\r\n * Returns the (scalar) cross product of vector from this to targetA and vector from this to targetB\r\n * @param target1 target of first vector\r\n * @param target2 target of second vector\r\n */\r\n public crossProductToPoints(target1: XAndY, target2: XAndY): number {\r\n const x1 = target1.x - this.x;\r\n const y1 = target1.y - this.y;\r\n const x2 = target2.x - this.x;\r\n const y2 = target2.y - this.y;\r\n return x1 * y2 - y1 * x2;\r\n }\r\n /**\r\n * Return the fractional coordinate of the projection of this instance x,y onto the\r\n * line from startPoint to endPoint.\r\n * @param startPoint start point of line\r\n * @param endPoint end point of line\r\n * @param defaultFraction fraction to return if startPoint and endPoint are equal.\r\n */\r\n public fractionOfProjectionToLine(startPoint: Point2d, endPoint: Point2d, defaultFraction: number = 0): number {\r\n const denominator = startPoint.distanceSquared(endPoint);\r\n if (denominator < Geometry.smallMetricDistanceSquared)\r\n return defaultFraction;\r\n const numerator = startPoint.dotVectorsToTargets(endPoint, this);\r\n return numerator / denominator;\r\n }\r\n}\r\n\r\n/**\r\n * 2D vector with `x`,`y` as properties\r\n * @public\r\n */\r\nexport class Vector2d extends XY implements BeJSONFunctions {\r\n constructor(x: number = 0, y: number = 0) {\r\n super(x, y);\r\n }\r\n /** Return a new Vector2d with the same x,y */\r\n public clone(result?: Vector2d): Vector2d {\r\n return Vector2d.create(this.x, this.y, result);\r\n }\r\n /** Return a new Vector2d with given x and y */\r\n public static create(x: number = 0, y: number = 0, result?: Vector2d): Vector2d {\r\n if (result) {\r\n result.x = x;\r\n result.y = y;\r\n return result;\r\n }\r\n return new Vector2d(x, y);\r\n }\r\n /**\r\n * Return a (new) Vector2d with components scale,0\r\n * If scale is not given default value 1 is used.\r\n */\r\n public static unitX(scale: number = 1): Vector2d {\r\n return new Vector2d(scale, 0);\r\n }\r\n /**\r\n * Return a (new) Vector2d with components 0,scale\r\n * If scale is not given default value 1 is used.\r\n */\r\n public static unitY(scale: number = 1): Vector2d {\r\n return new Vector2d(0, scale);\r\n }\r\n /** Return a Vector2d with components 0,0 */\r\n public static createZero(result?: Vector2d): Vector2d {\r\n return Vector2d.create(0, 0, result);\r\n }\r\n /** Copy contents from another Point3d, Point2d, Vector2d, or Vector3d, or leading entries of Float64Array */\r\n public static createFrom(data: XAndY | Float64Array, result?: Vector2d): Vector2d {\r\n if (data instanceof Float64Array) {\r\n if (data.length >= 2)\r\n return Vector2d.create(data[0], data[1]);\r\n if (data.length >= 1)\r\n return Vector2d.create(data[0], 0);\r\n return Vector2d.create(0, 0);\r\n }\r\n return Vector2d.create(data.x, data.y, result);\r\n }\r\n /**\r\n * Set x and y from a JSON input such as `[1,2]` or `{x:1, y:2}`\r\n * * If no JSON input is provided, 0 would be used as default values for x and y.\r\n * @param json the JSON input\r\n */\r\n public static fromJSON(json?: XYProps): Vector2d {\r\n const val = new Vector2d();\r\n val.setFromJSON(json);\r\n return val;\r\n }\r\n /** Return a new Vector2d from polar coordinates for radius and Angle from x axis */\r\n public static createPolar(r: number, theta: Angle): Vector2d {\r\n return Vector2d.create(r * theta.cos(), r * theta.sin());\r\n }\r\n /** Return a new Vector2d extending from point0 to point1 */\r\n public static createStartEnd(point0: XAndY, point1: XAndY, result?: Vector2d): Vector2d {\r\n return Vector2d.create(point1.x - point0.x, point1.y - point0.y, result);\r\n }\r\n /**\r\n * Return a vector that bisects the angle between two normals and extends to the intersection of two offset lines\r\n * * returns `undefined` if `unitPerpA = -unitPerpB` (i.e., are opposite)\r\n * * math details can be found at docs/learning/geometry/PointVector.md\r\n * @param unitPerpA unit perpendicular to incoming direction\r\n * @param unitPerpB unit perpendicular to outgoing direction\r\n * @param offset offset distance\r\n */\r\n public static createOffsetBisector(unitPerpA: Vector2d, unitPerpB: Vector2d, offset: number): Vector2d | undefined {\r\n let bisector: Vector2d | undefined = unitPerpA.plus(unitPerpB);\r\n bisector = bisector.normalize();\r\n if (bisector) {\r\n const c = bisector.dotProduct(unitPerpA);\r\n bisector.scale(offset, bisector);\r\n return bisector.safeDivideOrNull(c);\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Return a (new or optionally reused) vector which is `this` divided by `denominator`\r\n * * return undefined if denominator is zero.\r\n */\r\n public safeDivideOrNull(denominator: number, result?: Vector2d): Vector2d | undefined {\r\n if (denominator !== 0.0) {\r\n return this.scale(1.0 / denominator, result);\r\n }\r\n return undefined;\r\n }\r\n /** Return a unit vector in direction of this instance (undefined if this instance has near zero length) */\r\n public normalize(result?: Vector2d): Vector2d | undefined {\r\n const mag = Geometry.correctSmallMetricDistance(this.magnitude());\r\n result = result ? result : new Vector2d();\r\n return this.safeDivideOrNull(mag, result);\r\n }\r\n /**\r\n * Return fractional projection of target vector onto this\r\n * * It's returning the signed projection magnitude divided by the target magnitude. In other words,\r\n * it's returning the length of the projection as a fraction of the target magnitude.\r\n * @param target the target vector\r\n * @param defaultFraction the returned value in case magnitude square of target vector is very small\r\n */\r\n public fractionOfProjectionToVector(target: Vector2d, defaultFraction?: number): number {\r\n /*\r\n * projection length is (this.target)/||target||\r\n * but here we return (this.target)/||target||^2\r\n */\r\n const denominator = target.magnitudeSquared();\r\n if (denominator < Geometry.smallMetricDistanceSquared)\r\n return defaultFraction ? defaultFraction : 0;\r\n const numerator = this.dotProduct(target);\r\n return numerator / denominator;\r\n }\r\n /** Return a new vector with components negated from this instance. */\r\n public negate(result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n result.x = -this.x;\r\n result.y = -this.y;\r\n return result;\r\n }\r\n /** Return a vector same length as this but rotated 90 degrees counter clockwise */\r\n public rotate90CCWXY(result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n // save x,y to allow aliasing (\"this\" can be passed to the function as \"result\")\r\n const xx: number = this.x;\r\n const yy: number = this.y;\r\n result.x = -yy;\r\n result.y = xx;\r\n return result;\r\n }\r\n /** Return a vector same length as this but rotated 90 degrees clockwise */\r\n public rotate90CWXY(result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n // save x,y to allow aliasing (\"this\" can be passed to the function as \"result\")\r\n const xx: number = this.x;\r\n const yy: number = this.y;\r\n result.x = yy;\r\n result.y = -xx;\r\n return result;\r\n }\r\n /** Return a unit vector perpendicular to this instance. */\r\n public unitPerpendicularXY(result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n const xx: number = this.x;\r\n const yy: number = this.y;\r\n // save x,y to allow aliasing (\"this\" can be passed to the function as \"result\")\r\n result.x = -yy;\r\n result.y = xx;\r\n const d2: number = xx * xx + yy * yy;\r\n if (d2 !== 0.0) {\r\n const a = 1.0 / Math.sqrt(d2);\r\n result.x *= a;\r\n result.y *= a;\r\n }\r\n return result;\r\n }\r\n /** Return a new Vector2d rotated CCW by given angle */\r\n public rotateXY(angle: Angle, result?: Vector2d): Vector2d {\r\n const s = angle.sin();\r\n const c = angle.cos();\r\n // save x,y to allow aliasing (\"this\" can be passed to the function as \"result\")\r\n const xx: number = this.x;\r\n const yy: number = this.y;\r\n result = result ? result : new Vector2d();\r\n result.x = xx * c - yy * s;\r\n result.y = xx * s + yy * c;\r\n return result;\r\n }\r\n /**\r\n * Return a vector computed at fractional position between this vector and vectorB\r\n * @param fraction fractional position. 0 is at `this`. 1 is at `vectorB`.\r\n * True fractions are \"between\", negatives are \"before this\", beyond 1 is \"beyond vectorB\".\r\n * @param vectorB second vector\r\n * @param result optional preallocated result.\r\n */\r\n public interpolate(fraction: number, vectorB: Vector2d, result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n /*\r\n * For best last-bit behavior, if fraction is below 0.5, use this as base point.\r\n * If above 0.5, use vectorB as base point.\r\n */\r\n if (fraction <= 0.5) {\r\n result.x = this.x + fraction * (vectorB.x - this.x);\r\n result.y = this.y + fraction * (vectorB.y - this.y);\r\n } else {\r\n const t: number = fraction - 1.0;\r\n result.x = vectorB.x + t * (vectorB.x - this.x);\r\n result.y = vectorB.y + t * (vectorB.y - this.y);\r\n }\r\n return result;\r\n }\r\n /** Return {this + vector}. */\r\n public plus(vector: XAndY, result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n result.x = this.x + vector.x;\r\n result.y = this.y + vector.y;\r\n return result;\r\n }\r\n /** Return {this - vector}. */\r\n public minus(vector: XAndY, result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n result.x = this.x - vector.x;\r\n result.y = this.y - vector.y;\r\n return result;\r\n }\r\n /** Return {point + vector \\* scalar} */\r\n public plusScaled(vector: XAndY, scaleFactor: number, result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n result.x = this.x + vector.x * scaleFactor;\r\n result.y = this.y + vector.y * scaleFactor;\r\n return result;\r\n }\r\n /** Return {point + vectorA \\* scalarA + vectorB \\* scalarB} */\r\n public plus2Scaled(vectorA: XAndY, scalarA: number, vectorB: XAndY, scalarB: number, result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n result.x = this.x + vectorA.x * scalarA + vectorB.x * scalarB;\r\n result.y = this.y + vectorA.y * scalarA + vectorB.y * scalarB;\r\n return result;\r\n }\r\n /** Return {this + vectorA \\* scalarA + vectorB \\* scalarB + vectorC \\* scalarC} */\r\n public plus3Scaled(vectorA: XAndY, scalarA: number, vectorB: XAndY, scalarB: number, vectorC: XAndY, scalarC: number, result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n result.x = this.x + vectorA.x * scalarA + vectorB.x * scalarB + vectorC.x * scalarC;\r\n result.y = this.y + vectorA.y * scalarA + vectorB.y * scalarB + vectorC.y * scalarC;\r\n return result;\r\n }\r\n /** Return {this * scale} */\r\n public scale(scale: number, result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n result.x = this.x * scale;\r\n result.y = this.y * scale;\r\n return result;\r\n }\r\n /** Return a vector parallel to this but with specified length */\r\n public scaleToLength(length: number, result?: Vector2d): Vector2d | undefined {\r\n const mag = Geometry.correctSmallMetricDistance(this.magnitude());\r\n if (mag === 0)\r\n return undefined;\r\n return this.scale(length / mag, result);\r\n }\r\n /** Return the dot product of this with vectorB */\r\n public dotProduct(vectorB: XAndY): number {\r\n return this.x * vectorB.x + this.y * vectorB.y;\r\n }\r\n /** Dot product with vector from pointA to pointB */\r\n public dotProductStartEnd(pointA: XAndY, pointB: XAndY): number {\r\n return this.x * (pointB.x - pointA.x) + this.y * (pointB.y - pointA.y);\r\n }\r\n /** Vector cross product {this CROSS vectorB} */\r\n public crossProduct(vectorB: XAndY): number {\r\n return this.x * vectorB.y - this.y * vectorB.x;\r\n }\r\n /**\r\n * Return the radians (as a simple number, not strongly typed Angle) signed angle from this to vectorB.\r\n * This is positive if the shortest turn is counterclockwise, negative if clockwise.\r\n */\r\n public radiansTo(vectorB: XAndY): number {\r\n return Math.atan2(this.crossProduct(vectorB), this.dotProduct(vectorB));\r\n }\r\n /**\r\n * Return the (strongly typed) signed angle from this to vectorB.\r\n * This is positive if the shortest turn is counterclockwise, negative if clockwise.\r\n */\r\n public angleTo(vectorB: XAndY): Angle {\r\n return Angle.createRadians(this.radiansTo(vectorB));\r\n }\r\n /**\r\n * Test if this vector is parallel to other.\r\n * * The input tolerances in `options`, if given, are considered to be squared for efficiency's sake,\r\n * so if you have a distance or angle tolerance t, you should pass in t * t.\r\n * @param other second vector for comparison.\r\n * @param oppositeIsParallel whether to consider diametrically opposed vectors as parallel.\r\n * @param options optional radian and distance tolerances.\r\n */\r\n public isParallelTo(other: Vector2d, oppositeIsParallel: boolean = false,\r\n returnValueIfAnInputIsZeroLength: boolean = false, options?: PerpParallelOptions): boolean {\r\n const radianSquaredTol: number = options?.radianSquaredTol ?? Geometry.smallAngleRadiansSquared;\r\n const distanceSquaredTol: number = options?.distanceSquaredTol ?? Geometry.smallMetricDistanceSquared;\r\n const a2 = this.magnitudeSquared();\r\n const b2 = other.magnitudeSquared();\r\n if (a2 < distanceSquaredTol || b2 < distanceSquaredTol)\r\n return returnValueIfAnInputIsZeroLength;\r\n const dot = this.dotProduct(other);\r\n if (dot < 0.0 && !oppositeIsParallel)\r\n return false;\r\n const cross = this.crossProduct(other);\r\n /* a2,b2,cross2 are squared lengths of respective vectors */\r\n /* cross2 = sin^2(theta) * a2 * b2 */\r\n /* For small theta, sin^2(theta)~~theta^2 */\r\n return cross * cross <= radianSquaredTol * a2 * b2;\r\n }\r\n /**\r\n * Test if this vector is perpendicular to other.\r\n * * The input tolerances in `options`, if given, are considered to be squared for efficiency's sake,\r\n * so if you have a distance or angle tolerance t, you should pass in t * t.\r\n * @param other second vector in comparison.\r\n * @param returnValueIfAnInputIsZeroLength if either vector is near zero length, return this value.\r\n * @param options optional radian and distance tolerances.\r\n */\r\n public isPerpendicularTo(\r\n other: Vector2d, returnValueIfAnInputIsZeroLength: boolean = false, options?: PerpParallelOptions\r\n ): boolean {\r\n const radianSquaredTol: number = options?.radianSquaredTol ?? Geometry.smallAngleRadiansSquared;\r\n const distanceSquaredTol: number = options?.distanceSquaredTol ?? Geometry.smallMetricDistanceSquared;\r\n const aa = this.magnitudeSquared();\r\n const bb = other.magnitudeSquared();\r\n if (aa < distanceSquaredTol || bb < distanceSquaredTol)\r\n return returnValueIfAnInputIsZeroLength;\r\n const ab = this.dotProduct(other);\r\n return ab * ab <= radianSquaredTol * aa * bb;\r\n }\r\n}\r\n"]}
|
|
@@ -12,11 +12,11 @@ import { XYAndZ } from "./XYZProps";
|
|
|
12
12
|
* @public
|
|
13
13
|
*/
|
|
14
14
|
export declare class Point3dArrayCarrier extends IndexedReadWriteXYZCollection {
|
|
15
|
-
/**
|
|
15
|
+
/** Reference to array being queried. */
|
|
16
16
|
data: Point3d[];
|
|
17
17
|
/** CAPTURE caller supplied array ... */
|
|
18
18
|
constructor(data: Point3d[]);
|
|
19
|
-
/**
|
|
19
|
+
/** Test if `index` is a valid index into the array. */
|
|
20
20
|
isValidIndex(index: number): boolean;
|
|
21
21
|
/**
|
|
22
22
|
* Access by index, returning strongly typed Point3d
|
|
@@ -41,19 +41,19 @@ export declare class Point3dArrayCarrier extends IndexedReadWriteXYZCollection {
|
|
|
41
41
|
*/
|
|
42
42
|
getVector3dAtCheckedVectorIndex(index: number, result?: Vector3d): Vector3d | undefined;
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* Access x of indexed point
|
|
45
45
|
* * WARNING: make sure `pointIndex` is a valid index, otherwise, you get random results
|
|
46
|
-
|
|
46
|
+
*/
|
|
47
47
|
getXAtUncheckedPointIndex(pointIndex: number): number;
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
49
|
+
* Access y of indexed point
|
|
50
50
|
* * WARNING: make sure `pointIndex` is a valid index, otherwise, you get random results
|
|
51
|
-
|
|
51
|
+
*/
|
|
52
52
|
getYAtUncheckedPointIndex(pointIndex: number): number;
|
|
53
53
|
/**
|
|
54
|
-
*
|
|
54
|
+
* Access z of indexed point
|
|
55
55
|
* * WARNING: make sure `pointIndex` is a valid index, otherwise, you get random results
|
|
56
|
-
|
|
56
|
+
*/
|
|
57
57
|
getZAtUncheckedPointIndex(pointIndex: number): number;
|
|
58
58
|
/**
|
|
59
59
|
* Return a vector from the point at indexA to the point at indexB
|
|
@@ -98,33 +98,29 @@ export declare class Point3dArrayCarrier extends IndexedReadWriteXYZCollection {
|
|
|
98
98
|
* @returns return true if indexA, indexB both valid
|
|
99
99
|
*/
|
|
100
100
|
accumulateCrossProductIndexIndexIndex(originIndex: number, indexA: number, indexB: number, result: Vector3d): void;
|
|
101
|
-
/**
|
|
102
|
-
* Accumulate scale times the x,y,z values at index to the sum.
|
|
103
|
-
* No action if index is out of bounds.
|
|
104
|
-
*/
|
|
101
|
+
/** Accumulate scale times the x,y,z values at index to the sum. No action if index is out of bounds */
|
|
105
102
|
accumulateScaledXYZ(index: number, scale: number, sum: Point3d): void;
|
|
106
|
-
/**
|
|
107
|
-
* read-only property for number of XYZ in the collection.
|
|
108
|
-
*/
|
|
103
|
+
/** Read-only property for number of XYZ in the collection */
|
|
109
104
|
get length(): number;
|
|
110
|
-
/**
|
|
105
|
+
/**
|
|
106
|
+
* Push a (clone of) point onto the collection
|
|
111
107
|
* * point itself is not pushed -- xyz data is extracted into the native form of the collection.
|
|
112
108
|
*/
|
|
113
109
|
push(data: Point3d): void;
|
|
114
110
|
/**
|
|
115
|
-
*
|
|
111
|
+
* Push a new point (given by coordinates) onto the collection
|
|
116
112
|
* @param x x coordinate
|
|
117
113
|
* @param y y coordinate
|
|
118
114
|
* @param z z coordinate
|
|
119
115
|
*/
|
|
120
116
|
pushXYZ(x?: number, y?: number, z?: number): void;
|
|
121
|
-
/**
|
|
117
|
+
/** Extract (copy) the final point */
|
|
122
118
|
back(result?: Point3d): Point3d | undefined;
|
|
123
|
-
/**
|
|
119
|
+
/** Extract (copy) the first point */
|
|
124
120
|
front(result?: Point3d): Point3d | undefined;
|
|
125
|
-
/**
|
|
121
|
+
/** Remove the final point. */
|
|
126
122
|
pop(): void;
|
|
127
|
-
/**
|
|
123
|
+
/** Remove all points. */
|
|
128
124
|
clear(): void;
|
|
129
125
|
/** Reverse the points in place */
|
|
130
126
|
reverseInPlace(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Point3dArrayCarrier.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/Point3dArrayCarrier.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC;;;;;;GAMG;AACH,qBAAa,mBAAoB,SAAQ,6BAA6B;IACpE,wCAAwC;IACjC,IAAI,EAAE,OAAO,EAAE,CAAC;IACvB,wCAAwC;gBACrB,IAAI,EAAE,OAAO,EAAE;IAIlC,uDAAuD;IAChD,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAG3C;;;;;;OAMG;IACI,6BAA6B,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS;IAO1F;;;;;OAKG;IACI,+BAA+B,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO;IAIhF;;;;;OAKG;IACI,+BAA+B,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,C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