@itwin/core-geometry 4.10.0-dev.12 → 4.10.0-dev.14
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 +6 -1
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +6 -1
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts +2 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +2 -1
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +4 -3
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +4 -3
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/numerics/Polynomials.d.ts +36 -35
- package/lib/cjs/numerics/Polynomials.d.ts.map +1 -1
- package/lib/cjs/numerics/Polynomials.js +86 -95
- package/lib/cjs/numerics/Polynomials.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +6 -1
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts +2 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +2 -1
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +4 -3
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +4 -3
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/numerics/Polynomials.d.ts +36 -35
- package/lib/esm/numerics/Polynomials.d.ts.map +1 -1
- package/lib/esm/numerics/Polynomials.js +86 -95
- package/lib/esm/numerics/Polynomials.js.map +1 -1
- package/package.json +3 -3
|
@@ -268,7 +268,7 @@ export declare class AnalyticRoots {
|
|
|
268
268
|
private static appendFullCubicSolutions;
|
|
269
269
|
/** Compute roots of cubic 'c[0] + c[1] * x + c[2] * x^2 + c[3] * x^3 */
|
|
270
270
|
static appendCubicRoots(c: Float64Array | number[], results: GrowableFloat64Array): void;
|
|
271
|
-
/** Compute roots of quartic
|
|
271
|
+
/** Compute roots of quartic `c[0] + c[1] * x + c[2] * x^2 + c[3] * x^3 + c[4] * x^4` */
|
|
272
272
|
static appendQuarticRoots(c: Float64Array | number[], results: GrowableFloat64Array): void;
|
|
273
273
|
private static appendCosSinRadians;
|
|
274
274
|
/**
|
|
@@ -306,9 +306,9 @@ export declare class PowerPolynomial {
|
|
|
306
306
|
/** Evaluate the standard basis polynomial of degree `coff.length` at `x` */
|
|
307
307
|
static evaluate(coff: Float64Array, x: number): number;
|
|
308
308
|
/**
|
|
309
|
-
*
|
|
310
|
-
* *
|
|
311
|
-
* * Returns degree of result as determined by comparing trailing coefficients to zero
|
|
309
|
+
* Accumulate `coffQ*scaleQ` into `coffP`.
|
|
310
|
+
* * The length of `coffP` must be at least length of `coffQ`.
|
|
311
|
+
* * Returns degree of result as determined by comparing trailing coefficients to zero.
|
|
312
312
|
*/
|
|
313
313
|
static accumulate(coffP: Float64Array, coffQ: Float64Array, scaleQ: number): number;
|
|
314
314
|
/** Zero all coefficients */
|
|
@@ -320,55 +320,56 @@ export declare class PowerPolynomial {
|
|
|
320
320
|
*/
|
|
321
321
|
export declare class TrigPolynomial {
|
|
322
322
|
private static readonly _smallAngle;
|
|
323
|
-
/** Standard Basis coefficients for rational
|
|
323
|
+
/** Standard Basis coefficients for the numerator of the y-coordinate y(t) = S(t)/W(t) in the rational semicircle parameterization. */
|
|
324
324
|
static readonly S: Float64Array;
|
|
325
|
-
/** Standard Basis coefficients for rational
|
|
325
|
+
/** Standard Basis coefficients for the numerator of the x-coordinate x(t) = C(t)/W(t) in the rational semicircle parameterization. */
|
|
326
326
|
static readonly C: Float64Array;
|
|
327
|
-
/** Standard Basis coefficients for rational
|
|
327
|
+
/** Standard Basis coefficients for the denominator of x(t) and y(t) in the rational semicircle parameterization. */
|
|
328
328
|
static readonly W: Float64Array;
|
|
329
|
-
/** Standard Basis coefficients for
|
|
329
|
+
/** Standard Basis coefficients for C(t) * W(t). */
|
|
330
330
|
static readonly CW: Float64Array;
|
|
331
|
-
/** Standard Basis coefficients for
|
|
331
|
+
/** Standard Basis coefficients for S(t) * W(t). */
|
|
332
332
|
static readonly SW: Float64Array;
|
|
333
|
-
/** Standard Basis coefficients for
|
|
333
|
+
/** Standard Basis coefficients for S(t) * C(t). */
|
|
334
334
|
static readonly SC: Float64Array;
|
|
335
|
-
/** Standard Basis coefficients for
|
|
335
|
+
/** Standard Basis coefficients for S(t) * S(t). */
|
|
336
336
|
static readonly SS: Float64Array;
|
|
337
|
-
/** Standard Basis coefficients for
|
|
337
|
+
/** Standard Basis coefficients for C(t) * C(t). */
|
|
338
338
|
static readonly CC: Float64Array;
|
|
339
|
-
/** Standard Basis coefficients for
|
|
339
|
+
/** Standard Basis coefficients for W(t) * W(t). */
|
|
340
340
|
static readonly WW: Float64Array;
|
|
341
|
-
/** Standard Basis coefficients for (
|
|
341
|
+
/** Standard Basis coefficients for C(t) * C(t) - S(t) * S(t). */
|
|
342
342
|
static readonly CCminusSS: Float64Array;
|
|
343
343
|
/**
|
|
344
|
-
*
|
|
345
|
-
*
|
|
346
|
-
*
|
|
347
|
-
*
|
|
348
|
-
*
|
|
349
|
-
*
|
|
350
|
-
*
|
|
351
|
-
*
|
|
352
|
-
*
|
|
353
|
-
*
|
|
354
|
-
*
|
|
344
|
+
* Solve a polynomial created from trigonometric condition using Trig.S, Trig.C, Trig.W.
|
|
345
|
+
* * Polynomial is of degree 4:
|
|
346
|
+
* `coff[0] + coff[1] * t + coff[2] * t^2 + coff[3] * t^3 + coff[4] * t^4`
|
|
347
|
+
* * Solution logic includes inferring angular roots corresponding zero leading coefficients
|
|
348
|
+
* (roots at infinity).
|
|
349
|
+
* @param coff coefficients.
|
|
350
|
+
* @param nominalDegree degree of the polynomial under most complex root case. If there are
|
|
351
|
+
* any zero coefficients up to this degree, a single root "at infinity" is recorded as its
|
|
352
|
+
* corresponding angular parameter at negative pi/2.
|
|
353
|
+
* @param referenceCoefficient a number which represents the size of coefficients at various
|
|
354
|
+
* stages of computation. A small fraction of this will be used as a zero tolerance
|
|
355
|
+
* @param radians roots are placed here.
|
|
355
356
|
* @return false if equation is all zeros. This usually means any angle is a solution.
|
|
356
357
|
*/
|
|
357
358
|
static solveAngles(coff: Float64Array, nominalDegree: number, referenceCoefficient: number, radians: number[]): boolean;
|
|
358
359
|
private static readonly _coefficientRelTol;
|
|
359
360
|
/**
|
|
360
361
|
* Compute intersections of unit circle `x^2 + y^2 = 1` with general quadric
|
|
361
|
-
* `axx * x^2 + axy * x * y + ayy * y^2 + ax * x + ay * y +
|
|
362
|
+
* `axx * x^2 + axy * x * y + ayy * y^2 + ax * x + ay * y + a = 0`
|
|
362
363
|
* Solutions are returned as angles. Sine and Cosine of the angles are the x, y results.
|
|
363
|
-
* @param axx
|
|
364
|
-
* @param axy
|
|
365
|
-
* @param ayy
|
|
366
|
-
* @param ax
|
|
367
|
-
* @param ay
|
|
368
|
-
* @param
|
|
369
|
-
* @param radians
|
|
364
|
+
* @param axx coefficient of x^2
|
|
365
|
+
* @param axy coefficient of xy
|
|
366
|
+
* @param ayy coefficient of y^2
|
|
367
|
+
* @param ax coefficient of x
|
|
368
|
+
* @param ay coefficient of y
|
|
369
|
+
* @param a constant coefficient
|
|
370
|
+
* @param radians solution angles
|
|
370
371
|
*/
|
|
371
|
-
static solveUnitCircleImplicitQuadricIntersection(axx: number, axy: number, ayy: number, ax: number, ay: number,
|
|
372
|
+
static solveUnitCircleImplicitQuadricIntersection(axx: number, axy: number, ayy: number, ax: number, ay: number, a: number, radians: number[]): boolean;
|
|
372
373
|
/**
|
|
373
374
|
* Compute intersections of unit circle x^2 + y 2 = 1 with the ellipse
|
|
374
375
|
* (x,y) = (cx + ux Math.Cos + vx sin, cy + uy Math.Cos + vy sin)
|
|
@@ -384,7 +385,7 @@ export declare class TrigPolynomial {
|
|
|
384
385
|
*/
|
|
385
386
|
static solveUnitCircleEllipseIntersection(cx: number, cy: number, ux: number, uy: number, vx: number, vy: number, ellipseRadians: number[], circleRadians: number[]): boolean;
|
|
386
387
|
/**
|
|
387
|
-
* Compute intersections of unit circle `x^2 + y^2 = w^2` with the ellipse
|
|
388
|
+
* Compute intersections of unit circle `x^2 + y^2 = w^2` (in homogeneous coordinates) with the ellipse
|
|
388
389
|
* `F(t) = (cx + ux cos(t) + vx sin(t), cy + uy cos(t) + vy sin(t)) / (cw + uw cos(t) + vw sin(t))`.
|
|
389
390
|
* @param cx center x
|
|
390
391
|
* @param cy center y
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Polynomials.d.ts","sourceRoot":"","sources":["../../../src/numerics/Polynomials.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AACxG,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO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@ -829,49 +829,45 @@ export class AnalyticRoots {
|
|
|
829
829
|
// this.appendCubicRootsUnsorted(c, results);
|
|
830
830
|
results.sort();
|
|
831
831
|
}
|
|
832
|
-
/** Compute roots of quartic
|
|
832
|
+
/** Compute roots of quartic `c[0] + c[1] * x + c[2] * x^2 + c[3] * x^3 + c[4] * x^4` */
|
|
833
833
|
static appendQuarticRoots(c, results) {
|
|
834
|
-
const coffs = new Float64Array(4);
|
|
834
|
+
const coffs = new Float64Array(4);
|
|
835
835
|
let u;
|
|
836
836
|
let v;
|
|
837
|
-
// normal form: x^4 + Ax^3 + Bx^2 + Cx + D = 0
|
|
838
837
|
const coffScale = new Float64Array(1);
|
|
839
838
|
if (!this.safeDivide(coffScale, 1.0, c[4], 0.0, 0)) {
|
|
840
839
|
this.appendCubicRoots(c, results);
|
|
841
840
|
return;
|
|
842
841
|
}
|
|
842
|
+
// normal form: x^4 + Ax^3 + Bx^2 + Cx + D = 0
|
|
843
843
|
const A = c[3] * coffScale[0];
|
|
844
844
|
const B = c[2] * coffScale[0];
|
|
845
845
|
const C = c[1] * coffScale[0];
|
|
846
846
|
const D = c[0] * coffScale[0];
|
|
847
847
|
const origin = -0.25 * A;
|
|
848
|
-
|
|
849
|
-
x^4 + px^2 + qx + r = 0 */
|
|
848
|
+
// substitute x = y - A/4 to eliminate cubic term: y^4 + py^2 + qy + r = 0
|
|
850
849
|
const sq_A = A * A;
|
|
851
|
-
const p = -
|
|
850
|
+
const p = -0.375 * sq_A + B;
|
|
852
851
|
const q = 0.125 * sq_A * A - 0.5 * A * B + C;
|
|
853
|
-
const r = -
|
|
854
|
-
const
|
|
855
|
-
if (this.isZero(r)) {
|
|
856
|
-
// no absolute term: y(y^3 + py + q) = 0
|
|
852
|
+
const r = -0.01171875 * sq_A * sq_A + 0.0625 * sq_A * B - 0.25 * A * C + D;
|
|
853
|
+
const cubicSolutions = new GrowableFloat64Array();
|
|
854
|
+
if (this.isZero(r)) { // no absolute term: y(y^3 + py + q) = 0
|
|
857
855
|
coffs[0] = q;
|
|
858
856
|
coffs[1] = p;
|
|
859
857
|
coffs[2] = 0;
|
|
860
858
|
coffs[3] = 1;
|
|
861
859
|
this.appendCubicRoots(coffs, results);
|
|
862
|
-
results.push(0);
|
|
863
|
-
this.addConstant(origin, results);
|
|
860
|
+
results.push(0);
|
|
861
|
+
this.addConstant(origin, results); // apply origin
|
|
864
862
|
return;
|
|
865
863
|
}
|
|
866
|
-
else {
|
|
867
|
-
|
|
868
|
-
coffs[0] = 1.0 / 2 * r * p - 1.0 / 8 * q * q;
|
|
864
|
+
else { // solve the resolvent cubic; more info: https://en.wikipedia.org/wiki/Resolvent_cubic#Second_definition
|
|
865
|
+
coffs[0] = 0.5 * r * p - 0.125 * q * q;
|
|
869
866
|
coffs[1] = -r;
|
|
870
|
-
coffs[2] = -
|
|
867
|
+
coffs[2] = -0.5 * p;
|
|
871
868
|
coffs[3] = 1;
|
|
872
|
-
this.appendCubicRoots(coffs,
|
|
873
|
-
const z = this.mostDistantFromMean(
|
|
874
|
-
// ... to build two quadric equations
|
|
869
|
+
this.appendCubicRoots(coffs, cubicSolutions);
|
|
870
|
+
const z = this.mostDistantFromMean(cubicSolutions);
|
|
875
871
|
u = z * z - r;
|
|
876
872
|
v = 2 * z - p;
|
|
877
873
|
if (this.isSmallRatio(u, r)) {
|
|
@@ -890,11 +886,9 @@ export class AnalyticRoots {
|
|
|
890
886
|
v = Math.sqrt(v);
|
|
891
887
|
}
|
|
892
888
|
else {
|
|
893
|
-
for (let i = 0; i < tempStack.length; i++) {
|
|
894
|
-
results.push(tempStack.atUncheckedIndex(i));
|
|
895
|
-
}
|
|
896
889
|
return;
|
|
897
890
|
}
|
|
891
|
+
// the two quadratic equations
|
|
898
892
|
coffs[0] = z - u;
|
|
899
893
|
coffs[1] = ((q < 0) ? (-v) : (v));
|
|
900
894
|
coffs[2] = 1;
|
|
@@ -905,7 +899,7 @@ export class AnalyticRoots {
|
|
|
905
899
|
this.appendQuadraticRoots(coffs, results);
|
|
906
900
|
}
|
|
907
901
|
// substitute
|
|
908
|
-
this.addConstant(origin, results);
|
|
902
|
+
this.addConstant(origin, results); // apply origin
|
|
909
903
|
results.sort();
|
|
910
904
|
this.improveRoots(c, 4, results, true);
|
|
911
905
|
return;
|
|
@@ -1009,19 +1003,17 @@ export class PowerPolynomial {
|
|
|
1009
1003
|
return this.degreeKnownEvaluate(coff, degree, x);
|
|
1010
1004
|
}
|
|
1011
1005
|
/**
|
|
1012
|
-
*
|
|
1013
|
-
* *
|
|
1014
|
-
* * Returns degree of result as determined by comparing trailing coefficients to zero
|
|
1006
|
+
* Accumulate `coffQ*scaleQ` into `coffP`.
|
|
1007
|
+
* * The length of `coffP` must be at least length of `coffQ`.
|
|
1008
|
+
* * Returns degree of result as determined by comparing trailing coefficients to zero.
|
|
1015
1009
|
*/
|
|
1016
1010
|
static accumulate(coffP, coffQ, scaleQ) {
|
|
1017
1011
|
let degreeP = coffP.length - 1;
|
|
1018
1012
|
const degreeQ = coffQ.length - 1;
|
|
1019
|
-
for (let i = 0; i <= degreeQ; i++)
|
|
1013
|
+
for (let i = 0; i <= degreeQ; i++)
|
|
1020
1014
|
coffP[i] += scaleQ * coffQ[i];
|
|
1021
|
-
|
|
1022
|
-
while (degreeP >= 0 && coffP[degreeP] === 0.0) {
|
|
1015
|
+
while (degreeP >= 0 && coffP[degreeP] === 0.0)
|
|
1023
1016
|
degreeP--;
|
|
1024
|
-
}
|
|
1025
1017
|
return degreeP;
|
|
1026
1018
|
}
|
|
1027
1019
|
/** Zero all coefficients */
|
|
@@ -1037,17 +1029,18 @@ export class PowerPolynomial {
|
|
|
1037
1029
|
*/
|
|
1038
1030
|
export class TrigPolynomial {
|
|
1039
1031
|
/**
|
|
1040
|
-
*
|
|
1041
|
-
*
|
|
1042
|
-
*
|
|
1043
|
-
*
|
|
1044
|
-
*
|
|
1045
|
-
*
|
|
1046
|
-
*
|
|
1047
|
-
*
|
|
1048
|
-
*
|
|
1049
|
-
*
|
|
1050
|
-
*
|
|
1032
|
+
* Solve a polynomial created from trigonometric condition using Trig.S, Trig.C, Trig.W.
|
|
1033
|
+
* * Polynomial is of degree 4:
|
|
1034
|
+
* `coff[0] + coff[1] * t + coff[2] * t^2 + coff[3] * t^3 + coff[4] * t^4`
|
|
1035
|
+
* * Solution logic includes inferring angular roots corresponding zero leading coefficients
|
|
1036
|
+
* (roots at infinity).
|
|
1037
|
+
* @param coff coefficients.
|
|
1038
|
+
* @param nominalDegree degree of the polynomial under most complex root case. If there are
|
|
1039
|
+
* any zero coefficients up to this degree, a single root "at infinity" is recorded as its
|
|
1040
|
+
* corresponding angular parameter at negative pi/2.
|
|
1041
|
+
* @param referenceCoefficient a number which represents the size of coefficients at various
|
|
1042
|
+
* stages of computation. A small fraction of this will be used as a zero tolerance
|
|
1043
|
+
* @param radians roots are placed here.
|
|
1051
1044
|
* @return false if equation is all zeros. This usually means any angle is a solution.
|
|
1052
1045
|
*/
|
|
1053
1046
|
static solveAngles(coff, nominalDegree, referenceCoefficient, radians) {
|
|
@@ -1057,27 +1050,21 @@ export class TrigPolynomial {
|
|
|
1057
1050
|
const relTol = this._smallAngle;
|
|
1058
1051
|
for (let i = 0; i <= nominalDegree; i++) {
|
|
1059
1052
|
a = Math.abs(coff[i]);
|
|
1060
|
-
if (a > maxCoff)
|
|
1053
|
+
if (a > maxCoff)
|
|
1061
1054
|
maxCoff = a;
|
|
1062
|
-
}
|
|
1063
1055
|
}
|
|
1064
1056
|
const coffTol = relTol * maxCoff;
|
|
1065
1057
|
let degree = nominalDegree;
|
|
1066
|
-
while (degree > 0 && (Math.abs(coff[degree]) <= coffTol))
|
|
1058
|
+
while (degree > 0 && (Math.abs(coff[degree]) <= coffTol))
|
|
1067
1059
|
degree--;
|
|
1068
|
-
}
|
|
1069
|
-
// let status = false;
|
|
1070
1060
|
const roots = new GrowableFloat64Array();
|
|
1071
1061
|
if (degree === -1) {
|
|
1072
|
-
// Umm.
|
|
1073
|
-
// status = false;
|
|
1062
|
+
// Umm. Dunno. Nothing there.
|
|
1074
1063
|
}
|
|
1075
1064
|
else {
|
|
1076
|
-
// status = true;
|
|
1077
1065
|
if (degree === 0) {
|
|
1078
1066
|
// p(t) is a nonzero constant
|
|
1079
1067
|
// No roots, but not degenerate.
|
|
1080
|
-
// status = true;
|
|
1081
1068
|
}
|
|
1082
1069
|
else if (degree === 1) {
|
|
1083
1070
|
// p(t) = coff[1] * t + coff[0]
|
|
@@ -1093,13 +1080,12 @@ export class TrigPolynomial {
|
|
|
1093
1080
|
AnalyticRoots.appendQuarticRoots(coff, roots);
|
|
1094
1081
|
}
|
|
1095
1082
|
else {
|
|
1096
|
-
// TODO:
|
|
1097
|
-
// status = false;
|
|
1083
|
+
// TODO: WORK WITH BEZIER SOLVER
|
|
1098
1084
|
}
|
|
1099
1085
|
if (roots.length > 0) {
|
|
1100
1086
|
// Each solution t represents an angle with
|
|
1101
|
-
//
|
|
1102
|
-
// Division by W has no effect on
|
|
1087
|
+
// Math.Cos(theta) = C(t)/W(t) and sin(theta) = S(t)/W(t)
|
|
1088
|
+
// Division by W has no effect on atan2 calculations, so we just compute S(t),C(t)
|
|
1103
1089
|
for (let i = 0; i < roots.length; i++) {
|
|
1104
1090
|
const ss = PowerPolynomial.evaluate(this.S, roots.atUncheckedIndex(i));
|
|
1105
1091
|
const cc = PowerPolynomial.evaluate(this.C, roots.atUncheckedIndex(i));
|
|
@@ -1108,55 +1094,56 @@ export class TrigPolynomial {
|
|
|
1108
1094
|
// Each leading zero at the front of the coefficients corresponds to a root at -PI/2.
|
|
1109
1095
|
// Only make one entry....
|
|
1110
1096
|
// for (int i = degree; i < nominalDegree; i++)
|
|
1111
|
-
if (degree < nominalDegree)
|
|
1097
|
+
if (degree < nominalDegree)
|
|
1112
1098
|
radians.push(-0.5 * Math.PI);
|
|
1113
|
-
}
|
|
1114
1099
|
}
|
|
1115
1100
|
}
|
|
1116
1101
|
return radians.length > 0;
|
|
1117
1102
|
}
|
|
1118
1103
|
/**
|
|
1119
1104
|
* Compute intersections of unit circle `x^2 + y^2 = 1` with general quadric
|
|
1120
|
-
* `axx * x^2 + axy * x * y + ayy * y^2 + ax * x + ay * y +
|
|
1105
|
+
* `axx * x^2 + axy * x * y + ayy * y^2 + ax * x + ay * y + a = 0`
|
|
1121
1106
|
* Solutions are returned as angles. Sine and Cosine of the angles are the x, y results.
|
|
1122
|
-
* @param axx
|
|
1123
|
-
* @param axy
|
|
1124
|
-
* @param ayy
|
|
1125
|
-
* @param ax
|
|
1126
|
-
* @param ay
|
|
1127
|
-
* @param
|
|
1128
|
-
* @param radians
|
|
1107
|
+
* @param axx coefficient of x^2
|
|
1108
|
+
* @param axy coefficient of xy
|
|
1109
|
+
* @param ayy coefficient of y^2
|
|
1110
|
+
* @param ax coefficient of x
|
|
1111
|
+
* @param ay coefficient of y
|
|
1112
|
+
* @param a constant coefficient
|
|
1113
|
+
* @param radians solution angles
|
|
1129
1114
|
*/
|
|
1130
|
-
static solveUnitCircleImplicitQuadricIntersection(axx, axy, ayy, ax, ay,
|
|
1131
|
-
const
|
|
1132
|
-
PowerPolynomial.zero(
|
|
1115
|
+
static solveUnitCircleImplicitQuadricIntersection(axx, axy, ayy, ax, ay, a, radians) {
|
|
1116
|
+
const coffs = new Float64Array(5);
|
|
1117
|
+
PowerPolynomial.zero(coffs);
|
|
1133
1118
|
let degree;
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
PowerPolynomial.accumulate(
|
|
1138
|
-
PowerPolynomial.accumulate(
|
|
1139
|
-
PowerPolynomial.accumulate(
|
|
1140
|
-
PowerPolynomial.accumulate(
|
|
1119
|
+
// see itwinjs-core\core\geometry\internaldocs\unitCircleEllipseIntersection.md
|
|
1120
|
+
// on how coffs (coefficient array) is built.
|
|
1121
|
+
if (Geometry.hypotenuseXYZ(axx, axy, ayy) > TrigPolynomial._coefficientRelTol * Geometry.hypotenuseXYZ(ax, ay, a)) {
|
|
1122
|
+
PowerPolynomial.accumulate(coffs, this.CW, ax);
|
|
1123
|
+
PowerPolynomial.accumulate(coffs, this.SW, ay);
|
|
1124
|
+
PowerPolynomial.accumulate(coffs, this.WW, a);
|
|
1125
|
+
PowerPolynomial.accumulate(coffs, this.SS, ayy);
|
|
1126
|
+
PowerPolynomial.accumulate(coffs, this.CC, axx);
|
|
1127
|
+
PowerPolynomial.accumulate(coffs, this.SC, axy);
|
|
1141
1128
|
degree = 4;
|
|
1142
1129
|
}
|
|
1143
1130
|
else {
|
|
1144
|
-
PowerPolynomial.accumulate(
|
|
1145
|
-
PowerPolynomial.accumulate(
|
|
1146
|
-
PowerPolynomial.accumulate(
|
|
1131
|
+
PowerPolynomial.accumulate(coffs, this.C, ax);
|
|
1132
|
+
PowerPolynomial.accumulate(coffs, this.S, ay);
|
|
1133
|
+
PowerPolynomial.accumulate(coffs, this.W, a);
|
|
1147
1134
|
degree = 2;
|
|
1148
1135
|
}
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
const b = this.solveAngles(Coffs, degree, maxCoff, radians);
|
|
1136
|
+
const maxCoff = Math.max(Math.abs(axx), Math.abs(ayy), Math.abs(axy), Math.abs(ax), Math.abs(ay), Math.abs(a));
|
|
1137
|
+
const b = this.solveAngles(coffs, degree, maxCoff, radians);
|
|
1152
1138
|
/*
|
|
1153
1139
|
for (const theta of angles) {
|
|
1154
1140
|
const c = theta.cos();
|
|
1155
1141
|
const s = theta.sin();
|
|
1156
1142
|
GeometryCoreTestIO.consoleLog({
|
|
1157
1143
|
angle: theta, co: c, si: s,
|
|
1158
|
-
f: axx * c * c + axy * c * s + ayy * s * s + ax * c + ay * s +
|
|
1159
|
-
|
|
1144
|
+
f: axx * c * c + axy * c * s + ayy * s * s + ax * c + ay * s + a,
|
|
1145
|
+
});
|
|
1146
|
+
} */
|
|
1160
1147
|
return b;
|
|
1161
1148
|
}
|
|
1162
1149
|
/**
|
|
@@ -1191,7 +1178,7 @@ export class TrigPolynomial {
|
|
|
1191
1178
|
return status;
|
|
1192
1179
|
}
|
|
1193
1180
|
/**
|
|
1194
|
-
* Compute intersections of unit circle `x^2 + y^2 = w^2` with the ellipse
|
|
1181
|
+
* Compute intersections of unit circle `x^2 + y^2 = w^2` (in homogeneous coordinates) with the ellipse
|
|
1195
1182
|
* `F(t) = (cx + ux cos(t) + vx sin(t), cy + uy cos(t) + vy sin(t)) / (cw + uw cos(t) + vw sin(t))`.
|
|
1196
1183
|
* @param cx center x
|
|
1197
1184
|
* @param cy center y
|
|
@@ -1207,13 +1194,15 @@ export class TrigPolynomial {
|
|
|
1207
1194
|
*/
|
|
1208
1195
|
static solveUnitCircleHomogeneousEllipseIntersection(cx, cy, cw, ux, uy, uw, vx, vy, vw, ellipseRadians, circleRadians) {
|
|
1209
1196
|
circleRadians.length = 0;
|
|
1197
|
+
// see itwinjs-core\core\geometry\internaldocs\unitCircleEllipseIntersection.md
|
|
1198
|
+
// on how below variables are derived.
|
|
1210
1199
|
const acc = ux * ux + uy * uy - uw * uw;
|
|
1211
1200
|
const acs = 2.0 * (ux * vx + uy * vy - uw * vw);
|
|
1212
1201
|
const ass = vx * vx + vy * vy - vw * vw;
|
|
1213
1202
|
const ac = 2.0 * (ux * cx + uy * cy - uw * cw);
|
|
1214
|
-
const
|
|
1203
|
+
const as = 2.0 * (vx * cx + vy * cy - vw * cw);
|
|
1215
1204
|
const a = cx * cx + cy * cy - cw * cw;
|
|
1216
|
-
const status = this.solveUnitCircleImplicitQuadricIntersection(acc, acs, ass, ac,
|
|
1205
|
+
const status = this.solveUnitCircleImplicitQuadricIntersection(acc, acs, ass, ac, as, a, ellipseRadians);
|
|
1217
1206
|
for (const radians of ellipseRadians) {
|
|
1218
1207
|
const cc = Math.cos(radians);
|
|
1219
1208
|
const ss = Math.sin(radians);
|
|
@@ -1226,25 +1215,27 @@ export class TrigPolynomial {
|
|
|
1226
1215
|
}
|
|
1227
1216
|
// tolerance for small angle decision.
|
|
1228
1217
|
TrigPolynomial._smallAngle = 1.0e-11;
|
|
1229
|
-
|
|
1218
|
+
// see itwinjs-core\core\geometry\internaldocs\unitCircleEllipseIntersection.md
|
|
1219
|
+
// on how below variables are derived.
|
|
1220
|
+
/** Standard Basis coefficients for the numerator of the y-coordinate y(t) = S(t)/W(t) in the rational semicircle parameterization. */
|
|
1230
1221
|
TrigPolynomial.S = Float64Array.from([0.0, 2.0, -2.0]);
|
|
1231
|
-
/** Standard Basis coefficients for rational
|
|
1222
|
+
/** Standard Basis coefficients for the numerator of the x-coordinate x(t) = C(t)/W(t) in the rational semicircle parameterization. */
|
|
1232
1223
|
TrigPolynomial.C = Float64Array.from([1.0, -2.0]);
|
|
1233
|
-
/** Standard Basis coefficients for rational
|
|
1224
|
+
/** Standard Basis coefficients for the denominator of x(t) and y(t) in the rational semicircle parameterization. */
|
|
1234
1225
|
TrigPolynomial.W = Float64Array.from([1.0, -2.0, 2.0]);
|
|
1235
|
-
/** Standard Basis coefficients for
|
|
1226
|
+
/** Standard Basis coefficients for C(t) * W(t). */
|
|
1236
1227
|
TrigPolynomial.CW = Float64Array.from([1.0, -4.0, 6.0, -4.0]);
|
|
1237
|
-
/** Standard Basis coefficients for
|
|
1228
|
+
/** Standard Basis coefficients for S(t) * W(t). */
|
|
1238
1229
|
TrigPolynomial.SW = Float64Array.from([0.0, 2.0, -6.0, 8.0, -4.0]);
|
|
1239
|
-
/** Standard Basis coefficients for
|
|
1230
|
+
/** Standard Basis coefficients for S(t) * C(t). */
|
|
1240
1231
|
TrigPolynomial.SC = Float64Array.from([0.0, 2.0, -6.0, 4.0]);
|
|
1241
|
-
/** Standard Basis coefficients for
|
|
1232
|
+
/** Standard Basis coefficients for S(t) * S(t). */
|
|
1242
1233
|
TrigPolynomial.SS = Float64Array.from([0.0, 0.0, 4.0, -8.0, 4.0]);
|
|
1243
|
-
/** Standard Basis coefficients for
|
|
1234
|
+
/** Standard Basis coefficients for C(t) * C(t). */
|
|
1244
1235
|
TrigPolynomial.CC = Float64Array.from([1.0, -4.0, 4.0]);
|
|
1245
|
-
/** Standard Basis coefficients for
|
|
1236
|
+
/** Standard Basis coefficients for W(t) * W(t). */
|
|
1246
1237
|
TrigPolynomial.WW = Float64Array.from([1.0, -4.0, 8.0, -8.0, 4.0]);
|
|
1247
|
-
/** Standard Basis coefficients for (
|
|
1238
|
+
/** Standard Basis coefficients for C(t) * C(t) - S(t) * S(t). */
|
|
1248
1239
|
TrigPolynomial.CCminusSS = Float64Array.from([1.0, -4.0, 0.0, 8.0, -4.0]);
|
|
1249
1240
|
TrigPolynomial._coefficientRelTol = 1.0e-12;
|
|
1250
1241
|
/**
|