@itwin/core-geometry 4.10.0-dev.3 → 4.10.0-dev.6

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.
Files changed (69) hide show
  1. package/lib/cjs/Geometry.d.ts +2 -2
  2. package/lib/cjs/Geometry.js +2 -2
  3. package/lib/cjs/Geometry.js.map +1 -1
  4. package/lib/cjs/clipping/ClipPrimitive.d.ts +7 -7
  5. package/lib/cjs/clipping/ClipPrimitive.d.ts.map +1 -1
  6. package/lib/cjs/clipping/ClipPrimitive.js +1 -1
  7. package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
  8. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +27 -8
  9. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  10. package/lib/cjs/curve/CurveChainWithDistanceIndex.js +44 -25
  11. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  12. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts +1 -0
  13. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  14. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +30 -56
  15. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  16. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.d.ts +22 -7
  17. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -1
  18. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js +127 -67
  19. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  20. package/lib/cjs/geometry3d/Angle.d.ts +5 -5
  21. package/lib/cjs/geometry3d/Angle.js +5 -5
  22. package/lib/cjs/geometry3d/Angle.js.map +1 -1
  23. package/lib/cjs/geometry3d/AngleSweep.d.ts +91 -7
  24. package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
  25. package/lib/cjs/geometry3d/AngleSweep.js +141 -45
  26. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  27. package/lib/cjs/geometry3d/Matrix3d.d.ts +7 -14
  28. package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
  29. package/lib/cjs/geometry3d/Matrix3d.js +19 -14
  30. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  31. package/lib/cjs/geometry3d/Transform.d.ts +4 -2
  32. package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
  33. package/lib/cjs/geometry3d/Transform.js +4 -2
  34. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  35. package/lib/esm/Geometry.d.ts +2 -2
  36. package/lib/esm/Geometry.js +2 -2
  37. package/lib/esm/Geometry.js.map +1 -1
  38. package/lib/esm/clipping/ClipPrimitive.d.ts +7 -7
  39. package/lib/esm/clipping/ClipPrimitive.d.ts.map +1 -1
  40. package/lib/esm/clipping/ClipPrimitive.js +1 -1
  41. package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
  42. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +27 -8
  43. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  44. package/lib/esm/curve/CurveChainWithDistanceIndex.js +44 -25
  45. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  46. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts +1 -0
  47. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  48. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +30 -56
  49. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  50. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.d.ts +22 -7
  51. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -1
  52. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js +127 -67
  53. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  54. package/lib/esm/geometry3d/Angle.d.ts +5 -5
  55. package/lib/esm/geometry3d/Angle.js +5 -5
  56. package/lib/esm/geometry3d/Angle.js.map +1 -1
  57. package/lib/esm/geometry3d/AngleSweep.d.ts +91 -7
  58. package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
  59. package/lib/esm/geometry3d/AngleSweep.js +141 -45
  60. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  61. package/lib/esm/geometry3d/Matrix3d.d.ts +7 -14
  62. package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
  63. package/lib/esm/geometry3d/Matrix3d.js +19 -14
  64. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  65. package/lib/esm/geometry3d/Transform.d.ts +4 -2
  66. package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
  67. package/lib/esm/geometry3d/Transform.js +4 -2
  68. package/lib/esm/geometry3d/Transform.js.map +1 -1
  69. package/package.json +3 -3
