@itwin/core-geometry 5.3.0-dev.9 → 5.3.0

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 (162) hide show
  1. package/CHANGELOG.md +28 -1
  2. package/lib/cjs/curve/Arc3d.d.ts +15 -1
  3. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  4. package/lib/cjs/curve/Arc3d.js +31 -2
  5. package/lib/cjs/curve/Arc3d.js.map +1 -1
  6. package/lib/cjs/curve/CurveFactory.d.ts +25 -8
  7. package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
  8. package/lib/cjs/curve/CurveFactory.js +51 -55
  9. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  10. package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.d.ts +10 -13
  11. package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.d.ts.map +1 -1
  12. package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js +23 -22
  13. package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  14. package/lib/cjs/curve/spiral/ClothoidSeries.d.ts +10 -6
  15. package/lib/cjs/curve/spiral/ClothoidSeries.d.ts.map +1 -1
  16. package/lib/cjs/curve/spiral/ClothoidSeries.js +36 -19
  17. package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
  18. package/lib/cjs/curve/spiral/CubicEvaluator.d.ts +7 -6
  19. package/lib/cjs/curve/spiral/CubicEvaluator.d.ts.map +1 -1
  20. package/lib/cjs/curve/spiral/CubicEvaluator.js +29 -14
  21. package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
  22. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.d.ts +34 -44
  23. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.d.ts.map +1 -1
  24. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js +47 -53
  25. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  26. package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.d.ts +2 -2
  27. package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.d.ts.map +1 -1
  28. package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js +17 -7
  29. package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  30. package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts +112 -104
  31. package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
  32. package/lib/cjs/curve/spiral/DirectSpiral3d.js +143 -117
  33. package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
  34. package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts +71 -53
  35. package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
  36. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js +99 -66
  37. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  38. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.d.ts +8 -12
  39. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.d.ts.map +1 -1
  40. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js +11 -13
  41. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  42. package/lib/cjs/curve/spiral/NormalizedTransition.d.ts +36 -29
  43. package/lib/cjs/curve/spiral/NormalizedTransition.d.ts.map +1 -1
  44. package/lib/cjs/curve/spiral/NormalizedTransition.js +62 -40
  45. package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
  46. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.d.ts +13 -18
  47. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.d.ts.map +1 -1
  48. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js +21 -24
  49. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  50. package/lib/cjs/curve/spiral/TransitionConditionalProperties.d.ts +41 -27
  51. package/lib/cjs/curve/spiral/TransitionConditionalProperties.d.ts.map +1 -1
  52. package/lib/cjs/curve/spiral/TransitionConditionalProperties.js +50 -33
  53. package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  54. package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts +45 -34
  55. package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
  56. package/lib/cjs/curve/spiral/TransitionSpiral3d.js +56 -38
  57. package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
  58. package/lib/cjs/curve/spiral/XYCurveEvaluator.d.ts +27 -21
  59. package/lib/cjs/curve/spiral/XYCurveEvaluator.d.ts.map +1 -1
  60. package/lib/cjs/curve/spiral/XYCurveEvaluator.js +23 -18
  61. package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
  62. package/lib/cjs/geometry3d/GrowableXYArray.d.ts +96 -98
  63. package/lib/cjs/geometry3d/GrowableXYArray.d.ts.map +1 -1
  64. package/lib/cjs/geometry3d/GrowableXYArray.js +121 -110
  65. package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
  66. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +135 -142
  67. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  68. package/lib/cjs/geometry3d/GrowableXYZArray.js +165 -160
  69. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  70. package/lib/cjs/geometry3d/IndexedXYCollection.d.ts +51 -34
  71. package/lib/cjs/geometry3d/IndexedXYCollection.d.ts.map +1 -1
  72. package/lib/cjs/geometry3d/IndexedXYCollection.js +16 -6
  73. package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
  74. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +78 -77
  75. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  76. package/lib/cjs/geometry3d/IndexedXYZCollection.js +38 -35
  77. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  78. package/lib/cjs/geometry3d/PolygonOps.d.ts +27 -7
  79. package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
  80. package/lib/cjs/geometry3d/PolygonOps.js +30 -9
  81. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  82. package/lib/esm/curve/Arc3d.d.ts +15 -1
  83. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  84. package/lib/esm/curve/Arc3d.js +31 -2
  85. package/lib/esm/curve/Arc3d.js.map +1 -1
  86. package/lib/esm/curve/CurveFactory.d.ts +25 -8
  87. package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
  88. package/lib/esm/curve/CurveFactory.js +51 -55
  89. package/lib/esm/curve/CurveFactory.js.map +1 -1
  90. package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.d.ts +10 -13
  91. package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.d.ts.map +1 -1
  92. package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js +23 -22
  93. package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  94. package/lib/esm/curve/spiral/ClothoidSeries.d.ts +10 -6
  95. package/lib/esm/curve/spiral/ClothoidSeries.d.ts.map +1 -1
  96. package/lib/esm/curve/spiral/ClothoidSeries.js +36 -19
  97. package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
  98. package/lib/esm/curve/spiral/CubicEvaluator.d.ts +7 -6
  99. package/lib/esm/curve/spiral/CubicEvaluator.d.ts.map +1 -1
  100. package/lib/esm/curve/spiral/CubicEvaluator.js +29 -14
  101. package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
  102. package/lib/esm/curve/spiral/CzechSpiralEvaluator.d.ts +34 -44
  103. package/lib/esm/curve/spiral/CzechSpiralEvaluator.d.ts.map +1 -1
  104. package/lib/esm/curve/spiral/CzechSpiralEvaluator.js +47 -53
  105. package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  106. package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.d.ts +2 -2
  107. package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.d.ts.map +1 -1
  108. package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js +17 -7
  109. package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  110. package/lib/esm/curve/spiral/DirectSpiral3d.d.ts +112 -104
  111. package/lib/esm/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
  112. package/lib/esm/curve/spiral/DirectSpiral3d.js +143 -117
  113. package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
  114. package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts +71 -53
  115. package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
  116. package/lib/esm/curve/spiral/IntegratedSpiral3d.js +99 -66
  117. package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  118. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.d.ts +8 -12
  119. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.d.ts.map +1 -1
  120. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js +11 -13
  121. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  122. package/lib/esm/curve/spiral/NormalizedTransition.d.ts +36 -29
  123. package/lib/esm/curve/spiral/NormalizedTransition.d.ts.map +1 -1
  124. package/lib/esm/curve/spiral/NormalizedTransition.js +62 -40
  125. package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
  126. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.d.ts +13 -18
  127. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.d.ts.map +1 -1
  128. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js +21 -24
  129. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  130. package/lib/esm/curve/spiral/TransitionConditionalProperties.d.ts +41 -27
  131. package/lib/esm/curve/spiral/TransitionConditionalProperties.d.ts.map +1 -1
  132. package/lib/esm/curve/spiral/TransitionConditionalProperties.js +50 -33
  133. package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  134. package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts +45 -34
  135. package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
  136. package/lib/esm/curve/spiral/TransitionSpiral3d.js +56 -38
  137. package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
  138. package/lib/esm/curve/spiral/XYCurveEvaluator.d.ts +27 -21
  139. package/lib/esm/curve/spiral/XYCurveEvaluator.d.ts.map +1 -1
  140. package/lib/esm/curve/spiral/XYCurveEvaluator.js +23 -18
  141. package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
  142. package/lib/esm/geometry3d/GrowableXYArray.d.ts +96 -98
  143. package/lib/esm/geometry3d/GrowableXYArray.d.ts.map +1 -1
  144. package/lib/esm/geometry3d/GrowableXYArray.js +122 -111
  145. package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
  146. package/lib/esm/geometry3d/GrowableXYZArray.d.ts +135 -142
  147. package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  148. package/lib/esm/geometry3d/GrowableXYZArray.js +165 -160
  149. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  150. package/lib/esm/geometry3d/IndexedXYCollection.d.ts +51 -34
  151. package/lib/esm/geometry3d/IndexedXYCollection.d.ts.map +1 -1
  152. package/lib/esm/geometry3d/IndexedXYCollection.js +14 -5
  153. package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
  154. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +78 -77
  155. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  156. package/lib/esm/geometry3d/IndexedXYZCollection.js +38 -35
  157. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  158. package/lib/esm/geometry3d/PolygonOps.d.ts +27 -7
  159. package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
  160. package/lib/esm/geometry3d/PolygonOps.js +30 -9
  161. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  162. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"MXCubicAlongArcSpiralEvaluator.js","sourceRoot":"","sources":["../../../../src/curve/spiral/MXCubicAlongArcSpiralEvaluator.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,6CAA0C;AAC1C,qDAAkD;AAClD;;;;;;;;;;;;;;GAcG;AACH,MAAa,wBAAyB,SAAQ,+BAAc;IACnD,cAAc,CAAS;IACvB,cAAc,CAAS;IAE9B,uEAAuE;IACvE,YAAoB,OAAe,EAAE,OAAe,EAAE,UAAkB,EAAE,MAAc;QACtF,KAAK,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QAC1B,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;QAC9B,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;IAChC,CAAC;IAED,kCAAkC;IAC3B,MAAM,CAAC,aAAa,CAAC,OAAe,EAAE,OAAe;QAC1D,MAAM,UAAU,GAAG,wBAAwB,CAAC,2BAA2B,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QACnG,OAAO,GAAG,GAAG,CAAC,GAAG,GAAG,OAAO,GAAG,UAAU,CAAC,CAAC;IAC5C,CAAC;IAEM,MAAM,CAAC,MAAM,CAAC,OAAe,EAAE,OAAe;QACnD,MAAM,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC/C,IAAI,CAAC,KAAK,SAAS;YACjB,OAAO,SAAS,CAAC;QACnB,MAAM,IAAI,GAAG,wBAAwB,CAAC,2BAA2B,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAC7F,OAAO,IAAI,wBAAwB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACjE,CAAC;IAEe,YAAY,CAAC,WAAmB;QAC9C,IAAI,CAAC,cAAc,IAAI,WAAW,CAAC;QACnC,IAAI,CAAC,cAAc,IAAI,WAAW,CAAC;QACnC,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IAClC,CAAC;IACD,0CAA0C;IACnC,KAAK,KAA+B,OAAO,IAAI,wBAAwB,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACzJ,mCAAmC;IAC5B,aAAa,CAAC,KAAU;QAC7B,IAAI,KAAK,YAAY,wBAAwB,EAAE,CAAC;YAC9C,OAAO,mBAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC,cAAc,CAAC;mBACtE,mBAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;QAC5E,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD;;;;;OAKG;IACI,MAAM,CAAC,2BAA2B,CAAC,cAAsB,EAAE,cAAsB,EAAE,oBAA4B;QACpH,MAAM,EAAE,GAAG,cAAc,GAAG,cAAc,CAAC;QAC3C,MAAM,EAAE,GAAG,cAAc,GAAG,cAAc,CAAC;QAC3C,MAAM,EAAE,GAAG,oBAAoB,GAAG,oBAAoB,CAAC;QACvD,OAAO,oBAAoB,GAAG,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,IAAI,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;IACnE,CAAC;CACF;AApDD,4DAoDC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\nimport { Geometry } from \"../../Geometry\";\nimport { CubicEvaluator } from \"./CubicEvaluator\";\n/**\n * MX Cubic along arc.\n * This is y= m*x^3 with\n * * x any point on the x axis\n * * `fraction` along the spiral goes to `x = fraction * Lx`\n * * m is (1/6RL)\n * * construction length L is nominal along the curve.\n * * x length Lx is along the axis, determined by two terms of the clothoid x series.\n * *\n * @param localToWorld\n * @param nominalL1\n * @param nominalR1\n * @param activeInterval\n * @internal\n */\nexport class MXCubicAlongArcEvaluator extends CubicEvaluator {\n public nominalLength1: number;\n public nominalRadius1: number;\n\n /** Constructor is private. Caller responsible for cubicM validity. */\n private constructor(length1: number, radius1: number, axisLength: number, cubicM: number) {\n super(axisLength, cubicM);\n this.nominalLength1 = length1;\n this.nominalRadius1 = radius1;\n }\n\n /** Compute the cubic constant. */\n public static computeCubicM(length1: number, radius1: number): number | undefined {\n const axisLength = MXCubicAlongArcEvaluator.approximateDistanceAlongToX(length1, radius1, length1);\n return 1.0 / (6.0 * radius1 * axisLength);\n }\n\n public static create(length1: number, radius1: number): MXCubicAlongArcEvaluator | undefined {\n const m = this.computeCubicM(length1, radius1);\n if (m === undefined)\n return undefined;\n const xMax = MXCubicAlongArcEvaluator.approximateDistanceAlongToX(length1, radius1, length1);\n return new MXCubicAlongArcEvaluator(length1, radius1, xMax, m);\n }\n\n public override scaleInPlace(scaleFactor: number) {\n this.nominalLength1 *= scaleFactor;\n this.nominalRadius1 *= scaleFactor;\n super.scaleInPlace(scaleFactor);\n }\n /** return a deep copy of the evaluator */\n public clone(): MXCubicAlongArcEvaluator { return new MXCubicAlongArcEvaluator(this.nominalLength1, this.nominalRadius1, this.axisLength, this.cubicM); }\n /** Member by member matchup ... */\n public isAlmostEqual(other: any): boolean {\n if (other instanceof MXCubicAlongArcEvaluator) {\n return Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)\n && Geometry.isSameCoordinate(this.nominalRadius1, other.nominalRadius1);\n }\n return false;\n }\n /**\n * Return a (fast but mediocre) approximation of spiral x position as function of approximate distance along the curve.\n * * This x-to-distance relation is not as precise as the CurvePrimitive method moveSignedDistanceFromFraction.\n * * It is supported here for users interested in replicating the Czech distance mapping rather than the more accurate CurvePrimitive measurements.\n * @param x distance along the x axis.\n */\n public static approximateDistanceAlongToX(nominalLength1: number, nominalRadius1: number, nominalDistanceAlong: number): number {\n const l2 = nominalLength1 * nominalLength1;\n const r2 = nominalRadius1 * nominalRadius1;\n const xx = nominalDistanceAlong * nominalDistanceAlong;\n return nominalDistanceAlong * (1.0 - xx * xx / (40.0 * r2 * l2));\n }\n}\n"]}
