@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"}
@@ -216,9 +216,10 @@ class AngleSweep {
216
216
  /**
217
217
  * Return 2PI divided by the sweep radians (i.e. 360 degrees divided by sweep angle).
218
218
  * * This is the number of fractional intervals required to cover a whole circle.
219
+ * @returns period of the sweep, or 1 if sweep is empty.
219
220
  */
220
221
  fractionPeriod() {
221
- return Geometry_1.Geometry.safeDivideFraction(Math.PI * 2.0, Math.abs(this._radians1 - this._radians0), 1.0);
222
+ return this.isEmpty ? 1.0 : Angle_1.Angle.pi2Radians / Math.abs(this._radians1 - this._radians0);
222
223
  }
223
224
  /**
224
225
  * Return the fractionalized position of the given angle (as Angle) computed without consideration of
@@ -231,68 +232,100 @@ class AngleSweep {
231
232
  * * fraction larger than one for angles "before" the start angle if start > end
232
233
  * * negative fraction for angles "after" the end angle if start > end
233
234
  * * does not allow period shift
235
+ * @returns unbounded fraction, or 1 if sweep is empty.
234
236
  */
235
237
  angleToUnboundedFraction(theta) {
236
- return Geometry_1.Geometry.safeDivideFraction(theta.radians - this._radians0, this._radians1 - this._radians0, 1.0);
238
+ return this.isEmpty ? 1.0 : (theta.radians - this._radians0) / (this._radians1 - this._radians0);
239
+ }
240
+ /**
241
+ * Convert a sweep fraction to the equivalent period-shifted fraction inside the sweep, or within one period of zero
242
+ * on the desired side.
243
+ * @param fraction fraction of the sweep.
244
+ * @param radians0 start angle of sweep (in radians).
245
+ * @param radians1 end angle of sweep (in radians).
246
+ * @param toNegativeFraction return an exterior fraction period-shifted to within one period of the start (true) or
247
+ * end (false) of the sweep.
248
+ * @returns period-shifted fraction. If `fraction` is already in [0,1], or the sweep is empty, then `fraction` is
249
+ * returned unchanged.
250
+ */
251
+ static fractionToSignedPeriodicFractionStartEnd(fraction, radians0, radians1, toNegativeFraction) {
252
+ const sweep = radians1 - radians0;
253
+ if (Angle_1.Angle.isAlmostEqualRadiansNoPeriodShift(0, sweep))
254
+ return fraction; // empty sweep
255
+ if (Geometry_1.Geometry.isIn01(fraction))
256
+ return fraction;
257
+ const period = Angle_1.Angle.pi2Radians / Math.abs(sweep);
258
+ fraction = fraction % period; // period-shifted equivalent fraction closest to 0 with same sign as fraction
259
+ if (fraction + period < 1)
260
+ fraction += period; // it's really an interior fraction
261
+ if (Geometry_1.Geometry.isIn01(fraction) || (toNegativeFraction && fraction < 0) || (!toNegativeFraction && fraction > 1))
262
+ return fraction;
263
+ return toNegativeFraction ? fraction - period : fraction + period; // shift to other side of sweep
264
+ }
265
+ /**
266
+ * Convert a sweep fraction to the equivalent period-shifted fraction inside this sweep, or within one period of
267
+ * zero on the desired side.
268
+ * @param fraction fraction of the sweep.
269
+ * @param toNegativeFraction return an exterior fraction period-shifted to within one period of the start (true) or
270
+ * end (false) of the sweep.
271
+ * @returns period-shifted fraction. If `fraction` is already in [0,1], or the sweep is empty, then `fraction` is
272
+ * returned unchanged.
273
+ */
274
+ fractionToSignedPeriodicFraction(fraction, toNegativeFraction) {
275
+ return AngleSweep.fractionToSignedPeriodicFractionStartEnd(fraction, this._radians0, this._radians1, toNegativeFraction);
237
276
  }
238
277
  /**
239
278
  * Return the fractionalized position of the given angle (as radians), computed with consideration of 2PI period.
240
279
  * * consider radians0 as `start` angle of the sweep and radians1 as `end` angle of the sweep
241
- * * fraction is always positive
242
280
  * * the start angle is at fraction 0
243
281
  * * the end angle is at fraction 1
244
282
  * * interior angles are between 0 and 1
245
283
  * * all exterior angles are at fractions greater than 1
246
284
  * * allows period shift
285
+ * @param radians input angle (in radians)
286
+ * @param radians0 start angle of sweep (in radians)
287
+ * @param radians1 end angle of sweep (in radians)
288
+ * @param zeroSweepDefault return value when the sweep is empty (default 0)
289
+ * @returns nonnegative fraction, or `zeroSweepDefault` if the sweep is empty.
247
290
  */
248
291
  static radiansToPositivePeriodicFractionStartEnd(radians, radians0, radians1, zeroSweepDefault = 0.0) {
249
- if (Angle_1.Angle.isAlmostEqualRadiansAllowPeriodShift(radians0, radians1)) {
250
- // for 2nPi sweep, allow matching without period shift, else we never return 1.0
251
- if (Angle_1.Angle.isAlmostEqualRadiansNoPeriodShift(radians, radians0))
252
- return 0.0;
253
- if (Angle_1.Angle.isAlmostEqualRadiansNoPeriodShift(radians, radians1))
254
- return 1.0;
255
- }
256
- else {
257
- if (Angle_1.Angle.isAlmostEqualRadiansAllowPeriodShift(radians, radians0))
258
- return 0.0;
259
- if (Angle_1.Angle.isAlmostEqualRadiansAllowPeriodShift(radians, radians1))
260
- return 1.0;
292
+ const zeroSweepMarker = Geometry_1.Geometry.largeCoordinateResult;
293
+ let fraction = this.radiansToSignedPeriodicFractionStartEnd(radians, radians0, radians1, zeroSweepMarker);
294
+ if (fraction === zeroSweepMarker)
295
+ return zeroSweepDefault;
296
+ if (fraction < 0) {
297
+ const period = Angle_1.Angle.pi2Radians / Math.abs(radians1 - radians0);
298
+ fraction += period;
261
299
  }
262
- const sweep = radians1 - radians0;
263
- const delta = radians - radians0;
264
- if (sweep > 0) {
265
- const delta1 = Angle_1.Angle.adjustRadians0To2Pi(delta);
266
- const fraction1 = Geometry_1.Geometry.safeDivideFraction(delta1, sweep, zeroSweepDefault);
267
- return fraction1;
268
- }
269
- const delta2 = Angle_1.Angle.adjustRadians0To2Pi(-delta);
270
- const fraction2 = Geometry_1.Geometry.safeDivideFraction(delta2, -sweep, zeroSweepDefault);
271
- return fraction2;
300
+ return fraction;
272
301
  }
273
302
  /**
274
303
  * Return the fractionalized position of the given angle (as radians), computed with consideration of 2PI period.
275
- * * fraction is always positive
276
304
  * * the start angle is at fraction 0
277
305
  * * the end angle is at fraction 1
278
306
  * * interior angles are between 0 and 1
279
307
  * * all exterior angles are at fractions greater than 1
280
308
  * * allows period shift
309
+ * @param radians input angle (in radians)
310
+ * @param zeroSweepDefault return value when this sweep is empty (default 0)
311
+ * @returns nonnegative fraction, or `zeroSweepDefault` if the sweep is empty.
281
312
  */
282
313
  radiansToPositivePeriodicFraction(radians, zeroSweepDefault = 0.0) {
283
314
  return AngleSweep.radiansToPositivePeriodicFractionStartEnd(radians, this._radians0, this._radians1, zeroSweepDefault);
284
315
  }
285
316
  /**
286
317
  * Return the fractionalized position of the given angle (as Angle), computed with consideration of 2PI period.
287
- * * fraction is always positive
288
318
  * * the start angle is at fraction 0
289
319
  * * the end angle is at fraction 1
290
320
  * * interior angles are between 0 and 1
291
321
  * * all exterior angles are at fractions greater than 1
292
322
  * * allows period shift
323
+ * @param theta input angle
324
+ * @param zeroSweepDefault return value when this sweep is empty (default 0)
325
+ * @returns nonnegative fraction, or `zeroSweepDefault` if the sweep is empty.
293
326
  */
294
- angleToPositivePeriodicFraction(theta) {
295
- return this.radiansToPositivePeriodicFraction(theta.radians);
327
+ angleToPositivePeriodicFraction(theta, zeroSweepDefault = 0.0) {
328
+ return this.radiansToPositivePeriodicFraction(theta.radians, zeroSweepDefault);
296
329
  }
297
330
  /**
298
331
  * Return the fractionalized position of the given array of angles (as radian), computed with consideration of 2PI period.
@@ -318,10 +351,18 @@ class AngleSweep {
318
351
  * * negative fraction for angles "before" the start angle
319
352
  * * fraction larger than one for angles "after" the end angle
320
353
  * * allows period shift
354
+ * @param radians input angle (in radians)
355
+ * @param radians0 start angle of sweep (in radians)
356
+ * @param radians1 end angle of sweep (in radians)
357
+ * @param zeroSweepDefault return value when the sweep is empty (default 0)
358
+ * @returns fraction, or `zeroSweepDefault` if the sweep is empty.
321
359
  */
322
- static radiansToSignedPeriodicFractionStartEnd(radians, radians0, radians1) {
360
+ static radiansToSignedPeriodicFractionStartEnd(radians, radians0, radians1, zeroSweepDefault = 0.0) {
361
+ const sweep = radians1 - radians0;
362
+ if (Angle_1.Angle.isAlmostEqualRadiansNoPeriodShift(0, sweep))
363
+ return zeroSweepDefault;
323
364
  if (Angle_1.Angle.isAlmostEqualRadiansAllowPeriodShift(radians0, radians1)) {
324
- // for 2nPi sweep, allow matching without period shift, else we never return 1.0
365
+ // for sweep = 2nPi !== 0, allow matching without period shift, else we never return 1.0
325
366
  if (Angle_1.Angle.isAlmostEqualRadiansNoPeriodShift(radians, radians0))
326
367
  return 0.0;
327
368
  if (Angle_1.Angle.isAlmostEqualRadiansNoPeriodShift(radians, radians1))
@@ -333,16 +374,8 @@ class AngleSweep {
333
374
  if (Angle_1.Angle.isAlmostEqualRadiansAllowPeriodShift(radians, radians1))
334
375
  return 1.0;
335
376
  }
336
- const sweep = radians1 - radians0;
337
- const delta = radians - radians0 - 0.5 * sweep; // measure from middle of interval
338
- if (sweep > 0) {
339
- const delta1 = Angle_1.Angle.adjustRadiansMinusPiPlusPi(delta);
340
- const fraction1 = 0.5 + Geometry_1.Geometry.safeDivideFraction(delta1, sweep, 0.0);
341
- return fraction1;
342
- }
343
- const delta2 = Angle_1.Angle.adjustRadiansMinusPiPlusPi(-delta);
344
- const fraction = 0.5 + Geometry_1.Geometry.safeDivideFraction(delta2, -sweep, 0.0);
345
- return fraction;
377
+ const fraction = (radians - radians0) / sweep;
378
+ return this.fractionToSignedPeriodicFractionStartEnd(fraction, radians0, radians1, fraction < 0);
346
379
  }
347
380
  /**
348
381
  * Return the fractionalized position of the given angle (as radians) computed with consideration of
@@ -353,9 +386,12 @@ class AngleSweep {
353
386
  * * negative fraction for angles "before" the start angle
354
387
  * * fraction larger than one for angles "after" the end angle
355
388
  * * allows period shift
389
+ * @param radians input angle (in radians)
390
+ * @param zeroSweepDefault return value when this sweep is empty (default 0)
391
+ * @returns fraction, or `zeroSweepDefault` if this sweep is empty.
356
392
  */
357
- radiansToSignedPeriodicFraction(radians) {
358
- return AngleSweep.radiansToSignedPeriodicFractionStartEnd(radians, this._radians0, this._radians1);
393
+ radiansToSignedPeriodicFraction(radians, zeroSweepDefault = 0.0) {
394
+ return AngleSweep.radiansToSignedPeriodicFractionStartEnd(radians, this._radians0, this._radians1, zeroSweepDefault);
359
395
  }
360
396
  /**
361
397
  * Return the fractionalized position of the given angle (as Angle) computed with consideration of
@@ -366,9 +402,69 @@ class AngleSweep {
366
402
  * * negative fraction for angles "before" the start angle
367
403
  * * fraction larger than one for angles "after" the end angle
368
404
  * * allows period shift
405
+ * @param theta input angle
406
+ * @param zeroSweepDefault return value when this sweep is empty (default 0)
407
+ * @returns fraction, or `zeroSweepDefault` if this sweep is empty.
408
+ */
409
+ angleToSignedPeriodicFraction(theta, zeroSweepDefault = 0.0) {
410
+ return this.radiansToSignedPeriodicFraction(theta.radians, zeroSweepDefault);
411
+ }
412
+ /**
413
+ * Return the fractionalized position of the given radian angle with respect to the sweep.
414
+ * * The start angle returns fraction 0
415
+ * * The end angle returns fraction 1
416
+ * * Interior angles (and their multiples of 2PI) return fractions in [0,1].
417
+ * * Exterior angles return fractions outside [0,1] according to `toNegativeFraction`.
418
+ * @param radians input angle (in radians)
419
+ * @param radians0 start angle of sweep (in radians)
420
+ * @param radians1 end angle of sweep (in radians)
421
+ * @param toNegativeFraction convert an exterior angle to a negative number (true), or to
422
+ * a number greater than one (false, default). If false, this is just [[radiansToPositivePeriodicFractionStartEnd]].
423
+ * @param zeroSweepDefault return value when the sweep is empty (default 0).
424
+ * @returns fraction, or `zeroSweepDefault` if the sweep is empty
425
+ */
426
+ static radiansToSignedFractionStartEnd(radians, radians0, radians1, toNegativeFraction = false, zeroSweepDefault = 0.0) {
427
+ const zeroSweepMarker = Geometry_1.Geometry.largeCoordinateResult;
428
+ let fraction = this.radiansToSignedPeriodicFractionStartEnd(radians, radians0, radians1, zeroSweepMarker);
429
+ if (fraction === zeroSweepMarker)
430
+ return zeroSweepDefault;
431
+ if ((toNegativeFraction && fraction > 1) || (!toNegativeFraction && fraction < 0)) {
432
+ let period = Angle_1.Angle.pi2Radians / Math.abs(radians1 - radians0);
433
+ if (toNegativeFraction)
434
+ period = -period;
435
+ fraction += period;
436
+ }
437
+ return fraction;
438
+ }
439
+ /**
440
+ * Return the fractionalized position of the given radian angle with respect to this sweep.
441
+ * * The start angle returns fraction 0
442
+ * * The end angle returns fraction 1
443
+ * * Interior angles (and their multiples of 2PI) return fractions in [0,1].
444
+ * * Exterior angles return fractions outside [0,1] according to `toNegativeFraction`.
445
+ * @param radians input angle (in radians)
446
+ * @param toNegativeFraction convert an exterior angle to a negative number (true), or to
447
+ * a number greater than one (false, default). If false, this is just [[radiansToPositivePeriodicFraction]].
448
+ * @param zeroSweepDefault return value when this sweep is empty (default 0).
449
+ * @returns fraction, or `zeroSweepDefault` if this sweep is empty
450
+ */
451
+ radiansToSignedFraction(radians, toNegativeFraction = false, zeroSweepDefault = 0.0) {
452
+ return AngleSweep.radiansToSignedFractionStartEnd(radians, this._radians0, this._radians1, toNegativeFraction, zeroSweepDefault);
453
+ }
454
+ /**
455
+ * Return the fractionalized position of the given angle with respect to this sweep.
456
+ * * The start angle returns fraction 0
457
+ * * The end angle returns fraction 1
458
+ * * Interior angles (and their multiples of 2PI) return fractions in [0,1].
459
+ * * Exterior angles return fractions outside [0,1] according to `toNegativeFraction`.
460
+ * @param theta input angle
461
+ * @param toNegativeFraction convert an exterior angle to a negative number (true), or to
462
+ * a number greater than one (false, default). If false, this is just [[angleToPositivePeriodicFraction]].
463
+ * @param zeroSweepDefault return value when this sweep is empty (default 0).
464
+ * @returns fraction, or `zeroSweepDefault` if this sweep is empty
369
465
  */
370
- angleToSignedPeriodicFraction(theta) {
371
- return this.radiansToSignedPeriodicFraction(theta.radians);
466
+ angleToSignedFraction(theta, toNegativeFraction = false, zeroSweepDefault = 0.0) {
467
+ return this.radiansToSignedFraction(theta.radians, toNegativeFraction, zeroSweepDefault);
372
468
  }
373
469
  /** Test if the given angle (as radians) is within sweep (between radians0 and radians1) */
374
470
  static isRadiansInStartEnd(radians, radians0, radians1, allowPeriodShift = true) {