@@ -116,6 +116,7 @@ export declare class AngleSweep implements BeJSONFunctions {
116
116
  /**
117
117
  * Return 2PI divided by the sweep radians (i.e. 360 degrees divided by sweep angle).
118
118
  * * This is the number of fractional intervals required to cover a whole circle.
119
+ * @returns period of the sweep, or 1 if sweep is empty.
119
120
  */
120
121
  fractionPeriod(): number;
121
122
  /**
@@ -129,39 +130,70 @@ export declare class AngleSweep implements BeJSONFunctions {
129
130
  * * fraction larger than one for angles "before" the start angle if start > end
130
131
  * * negative fraction for angles "after" the end angle if start > end
131
132
  * * does not allow period shift
133
+ * @returns unbounded fraction, or 1 if sweep is empty.
132
134
  */
133
135
  angleToUnboundedFraction(theta: Angle): number;
136
+ /**
137
+ * Convert a sweep fraction to the equivalent period-shifted fraction inside the sweep, or within one period of zero
138
+ * on the desired side.
139
+ * @param fraction fraction of the sweep.
140
+ * @param radians0 start angle of sweep (in radians).
141
+ * @param radians1 end angle of sweep (in radians).
142
+ * @param toNegativeFraction return an exterior fraction period-shifted to within one period of the start (true) or
143
+ * end (false) of the sweep.
144
+ * @returns period-shifted fraction. If `fraction` is already in [0,1], or the sweep is empty, then `fraction` is
145
+ * returned unchanged.
146
+ */
147
+ static fractionToSignedPeriodicFractionStartEnd(fraction: number, radians0: number, radians1: number, toNegativeFraction: boolean): number;
148
+ /**
149
+ * Convert a sweep fraction to the equivalent period-shifted fraction inside this sweep, or within one period of
150
+ * zero on the desired side.
151
+ * @param fraction fraction of the sweep.
152
+ * @param toNegativeFraction return an exterior fraction period-shifted to within one period of the start (true) or
153
+ * end (false) of the sweep.
154
+ * @returns period-shifted fraction. If `fraction` is already in [0,1], or the sweep is empty, then `fraction` is
155
+ * returned unchanged.
156
+ */
157
+ fractionToSignedPeriodicFraction(fraction: number, toNegativeFraction: boolean): number;
134
158
  /**
135
159
  * Return the fractionalized position of the given angle (as radians), computed with consideration of 2PI period.
136
160
  * * consider radians0 as `start` angle of the sweep and radians1 as `end` angle of the sweep
137
- * * fraction is always positive
138
161
  * * the start angle is at fraction 0
139
162
  * * the end angle is at fraction 1
140
163
  * * interior angles are between 0 and 1
141
164
  * * all exterior angles are at fractions greater than 1
142
165
  * * allows period shift
166
+ * @param radians input angle (in radians)
167
+ * @param radians0 start angle of sweep (in radians)
168
+ * @param radians1 end angle of sweep (in radians)
169
+ * @param zeroSweepDefault return value when the sweep is empty (default 0)
170
+ * @returns nonnegative fraction, or `zeroSweepDefault` if the sweep is empty.
143
171
  */
144
172
  static radiansToPositivePeriodicFractionStartEnd(radians: number, radians0: number, radians1: number, zeroSweepDefault?: number): number;
145
173
  /**
146
174
  * Return the fractionalized position of the given angle (as radians), computed with consideration of 2PI period.
147
- * * fraction is always positive
148
175
  * * the start angle is at fraction 0
149
176
  * * the end angle is at fraction 1
150
177
  * * interior angles are between 0 and 1
151
178
  * * all exterior angles are at fractions greater than 1
152
179
  * * allows period shift
180
+ * @param radians input angle (in radians)
181
+ * @param zeroSweepDefault return value when this sweep is empty (default 0)
182
+ * @returns nonnegative fraction, or `zeroSweepDefault` if the sweep is empty.
153
183
  */
154
184
  radiansToPositivePeriodicFraction(radians: number, zeroSweepDefault?: number): number;
155
185
  /**
156
186
  * Return the fractionalized position of the given angle (as Angle), computed with consideration of 2PI period.
157
- * * fraction is always positive
158
187
  * * the start angle is at fraction 0
159
188
  * * the end angle is at fraction 1
160
189
  * * interior angles are between 0 and 1
161
190
  * * all exterior angles are at fractions greater than 1
162
191
  * * allows period shift
192
+ * @param theta input angle
193
+ * @param zeroSweepDefault return value when this sweep is empty (default 0)
194
+ * @returns nonnegative fraction, or `zeroSweepDefault` if the sweep is empty.
163
195
  */
164
- angleToPositivePeriodicFraction(theta: Angle): number;
196
+ angleToPositivePeriodicFraction(theta: Angle, zeroSweepDefault?: number): number;
165
197
  /**
166
198
  * Return the fractionalized position of the given array of angles (as radian), computed with consideration of 2PI period.
167
199
  * * fraction is always positive
@@ -181,8 +213,13 @@ export declare class AngleSweep implements BeJSONFunctions {
181
213
  * * negative fraction for angles "before" the start angle
182
214
  * * fraction larger than one for angles "after" the end angle
183
215
  * * allows period shift
216
+ * @param radians input angle (in radians)
217
+ * @param radians0 start angle of sweep (in radians)
218
+ * @param radians1 end angle of sweep (in radians)
219
+ * @param zeroSweepDefault return value when the sweep is empty (default 0)
220
+ * @returns fraction, or `zeroSweepDefault` if the sweep is empty.
184
221
  */
185
- static radiansToSignedPeriodicFractionStartEnd(radians: number, radians0: number, radians1: number): number;
222
+ static radiansToSignedPeriodicFractionStartEnd(radians: number, radians0: number, radians1: number, zeroSweepDefault?: number): number;
186
223
  /**
187
224
  * Return the fractionalized position of the given angle (as radians) computed with consideration of
188
225
  * 2PI period and with consideration of angle sweep direction (CW or CCW).
@@ -192,8 +229,11 @@ export declare class AngleSweep implements BeJSONFunctions {
192
229
  * * negative fraction for angles "before" the start angle
193
230
  * * fraction larger than one for angles "after" the end angle
194
231
  * * allows period shift
232
+ * @param radians input angle (in radians)
233
+ * @param zeroSweepDefault return value when this sweep is empty (default 0)
234
+ * @returns fraction, or `zeroSweepDefault` if this sweep is empty.
195
235
  */
196
- radiansToSignedPeriodicFraction(radians: number): number;
236
+ radiansToSignedPeriodicFraction(radians: number, zeroSweepDefault?: number): number;
197
237
  /**
198
238
  * Return the fractionalized position of the given angle (as Angle) computed with consideration of
199
239
  * 2PI period and with consideration of angle sweep direction (CW or CCW).
@@ -203,8 +243,52 @@ export declare class AngleSweep implements BeJSONFunctions {
203
243
  * * negative fraction for angles "before" the start angle
204
244
  * * fraction larger than one for angles "after" the end angle
205
245
  * * allows period shift
246
+ * @param theta input angle
247
+ * @param zeroSweepDefault return value when this sweep is empty (default 0)
248
+ * @returns fraction, or `zeroSweepDefault` if this sweep is empty.
249
+ */
250
+ angleToSignedPeriodicFraction(theta: Angle, zeroSweepDefault?: number): number;
251
+ /**
252
+ * Return the fractionalized position of the given radian angle with respect to the sweep.
253
+ * * The start angle returns fraction 0
254
+ * * The end angle returns fraction 1
255
+ * * Interior angles (and their multiples of 2PI) return fractions in [0,1].
256
+ * * Exterior angles return fractions outside [0,1] according to `toNegativeFraction`.
257
+ * @param radians input angle (in radians)
258
+ * @param radians0 start angle of sweep (in radians)
259
+ * @param radians1 end angle of sweep (in radians)
260
+ * @param toNegativeFraction convert an exterior angle to a negative number (true), or to
261
+ * a number greater than one (false, default). If false, this is just [[radiansToPositivePeriodicFractionStartEnd]].
262
+ * @param zeroSweepDefault return value when the sweep is empty (default 0).
263
+ * @returns fraction, or `zeroSweepDefault` if the sweep is empty
264
+ */
265
+ static radiansToSignedFractionStartEnd(radians: number, radians0: number, radians1: number, toNegativeFraction?: boolean, zeroSweepDefault?: number): number;
266
+ /**
267
+ * Return the fractionalized position of the given radian angle with respect to this sweep.
268
+ * * The start angle returns fraction 0
269
+ * * The end angle returns fraction 1
270
+ * * Interior angles (and their multiples of 2PI) return fractions in [0,1].
271
+ * * Exterior angles return fractions outside [0,1] according to `toNegativeFraction`.
272
+ * @param radians input angle (in radians)
273
+ * @param toNegativeFraction convert an exterior angle to a negative number (true), or to
274
+ * a number greater than one (false, default). If false, this is just [[radiansToPositivePeriodicFraction]].
275
+ * @param zeroSweepDefault return value when this sweep is empty (default 0).
276
+ * @returns fraction, or `zeroSweepDefault` if this sweep is empty
277
+ */
278
+ radiansToSignedFraction(radians: number, toNegativeFraction?: boolean, zeroSweepDefault?: number): number;
279
+ /**
280
+ * Return the fractionalized position of the given angle with respect to this sweep.
281
+ * * The start angle returns fraction 0
282
+ * * The end angle returns fraction 1
283
+ * * Interior angles (and their multiples of 2PI) return fractions in [0,1].
284
+ * * Exterior angles return fractions outside [0,1] according to `toNegativeFraction`.
285
+ * @param theta input angle
286
+ * @param toNegativeFraction convert an exterior angle to a negative number (true), or to
287
+ * a number greater than one (false, default). If false, this is just [[angleToPositivePeriodicFraction]].
288
+ * @param zeroSweepDefault return value when this sweep is empty (default 0).
289
+ * @returns fraction, or `zeroSweepDefault` if this sweep is empty
206
290
  */
207
- angleToSignedPeriodicFraction(theta: Angle): number;
291
+ angleToSignedFraction(theta: Angle, toNegativeFraction?: boolean, zeroSweepDefault?: number): number;
208
292
  /** Test if the given angle (as radians) is within sweep (between radians0 and radians1) */
209
293
  static isRadiansInStartEnd(radians: number, radians0: number, radians1: number, allowPeriodShift?: boolean): boolean;
210
294
  /** Test if the given angle (as radians) is within sweep */
@@ -1 +1 @@
1
- {"version":3,"file":"AngleSweep.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/AngleSweep.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,eAAe,EAAY,MAAM,aAAa,CAAC;AACzE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,UAAW,YAAW,eAAe;IAChD,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,SAAS,CAAS;IAC1B,iEAAiE;IACjE,IAAW,YAAY,WAEtB;IACD,+DAA+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OAAO,EAAE,MAAM,EAAE,kBAAkB,GAAE,OAAe,EAAE,gBAAgB,GAAE,MAAY,GAAG,MAAM;IAG5H;;;;;;;;;;;OAWG;IACI,qBAAqB,CAAC,KAAK,EAAE,KAAK,EAAE,kBAAkB,GAAE,OAAe,EAAE,gBAAgB,GAAE,MAAY,GAAG,MAAM;IAIvH,6FAA6F;WAC/E,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,gBAAgB,GAAE,OAAc,GAAG,OAAO;IASjI,4DAA4D;IACrD,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,gBAAgB,GAAE,OAAc,GAAG,OAAO;IAGnF,6DAA6D;IACtD,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO;IAG5C;;;;;;;;OAQG;IACI,WAAW,CAAC,IAAI,CAAC,EAAE,GAAG;IAc7B,+CAA+C;WACjC,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,UAAU;IAK1D;;;OAGG;IACI,MAAM,IAAI,GAAG;IAGpB;;;OAGG;IACI,6BAA6B,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO;IAMhE;;;OAGG;IACI,0BAA0B,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO;IAI7D;;;;;OAKG;IACI,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO;CAGjD"}
@@ -213,9 +213,10 @@ export class AngleSweep {
213
213
  /**
214
214
  * Return 2PI divided by the sweep radians (i.e. 360 degrees divided by sweep angle).
215
215
  * * This is the number of fractional intervals required to cover a whole circle.
216
+ * @returns period of the sweep, or 1 if sweep is empty.
216
217
  */
217
218
  fractionPeriod() {
218
- return Geometry.safeDivideFraction(Math.PI * 2.0, Math.abs(this._radians1 - this._radians0), 1.0);
219
+ return this.isEmpty ? 1.0 : Angle.pi2Radians / Math.abs(this._radians1 - this._radians0);
219
220
  }
220
221
  /**
221
222
  * Return the fractionalized position of the given angle (as Angle) computed without consideration of
@@ -228,68 +229,100 @@ export class AngleSweep {
228
229
  * * fraction larger than one for angles "before" the start angle if start > end
229
230
  * * negative fraction for angles "after" the end angle if start > end
230
231
  * * does not allow period shift
232
+ * @returns unbounded fraction, or 1 if sweep is empty.
231
233
  */
232
234
  angleToUnboundedFraction(theta) {
233
- return Geometry.safeDivideFraction(theta.radians - this._radians0, this._radians1 - this._radians0, 1.0);
235
+ return this.isEmpty ? 1.0 : (theta.radians - this._radians0) / (this._radians1 - this._radians0);
236
+ }
237
+ /**
238
+ * Convert a sweep fraction to the equivalent period-shifted fraction inside the sweep, or within one period of zero
239
+ * on the desired side.
240
+ * @param fraction fraction of the sweep.
241
+ * @param radians0 start angle of sweep (in radians).
242
+ * @param radians1 end angle of sweep (in radians).
243
+ * @param toNegativeFraction return an exterior fraction period-shifted to within one period of the start (true) or
244
+ * end (false) of the sweep.
245
+ * @returns period-shifted fraction. If `fraction` is already in [0,1], or the sweep is empty, then `fraction` is
246
+ * returned unchanged.
247
+ */
248
+ static fractionToSignedPeriodicFractionStartEnd(fraction, radians0, radians1, toNegativeFraction) {
249
+ const sweep = radians1 - radians0;
250
+ if (Angle.isAlmostEqualRadiansNoPeriodShift(0, sweep))
251
+ return fraction; // empty sweep
252
+ if (Geometry.isIn01(fraction))
253
+ return fraction;
254
+ const period = Angle.pi2Radians / Math.abs(sweep);
255
+ fraction = fraction % period; // period-shifted equivalent fraction closest to 0 with same sign as fraction
256
+ if (fraction + period < 1)
257
+ fraction += period; // it's really an interior fraction
258
+ if (Geometry.isIn01(fraction) || (toNegativeFraction && fraction < 0) || (!toNegativeFraction && fraction > 1))
259
+ return fraction;
260
+ return toNegativeFraction ? fraction - period : fraction + period; // shift to other side of sweep
261
+ }
262
+ /**
263
+ * Convert a sweep fraction to the equivalent period-shifted fraction inside this sweep, or within one period of
264
+ * zero on the desired side.
265
+ * @param fraction fraction of the sweep.
266
+ * @param toNegativeFraction return an exterior fraction period-shifted to within one period of the start (true) or
267
+ * end (false) of the sweep.
268
+ * @returns period-shifted fraction. If `fraction` is already in [0,1], or the sweep is empty, then `fraction` is
269
+ * returned unchanged.
270
+ */
271
+ fractionToSignedPeriodicFraction(fraction, toNegativeFraction) {
272
+ return AngleSweep.fractionToSignedPeriodicFractionStartEnd(fraction, this._radians0, this._radians1, toNegativeFraction);
234
273
  }
235
274
  /**
236
275
  * Return the fractionalized position of the given angle (as radians), computed with consideration of 2PI period.
237
276
  * * consider radians0 as `start` angle of the sweep and radians1 as `end` angle of the sweep
238
- * * fraction is always positive
239
277
  * * the start angle is at fraction 0
240
278
  * * the end angle is at fraction 1
241
279
  * * interior angles are between 0 and 1
242
280
  * * all exterior angles are at fractions greater than 1
243
281
  * * allows period shift
282
+ * @param radians input angle (in radians)
283
+ * @param radians0 start angle of sweep (in radians)
284
+ * @param radians1 end angle of sweep (in radians)
285
+ * @param zeroSweepDefault return value when the sweep is empty (default 0)
286
+ * @returns nonnegative fraction, or `zeroSweepDefault` if the sweep is empty.
244
287
  */
245
288
  static radiansToPositivePeriodicFractionStartEnd(radians, radians0, radians1, zeroSweepDefault = 0.0) {
246
- if (Angle.isAlmostEqualRadiansAllowPeriodShift(radians0, radians1)) {
247
- // for 2nPi sweep, allow matching without period shift, else we never return 1.0
248
- if (Angle.isAlmostEqualRadiansNoPeriodShift(radians, radians0))
249
- return 0.0;
250
- if (Angle.isAlmostEqualRadiansNoPeriodShift(radians, radians1))
251
- return 1.0;
252
- }
253
- else {
254
- if (Angle.isAlmostEqualRadiansAllowPeriodShift(radians, radians0))
255
- return 0.0;
256
- if (Angle.isAlmostEqualRadiansAllowPeriodShift(radians, radians1))
257
- return 1.0;
289
+ const zeroSweepMarker = Geometry.largeCoordinateResult;
290
+ let fraction = this.radiansToSignedPeriodicFractionStartEnd(radians, radians0, radians1, zeroSweepMarker);
291
+ if (fraction === zeroSweepMarker)
292
+ return zeroSweepDefault;
293
+ if (fraction < 0) {
294
+ const period = Angle.pi2Radians / Math.abs(radians1 - radians0);
295
+ fraction += period;
258
296
  }
259
- const sweep = radians1 - radians0;
260
- const delta = radians - radians0;
261
- if (sweep > 0) {
262
- const delta1 = Angle.adjustRadians0To2Pi(delta);
263
- const fraction1 = Geometry.safeDivideFraction(delta1, sweep, zeroSweepDefault);
264
- return fraction1;
265
- }
266
- const delta2 = Angle.adjustRadians0To2Pi(-delta);
267
- const fraction2 = Geometry.safeDivideFraction(delta2, -sweep, zeroSweepDefault);
268
- return fraction2;
297
+ return fraction;
269
298
  }
270
299
  /**
271
300
  * Return the fractionalized position of the given angle (as radians), computed with consideration of 2PI period.
272
- * * fraction is always positive
273
301
  * * the start angle is at fraction 0
274
302
  * * the end angle is at fraction 1
275
303
  * * interior angles are between 0 and 1
276
304
  * * all exterior angles are at fractions greater than 1
277
305
  * * allows period shift
306
+ * @param radians input angle (in radians)
307
+ * @param zeroSweepDefault return value when this sweep is empty (default 0)
308
+ * @returns nonnegative fraction, or `zeroSweepDefault` if the sweep is empty.
278
309
  */
279
310
  radiansToPositivePeriodicFraction(radians, zeroSweepDefault = 0.0) {
280
311
  return AngleSweep.radiansToPositivePeriodicFractionStartEnd(radians, this._radians0, this._radians1, zeroSweepDefault);
281
312
  }
282
313
  /**
283
314
  * Return the fractionalized position of the given angle (as Angle), computed with consideration of 2PI period.
284
- * * fraction is always positive
285
315
  * * the start angle is at fraction 0
286
316
  * * the end angle is at fraction 1
287
317
  * * interior angles are between 0 and 1
288
318
  * * all exterior angles are at fractions greater than 1
289
319
  * * allows period shift
320
+ * @param theta input angle
321
+ * @param zeroSweepDefault return value when this sweep is empty (default 0)
322
+ * @returns nonnegative fraction, or `zeroSweepDefault` if the sweep is empty.
290
323
  */
291
- angleToPositivePeriodicFraction(theta) {
292
- return this.radiansToPositivePeriodicFraction(theta.radians);
324
+ angleToPositivePeriodicFraction(theta, zeroSweepDefault = 0.0) {
325
+ return this.radiansToPositivePeriodicFraction(theta.radians, zeroSweepDefault);
293
326
  }
294
327
  /**
295
328
  * Return the fractionalized position of the given array of angles (as radian), computed with consideration of 2PI period.
@@ -315,10 +348,18 @@ export class AngleSweep {
315
348
  * * negative fraction for angles "before" the start angle
316
349
  * * fraction larger than one for angles "after" the end angle
317
350
  * * allows period shift
351
+ * @param radians input angle (in radians)
352
+ * @param radians0 start angle of sweep (in radians)
353
+ * @param radians1 end angle of sweep (in radians)
354
+ * @param zeroSweepDefault return value when the sweep is empty (default 0)
355
+ * @returns fraction, or `zeroSweepDefault` if the sweep is empty.
318
356
  */
319
- static radiansToSignedPeriodicFractionStartEnd(radians, radians0, radians1) {
357
+ static radiansToSignedPeriodicFractionStartEnd(radians, radians0, radians1, zeroSweepDefault = 0.0) {
358
+ const sweep = radians1 - radians0;
359
+ if (Angle.isAlmostEqualRadiansNoPeriodShift(0, sweep))
360
+ return zeroSweepDefault;
320
361
  if (Angle.isAlmostEqualRadiansAllowPeriodShift(radians0, radians1)) {
321
- // for 2nPi sweep, allow matching without period shift, else we never return 1.0
362
+ // for sweep = 2nPi !== 0, allow matching without period shift, else we never return 1.0
322
363
  if (Angle.isAlmostEqualRadiansNoPeriodShift(radians, radians0))
323
364
  return 0.0;
324
365
  if (Angle.isAlmostEqualRadiansNoPeriodShift(radians, radians1))
@@ -330,16 +371,8 @@ export class AngleSweep {
330
371
  if (Angle.isAlmostEqualRadiansAllowPeriodShift(radians, radians1))
331
372
  return 1.0;
332
373
  }
333
- const sweep = radians1 - radians0;
334
- const delta = radians - radians0 - 0.5 * sweep; // measure from middle of interval
335
- if (sweep > 0) {
336
- const delta1 = Angle.adjustRadiansMinusPiPlusPi(delta);
337
- const fraction1 = 0.5 + Geometry.safeDivideFraction(delta1, sweep, 0.0);
338
- return fraction1;
339
- }
340
- const delta2 = Angle.adjustRadiansMinusPiPlusPi(-delta);
341
- const fraction = 0.5 + Geometry.safeDivideFraction(delta2, -sweep, 0.0);
342
- return fraction;
374
+ const fraction = (radians - radians0) / sweep;
375
+ return this.fractionToSignedPeriodicFractionStartEnd(fraction, radians0, radians1, fraction < 0);
343
376
  }
344
377
  /**
345
378
  * Return the fractionalized position of the given angle (as radians) computed with consideration of
@@ -350,9 +383,12 @@ export class AngleSweep {
350
383
  * * negative fraction for angles "before" the start angle
351
384
  * * fraction larger than one for angles "after" the end angle
352
385
  * * allows period shift
386
+ * @param radians input angle (in radians)
387
+ * @param zeroSweepDefault return value when this sweep is empty (default 0)
388
+ * @returns fraction, or `zeroSweepDefault` if this sweep is empty.
353
389
  */
354
- radiansToSignedPeriodicFraction(radians) {
355
- return AngleSweep.radiansToSignedPeriodicFractionStartEnd(radians, this._radians0, this._radians1);
390
+ radiansToSignedPeriodicFraction(radians, zeroSweepDefault = 0.0) {
391
+ return AngleSweep.radiansToSignedPeriodicFractionStartEnd(radians, this._radians0, this._radians1, zeroSweepDefault);
356
392
  }
357
393
  /**
358
394
  * Return the fractionalized position of the given angle (as Angle) computed with consideration of
@@ -363,9 +399,69 @@ export class AngleSweep {
363
399
  * * negative fraction for angles "before" the start angle
364
400
  * * fraction larger than one for angles "after" the end angle
365
401
  * * allows period shift
402
+ * @param theta input angle
403
+ * @param zeroSweepDefault return value when this sweep is empty (default 0)
404
+ * @returns fraction, or `zeroSweepDefault` if this sweep is empty.
405
+ */
406
+ angleToSignedPeriodicFraction(theta, zeroSweepDefault = 0.0) {
407
+ return this.radiansToSignedPeriodicFraction(theta.radians, zeroSweepDefault);
408
+ }
409
+ /**
410
+ * Return the fractionalized position of the given radian angle with respect to the sweep.
411
+ * * The start angle returns fraction 0
412
+ * * The end angle returns fraction 1
413
+ * * Interior angles (and their multiples of 2PI) return fractions in [0,1].
414
+ * * Exterior angles return fractions outside [0,1] according to `toNegativeFraction`.
415
+ * @param radians input angle (in radians)
416
+ * @param radians0 start angle of sweep (in radians)
417
+ * @param radians1 end angle of sweep (in radians)
418
+ * @param toNegativeFraction convert an exterior angle to a negative number (true), or to
419
+ * a number greater than one (false, default). If false, this is just [[radiansToPositivePeriodicFractionStartEnd]].
420
+ * @param zeroSweepDefault return value when the sweep is empty (default 0).
421
+ * @returns fraction, or `zeroSweepDefault` if the sweep is empty
422
+ */
423
+ static radiansToSignedFractionStartEnd(radians, radians0, radians1, toNegativeFraction = false, zeroSweepDefault = 0.0) {
424
+ const zeroSweepMarker = Geometry.largeCoordinateResult;
425
+ let fraction = this.radiansToSignedPeriodicFractionStartEnd(radians, radians0, radians1, zeroSweepMarker);
426
+ if (fraction === zeroSweepMarker)
427
+ return zeroSweepDefault;
428
+ if ((toNegativeFraction && fraction > 1) || (!toNegativeFraction && fraction < 0)) {
429
+ let period = Angle.pi2Radians / Math.abs(radians1 - radians0);
430
+ if (toNegativeFraction)
431
+ period = -period;
432
+ fraction += period;
433
+ }
434
+ return fraction;
435
+ }
436
+ /**
437
+ * Return the fractionalized position of the given radian angle with respect to this sweep.
438
+ * * The start angle returns fraction 0
439
+ * * The end angle returns fraction 1
440
+ * * Interior angles (and their multiples of 2PI) return fractions in [0,1].
441
+ * * Exterior angles return fractions outside [0,1] according to `toNegativeFraction`.
442
+ * @param radians input angle (in radians)
443
+ * @param toNegativeFraction convert an exterior angle to a negative number (true), or to
444
+ * a number greater than one (false, default). If false, this is just [[radiansToPositivePeriodicFraction]].
445
+ * @param zeroSweepDefault return value when this sweep is empty (default 0).
446
+ * @returns fraction, or `zeroSweepDefault` if this sweep is empty
447
+ */
448
+ radiansToSignedFraction(radians, toNegativeFraction = false, zeroSweepDefault = 0.0) {
449
+ return AngleSweep.radiansToSignedFractionStartEnd(radians, this._radians0, this._radians1, toNegativeFraction, zeroSweepDefault);
450
+ }
451
+ /**
452
+ * Return the fractionalized position of the given angle with respect to this sweep.
453
+ * * The start angle returns fraction 0
454
+ * * The end angle returns fraction 1
455
+ * * Interior angles (and their multiples of 2PI) return fractions in [0,1].
456
+ * * Exterior angles return fractions outside [0,1] according to `toNegativeFraction`.
457
+ * @param theta input angle
458
+ * @param toNegativeFraction convert an exterior angle to a negative number (true), or to
459
+ * a number greater than one (false, default). If false, this is just [[angleToPositivePeriodicFraction]].
460
+ * @param zeroSweepDefault return value when this sweep is empty (default 0).
461
+ * @returns fraction, or `zeroSweepDefault` if this sweep is empty
366
462
  */
367
- angleToSignedPeriodicFraction(theta) {
368
- return this.radiansToSignedPeriodicFraction(theta.radians);
463
+ angleToSignedFraction(theta, toNegativeFraction = false, zeroSweepDefault = 0.0) {
464
+ return this.radiansToSignedFraction(theta.radians, toNegativeFraction, zeroSweepDefault);
369
465
  }
370
466
  /** Test if the given angle (as radians) is within sweep (between radians0 and radians1) */
371
467
  static isRadiansInStartEnd(radians, radians0, radians1, allowPeriodShift = true) {