1
+ {"version":3,"file":"MXCubicAlongArcSpiralEvaluator.js","sourceRoot":"","sources":["../../../../src/curve/spiral/MXCubicAlongArcSpiralEvaluator.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,6CAA0C;AAC1C,qDAAkD;AAElD;;;;;;;;;GASG;AACH,MAAa,wBAAyB,SAAQ,+BAAc;IACnD,cAAc,CAAS;IACvB,cAAc,CAAS;IAC9B,uEAAuE;IACvE,YAAoB,OAAe,EAAE,OAAe,EAAE,UAAkB,EAAE,MAAc;QACtF,KAAK,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QAC1B,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;QAC9B,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;IAChC,CAAC;IACD,kCAAkC;IAC3B,MAAM,CAAC,aAAa,CAAC,OAAe,EAAE,OAAe;QAC1D,MAAM,UAAU,GAAG,wBAAwB,CAAC,2BAA2B,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QACnG,OAAO,GAAG,GAAG,CAAC,GAAG,GAAG,OAAO,GAAG,UAAU,CAAC,CAAC;IAC5C,CAAC;IACM,MAAM,CAAC,MAAM,CAAC,O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;QACvD,OAAO,oBAAoB,GAAG,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,IAAI,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;IACnE,CAAC;CACF;AArDD,4DAqDC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\nimport { Geometry } from \"../../Geometry\";\nimport { CubicEvaluator } from \"./CubicEvaluator\";\n\n/**\n * MX Cubic along arc.\n * This is y = m*x^3 with\n * * x any point on the x axis.\n * * `fraction` along the spiral goes to `x = fraction * Lx`.\n * * m is (1/6RL).\n * * construction length L is nominal along the curve.\n * * x length Lx is along the axis, determined by two terms of the clothoid x series.\n * @internal\n */\nexport class MXCubicAlongArcEvaluator extends CubicEvaluator {\n public nominalLength1: number;\n public nominalRadius1: number;\n /** Constructor is private. Caller responsible for cubicM validity. */\n private constructor(length1: number, radius1: number, axisLength: number, cubicM: number) {\n super(axisLength, cubicM);\n this.nominalLength1 = length1;\n this.nominalRadius1 = radius1;\n }\n /** Compute the cubic constant. */\n public static computeCubicM(length1: number, radius1: number): number | undefined {\n const axisLength = MXCubicAlongArcEvaluator.approximateDistanceAlongToX(length1, radius1, length1);\n return 1.0 / (6.0 * radius1 * axisLength);\n }\n public static create(length1: number, radius1: number): MXCubicAlongArcEvaluator | undefined {\n const m = this.computeCubicM(length1, radius1);\n if (m === undefined)\n return undefined;\n const xMax = MXCubicAlongArcEvaluator.approximateDistanceAlongToX(length1, radius1, length1);\n return new MXCubicAlongArcEvaluator(length1, radius1, xMax, m);\n }\n public override scaleInPlace(scaleFactor: number) {\n this.nominalLength1 *= scaleFactor;\n this.nominalRadius1 *= scaleFactor;\n super.scaleInPlace(scaleFactor);\n }\n /** Return a deep copy of the evaluator. */\n public clone(): MXCubicAlongArcEvaluator {\n return new MXCubicAlongArcEvaluator(this.nominalLength1, this.nominalRadius1, this.axisLength, this.cubicM);\n }\n /** Member by member matchup. */\n public isAlmostEqual(other: any): boolean {\n if (other instanceof MXCubicAlongArcEvaluator) {\n return Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)\n && Geometry.isSameCoordinate(this.nominalRadius1, other.nominalRadius1);\n }\n return false;\n }\n /**\n * Return a (fast but mediocre) approximation of spiral x position as function of approximate distance along the curve.\n * * This x-to-distance relation is not as precise as the CurvePrimitive method moveSignedDistanceFromFraction.\n * * It is supported here for users interested in replicating the Czech distance mapping rather than the more accurate\n * CurvePrimitive measurements.\n * @param x distance along the x axis.\n */\n public static approximateDistanceAlongToX(\n nominalLength1: number, nominalRadius1: number, nominalDistanceAlong: number,\n ): number {\n const l2 = nominalLength1 * nominalLength1;\n const r2 = nominalRadius1 * nominalRadius1;\n const xx = nominalDistanceAlong * nominalDistanceAlong;\n return nominalDistanceAlong * (1.0 - xx * xx / (40.0 * r2 * l2));\n }\n}\n"]}
@@ -6,22 +6,23 @@
6
6
  * * Each function maps fractional progress to a curvature value.
7
7
  * * f(0) === 0
8
8
  * * f(1) === 1
9
- * * f(u) === 1 - f (1-u)
9
+ * * f(u) === 1 - f(1-u)
10
10
  * * Each implementation provides:
11
11
  * * fractionToCurvature -- the f(u) function described above
12
12
  * * fractionToCurvatureDerivative -- df(u)/du
13
13
  * * fractionToArea -- integral of the area under f(u) from 0 to u.
14
- * * the symmetry condition ensures that the integral from 0 to 1 is 1/2
14
+ * * The symmetry condition ensures that the integral from 0 to 1 is 1/2.
15
15
  * @internal
16
16
  */
17
17
  export declare abstract class NormalizedTransition {
18
- /** Constructor initializes with 0..1 values .. call "setBearingCurvatureLengthCurvature" to apply real values */
18
+ /** Constructor initializes with 0..1 values. Call "setBearingCurvatureLengthCurvature" to apply real values. */
19
19
  constructor();
20
20
  /** At fractional position on the x axis, return the (normalized) curvature fraction. */
21
21
  abstract fractionToCurvatureFraction(fractionX: number): number;
22
- /** Return the derivative of the (normalized) curvature fraction */
22
+ /** Return the derivative of the (normalized) curvature fraction. */
23
23
  abstract fractionToCurvatureFractionDerivative(fractionX: number): number;
24
- /** Return the integrated area under the curve
24
+ /**
25
+ * Return the integrated area under the curve.
25
26
  * * This is equal to the accumulated angle change.
26
27
  */
27
28
  abstract fractionToArea(fractionX: number): number;
@@ -53,34 +54,36 @@ export declare class NormalizedClothoidTransition extends NormalizedTransition {
53
54
  constructor();
54
55
  /** At fractional position on the x axis, return the (normalized) curvature fraction. */
55
56
  fractionToCurvatureFraction(fractionX: number): number;
56
- /** Return the derivative of the (normalized) curvature fraction */
57
+ /** Return the derivative of the (normalized) curvature fraction. */
57
58
  fractionToCurvatureFractionDerivative(_u: number): number;
58
- /** Return the integrated area under the curve.
59
+ /**
60
+ * Return the integrated area under the curve.
59
61
  * * This fraction is the angular change fraction.
60
62
  */
61
63
  fractionToArea(fractionX: number): number;
62
64
  }
63
65
  /**
64
66
  * Transition functions for bloss spiral.
65
- * * curvature variation is cubic from (0,0) with slope 0 to (1,1) with slope 1
67
+ * * curvature variation is cubic from (0,0) with slope 0 to (1,1) with slope 1.
66
68
  * @internal
67
69
  */
68
70
  export declare class NormalizedBlossTransition extends NormalizedTransition {
69
71
  constructor();
70
72
  /** At fractional position on the x axis, return the (normalized) curvature fraction. */
71
73
  fractionToCurvatureFraction(u: number): number;
72
- /** Return the derivative of the (normalized) curvature fraction */
74
+ /** Return the derivative of the (normalized) curvature fraction. */
73
75
  fractionToCurvatureFractionDerivative(u: number): number;
74
- /** Return the integrated area under the curve.
76
+ /**
77
+ * Return the integrated area under the curve.
75
78
  * * This fraction is the angular change fraction.
76
79
  */
77
80
  fractionToArea(u: number): number;
78
81
  }
79
82
  /**
80
- * Transition functions for biquadratic transition
83
+ * Transition functions for biquadratic transition.
81
84
  * * Curvature is a pair of joining quadratics.
82
- * * In lower half of the interval, the quadratic is from (0,0) to (0.5, 0.5) with zero slope at origin
83
- * * In upper half of the interval, the quadratic is from (0.5,0.5) to (1,1) with zero slope at 1
85
+ * * In lower half of the interval, the quadratic is from (0,0) to (0.5, 0.5) with zero slope at origin.
86
+ * * In upper half of the interval, the quadratic is from (0.5,0.5) to (1,1) with zero slope at 1.
84
87
  * @internal
85
88
  */
86
89
  export declare class NormalizedBiQuadraticTransition extends NormalizedTransition {
@@ -88,50 +91,54 @@ export declare class NormalizedBiQuadraticTransition extends NormalizedTransitio
88
91
  private integratedBasis;
89
92
  private basis;
90
93
  private basisDerivative;
91
- /** At fractional position on the x axis, return the (normalized) curvature fraction.
92
- * * * For [u <= 0.5, u >= 0.5]
93
- * * f(u) = [2 u^2, 1 - 2 (1-u)^2]
94
- * * f'(u) = [4 u, 4 (1-u)]
95
- * * If(u) = [2 u^3 / 3, 0.5 (1 -u )^3/3]
94
+ /**
95
+ * At fractional position on the x axis, return the (normalized) curvature fraction.
96
+ * * For [u <= 0.5, u >= 0.5]
97
+ * * f(u) = [2 u^2, 1 - 2 (1-u)^2]
98
+ * * f'(u) = [4 u, 4 (1-u)]
99
+ * * If(u) = [2 u^3 / 3, 0.5 (1 -u )^3/3]
96
100
  */
97
101
  fractionToCurvatureFraction(u: number): number;
98
- /** Return the derivative of the (normalized) curvature fraction */
102
+ /** Return the derivative of the (normalized) curvature fraction. */
99
103
  fractionToCurvatureFractionDerivative(u: number): number;
100
- /** Return the integrated area under the curve.
104
+ /**
105
+ * Return the integrated area under the curve.
101
106
  * * This fraction is the angular change fraction.
102
107
  */
103
108
  fractionToArea(u: number): number;
104
109
  }
105
110
  /**
106
- * Transition functions for sine transition
111
+ * Transition functions for sine transition.
107
112
  * * curvature variation is the sum of
108
- * * straight line from (0,0) to (1,1), like clothoid
109
- * * additional full period of a sine wave, producing 0 slope at both ends
113
+ * * straight line from (0,0) to (1,1), like clothoid.
114
+ * * additional full period of a sine wave, producing 0 slope at both ends.
110
115
  * @internal
111
116
  */
112
117
  export declare class NormalizedSineTransition extends NormalizedTransition {
113
118
  constructor();
114
119
  /** At fractional position on the x axis, return the (normalized) curvature fraction. */
115
120
  fractionToCurvatureFraction(u: number): number;
116
- /** Return the derivative of the (normalized) curvature fraction */
121
+ /** Return the derivative of the (normalized) curvature fraction. */
117
122
  fractionToCurvatureFractionDerivative(u: number): number;
118
- /** Return the integrated area under the curve.
123
+ /**
124
+ * Return the integrated area under the curve.
119
125
  * * This fraction is the angular change fraction.
120
126
  */
121
127
  fractionToArea(u: number): number;
122
128
  }
123
129
  /**
124
- * Transition functions for cosine
125
- * * curvature variation is a half period of a cosine
130
+ * Transition functions for cosine.
131
+ * * curvature variation is a half period of a cosine.
126
132
  * @internal
127
133
  */
128
134
  export declare class NormalizedCosineTransition extends NormalizedTransition {
129
135
  constructor();
130
136
  /** At fractional position on the x axis, return the (normalized) curvature fraction. */
131
137
  fractionToCurvatureFraction(u: number): number;
132
- /** Return the derivative of the (normalized) curvature fraction */
138
+ /** Return the derivative of the (normalized) curvature fraction. */
133
139
  fractionToCurvatureFractionDerivative(u: number): number;
134
- /** Return the integrated area under the curve.
140
+ /**
141
+ * Return the integrated area under the curve.
135
142
  * * This fraction is the angular change fraction.
136
143
  */
137
144
  fractionToArea(u: number): number;
@@ -1 +1 @@
1
- {"version":3,"file":"NormalizedTransition.d.ts","sourceRoot":"","sources":["../../../../src/curve/spiral/NormalizedTransition.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH;;;;;;;;;;;;GAYG;AACH,8BAAsB,oBAAoB;IACxC,iHAAiH;;IAEjH,wFAAwF;aACxE,2BAA2B,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IACtE,mEAAmE;aACnD,qCAAqC,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAChF;;OAEG;aACa,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IACzD,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAA+B;IACjE,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAkC;IACvE,OAAO,CAAC,MAAM,CAAC,eAAe,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ps fractional progress to a curvature value.
14
14
  * * f(0) === 0
15
15
  * * f(1) === 1
16
- * * f(u) === 1 - f (1-u)
16
+ * * f(u) === 1 - f(1-u)
17
17
  * * Each implementation provides:
18
18
  * * fractionToCurvature -- the f(u) function described above
19
19
  * * fractionToCurvatureDerivative -- df(u)/du
20
20
  * * fractionToArea -- integral of the area under f(u) from 0 to u.
21
- * * the symmetry condition ensures that the integral from 0 to 1 is 1/2
21
+ * * The symmetry condition ensures that the integral from 0 to 1 is 1/2.
22
22
  * @internal
23
23
  */
24
24
  class NormalizedTransition {
25
- /** Constructor initializes with 0..1 values .. call "setBearingCurvatureLengthCurvature" to apply real values */
25
+ /** Constructor initializes with 0..1 values. Call "setBearingCurvatureLengthCurvature" to apply real values. */
26
26
  constructor() { }
27
27
  static _clothoidEvaluator;
28
28
  static _biquadraticEvaluator;
@@ -62,12 +62,19 @@ exports.NormalizedTransition = NormalizedTransition;
62
62
  * @internal
63
63
  */
64
64
  class NormalizedClothoidTransition extends NormalizedTransition {
65
- constructor() { super(); }
65
+ constructor() {
66
+ super();
67
+ }
66
68
  /** At fractional position on the x axis, return the (normalized) curvature fraction. */
67
- fractionToCurvatureFraction(fractionX) { return fractionX; }
68
- /** Return the derivative of the (normalized) curvature fraction */
69
- fractionToCurvatureFractionDerivative(_u) { return 1.0; }
70
- /** Return the integrated area under the curve.
69
+ fractionToCurvatureFraction(fractionX) {
70
+ return fractionX;
71
+ }
72
+ /** Return the derivative of the (normalized) curvature fraction. */
73
+ fractionToCurvatureFractionDerivative(_u) {
74
+ return 1.0;
75
+ }
76
+ /**
77
+ * Return the integrated area under the curve.
71
78
  * * This fraction is the angular change fraction.
72
79
  */
73
80
  fractionToArea(fractionX) {
@@ -77,24 +84,27 @@ class NormalizedClothoidTransition extends NormalizedTransition {
77
84
  exports.NormalizedClothoidTransition = NormalizedClothoidTransition;
78
85
  /**
79
86
  * Transition functions for bloss spiral.
80
- * * curvature variation is cubic from (0,0) with slope 0 to (1,1) with slope 1
87
+ * * curvature variation is cubic from (0,0) with slope 0 to (1,1) with slope 1.
81
88
  * @internal
82
89
  */
83
90
  class NormalizedBlossTransition extends NormalizedTransition {
84
91
  // bloss curve is (3 - 2x) x ^2 = 3 x^2 - 2 x^3
85
- // derivative 6x (1-x)
86
- // 2nd derivative 6 - 12 x
87
- // derivatives zero at 0,1
88
- // inflection zero at 0.5
89
- // integral is x^3 - x^4 / 2 = x^3 ( 1-x/2)
92
+ // derivative 6x (1-x)
93
+ // 2nd derivative 6 - 12 x
94
+ // derivatives zero at 0,1
95
+ // inflection zero at 0.5
96
+ // integral is x^3 - x^4 / 2 = x^3 (1-x/2)
90
97
  constructor() { super(); }
91
98
  /** At fractional position on the x axis, return the (normalized) curvature fraction. */
92
- fractionToCurvatureFraction(u) { return u * u * (3 - 2 * u); }
93
- /** Return the derivative of the (normalized) curvature fraction */
99
+ fractionToCurvatureFraction(u) {
100
+ return u * u * (3 - 2 * u);
101
+ }
102
+ /** Return the derivative of the (normalized) curvature fraction. */
94
103
  fractionToCurvatureFractionDerivative(u) {
95
104
  return 6.0 * u * (1.0 - u);
96
105
  }
97
- /** Return the integrated area under the curve.
106
+ /**
107
+ * Return the integrated area under the curve.
98
108
  * * This fraction is the angular change fraction.
99
109
  */
100
110
  fractionToArea(u) {
@@ -103,31 +113,41 @@ class NormalizedBlossTransition extends NormalizedTransition {
103
113
  }
104
114
  exports.NormalizedBlossTransition = NormalizedBlossTransition;
105
115
  /**
106
- * Transition functions for biquadratic transition
116
+ * Transition functions for biquadratic transition.
107
117
  * * Curvature is a pair of joining quadratics.
108
- * * In lower half of the interval, the quadratic is from (0,0) to (0.5, 0.5) with zero slope at origin
109
- * * In upper half of the interval, the quadratic is from (0.5,0.5) to (1,1) with zero slope at 1
118
+ * * In lower half of the interval, the quadratic is from (0,0) to (0.5, 0.5) with zero slope at origin.
119
+ * * In upper half of the interval, the quadratic is from (0.5,0.5) to (1,1) with zero slope at 1.
110
120
  * @internal
111
121
  */
112
122
  class NormalizedBiQuadraticTransition extends NormalizedTransition {
113
- constructor() { super(); }
114
- integratedBasis(u) { return u * u * u * (2.0 / 3.0); }
115
- basis(u) { return 2 * u * u; }
116
- basisDerivative(u) { return 4 * u; }
117
- /** At fractional position on the x axis, return the (normalized) curvature fraction.
118
- * * * For [u <= 0.5, u >= 0.5]
119
- * * f(u) = [2 u^2, 1 - 2 (1-u)^2]
120
- * * f'(u) = [4 u, 4 (1-u)]
121
- * * If(u) = [2 u^3 / 3, 0.5 (1 -u )^3/3]
123
+ constructor() {
124
+ super();
125
+ }
126
+ integratedBasis(u) {
127
+ return u * u * u * (2.0 / 3.0);
128
+ }
129
+ basis(u) {
130
+ return 2 * u * u;
131
+ }
132
+ basisDerivative(u) {
133
+ return 4 * u;
134
+ }
135
+ /**
136
+ * At fractional position on the x axis, return the (normalized) curvature fraction.
137
+ * * For [u <= 0.5, u >= 0.5]
138
+ * * f(u) = [2 u^2, 1 - 2 (1-u)^2]
139
+ * * f'(u) = [4 u, 4 (1-u)]
140
+ * * If(u) = [2 u^3 / 3, 0.5 (1 -u )^3/3]
122
141
  */
123
142
  fractionToCurvatureFraction(u) {
124
143
  return u <= 0.5 ? this.basis(u) : 1.0 - this.basis(1.0 - u);
125
144
  }
126
- /** Return the derivative of the (normalized) curvature fraction */
145
+ /** Return the derivative of the (normalized) curvature fraction. */
127
146
  fractionToCurvatureFractionDerivative(u) {
128
147
  return u < 0.5 ? this.basisDerivative(u) : this.basisDerivative(1 - u);
129
148
  }
130
- /** Return the integrated area under the curve.
149
+ /**
150
+ * Return the integrated area under the curve.
131
151
  * * This fraction is the angular change fraction.
132
152
  */
133
153
  fractionToArea(u) {
@@ -139,10 +159,10 @@ class NormalizedBiQuadraticTransition extends NormalizedTransition {
139
159
  }
140
160
  exports.NormalizedBiQuadraticTransition = NormalizedBiQuadraticTransition;
141
161
  /**
142
- * Transition functions for sine transition
162
+ * Transition functions for sine transition.
143
163
  * * curvature variation is the sum of
144
- * * straight line from (0,0) to (1,1), like clothoid
145
- * * additional full period of a sine wave, producing 0 slope at both ends
164
+ * * straight line from (0,0) to (1,1), like clothoid.
165
+ * * additional full period of a sine wave, producing 0 slope at both ends.
146
166
  * @internal
147
167
  */
148
168
  class NormalizedSineTransition extends NormalizedTransition {
@@ -152,12 +172,13 @@ class NormalizedSineTransition extends NormalizedTransition {
152
172
  const a = 2.0 * Math.PI;
153
173
  return u - Math.sin(u * a) / a;
154
174
  }
155
- /** Return the derivative of the (normalized) curvature fraction */
175
+ /** Return the derivative of the (normalized) curvature fraction. */
156
176
  fractionToCurvatureFractionDerivative(u) {
157
177
  const a = 2.0 * Math.PI;
158
178
  return 1 - Math.cos(u * a);
159
179
  }
160
- /** Return the integrated area under the curve.
180
+ /**
181
+ * Return the integrated area under the curve.
161
182
  * * This fraction is the angular change fraction.
162
183
  */
163
184
  fractionToArea(u) {
@@ -167,8 +188,8 @@ class NormalizedSineTransition extends NormalizedTransition {
167
188
  }
168
189
  exports.NormalizedSineTransition = NormalizedSineTransition;
169
190
  /**
170
- * Transition functions for cosine
171
- * * curvature variation is a half period of a cosine
191
+ * Transition functions for cosine.
192
+ * * curvature variation is a half period of a cosine.
172
193
  * @internal
173
194
  */
174
195
  class NormalizedCosineTransition extends NormalizedTransition {
@@ -178,12 +199,13 @@ class NormalizedCosineTransition extends NormalizedTransition {
178
199
  const a = Math.PI;
179
200
  return 0.5 * (1 - Math.cos(u * a));
180
201
  }
181
- /** Return the derivative of the (normalized) curvature fraction */
202
+ /** Return the derivative of the (normalized) curvature fraction. */
182
203
  fractionToCurvatureFractionDerivative(u) {
183
204
  const a = Math.PI;
184
205
  return 0.5 * a * Math.sin(u * a);
185
206
  }
186
- /** Return the integrated area under the curve.
207
+ /**
208
+ * Return the integrated area under the curve.
187
209
  * * This fraction is the angular change fraction.
188
210
  */
189
211
  fractionToArea(u) {
@@ -1 +1 @@
1
- {"version":3,"file":"NormalizedTransition.js","sourceRoot":"","sources":["../../../../src/curve/spiral/NormalizedTransition.ts"],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mEAAmE;IAC5D,qCAAqC,CAAC,CAAS;QACpD,MAAM,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC;QACxB,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7B,CAAC;IACD;;OAEG;IACI,cAAc,CAAC,CAAS;QAC7B,MAAM,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC;QACxB,OAAO,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACzD,CAAC;CACF;AAnBD,4DAmBC;AACD;;;;GAIG;AACH,MAAa,0BAA2B,SAAQ,oBAAoB;IAClE,gBAAgB,KAAK,EAAE,CAAC,CAAC,CAAC;IAC1B,wFAAwF;IACjF,2BAA2B,CAAC,CAAS;QAC1C,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,OAAO,GAAG,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;IACD,mEAAmE;IAC5D,qCAAqC,CAAC,CAAS;QACpD,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,OAAO,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACnC,CAAC;IACD;;OAEG;IACI,cAAc,CAAC,CAAS;QAC7B,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,OAAO,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IAC7C,CAAC;CACF;AAnBD,gEAmBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\n/**\n * NormalizedTransition is the (abstract) base class for clothoid, bloss, biquadratic, sine, and cosine transition functions.\n * * Each function maps fractional progress to a curvature value.\n * * f(0) === 0\n * * f(1) === 1\n * * f(u) === 1 - f (1-u)\n * * Each implementation provides:\n * * fractionToCurvature -- the f(u) function described above\n * * fractionToCurvatureDerivative -- df(u)/du\n * * fractionToArea -- integral of the area under f(u) from 0 to u.\n * * the symmetry condition ensures that the integral from 0 to 1 is 1/2\n * @internal\n */\nexport abstract class NormalizedTransition {\n /** Constructor initializes with 0..1 values .. call \"setBearingCurvatureLengthCurvature\" to apply real values */\n constructor() { }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public abstract fractionToCurvatureFraction(fractionX: number): number;\n /** Return the derivative of the (normalized) curvature fraction */\n public abstract fractionToCurvatureFractionDerivative(fractionX: number): number;\n /** Return the integrated area under the curve\n * * This is equal to the accumulated angle change.\n */\n public abstract fractionToArea(fractionX: number): number;\n private static _clothoidEvaluator?: NormalizedClothoidTransition;\n private static _biquadraticEvaluator?: NormalizedBiQuadraticTransition;\n private static _blossEvaluator?: NormalizedBlossTransition;\n private static _sineEvaluator?: NormalizedSineTransition;\n private static _cosineEvaluator?: NormalizedCosineTransition;\n\n /**\n * Return a standard evaluator identified by string as:\n * * clothoid\n * * bloss\n * * biquadratic\n * * sine\n * * cosine\n * Each of these types\n * * is instantiated (only once) as a single static object within the NormalizedTransition class.\n * * has no instance data or mutator methods.\n * @param name string name of the transition.\n */\n public static findEvaluator(name: string): NormalizedTransition | undefined {\n if (name === \"clothoid\")\n return this._clothoidEvaluator ? this._clothoidEvaluator : (this._clothoidEvaluator = new NormalizedClothoidTransition());\n if (name === \"bloss\")\n return this._blossEvaluator ? this._blossEvaluator : (this._blossEvaluator = new NormalizedBlossTransition());\n if (name === \"biquadratic\")\n return this._biquadraticEvaluator ? this._biquadraticEvaluator : (this._biquadraticEvaluator = new NormalizedBiQuadraticTransition());\n if (name === \"sine\")\n return this._sineEvaluator ? this._sineEvaluator : (this._sineEvaluator = new NormalizedSineTransition());\n if (name === \"cosine\")\n return this._cosineEvaluator ? this._cosineEvaluator : (this._cosineEvaluator = new NormalizedCosineTransition());\n return undefined;\n }\n}\n/**\n * Transition functions for clothoid spiral.\n * * curvature variation is linear from (0,0) to (1,1)\n * @internal\n */\nexport class NormalizedClothoidTransition extends NormalizedTransition {\n constructor() { super(); }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public fractionToCurvatureFraction(fractionX: number): number { return fractionX; }\n /** Return the derivative of the (normalized) curvature fraction */\n public fractionToCurvatureFractionDerivative(_u: number): number { return 1.0; }\n /** Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(fractionX: number): number {\n return fractionX * fractionX * 0.5;\n }\n}\n\n/**\n * Transition functions for bloss spiral.\n * * curvature variation is cubic from (0,0) with slope 0 to (1,1) with slope 1\n * @internal\n */\nexport class NormalizedBlossTransition extends NormalizedTransition {\n // bloss curve is (3 - 2x) x ^2 = 3 x^2 - 2 x^3\n // derivative 6x (1-x)\n // 2nd derivative 6 - 12 x\n // derivatives zero at 0,1\n // inflection zero at 0.5\n // integral is x^3 - x^4 / 2 = x^3 ( 1-x/2)\n constructor() { super(); }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public fractionToCurvatureFraction(u: number): number { return u * u * (3 - 2 * u); }\n /** Return the derivative of the (normalized) curvature fraction */\n public fractionToCurvatureFractionDerivative(u: number): number {\n return 6.0 * u * (1.0 - u);\n }\n /** Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(u: number): number {\n return u * u * u * (1 - 0.5 * u);\n }\n}\n\n/**\n * Transition functions for biquadratic transition\n * * Curvature is a pair of joining quadratics.\n * * In lower half of the interval, the quadratic is from (0,0) to (0.5, 0.5) with zero slope at origin\n * * In upper half of the interval, the quadratic is from (0.5,0.5) to (1,1) with zero slope at 1\n * @internal\n */\nexport class NormalizedBiQuadraticTransition extends NormalizedTransition {\n constructor() { super(); }\n private integratedBasis(u: number): number { return u * u * u * (2.0 / 3.0); }\n private basis(u: number): number { return 2 * u * u; }\n private basisDerivative(u: number): number { return 4 * u; }\n /** At fractional position on the x axis, return the (normalized) curvature fraction.\n * * * For [u <= 0.5, u >= 0.5]\n * * f(u) = [2 u^2, 1 - 2 (1-u)^2]\n * * f'(u) = [4 u, 4 (1-u)]\n * * If(u) = [2 u^3 / 3, 0.5 (1 -u )^3/3]\n */\n public fractionToCurvatureFraction(u: number): number {\n return u <= 0.5 ? this.basis(u) : 1.0 - this.basis(1.0 - u);\n }\n /** Return the derivative of the (normalized) curvature fraction */\n public fractionToCurvatureFractionDerivative(u: number): number {\n return u < 0.5 ? this.basisDerivative(u) : this.basisDerivative(1 - u);\n }\n /** Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(u: number): number {\n if (u <= 0.5)\n return this.integratedBasis(u);\n const v = 1 - u;\n return 0.5 - v + this.integratedBasis(v);\n }\n}\n\n/**\n * Transition functions for sine transition\n * * curvature variation is the sum of\n * * straight line from (0,0) to (1,1), like clothoid\n * * additional full period of a sine wave, producing 0 slope at both ends\n * @internal\n */\nexport class NormalizedSineTransition extends NormalizedTransition {\n constructor() { super(); }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public fractionToCurvatureFraction(u: number): number {\n const a = 2.0 * Math.PI;\n return u - Math.sin(u * a) / a;\n }\n /** Return the derivative of the (normalized) curvature fraction */\n public fractionToCurvatureFractionDerivative(u: number): number {\n const a = 2.0 * Math.PI;\n return 1 - Math.cos(u * a);\n }\n /** Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(u: number): number {\n const a = 2.0 * Math.PI;\n return 0.5 * u * u + (Math.cos(u * a) - 1.0) / (a * a);\n }\n}\n/**\n * Transition functions for cosine\n * * curvature variation is a half period of a cosine\n * @internal\n */\nexport class NormalizedCosineTransition extends NormalizedTransition {\n constructor() { super(); }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public fractionToCurvatureFraction(u: number): number {\n const a = Math.PI;\n return 0.5 * (1 - Math.cos(u * a));\n }\n /** Return the derivative of the (normalized) curvature fraction */\n public fractionToCurvatureFractionDerivative(u: number): number {\n const a = Math.PI;\n return 0.5 * a * Math.sin(u * a);\n }\n /** Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(u: number): number {\n const a = Math.PI;\n return 0.5 * u - 0.5 * Math.sin(u * a) / a;\n }\n}\n"]}
1
+ {"version":3,"file":"NormalizedTransition.js","sourceRoot":"","sources":["../../../../src/curve/spiral/NormalizedTransition.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH;;;;;;;;;;;;GAYG;AACH,MAAsB,oBAAoB;IACxC,gHAAgH;IAChH,gBAAgB,CAAC;IAUT,MAAM,CAAC,kBAAkB,CAAgC;IACzD,MAAM,CAAC,qBAAqB,CAAmC;IAC/D,MAAM,CAAC,eAAe,CAA6B;IACnD,MAAM,CAAC,cAAc,CAA4B;IACjD,MAAM,CAAC,gBAAgB,CAA8B;IAC7D;;;;;;;;;;;OAWG;IACI,MAAM,CAAC,aAAa,CAAC,IAAY;QACtC,IAAI,IAAI,KAAK,UAAU;YACrB,OAAO,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,GAAG,IAAI,4BAA4B,EAAE,CAAC,CAAC;QAC5H,IAAI,IAAI,KAAK,OAAO;YAClB,OAAO,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,GAAG,IAAI,yBAAyB,EAAE,CAAC,CAAC;QAChH,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C,GAAG,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;IACD,oEAAoE;IAC7D,qCAAqC,CAAC,CAAS;QACpD,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,OAAO,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACnC,CAAC;IACD;;;OAGG;IACI,cAAc,CAAC,CAAS;QAC7B,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,OAAO,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IAC7C,CAAC;CACF;AApBD,gEAoBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\n\n/**\n * NormalizedTransition is the (abstract) base class for clothoid, bloss, biquadratic, sine, and cosine transition functions.\n * * Each function maps fractional progress to a curvature value.\n * * f(0) === 0\n * * f(1) === 1\n * * f(u) === 1 - f(1-u)\n * * Each implementation provides:\n * * fractionToCurvature -- the f(u) function described above\n * * fractionToCurvatureDerivative -- df(u)/du\n * * fractionToArea -- integral of the area under f(u) from 0 to u.\n * * The symmetry condition ensures that the integral from 0 to 1 is 1/2.\n * @internal\n */\nexport abstract class NormalizedTransition {\n /** Constructor initializes with 0..1 values. Call \"setBearingCurvatureLengthCurvature\" to apply real values. */\n constructor() { }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public abstract fractionToCurvatureFraction(fractionX: number): number;\n /** Return the derivative of the (normalized) curvature fraction. */\n public abstract fractionToCurvatureFractionDerivative(fractionX: number): number;\n /**\n * Return the integrated area under the curve.\n * * This is equal to the accumulated angle change.\n */\n public abstract fractionToArea(fractionX: number): number;\n private static _clothoidEvaluator?: NormalizedClothoidTransition;\n private static _biquadraticEvaluator?: NormalizedBiQuadraticTransition;\n private static _blossEvaluator?: NormalizedBlossTransition;\n private static _sineEvaluator?: NormalizedSineTransition;\n private static _cosineEvaluator?: NormalizedCosineTransition;\n /**\n * Return a standard evaluator identified by string as:\n * * clothoid\n * * bloss\n * * biquadratic\n * * sine\n * * cosine\n * Each of these types\n * * is instantiated (only once) as a single static object within the NormalizedTransition class.\n * * has no instance data or mutator methods.\n * @param name string name of the transition.\n */\n public static findEvaluator(name: string): NormalizedTransition | undefined {\n if (name === \"clothoid\")\n return this._clothoidEvaluator ? this._clothoidEvaluator : (this._clothoidEvaluator = new NormalizedClothoidTransition());\n if (name === \"bloss\")\n return this._blossEvaluator ? this._blossEvaluator : (this._blossEvaluator = new NormalizedBlossTransition());\n if (name === \"biquadratic\")\n return this._biquadraticEvaluator ? this._biquadraticEvaluator : (this._biquadraticEvaluator = new NormalizedBiQuadraticTransition());\n if (name === \"sine\")\n return this._sineEvaluator ? this._sineEvaluator : (this._sineEvaluator = new NormalizedSineTransition());\n if (name === \"cosine\")\n return this._cosineEvaluator ? this._cosineEvaluator : (this._cosineEvaluator = new NormalizedCosineTransition());\n return undefined;\n }\n}\n\n/**\n * Transition functions for clothoid spiral.\n * * curvature variation is linear from (0,0) to (1,1)\n * @internal\n */\nexport class NormalizedClothoidTransition extends NormalizedTransition {\n constructor() {\n super();\n }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public fractionToCurvatureFraction(fractionX: number): number {\n return fractionX;\n }\n /** Return the derivative of the (normalized) curvature fraction. */\n public fractionToCurvatureFractionDerivative(_u: number): number {\n return 1.0;\n }\n /**\n * Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(fractionX: number): number {\n return fractionX * fractionX * 0.5;\n }\n}\n\n/**\n * Transition functions for bloss spiral.\n * * curvature variation is cubic from (0,0) with slope 0 to (1,1) with slope 1.\n * @internal\n */\nexport class NormalizedBlossTransition extends NormalizedTransition {\n // bloss curve is (3 - 2x) x ^2 = 3 x^2 - 2 x^3\n // derivative 6x (1-x)\n // 2nd derivative 6 - 12 x\n // derivatives zero at 0,1\n // inflection zero at 0.5\n // integral is x^3 - x^4 / 2 = x^3 (1-x/2)\n constructor() { super(); }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public fractionToCurvatureFraction(u: number): number {\n return u * u * (3 - 2 * u);\n }\n /** Return the derivative of the (normalized) curvature fraction. */\n public fractionToCurvatureFractionDerivative(u: number): number {\n return 6.0 * u * (1.0 - u);\n }\n /**\n * Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(u: number): number {\n return u * u * u * (1 - 0.5 * u);\n }\n}\n\n/**\n * Transition functions for biquadratic transition.\n * * Curvature is a pair of joining quadratics.\n * * In lower half of the interval, the quadratic is from (0,0) to (0.5, 0.5) with zero slope at origin.\n * * In upper half of the interval, the quadratic is from (0.5,0.5) to (1,1) with zero slope at 1.\n * @internal\n */\nexport class NormalizedBiQuadraticTransition extends NormalizedTransition {\n constructor() {\n super();\n }\n private integratedBasis(u: number): number {\n return u * u * u * (2.0 / 3.0);\n }\n private basis(u: number): number {\n return 2 * u * u;\n }\n private basisDerivative(u: number): number {\n return 4 * u;\n }\n /**\n * At fractional position on the x axis, return the (normalized) curvature fraction.\n * * For [u <= 0.5, u >= 0.5]\n * * f(u) = [2 u^2, 1 - 2 (1-u)^2]\n * * f'(u) = [4 u, 4 (1-u)]\n * * If(u) = [2 u^3 / 3, 0.5 (1 -u )^3/3]\n */\n public fractionToCurvatureFraction(u: number): number {\n return u <= 0.5 ? this.basis(u) : 1.0 - this.basis(1.0 - u);\n }\n /** Return the derivative of the (normalized) curvature fraction. */\n public fractionToCurvatureFractionDerivative(u: number): number {\n return u < 0.5 ? this.basisDerivative(u) : this.basisDerivative(1 - u);\n }\n /**\n * Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(u: number): number {\n if (u <= 0.5)\n return this.integratedBasis(u);\n const v = 1 - u;\n return 0.5 - v + this.integratedBasis(v);\n }\n}\n\n/**\n * Transition functions for sine transition.\n * * curvature variation is the sum of\n * * straight line from (0,0) to (1,1), like clothoid.\n * * additional full period of a sine wave, producing 0 slope at both ends.\n * @internal\n */\nexport class NormalizedSineTransition extends NormalizedTransition {\n constructor() { super(); }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public fractionToCurvatureFraction(u: number): number {\n const a = 2.0 * Math.PI;\n return u - Math.sin(u * a) / a;\n }\n /** Return the derivative of the (normalized) curvature fraction. */\n public fractionToCurvatureFractionDerivative(u: number): number {\n const a = 2.0 * Math.PI;\n return 1 - Math.cos(u * a);\n }\n /**\n * Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(u: number): number {\n const a = 2.0 * Math.PI;\n return 0.5 * u * u + (Math.cos(u * a) - 1.0) / (a * a);\n }\n}\n\n/**\n * Transition functions for cosine.\n * * curvature variation is a half period of a cosine.\n * @internal\n */\nexport class NormalizedCosineTransition extends NormalizedTransition {\n constructor() { super(); }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public fractionToCurvatureFraction(u: number): number {\n const a = Math.PI;\n return 0.5 * (1 - Math.cos(u * a));\n }\n /** Return the derivative of the (normalized) curvature fraction. */\n public fractionToCurvatureFractionDerivative(u: number): number {\n const a = Math.PI;\n return 0.5 * a * Math.sin(u * a);\n }\n /**\n * Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(u: number): number {\n const a = Math.PI;\n return 0.5 * u - 0.5 * Math.sin(u * a) / a;\n }\n}\n"]}
@@ -2,15 +2,10 @@ import { CubicEvaluator } from "./CubicEvaluator";
2
2
  /**
3
3
  * Polish Cubic.
4
4
  * * Construction takes nominal length and end radius.
5
- * curve is is y= m*x^3 with
6
- * * x any point on the x axis
7
- * * m is (1/6RL)
8
- * * Lx = x length is along the axis, determined by inversion of a distance series at nominal length
9
- * *
10
- * @param localToWorld
11
- * @param nominalL1
12
- * @param nominalR1
13
- * @param activeInterval
5
+ * curve is y = m*x^3 with
6
+ * * x any point on the x axis.
7
+ * * m is (1/6RL).
8
+ * * Lx = x length is along the axis, determined by inversion of a distance series at nominal length.
14
9
  * @internal
15
10
  */
16
11
  export declare class PolishCubicEvaluator extends CubicEvaluator {
@@ -22,25 +17,25 @@ export declare class PolishCubicEvaluator extends CubicEvaluator {
22
17
  static computeCubicM(length1: number, radius1: number): number;
23
18
  static create(length1: number, radius1: number): PolishCubicEvaluator | undefined;
24
19
  scaleInPlace(scaleFactor: number): void;
25
- /** return a deep copy of the evaluator */
20
+ /** Return a deep copy of the evaluator. */
26
21
  clone(): PolishCubicEvaluator;
27
- /** Member by member matchup ... */
22
+ /** Member by member matchup. */
28
23
  isAlmostEqual(other: any): boolean;
29
- /** Compute the coefficient of x^4 in the x-to-distance series expansion */
24
+ /** Compute the coefficient of x^4 in the x-to-distance series expansion. */
30
25
  static computeX4SeriesCoefficient(length1: number, radius1: number): number;
31
26
  /**
32
27
  * Evaluate a series approximation of distance along the true curve.
33
- * @param x distance along x axis
34
- * @param radius1 nominal end radius
35
- * @param length1 nominal length along curve
28
+ * @param x distance along x axis.
29
+ * @param radius1 nominal end radius.
30
+ * @param length1 nominal length along curve.
36
31
  * @returns
37
32
  */
38
33
  static xToApproximateDistance(x: number, radius1: number, length1: number): number;
39
34
  /**
40
35
  * Evaluate the derivative of the x-to-distance series.
41
- * @param x distance along x axis
42
- * @param radius1 nominal end radius
43
- * @param length1 nominal length along curve
36
+ * @param x distance along x axis.
37
+ * @param radius1 nominal end radius.
38
+ * @param length1 nominal length along curve.
44
39
  * @returns
45
40
  */
46
41
  static xToApproximateDistanceDerivative(x: number, radius1: number, length1: number): number;
@@ -1 +1 @@
1
- {"version":3,"file":"PolishCubicSpiralEvaluator.d.ts","sourceRoot":"","sources":["../../../../src/curve/spiral/PolishCubicSpiralEvaluator.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,cA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AAC;IAC9B,uEAAuE;IACvE,OAAO;IAKP,wCAAwC;WAC1B,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM;WAGvD,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS;IASxE,YAAY,CAAC,WAAW,EAAE,MAAM;IAKhD,2CAA2C;IACpC,KAAK,IAAI,oBAAoB;IAGpC,gCAAgC;IACzB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO;IAOzC,4EAA4E;WAC9D,0BAA0B,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM;IAGlF;;;;;;OAMG;WACW,sBAAsB,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM;IASzF;;;;;;OAMG;WACW,gCAAgC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM;IAgBnG,kDAAkD;WACpC,2BAA2B,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;CAM3G"}
@@ -14,15 +14,10 @@ const CubicEvaluator_1 = require("./CubicEvaluator");
14
14
  /**
15
15
  * Polish Cubic.
16
16
  * * Construction takes nominal length and end radius.
17
- * curve is is y= m*x^3 with
18
- * * x any point on the x axis
19
- * * m is (1/6RL)
20
- * * Lx = x length is along the axis, determined by inversion of a distance series at nominal length
21
- * *
22
- * @param localToWorld
23
- * @param nominalL1
24
- * @param nominalR1
25
- * @param activeInterval
17
+ * curve is y = m*x^3 with
18
+ * * x any point on the x axis.
19
+ * * m is (1/6RL).
20
+ * * Lx = x length is along the axis, determined by inversion of a distance series at nominal length.
26
21
  * @internal
27
22
  */
28
23
  class PolishCubicEvaluator extends CubicEvaluator_1.CubicEvaluator {
@@ -52,9 +47,11 @@ class PolishCubicEvaluator extends CubicEvaluator_1.CubicEvaluator {
52
47
  this.nominalRadius1 *= scaleFactor;
53
48
  super.scaleInPlace(scaleFactor);
54
49
  }
55
- /** return a deep copy of the evaluator */
56
- clone() { return new PolishCubicEvaluator(this.nominalLength1, this.nominalRadius1, this.axisLength, this.cubicM); }
57
- /** Member by member matchup ... */
50
+ /** Return a deep copy of the evaluator. */
51
+ clone() {
52
+ return new PolishCubicEvaluator(this.nominalLength1, this.nominalRadius1, this.axisLength, this.cubicM);
53
+ }
54
+ /** Member by member matchup. */
58
55
  isAlmostEqual(other) {
59
56
  if (other instanceof PolishCubicEvaluator) {
60
57
  return Geometry_1.Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)
@@ -62,15 +59,15 @@ class PolishCubicEvaluator extends CubicEvaluator_1.CubicEvaluator {
62
59
  }
63
60
  return false;
64
61
  }
65
- /** Compute the coefficient of x^4 in the x-to-distance series expansion */
62
+ /** Compute the coefficient of x^4 in the x-to-distance series expansion. */
66
63
  static computeX4SeriesCoefficient(length1, radius1) {
67
64
  return 1.0 / (4.0 * length1 * length1 * radius1 * radius1);
68
65
  }
69
66
  /**
70
67
  * Evaluate a series approximation of distance along the true curve.
71
- * @param x distance along x axis
72
- * @param radius1 nominal end radius
73
- * @param length1 nominal length along curve
68
+ * @param x distance along x axis.
69
+ * @param radius1 nominal end radius.
70
+ * @param length1 nominal length along curve.
74
71
  * @returns
75
72
  */
76
73
  static xToApproximateDistance(x, radius1, length1) {
@@ -84,9 +81,9 @@ class PolishCubicEvaluator extends CubicEvaluator_1.CubicEvaluator {
84
81
  }
85
82
  /**
86
83
  * Evaluate the derivative of the x-to-distance series.
87
- * @param x distance along x axis
88
- * @param radius1 nominal end radius
89
- * @param length1 nominal length along curve
84
+ * @param x distance along x axis.
85
+ * @param radius1 nominal end radius.
86
+ * @param length1 nominal length along curve.
90
87
  * @returns
91
88
  */
92
89
  static xToApproximateDistanceDerivative(x, radius1, length1) {
@@ -95,13 +92,13 @@ class PolishCubicEvaluator extends CubicEvaluator_1.CubicEvaluator {
95
92
  const ax2 = a4 * x * x;
96
93
  const ax3 = ax2 * x;
97
94
  const ax4 = ax3 * x;
98
- // derivative notes ..
95
+ // derivative notes:
99
96
  // take away leading x -- this reduces each power by 1
100
97
  // multiply each coefficient by its original power:
101
- // 0.1==>0.5
102
- // 1/72==> 9/72 = 1/8
103
- // 1/208==>13/208=1/16
104
- // 1/2176==>17/2176= 1/128
98
+ // 0.1 ==> 0.5
99
+ // 1/72 ==> 9/72 = 1/8
100
+ // 1/208 ==> 13/208 = 1/16
101
+ // 1/2176 ==> 17/2176 = 1/128
105
102
  const ds = (1.0 + ax4 * (0.5 + ax4 * (-1.0 / 8.0 + ax4 * (1.0 / 16.0 - 5.0 * ax4 / 128.0))));
106
103
  return ds;
107
104
  }