@itwin/core-geometry 4.10.0-dev.9 → 5.0.0-dev.1

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 (338) hide show
  1. package/CHANGELOG.md +26 -1
  2. package/lib/cjs/Geometry.js +2 -2
  3. package/lib/cjs/Geometry.js.map +1 -1
  4. package/lib/cjs/bspline/BSpline1dNd.d.ts.map +1 -1
  5. package/lib/cjs/bspline/BSpline1dNd.js +0 -1
  6. package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
  7. package/lib/cjs/bspline/BSplineCurve.d.ts +5 -3
  8. package/lib/cjs/bspline/BSplineCurve.d.ts.map +1 -1
  9. package/lib/cjs/bspline/BSplineCurve.js +5 -4
  10. package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
  11. package/lib/cjs/clipping/ClipVector.js +1 -1
  12. package/lib/cjs/clipping/ClipVector.js.map +1 -1
  13. package/lib/cjs/core-geometry.d.ts +1 -1
  14. package/lib/cjs/core-geometry.d.ts.map +1 -1
  15. package/lib/cjs/core-geometry.js +1 -1
  16. package/lib/cjs/core-geometry.js.map +1 -1
  17. package/lib/cjs/curve/Arc3d.d.ts +136 -128
  18. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  19. package/lib/cjs/curve/Arc3d.js +177 -152
  20. package/lib/cjs/curve/Arc3d.js.map +1 -1
  21. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +7 -5
  22. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  23. package/lib/cjs/curve/CurveChainWithDistanceIndex.js +9 -7
  24. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  25. package/lib/cjs/curve/CurveCollection.d.ts +21 -2
  26. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  27. package/lib/cjs/curve/CurveCollection.js +45 -10
  28. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  29. package/lib/cjs/curve/CurveExtendMode.d.ts +18 -15
  30. package/lib/cjs/curve/CurveExtendMode.d.ts.map +1 -1
  31. package/lib/cjs/curve/CurveExtendMode.js +18 -17
  32. package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
  33. package/lib/cjs/curve/CurveFactory.d.ts +11 -13
  34. package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
  35. package/lib/cjs/curve/CurveFactory.js +19 -46
  36. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  37. package/lib/cjs/curve/CurvePrimitive.d.ts +9 -5
  38. package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
  39. package/lib/cjs/curve/CurvePrimitive.js +9 -5
  40. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  41. package/lib/cjs/curve/CurveProcessor.d.ts.map +1 -1
  42. package/lib/cjs/curve/CurveProcessor.js +0 -1
  43. package/lib/cjs/curve/CurveProcessor.js.map +1 -1
  44. package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
  45. package/lib/cjs/curve/LineSegment3d.js +2 -3
  46. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  47. package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
  48. package/lib/cjs/curve/OffsetOptions.d.ts.map +1 -1
  49. package/lib/cjs/curve/OffsetOptions.js +4 -4
  50. package/lib/cjs/curve/OffsetOptions.js.map +1 -1
  51. package/lib/cjs/curve/Path.d.ts +14 -0
  52. package/lib/cjs/curve/Path.d.ts.map +1 -1
  53. package/lib/cjs/curve/Path.js +27 -0
  54. package/lib/cjs/curve/Path.js.map +1 -1
  55. package/lib/cjs/curve/PointString3d.d.ts.map +1 -1
  56. package/lib/cjs/curve/PointString3d.js +0 -1
  57. package/lib/cjs/curve/PointString3d.js.map +1 -1
  58. package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
  59. package/lib/cjs/curve/StrokeOptions.js +0 -1
  60. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  61. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
  62. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +5 -6
  63. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  64. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  65. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +10 -10
  66. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  67. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -1
  68. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js +4 -4
  69. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  70. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.d.ts +18 -18
  71. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -1
  72. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js +46 -42
  73. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  74. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +5 -4
  75. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  76. package/lib/cjs/geometry3d/AngleSweep.d.ts +10 -6
  77. package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
  78. package/lib/cjs/geometry3d/AngleSweep.js +15 -12
  79. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  80. package/lib/cjs/geometry3d/BilinearPatch.js +4 -4
  81. package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
  82. package/lib/cjs/geometry3d/FrameBuilder.d.ts.map +1 -1
  83. package/lib/cjs/geometry3d/FrameBuilder.js +0 -1
  84. package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
  85. package/lib/cjs/geometry3d/IndexedXYCollection.d.ts.map +1 -1
  86. package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
  87. package/lib/cjs/geometry3d/Matrix3d.d.ts +28 -17
  88. package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
  89. package/lib/cjs/geometry3d/Matrix3d.js +36 -17
  90. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  91. package/lib/cjs/geometry3d/Point2dArrayCarrier.d.ts.map +1 -1
  92. package/lib/cjs/geometry3d/Point2dArrayCarrier.js +2 -3
  93. package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
  94. package/lib/cjs/geometry3d/Point3dVector3d.d.ts +6 -5
  95. package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
  96. package/lib/cjs/geometry3d/Point3dVector3d.js +6 -5
  97. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  98. package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
  99. package/lib/cjs/geometry3d/PointHelpers.js +0 -1
  100. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  101. package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
  102. package/lib/cjs/geometry3d/PolygonOps.js +2 -4
  103. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  104. package/lib/cjs/geometry3d/Ray3d.js +2 -2
  105. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  106. package/lib/cjs/geometry3d/YawPitchRollAngles.d.ts.map +1 -1
  107. package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
  108. package/lib/cjs/geometry4d/Map4d.d.ts +5 -5
  109. package/lib/cjs/geometry4d/Map4d.js +5 -5
  110. package/lib/cjs/geometry4d/Map4d.js.map +1 -1
  111. package/lib/cjs/geometry4d/Matrix4d.d.ts +4 -7
  112. package/lib/cjs/geometry4d/Matrix4d.d.ts.map +1 -1
  113. package/lib/cjs/geometry4d/Matrix4d.js +4 -7
  114. package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
  115. package/lib/cjs/geometry4d/Point4d.d.ts.map +1 -1
  116. package/lib/cjs/geometry4d/Point4d.js +2 -1
  117. package/lib/cjs/geometry4d/Point4d.js.map +1 -1
  118. package/lib/cjs/numerics/BezierPolynomials.d.ts.map +1 -1
  119. package/lib/cjs/numerics/BezierPolynomials.js +0 -1
  120. package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
  121. package/lib/cjs/numerics/Newton.d.ts +3 -0
  122. package/lib/cjs/numerics/Newton.d.ts.map +1 -1
  123. package/lib/cjs/numerics/Newton.js +2 -5
  124. package/lib/cjs/numerics/Newton.js.map +1 -1
  125. package/lib/cjs/numerics/Polynomials.d.ts +46 -201
  126. package/lib/cjs/numerics/Polynomials.d.ts.map +1 -1
  127. package/lib/cjs/numerics/Polynomials.js +132 -445
  128. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  129. package/lib/cjs/numerics/Range1dArray.js +2 -2
  130. package/lib/cjs/numerics/Range1dArray.js.map +1 -1
  131. package/lib/cjs/numerics/SmallSystem.d.ts +164 -0
  132. package/lib/cjs/numerics/SmallSystem.d.ts.map +1 -0
  133. package/lib/cjs/numerics/SmallSystem.js +321 -0
  134. package/lib/cjs/numerics/SmallSystem.js.map +1 -0
  135. package/lib/cjs/polyface/AuxData.d.ts.map +1 -1
  136. package/lib/cjs/polyface/AuxData.js.map +1 -1
  137. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  138. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +0 -1
  139. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  140. package/lib/cjs/polyface/Polyface.d.ts +2 -2
  141. package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
  142. package/lib/cjs/polyface/Polyface.js +0 -1
  143. package/lib/cjs/polyface/Polyface.js.map +1 -1
  144. package/lib/cjs/polyface/PolyfaceBuilder.js +1 -1
  145. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  146. package/lib/cjs/polyface/PolyfaceClip.d.ts +3 -3
  147. package/lib/cjs/polyface/PolyfaceClip.d.ts.map +1 -1
  148. package/lib/cjs/polyface/PolyfaceClip.js +1 -2
  149. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  150. package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
  151. package/lib/cjs/polyface/PolyfaceQuery.js +0 -1
  152. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  153. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  154. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  155. package/lib/cjs/polyface/multiclip/OffsetMeshContext.d.ts +1 -1
  156. package/lib/cjs/polyface/multiclip/OffsetMeshContext.d.ts.map +1 -1
  157. package/lib/cjs/polyface/multiclip/OffsetMeshContext.js +7 -7
  158. package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  159. package/lib/cjs/serialization/DeepCompare.d.ts.map +1 -1
  160. package/lib/cjs/serialization/DeepCompare.js +0 -1
  161. package/lib/cjs/serialization/DeepCompare.js.map +1 -1
  162. package/lib/cjs/topology/Graph.d.ts.map +1 -1
  163. package/lib/cjs/topology/Graph.js +2 -2
  164. package/lib/cjs/topology/Graph.js.map +1 -1
  165. package/lib/cjs/topology/InsertAndRetriangulateContext.js +2 -2
  166. package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
  167. package/lib/cjs/topology/Merging.d.ts +1 -1
  168. package/lib/cjs/topology/Merging.d.ts.map +1 -1
  169. package/lib/cjs/topology/Merging.js +2 -2
  170. package/lib/cjs/topology/Merging.js.map +1 -1
  171. package/lib/esm/Geometry.js +2 -2
  172. package/lib/esm/Geometry.js.map +1 -1
  173. package/lib/esm/bspline/BSpline1dNd.d.ts.map +1 -1
  174. package/lib/esm/bspline/BSpline1dNd.js +0 -1
  175. package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
  176. package/lib/esm/bspline/BSplineCurve.d.ts +5 -3
  177. package/lib/esm/bspline/BSplineCurve.d.ts.map +1 -1
  178. package/lib/esm/bspline/BSplineCurve.js +5 -4
  179. package/lib/esm/bspline/BSplineCurve.js.map +1 -1
  180. package/lib/esm/clipping/ClipVector.js +1 -1
  181. package/lib/esm/clipping/ClipVector.js.map +1 -1
  182. package/lib/esm/core-geometry.d.ts +1 -1
  183. package/lib/esm/core-geometry.d.ts.map +1 -1
  184. package/lib/esm/core-geometry.js +1 -1
  185. package/lib/esm/core-geometry.js.map +1 -1
  186. package/lib/esm/curve/Arc3d.d.ts +136 -128
  187. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  188. package/lib/esm/curve/Arc3d.js +177 -152
  189. package/lib/esm/curve/Arc3d.js.map +1 -1
  190. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +7 -5
  191. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  192. package/lib/esm/curve/CurveChainWithDistanceIndex.js +9 -7
  193. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  194. package/lib/esm/curve/CurveCollection.d.ts +21 -2
  195. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  196. package/lib/esm/curve/CurveCollection.js +45 -10
  197. package/lib/esm/curve/CurveCollection.js.map +1 -1
  198. package/lib/esm/curve/CurveExtendMode.d.ts +18 -15
  199. package/lib/esm/curve/CurveExtendMode.d.ts.map +1 -1
  200. package/lib/esm/curve/CurveExtendMode.js +18 -17
  201. package/lib/esm/curve/CurveExtendMode.js.map +1 -1
  202. package/lib/esm/curve/CurveFactory.d.ts +11 -13
  203. package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
  204. package/lib/esm/curve/CurveFactory.js +17 -44
  205. package/lib/esm/curve/CurveFactory.js.map +1 -1
  206. package/lib/esm/curve/CurvePrimitive.d.ts +9 -5
  207. package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
  208. package/lib/esm/curve/CurvePrimitive.js +9 -5
  209. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  210. package/lib/esm/curve/CurveProcessor.d.ts.map +1 -1
  211. package/lib/esm/curve/CurveProcessor.js +0 -1
  212. package/lib/esm/curve/CurveProcessor.js.map +1 -1
  213. package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
  214. package/lib/esm/curve/LineSegment3d.js +1 -2
  215. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  216. package/lib/esm/curve/LineString3d.d.ts.map +1 -1
  217. package/lib/esm/curve/OffsetOptions.d.ts.map +1 -1
  218. package/lib/esm/curve/OffsetOptions.js +4 -4
  219. package/lib/esm/curve/OffsetOptions.js.map +1 -1
  220. package/lib/esm/curve/Path.d.ts +14 -0
  221. package/lib/esm/curve/Path.d.ts.map +1 -1
  222. package/lib/esm/curve/Path.js +27 -0
  223. package/lib/esm/curve/Path.js.map +1 -1
  224. package/lib/esm/curve/PointString3d.d.ts.map +1 -1
  225. package/lib/esm/curve/PointString3d.js +0 -1
  226. package/lib/esm/curve/PointString3d.js.map +1 -1
  227. package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
  228. package/lib/esm/curve/StrokeOptions.js +0 -1
  229. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  230. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
  231. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +4 -5
  232. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  233. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  234. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +5 -5
  235. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  236. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -1
  237. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js +3 -3
  238. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  239. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.d.ts +18 -18
  240. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -1
  241. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js +46 -42
  242. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  243. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +5 -4
  244. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  245. package/lib/esm/geometry3d/AngleSweep.d.ts +10 -6
  246. package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
  247. package/lib/esm/geometry3d/AngleSweep.js +15 -12
  248. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  249. package/lib/esm/geometry3d/BilinearPatch.js +1 -1
  250. package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
  251. package/lib/esm/geometry3d/FrameBuilder.d.ts.map +1 -1
  252. package/lib/esm/geometry3d/FrameBuilder.js +0 -1
  253. package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
  254. package/lib/esm/geometry3d/IndexedXYCollection.d.ts.map +1 -1
  255. package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
  256. package/lib/esm/geometry3d/Matrix3d.d.ts +28 -17
  257. package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
  258. package/lib/esm/geometry3d/Matrix3d.js +36 -17
  259. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  260. package/lib/esm/geometry3d/Point2dArrayCarrier.d.ts.map +1 -1
  261. package/lib/esm/geometry3d/Point2dArrayCarrier.js +0 -1
  262. package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
  263. package/lib/esm/geometry3d/Point3dVector3d.d.ts +6 -5
  264. package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
  265. package/lib/esm/geometry3d/Point3dVector3d.js +6 -5
  266. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  267. package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
  268. package/lib/esm/geometry3d/PointHelpers.js +0 -1
  269. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  270. package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
  271. package/lib/esm/geometry3d/PolygonOps.js +2 -4
  272. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  273. package/lib/esm/geometry3d/Ray3d.js +1 -1
  274. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  275. package/lib/esm/geometry3d/YawPitchRollAngles.d.ts.map +1 -1
  276. package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
  277. package/lib/esm/geometry4d/Map4d.d.ts +5 -5
  278. package/lib/esm/geometry4d/Map4d.js +5 -5
  279. package/lib/esm/geometry4d/Map4d.js.map +1 -1
  280. package/lib/esm/geometry4d/Matrix4d.d.ts +4 -7
  281. package/lib/esm/geometry4d/Matrix4d.d.ts.map +1 -1
  282. package/lib/esm/geometry4d/Matrix4d.js +4 -7
  283. package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
  284. package/lib/esm/geometry4d/Point4d.d.ts.map +1 -1
  285. package/lib/esm/geometry4d/Point4d.js +2 -1
  286. package/lib/esm/geometry4d/Point4d.js.map +1 -1
  287. package/lib/esm/numerics/BezierPolynomials.d.ts.map +1 -1
  288. package/lib/esm/numerics/BezierPolynomials.js +0 -1
  289. package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
  290. package/lib/esm/numerics/Newton.d.ts +3 -0
  291. package/lib/esm/numerics/Newton.d.ts.map +1 -1
  292. package/lib/esm/numerics/Newton.js +1 -4
  293. package/lib/esm/numerics/Newton.js.map +1 -1
  294. package/lib/esm/numerics/Polynomials.d.ts +46 -201
  295. package/lib/esm/numerics/Polynomials.d.ts.map +1 -1
  296. package/lib/esm/numerics/Polynomials.js +132 -444
  297. package/lib/esm/numerics/Polynomials.js.map +1 -1
  298. package/lib/esm/numerics/SmallSystem.d.ts +164 -0
  299. package/lib/esm/numerics/SmallSystem.d.ts.map +1 -0
  300. package/lib/esm/numerics/SmallSystem.js +317 -0
  301. package/lib/esm/numerics/SmallSystem.js.map +1 -0
  302. package/lib/esm/polyface/AuxData.d.ts.map +1 -1
  303. package/lib/esm/polyface/AuxData.js.map +1 -1
  304. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  305. package/lib/esm/polyface/IndexedPolyfaceVisitor.js +0 -1
  306. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  307. package/lib/esm/polyface/Polyface.d.ts +2 -2
  308. package/lib/esm/polyface/Polyface.d.ts.map +1 -1
  309. package/lib/esm/polyface/Polyface.js +0 -1
  310. package/lib/esm/polyface/Polyface.js.map +1 -1
  311. package/lib/esm/polyface/PolyfaceBuilder.js +1 -1
  312. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  313. package/lib/esm/polyface/PolyfaceClip.d.ts +3 -3
  314. package/lib/esm/polyface/PolyfaceClip.d.ts.map +1 -1
  315. package/lib/esm/polyface/PolyfaceClip.js +1 -2
  316. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  317. package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
  318. package/lib/esm/polyface/PolyfaceQuery.js +0 -1
  319. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  320. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  321. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  322. package/lib/esm/polyface/multiclip/OffsetMeshContext.d.ts +1 -1
  323. package/lib/esm/polyface/multiclip/OffsetMeshContext.d.ts.map +1 -1
  324. package/lib/esm/polyface/multiclip/OffsetMeshContext.js +4 -4
  325. package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  326. package/lib/esm/serialization/DeepCompare.d.ts.map +1 -1
  327. package/lib/esm/serialization/DeepCompare.js +0 -1
  328. package/lib/esm/serialization/DeepCompare.js.map +1 -1
  329. package/lib/esm/topology/Graph.d.ts.map +1 -1
  330. package/lib/esm/topology/Graph.js +1 -1
  331. package/lib/esm/topology/Graph.js.map +1 -1
  332. package/lib/esm/topology/InsertAndRetriangulateContext.js +1 -1
  333. package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
  334. package/lib/esm/topology/Merging.d.ts +1 -1
  335. package/lib/esm/topology/Merging.d.ts.map +1 -1
  336. package/lib/esm/topology/Merging.js +1 -1
  337. package/lib/esm/topology/Merging.js.map +1 -1
  338. package/package.json +8 -8
@@ -1 +1 @@
1
- {"version":3,"file":"Newton.js","sourceRoot":"","sources":["../../../src/numerics/Newton.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,0CAAuC;AAEvC,uFAAoF;AACpF,mEAAkE;AAElE,+CAA4C;AAC5C,+CAA4C;AAE5C,+BAA+B;AAE/B;;;;GAIG;AACH,MAAsB,sBAAsB;IAa1C;;;;;;;;;;;OAWG;IACH,YACE,oBAA4B,OAAO,EACnC,8BAAsC,CAAC,EACvC,gBAAwB,EAAE;QAM5B,sEAAsE;QAC5D,iBAAY,GAAW,CAAC,CAAC;QAOnC,uDAAuD;QAChD,kBAAa,GAAW,CAAC,CAAC;QAb/B,IAAI,CAAC,kBAAkB,GAAG,iBAAiB,CAAC;QAC5C,IAAI,CAAC,4BAA4B,GAAG,2BAA2B,CAAC;QAChE,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;IACtC,CAAC;IAWD;;;;;OAKG;IACI,eAAe,CAAC,KAAa;QAClC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC9C,IAAI,CAAC,YAAY,EAAE,CAAC;YACpB,OAAO,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,4BAA4B,CAAC;QAChE,CAAC;QACD,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;QACtB,OAAO,KAAK,CAAC;IACf,CAAC;IACD;;;;;;OAMG;IACI,aAAa;QAClB,IA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CAAC,CAAC,CAAC;QACvC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QACxC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QACxC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QACxC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QACxC,IAAI,CAAC,QAAQ,CAAC,sBAAsB,CAClC,OAAO,GAAG,IAAI,GAAG,OAAO,GAAG,IAAI,EAC/B,OAAO,GAAG,IAAI,GAAG,OAAO,GAAG,IAAI,EAC/B,GAAG,EACH,QAAQ,GAAG,IAAI,GAAG,QAAQ,GAAG,IAAI,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,EACzE,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,EACrC,GAAG,EACH,CAAC,CAAC,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC,EACxC,QAAQ,GAAG,IAAI,GAAG,QAAQ,GAAG,IAAI,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,EACzE,GAAG,CACJ,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAjDD,4EAiDC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Numerics\r\n */\r\n\r\nimport { Geometry } from \"../Geometry\";\r\nimport { CurvePrimitive } from \"../curve/CurvePrimitive\";\r\nimport { Plane3dByOriginAndVectors } from \"../geometry3d/Plane3dByOriginAndVectors\";\r\nimport { Point2d, Vector2d } from \"../geometry3d/Point2dVector2d\";\r\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { SmallSystem } from \"./Polynomials\";\r\n\r\n// cspell:word currentdFdX XYRR\r\n\r\n/**\r\n * Base class for Newton iterations in various dimensions.\r\n * Dimension-specific classes carry all dimension-related data and answer generalized queries from this base class.\r\n * @internal\r\n */\r\nexport abstract class AbstractNewtonIterator {\r\n /** Compute a step. The current x and function values must be retained for use in later method calls. */\r\n public abstract computeStep(): boolean;\r\n /**\r\n * Return the current step size, scaled for use in tolerance tests.\r\n * * This is a single number, typically the max of various per-dimension `dx/(1+x)` for the x and dx of that dimension.\r\n */\r\n public abstract currentStepSize(): number;\r\n /**\r\n * Apply the current step (in all dimensions).\r\n * @param isFinalStep true if this is a final step.\r\n */\r\n public abstract applyCurrentStep(isFinalStep: boolean): boolean;\r\n /**\r\n * The constructor.\r\n * @param stepSizeTarget tolerance to consider a single step converged.\r\n * This number should be \"moderately\" strict. Because 2 successive convergences are required,\r\n * it is expected that a first \"accept\" for (say) 10 to 14 digit step will be followed by another\r\n * iteration. A well behaved newton would then hypothetically double the number of digits to\r\n * 20 to 28. Since the IEEE double only carries 16 digits, this second-convergence step will\r\n * typically achieve full precision.\r\n * @param successiveConvergenceTarget number of successive convergences required for acceptance.\r\n * @param maxIterations max number of iterations. A typical newton step converges in 3 to 6 iterations.\r\n * Allow 15 to 20 to catch difficult cases.\r\n */\r\n protected constructor(\r\n stepSizeTolerance: number = 1.0e-11,\r\n successiveConvergenceTarget: number = 2,\r\n maxIterations: number = 15,\r\n ) {\r\n this._stepSizeTolerance = stepSizeTolerance;\r\n this._successiveConvergenceTarget = successiveConvergenceTarget;\r\n this._maxIterations = maxIterations;\r\n }\r\n /** Number of consecutive steps which passed convergence condition. */\r\n protected _numAccepted: number = 0;\r\n /** Target number of successive convergences. */\r\n protected _successiveConvergenceTarget: number;\r\n /** Convergence target (the implementation-specific currentStepSize is compared to this). */\r\n protected _stepSizeTolerance: number;\r\n /** Max iterations allowed. */\r\n protected _maxIterations: number;\r\n /** Number of iterations (incremented at each step). */\r\n public numIterations: number = 0;\r\n /**\r\n * Test if a step is converged.\r\n * * Convergence is accepted with enough (_successiveConvergenceTarget) small steps (according to _stepSizeTolerance)\r\n * occur in succession.\r\n * @param delta step size as reported by currentStepSize.\r\n */\r\n public testConvergence(delta: number): boolean {\r\n if (Math.abs(delta) < this._stepSizeTolerance) {\r\n this._numAccepted++;\r\n return this._numAccepted >= this._successiveConvergenceTarget;\r\n }\r\n this._numAccepted = 0;\r\n return false;\r\n }\r\n /**\r\n * Run iterations, calling various methods from base and derived classes:\r\n * * computeStep -- typically evaluate derivatives and solve linear system.\r\n * * currentStepSize -- return numeric measure of the step just computed by computeStep.\r\n * * testConvergence -- test if the step from currentStepSize (along with recent steps) is converged.\r\n * * applyCurrentStep -- apply the step to the independent variables.\r\n */\r\n public runIterations(): boolean {\r\n this._numAccepted = 0;\r\n this.numIterations = 0;\r\n while (this.numIterations++ < this._maxIterations && this.computeStep()) {\r\n if (this.testConvergence(this.currentStepSize()) && this.applyCurrentStep(true)) {\r\n // console.log(\"iter: \" + this.numIterations); // print number of Newton iterations for debug\r\n return true;\r\n }\r\n this.applyCurrentStep(false);\r\n }\r\n return false;\r\n }\r\n}\r\n/**\r\n * Object to evaluate a newton function. The object must retain most-recent function and derivative\r\n * values for immediate query.\r\n * @internal\r\n */\r\nexport abstract class NewtonEvaluatorRtoRD {\r\n /** Evaluate the function and its derivative at x. */\r\n public abstract evaluate(x: number): boolean;\r\n /** Most recent function value, i.e., f(x_n). */\r\n public currentF!: number;\r\n /** Most recent evaluated derivative, i.e., f'(x_n). */\r\n public currentdFdX!: number;\r\n}\r\n/**\r\n * Newton iterator for use when both function and derivative can be evaluated.\r\n * To solve `f(x) = 0`, the Newton iteration is `x_{n+1} = x_n - dx = x_n - f(x_n)/f'(x_n)`.\r\n * To solve `f(x) = target` which is equivalent to solving `g(x) = f(x) - target = 0`, the Newton iteration is\r\n * `x_{n+1} = x_n - dx = x_n - g(x_n)/g'(x_n) = x_n - (f(x_n)-target)/f'(x_n)`.\r\n * @internal\r\n */\r\nexport class Newton1dUnbounded extends AbstractNewtonIterator {\r\n private _func: NewtonEvaluatorRtoRD;\r\n /** Current step is dx. */\r\n private _currentStep!: number;\r\n /** Current X is x_n. */\r\n private _currentX!: number;\r\n /** The target */\r\n private _target!: number;\r\n /**\r\n * Constructor for 1D newton iteration with derivatives.\r\n * @param func function that returns both function value and derivative.\r\n */\r\n public constructor(func: NewtonEvaluatorRtoRD, maxIterations?: number) {\r\n super(undefined, undefined, maxIterations);\r\n this._func = func;\r\n this.setTarget(0);\r\n }\r\n /** Set the independent variable, i.e., x_n. */\r\n public setX(x: number): boolean {\r\n this._currentX = x;\r\n return true;\r\n }\r\n /** Get the independent variable, i.e., x_n. */\r\n public getX(): number {\r\n return this._currentX;\r\n }\r\n /** Set the target function value. */\r\n public setTarget(y: number): void {\r\n this._target = y;\r\n }\r\n /** Move the current X by the just-computed step, i.e., `x_n - dx`. */\r\n public applyCurrentStep(): boolean {\r\n // console.log(this._currentX - this._currentStep); // print approximations for debug\r\n return this.setX(this._currentX - this._currentStep);\r\n }\r\n /** Compute the univariate newton step dx. */\r\n public computeStep(): boolean {\r\n if (this._func.evaluate(this._currentX)) {\r\n const dx = Geometry.conditionalDivideFraction(this._func.currentF - this._target, this._func.currentdFdX);\r\n if (dx !== undefined) {\r\n this._currentStep = dx;\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n /** Return the current step size as a relative number, i.e., `|dx / (1 + |x_n|)|`. */\r\n public currentStepSize(): number {\r\n return Math.abs(this._currentStep / (1.0 + Math.abs(this._currentX)));\r\n }\r\n}\r\n\r\n/**\r\n * Object to evaluate a newton function (without derivative). The object must retain most-recent function value.\r\n * @internal\r\n */\r\nexport abstract class NewtonEvaluatorRtoR {\r\n /** Evaluate function value into member currentF */\r\n public abstract evaluate(x: number): boolean;\r\n /** Most recent function evaluation, i.e., f(x_n). */\r\n public currentF!: number;\r\n}\r\n\r\n/**\r\n * Newton iteration for a univariate function, using approximate derivatives.\r\n * To approximate the derivatives we use a small step `h`, i.e., `f'(x_n) = (f(x_n + h) - f(x_n)) / h`.\r\n * Therefore, to solve `f(x) = 0`, the iteration is\r\n * `x_{n+1} = x_n - dx = x_n - f(x_n)/f'(x_n) = x_n - f(x_n) * h / (f(x_n + h) - f(x_n))`.\r\n * @internal\r\n */\r\nexport class Newton1dUnboundedApproximateDerivative extends AbstractNewtonIterator {\r\n private _func: NewtonEvaluatorRtoR;\r\n /** Current step is dx. */\r\n private _currentStep!: number;\r\n /** Current X is x_n. */\r\n private _currentX!: number;\r\n /**\r\n * Step size for approximate derivative for the iteration.\r\n * * Initialized to 1e-8, which is appropriate for iteration in fraction space.\r\n * * Should be larger for iteration with real distance as x.\r\n */\r\n public derivativeH: number; // h\r\n\r\n /**\r\n * Constructor for 1D newton iteration with approximate derivatives.\r\n * @param func function that only returns function value (and not derivative).\r\n */\r\n public constructor(func: NewtonEvaluatorRtoR, maxIterations?: number) {\r\n super(undefined, undefined, maxIterations);\r\n this._func = func;\r\n this.derivativeH = 1.0e-8;\r\n }\r\n /** Set the independent variable, i.e., x_n. */\r\n public setX(x: number): boolean {\r\n this._currentX = x;\r\n return true;\r\n }\r\n /** Get the independent variable, i.e., x_n. */\r\n public getX(): number {\r\n return this._currentX;\r\n }\r\n /** Move the current X by the just-computed step, i.e., `x_n - dx`. */\r\n public applyCurrentStep(): boolean {\r\n // console.log(this._currentX - this._currentStep); // print approximations for debug\r\n return this.setX(this._currentX - this._currentStep);\r\n }\r\n /** Univariate newton step dx, computed with approximate derivative. */\r\n public computeStep(): boolean {\r\n if (this._func.evaluate(this._currentX)) {\r\n const fA = this._func.currentF; // f(x_n)\r\n if (this._func.evaluate(this._currentX + this.derivativeH)) {\r\n const fB = this._func.currentF; // f(x_n + h)\r\n const dx = Geometry.conditionalDivideFraction(fA, (fB - fA) / this.derivativeH);\r\n if (dx !== undefined) {\r\n this._currentStep = dx;\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n /** Return the current step size as a relative number, i.e., `|dx / (1 + |x_n|)|`. */\r\n public currentStepSize(): number {\r\n return Math.abs(this._currentStep / (1.0 + Math.abs(this._currentX)));\r\n }\r\n}\r\n\r\n/**\r\n * Object to evaluate a 2-parameter newton function with derivatives.\r\n * @internal\r\n */\r\nexport abstract class NewtonEvaluatorRRtoRRD {\r\n /**\r\n * Iteration controller calls this to ask for evaluation of the function and its two partial derivatives.\r\n * * The implementation returns true, it must set the currentF object.\r\n */\r\n public abstract evaluate(x: number, y: number): boolean;\r\n /**\r\n * Most recent function evaluation as parts of the plane.\r\n * * See doc of [[Newton2dUnboundedWithDerivative]] class for info on 2d newton method.\r\n * * For `F(u,v) := (x(u,v), y(u,v))` the returned plane stores the following evaluations at current value `X := (u,v)`:\r\n * * `origin` = F(X) = (x(X), y(X))\r\n * * `vectorU` = F_u(X) = partial deriv of F wrt u at X = (x_u(X), y_u(X)) = 1st col of Jacobian matrix evaluated at X\r\n * * `vectorV` = F_v(X) = partial deriv of F wrt v at X = (x_v(X), y_v(X)) = 2nd col of Jacobian matrix evaluated at X\r\n */\r\n public currentF!: Plane3dByOriginAndVectors;\r\n /**\r\n * Constructor.\r\n * * This creates a currentF object to (repeatedly) receive function and derivatives.\r\n */\r\n public constructor() {\r\n this.currentF = Plane3dByOriginAndVectors.createXYPlane();\r\n }\r\n}\r\n\r\n/**\r\n * Implement evaluation steps for newton iteration in 2 dimensions, using caller supplied NewtonEvaluatorRRtoRRD object.\r\n * * Suppose we want to find the roots of `F(u,v) := (x(u,v), y(u,v))`. Writing `X := (u,v)` and `F(X)` as column vectors,\r\n * the 2D Newton's iteration to find a root of `F` is given by:\r\n * `X_{n+1} = X_n - dX = X_n - JInv(X_n)F(X_n)`, where `JInv` is the inverse of the Jacobian matrix `J`, and `J` is\r\n * defined by the partial derivatives of the component functions of F:\r\n *\r\n * `[dx/du dx/dv]`\r\n *\r\n * `[dy/du dy/dv]`\r\n * @internal\r\n */\r\nexport class Newton2dUnboundedWithDerivative extends AbstractNewtonIterator {\r\n private _func: NewtonEvaluatorRRtoRRD;\r\n /** Current step, or dX = (du, dv). */\r\n private _currentStep: Vector2d;\r\n /** Current uv parameters, or X_n = (u_n, v_n). */\r\n private _currentUV: Point2d;\r\n /**\r\n * Constructor for 2D newton iteration with derivatives.\r\n * @param func function that returns both function value and derivative.\r\n */\r\n public constructor(func: NewtonEvaluatorRRtoRRD, maxIterations?: number) {\r\n super(undefined, undefined, maxIterations);\r\n this._func = func;\r\n this._currentStep = Vector2d.createZero();\r\n this._currentUV = Point2d.createZero();\r\n }\r\n /** Set the current uv parameters, i.e., `X_n = (u_n, v_n)`. */\r\n public setUV(u: number, v: number): boolean {\r\n this._currentUV.set(u, v);\r\n return true;\r\n }\r\n /** Get the current u parameter of X_n, i.e., u_n. */\r\n public getU(): number {\r\n return this._currentUV.x;\r\n }\r\n /** Get the current v parameter of X_n, i.e., v_n. */\r\n public getV(): number {\r\n return this._currentUV.y;\r\n }\r\n /** Update the current uv parameter by currentStep, i.e., compute `X_{n+1} := X_n - dX = (u_n - du, v_n - dv)`. */\r\n public applyCurrentStep(): boolean {\r\n // console.log(\"(\" + (this._currentUV.x - this._currentStep.x) + \",\" + (this._currentUV.y - this._currentStep.y) + \")\");\r\n return this.setUV(this._currentUV.x - this._currentStep.x, this._currentUV.y - this._currentStep.y);\r\n }\r\n /**\r\n * Evaluate the functions and derivatives at `X_n = (u_n, v_n)`, and solve the Jacobian matrix equation to\r\n * compute `dX = (du, dv)`.\r\n */\r\n public computeStep(): boolean {\r\n if (!this._func.evaluate(this._currentUV.x, this._currentUV.y))\r\n return false;\r\n const fA = this._func.currentF;\r\n const jCol0 = fA.vectorU;\r\n const jCol1 = fA.vectorV;\r\n const fX = fA.origin;\r\n // Given X_{n+1} = X_n - dX = X_n - JInv(X_n) F(X_n), we solve J(X_n) dX = F(X_n) for dX:\r\n if (SmallSystem.linearSystem2d(jCol0.x, jCol1.x, jCol0.y, jCol1.y, fX.x, fX.y, this._currentStep))\r\n return true;\r\n return false;\r\n }\r\n /**\r\n * Return the current relative step size, i.e., the larger absolute component of `dX / (1 + |X_n|)`\r\n */\r\n public currentStepSize(): number {\r\n return Geometry.maxAbsXY(\r\n this._currentStep.x / (1.0 + Math.abs(this._currentUV.x)),\r\n this._currentStep.y / (1.0 + Math.abs(this._currentUV.y)),\r\n );\r\n }\r\n}\r\n/**\r\n * SimpleNewton has static methods for newton methods with evaluated functions presented as immediate arguments\r\n * (not function object).\r\n * @internal\r\n */\r\nexport class SimpleNewton {\r\n /**\r\n * Run a one-dimensional newton iteration with separate functions for function and derivative.\r\n * * Completion is at 2 (TWO) successive passes at `absoluteTolerance + relTol * abs(x)`, where relTol is\r\n * chosen internally.\r\n * * `absoluteTolerance` is usually aggressively tight -- should come into play only for x near zero.\r\n * * The `relTol` is fluffy (for instance around 1e-11) but in properly converging cases the extra pass after\r\n * first success normally moves to full machine precision.\r\n * * This is an open-loop newton -- it just runs, and returns undefined if anything bad happens.\r\n */\r\n public static runNewton1D(\r\n x: number,\r\n func: (x: number) => number | undefined,\r\n derivative: (x: number) => number | undefined,\r\n absoluteTolerance: number = Geometry.smallFloatingPoint,\r\n ): number | undefined {\r\n let numConverged = 0;\r\n let tolerance: number;\r\n const relTol = 1.0e-11;\r\n for (let iteration = 0; iteration < 20; iteration++) {\r\n const f = func(x);\r\n const df = derivative(x);\r\n if (f !== undefined && df !== undefined) {\r\n const dx = Geometry.conditionalDivideCoordinate(f, df);\r\n if (dx === undefined)\r\n return undefined;\r\n x -= dx;\r\n // console.log(x); // print approximations for debug\r\n tolerance = absoluteTolerance + Math.abs(x) * relTol;\r\n if (Math.abs(dx) < tolerance) {\r\n numConverged++;\r\n if (dx === 0.0 || numConverged > 1) // bypass convergence count on true 0 dx\r\n return x;\r\n } else {\r\n numConverged = 0;\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\n\r\n/**\r\n * Class to evaluate XY intersection between 2 curve primitives using the Newton method.\r\n * @internal\r\n */\r\nexport class CurveCurveIntersectionXYRRToRRD extends NewtonEvaluatorRRtoRRD {\r\n private _curveP: CurvePrimitive;\r\n private _curveQ: CurvePrimitive;\r\n private _rayP: Ray3d;\r\n private _rayQ: Ray3d;\r\n constructor(curveP: CurvePrimitive, curveQ: CurvePrimitive) {\r\n super();\r\n this._curveP = curveP;\r\n this._curveQ = curveQ;\r\n this._rayP = Ray3d.createZero();\r\n this._rayQ = Ray3d.createZero();\r\n }\r\n public evaluate(fractionU: number, fractionV: number): boolean {\r\n /**\r\n * To find an intersection between xy-curves P(u) = (x_p(u), y_p(u)) and Q(v) = (x_q(v), y_q(v)) we should solve\r\n * F(u,v) := P(u) - Q(v) = (0,0)\r\n * Using the Newton method we can find the fractions u and v at the intersection via\r\n * [u_{n+1}] [u_n] [x_p'(u_n) -x_q'(v_n)] [x_p(u_n) - x_q(v_n)]\r\n * = - Inv( )\r\n * [v_{n+1}] [v_n] [y_p'(u_n) -y_q'(v_n)] [y_p(u_n) - y_q(v_n)]\r\n * Note that this is xy intersection so we can ignore z.\r\n */\r\n this._curveP.fractionToPointAndDerivative(fractionU, this._rayP);\r\n this._curveQ.fractionToPointAndDerivative(fractionV, this._rayQ);\r\n this.currentF.setOriginAndVectorsXYZ(\r\n this._rayP.origin.x - this._rayQ.origin.x, this._rayP.origin.y - this._rayQ.origin.y, 0.0,\r\n this._rayP.direction.x, this._rayP.direction.y, 0.0,\r\n -this._rayQ.direction.x, -this._rayQ.direction.y, 0.0,\r\n );\r\n return true;\r\n }\r\n}\r\n\r\n/**\r\n * Class to evaluate XY close approach between a curve primitive and a point using the Newton method.\r\n * @internal\r\n */\r\nexport class CurvePointCloseApproachXYRtoRD extends NewtonEvaluatorRtoRD {\r\n private _curveP: CurvePrimitive;\r\n private _pointQ: Point3d;\r\n private _planeP: Plane3dByOriginAndVectors;\r\n constructor(curveP: CurvePrimitive, pointQ: Point3d) {\r\n super();\r\n this._curveP = curveP;\r\n this._pointQ = pointQ;\r\n this._planeP = Plane3dByOriginAndVectors.createXYPlane();\r\n }\r\n public evaluate(fractionU: number): boolean {\r\n /**\r\n * To find a close approach between xy-curve P(u) and xy-point q we should solve\r\n * F(u) := P'(u).(P(u) - q) = 0\r\n * For a solution u, the segment S(u) := P(u) - q is perpendicular to the curve tangent P'(u), which means S(u) is a close approach.\r\n * Using the Newton method we can find the fractions u at the close approach location via\r\n * u_{n+1} = u_n + F(u_n)/F'(u_n) = u_n + [ P'(u_n).S(u_n) ]/[ P''(u_n).S(u_n) + P'(u_n).P'(u_n) ]\r\n * Note that this is xy close approach so we can ignore z.\r\n */\r\n this._curveP.fractionToPointAnd2Derivatives(fractionU, this._planeP);\r\n const segX = this._planeP.origin.x - this._pointQ.x;\r\n const segY = this._planeP.origin.y - this._pointQ.y;\r\n const pDerivX = this._planeP.vectorU.x;\r\n const pDerivY = this._planeP.vectorU.y;\r\n const p2DerivX = this._planeP.vectorV.x;\r\n const p2DerivY = this._planeP.vectorV.y;\r\n this.currentF = pDerivX * segX + pDerivY * segY;\r\n this.currentdFdX = p2DerivX * segX + pDerivX * pDerivX + p2DerivY * segY + pDerivY * pDerivY;\r\n return true;\r\n }\r\n}\r\n\r\n/**\r\n * Class to evaluate XY close approach between 2 curve primitives using the Newton method.\r\n * @internal\r\n */\r\nexport class CurveCurveCloseApproachXYRRtoRRD extends NewtonEvaluatorRRtoRRD {\r\n private _curveP: CurvePrimitive;\r\n private _curveQ: CurvePrimitive;\r\n private _planeP: Plane3dByOriginAndVectors;\r\n private _planeQ: Plane3dByOriginAndVectors;\r\n constructor(curveP: CurvePrimitive, curveQ: CurvePrimitive) {\r\n super();\r\n this._curveP = curveP;\r\n this._curveQ = curveQ;\r\n this._planeP = Plane3dByOriginAndVectors.createXYPlane();\r\n this._planeQ = Plane3dByOriginAndVectors.createXYPlane();\r\n }\r\n public evaluate(fractionU: number, fractionV: number): boolean {\r\n /**\r\n * To find a close approach between xy-curves P(u) and Q(v) we should solve\r\n * F(u,v) := (P'(u).(P(u) - Q(v)), Q'(v).(P(u) - Q(v))) = (0,0)\r\n * For a solution (u,v), the segment S(u,v) := P(u) - Q(v) is perpendicular to the curve tangents P'(u) and Q'(v),\r\n * which means S(u,v) is a close approach.\r\n * Using the Newton method we can find the fractions u and v at the close approach location via\r\n * [u_{n+1}] [u_n] [P''(u_n).S(u_n,v_n) + P'(u_n).P'(u_n) -P'(u_n).Q'(v_n)] [P'(u_n).S(u_n,v_n)]\r\n * = - Inv( )\r\n * [v_{n+1}] [v_n] [Q'(v_n).P'(u_n) Q''(v_n).S(u_n,v_n) - Q'(v_n).Q'(v_n)] [Q'(v_n).S(u_n,v_n)]\r\n * Note that this is xy close approach so we can ignore z.\r\n */\r\n this._curveP.fractionToPointAnd2Derivatives(fractionU, this._planeP);\r\n this._curveQ.fractionToPointAnd2Derivatives(fractionV, this._planeQ);\r\n const segX = this._planeP.origin.x - this._planeQ.origin.x;\r\n const segY = this._planeP.origin.y - this._planeQ.origin.y;\r\n const pDerivX = this._planeP.vectorU.x;\r\n const pDerivY = this._planeP.vectorU.y;\r\n const qDerivX = this._planeQ.vectorU.x;\r\n const qDerivY = this._planeQ.vectorU.y;\r\n const p2DerivX = this._planeP.vectorV.x;\r\n const p2DerivY = this._planeP.vectorV.y;\r\n const q2DerivX = this._planeQ.vectorV.x;\r\n const q2DerivY = this._planeQ.vectorV.y;\r\n this.currentF.setOriginAndVectorsXYZ(\r\n pDerivX * segX + pDerivY * segY,\r\n qDerivX * segX + qDerivY * segY,\r\n 0.0,\r\n p2DerivX * segX + p2DerivY * segY + pDerivX * pDerivX + pDerivY * pDerivY,\r\n qDerivX * pDerivX + qDerivY * pDerivY,\r\n 0.0,\r\n -(pDerivX * qDerivX + pDerivY * qDerivY),\r\n q2DerivX * segX + q2DerivY * segY - qDerivX * qDerivX - qDerivY *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C,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QACxC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QACxC,IAAI,CAAC,QAAQ,CAAC,sBAAsB,CAClC,OAAO,GAAG,IAAI,GAAG,OAAO,GAAG,IAAI,EAC/B,OAAO,GAAG,IAAI,GAAG,OAAO,GAAG,IAAI,EAC/B,GAAG,EACH,QAAQ,GAAG,IAAI,GAAG,QAAQ,GAAG,IAAI,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,EACzE,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,EACrC,GAAG,EACH,CAAC,CAAC,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC,EACxC,QAAQ,GAAG,IAAI,GAAG,QAAQ,GAAG,IAAI,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,EACzE,GAAG,CACJ,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAjDD,4EAiDC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Numerics\r\n */\r\n\r\nimport { CurvePrimitive } from \"../curve/CurvePrimitive\";\r\nimport { Geometry } from \"../Geometry\";\r\nimport { Plane3dByOriginAndVectors } from \"../geometry3d/Plane3dByOriginAndVectors\";\r\nimport { Point2d, Vector2d } from \"../geometry3d/Point2dVector2d\";\r\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { SmallSystem } from \"./SmallSystem\";\r\n\r\n// cspell:word currentdFdX XYRR\r\n\r\n/**\r\n * Base class for Newton iterations in various dimensions.\r\n * Dimension-specific classes carry all dimension-related data and answer generalized queries from this base class.\r\n * @internal\r\n */\r\nexport abstract class AbstractNewtonIterator {\r\n /** Compute a step. The current x and function values must be retained for use in later method calls. */\r\n public abstract computeStep(): boolean;\r\n /**\r\n * Return the current step size, scaled for use in tolerance tests.\r\n * * This is a single number, typically the max of various per-dimension `dx/(1+x)` for the x and dx of that dimension.\r\n */\r\n public abstract currentStepSize(): number;\r\n /**\r\n * Apply the current step (in all dimensions).\r\n * @param isFinalStep true if this is a final step.\r\n */\r\n public abstract applyCurrentStep(isFinalStep: boolean): boolean;\r\n /**\r\n * The constructor.\r\n * @param stepSizeTarget tolerance to consider a single step converged.\r\n * This number should be \"moderately\" strict. Because 2 successive convergences are required,\r\n * it is expected that a first \"accept\" for (say) 10 to 14 digit step will be followed by another\r\n * iteration. A well behaved newton would then hypothetically double the number of digits to\r\n * 20 to 28. Since the IEEE double only carries 16 digits, this second-convergence step will\r\n * typically achieve full precision.\r\n * @param successiveConvergenceTarget number of successive convergences required for acceptance.\r\n * @param maxIterations max number of iterations. A typical newton step converges in 3 to 6 iterations.\r\n * Allow 15 to 20 to catch difficult cases.\r\n */\r\n protected constructor(\r\n stepSizeTolerance: number = 1.0e-11,\r\n successiveConvergenceTarget: number = 2,\r\n maxIterations: number = 15,\r\n ) {\r\n this._stepSizeTolerance = stepSizeTolerance;\r\n this._successiveConvergenceTarget = successiveConvergenceTarget;\r\n this._maxIterations = maxIterations;\r\n }\r\n /** Number of consecutive steps which passed convergence condition. */\r\n protected _numAccepted: number = 0;\r\n /** Target number of successive convergences. */\r\n protected _successiveConvergenceTarget: number;\r\n /** Convergence target (the implementation-specific currentStepSize is compared to this). */\r\n protected _stepSizeTolerance: number;\r\n /** Max iterations allowed. */\r\n protected _maxIterations: number;\r\n /** Number of iterations (incremented at each step). */\r\n public numIterations: number = 0;\r\n /**\r\n * Test if a step is converged.\r\n * * Convergence is accepted with enough (_successiveConvergenceTarget) small steps (according to _stepSizeTolerance)\r\n * occur in succession.\r\n * @param delta step size as reported by currentStepSize.\r\n */\r\n public testConvergence(delta: number): boolean {\r\n if (Math.abs(delta) < this._stepSizeTolerance) {\r\n this._numAccepted++;\r\n return this._numAccepted >= this._successiveConvergenceTarget;\r\n }\r\n this._numAccepted = 0;\r\n return false;\r\n }\r\n /**\r\n * Run iterations, calling various methods from base and derived classes:\r\n * * computeStep -- typically evaluate derivatives and solve linear system.\r\n * * currentStepSize -- return numeric measure of the step just computed by computeStep.\r\n * * testConvergence -- test if the step from currentStepSize (along with recent steps) is converged.\r\n * * applyCurrentStep -- apply the step to the independent variables.\r\n */\r\n public runIterations(): boolean {\r\n this._numAccepted = 0;\r\n this.numIterations = 0;\r\n while (this.numIterations++ < this._maxIterations && this.computeStep()) {\r\n if (this.testConvergence(this.currentStepSize()) && this.applyCurrentStep(true)) {\r\n // console.log(\"iter: \" + this.numIterations); // print number of Newton iterations for debug\r\n return true;\r\n }\r\n this.applyCurrentStep(false);\r\n }\r\n return false;\r\n }\r\n}\r\n/**\r\n * Object to evaluate a newton function. The object must retain most-recent function and derivative\r\n * values for immediate query.\r\n * @internal\r\n */\r\nexport abstract class NewtonEvaluatorRtoRD {\r\n /** Evaluate the function and its derivative at x. */\r\n public abstract evaluate(x: number): boolean;\r\n /** Most recent function value, i.e., f(x_n). */\r\n public currentF!: number;\r\n /** Most recent evaluated derivative, i.e., f'(x_n). */\r\n public currentdFdX!: number;\r\n}\r\n/**\r\n * Newton iterator for use when both function and derivative can be evaluated.\r\n * To solve `f(x) = 0`, the Newton iteration is `x_{n+1} = x_n - dx = x_n - f(x_n)/f'(x_n)`.\r\n * To solve `f(x) = target` which is equivalent to solving `g(x) = f(x) - target = 0`, the Newton iteration is\r\n * `x_{n+1} = x_n - dx = x_n - g(x_n)/g'(x_n) = x_n - (f(x_n)-target)/f'(x_n)`.\r\n * @internal\r\n */\r\nexport class Newton1dUnbounded extends AbstractNewtonIterator {\r\n private _func: NewtonEvaluatorRtoRD;\r\n /** Current step is dx. */\r\n private _currentStep!: number;\r\n /** Current X is x_n. */\r\n private _currentX!: number;\r\n /** The target */\r\n private _target!: number;\r\n /**\r\n * Constructor for 1D newton iteration with derivatives.\r\n * @param func function that returns both function value and derivative.\r\n */\r\n public constructor(func: NewtonEvaluatorRtoRD, maxIterations?: number) {\r\n super(undefined, undefined, maxIterations);\r\n this._func = func;\r\n this.setTarget(0);\r\n }\r\n /** Set the independent variable, i.e., x_n. */\r\n public setX(x: number): boolean {\r\n this._currentX = x;\r\n return true;\r\n }\r\n /** Get the independent variable, i.e., x_n. */\r\n public getX(): number {\r\n return this._currentX;\r\n }\r\n /** Set the target function value. */\r\n public setTarget(y: number): void {\r\n this._target = y;\r\n }\r\n /** Move the current X by the just-computed step, i.e., `x_n - dx`. */\r\n public applyCurrentStep(): boolean {\r\n // console.log(this._currentX - this._currentStep); // print approximations for debug\r\n return this.setX(this._currentX - this._currentStep);\r\n }\r\n /** Compute the univariate newton step dx. */\r\n public computeStep(): boolean {\r\n if (this._func.evaluate(this._currentX)) {\r\n const dx = Geometry.conditionalDivideFraction(this._func.currentF - this._target, this._func.currentdFdX);\r\n if (dx !== undefined) {\r\n this._currentStep = dx;\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n /** Return the current step size as a relative number, i.e., `|dx / (1 + |x_n|)|`. */\r\n public currentStepSize(): number {\r\n return Math.abs(this._currentStep / (1.0 + Math.abs(this._currentX)));\r\n }\r\n}\r\n\r\n/**\r\n * Object to evaluate a newton function (without derivative). The object must retain most-recent function value.\r\n * @internal\r\n */\r\nexport abstract class NewtonEvaluatorRtoR {\r\n /** Evaluate function value into member currentF */\r\n public abstract evaluate(x: number): boolean;\r\n /** Most recent function evaluation, i.e., f(x_n). */\r\n public currentF!: number;\r\n}\r\n\r\n/**\r\n * Newton iteration for a univariate function, using approximate derivatives.\r\n * To approximate the derivatives we use a small step `h`, i.e., `f'(x_n) = (f(x_n + h) - f(x_n)) / h`.\r\n * Therefore, to solve `f(x) = 0`, the iteration is\r\n * `x_{n+1} = x_n - dx = x_n - f(x_n)/f'(x_n) = x_n - f(x_n) * h / (f(x_n + h) - f(x_n))`.\r\n * @internal\r\n */\r\nexport class Newton1dUnboundedApproximateDerivative extends AbstractNewtonIterator {\r\n private _func: NewtonEvaluatorRtoR;\r\n /** Current step is dx. */\r\n private _currentStep!: number;\r\n /** Current X is x_n. */\r\n private _currentX!: number;\r\n /**\r\n * Step size for approximate derivative for the iteration.\r\n * * Initialized to 1e-8, which is appropriate for iteration in fraction space.\r\n * * Should be larger for iteration with real distance as x.\r\n */\r\n public derivativeH: number; // h\r\n\r\n /**\r\n * Constructor for 1D newton iteration with approximate derivatives.\r\n * @param func function that only returns function value (and not derivative).\r\n */\r\n public constructor(func: NewtonEvaluatorRtoR, maxIterations?: number) {\r\n super(undefined, undefined, maxIterations);\r\n this._func = func;\r\n this.derivativeH = 1.0e-8;\r\n }\r\n /** Set the independent variable, i.e., x_n. */\r\n public setX(x: number): boolean {\r\n this._currentX = x;\r\n return true;\r\n }\r\n /** Get the independent variable, i.e., x_n. */\r\n public getX(): number {\r\n return this._currentX;\r\n }\r\n /** Move the current X by the just-computed step, i.e., `x_n - dx`. */\r\n public applyCurrentStep(): boolean {\r\n // console.log(this._currentX - this._currentStep); // print approximations for debug\r\n return this.setX(this._currentX - this._currentStep);\r\n }\r\n /** Univariate newton step dx, computed with approximate derivative. */\r\n public computeStep(): boolean {\r\n if (this._func.evaluate(this._currentX)) {\r\n const fA = this._func.currentF; // f(x_n)\r\n if (this._func.evaluate(this._currentX + this.derivativeH)) {\r\n const fB = this._func.currentF; // f(x_n + h)\r\n const dx = Geometry.conditionalDivideFraction(fA, (fB - fA) / this.derivativeH);\r\n if (dx !== undefined) {\r\n this._currentStep = dx;\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n /** Return the current step size as a relative number, i.e., `|dx / (1 + |x_n|)|`. */\r\n public currentStepSize(): number {\r\n return Math.abs(this._currentStep / (1.0 + Math.abs(this._currentX)));\r\n }\r\n}\r\n\r\n/**\r\n * Object to evaluate a 2-parameter newton function with derivatives.\r\n * @internal\r\n */\r\nexport abstract class NewtonEvaluatorRRtoRRD {\r\n /**\r\n * Iteration controller calls this to ask for evaluation of the function and its two partial derivatives.\r\n * * The implementation returns true, it must set the currentF object.\r\n */\r\n public abstract evaluate(x: number, y: number): boolean;\r\n /**\r\n * Most recent function evaluation as parts of the plane.\r\n * * See doc of [[Newton2dUnboundedWithDerivative]] class for info on 2d newton method.\r\n * * For `F(u,v) := (x(u,v), y(u,v))` the returned plane stores the following evaluations at current value `X := (u,v)`:\r\n * * `origin` = F(X) = (x(X), y(X))\r\n * * `vectorU` = F_u(X) = partial deriv of F wrt u at X = (x_u(X), y_u(X)) = 1st col of Jacobian matrix evaluated at X\r\n * * `vectorV` = F_v(X) = partial deriv of F wrt v at X = (x_v(X), y_v(X)) = 2nd col of Jacobian matrix evaluated at X\r\n */\r\n public currentF!: Plane3dByOriginAndVectors;\r\n /**\r\n * Constructor.\r\n * * This creates a currentF object to (repeatedly) receive function and derivatives.\r\n */\r\n public constructor() {\r\n this.currentF = Plane3dByOriginAndVectors.createXYPlane();\r\n }\r\n}\r\n\r\n/**\r\n * Implement evaluation steps for newton iteration in 2 dimensions, using caller supplied NewtonEvaluatorRRtoRRD object.\r\n * * Suppose we want to find the roots of `F(u,v) := (x(u,v), y(u,v))`. Writing `X := (u,v)` and `F(X)` as column vectors,\r\n * the 2D Newton's iteration to find a root of `F` is given by:\r\n * `X_{n+1} = X_n - dX = X_n - JInv(X_n)F(X_n)`, where `JInv` is the inverse of the Jacobian matrix `J`, and `J` is\r\n * defined by the partial derivatives of the component functions of F:\r\n *\r\n * `[dx/du dx/dv]`\r\n *\r\n * `[dy/du dy/dv]`\r\n * @internal\r\n */\r\nexport class Newton2dUnboundedWithDerivative extends AbstractNewtonIterator {\r\n private _func: NewtonEvaluatorRRtoRRD;\r\n /** Current step, or dX = (du, dv). */\r\n private _currentStep: Vector2d;\r\n /** Current uv parameters, or X_n = (u_n, v_n). */\r\n private _currentUV: Point2d;\r\n /**\r\n * Constructor for 2D newton iteration with derivatives.\r\n * @param func function that returns both function value and derivative.\r\n */\r\n public constructor(func: NewtonEvaluatorRRtoRRD, maxIterations?: number) {\r\n super(undefined, undefined, maxIterations);\r\n this._func = func;\r\n this._currentStep = Vector2d.createZero();\r\n this._currentUV = Point2d.createZero();\r\n }\r\n /** Set the current uv parameters, i.e., `X_n = (u_n, v_n)`. */\r\n public setUV(u: number, v: number): boolean {\r\n this._currentUV.set(u, v);\r\n return true;\r\n }\r\n /** Get the current u parameter of X_n, i.e., u_n. */\r\n public getU(): number {\r\n return this._currentUV.x;\r\n }\r\n /** Get the current v parameter of X_n, i.e., v_n. */\r\n public getV(): number {\r\n return this._currentUV.y;\r\n }\r\n /** Update the current uv parameter by currentStep, i.e., compute `X_{n+1} := X_n - dX = (u_n - du, v_n - dv)`. */\r\n public applyCurrentStep(): boolean {\r\n // console.log(\"(\" + (this._currentUV.x - this._currentStep.x) + \",\" + (this._currentUV.y - this._currentStep.y) + \")\");\r\n return this.setUV(this._currentUV.x - this._currentStep.x, this._currentUV.y - this._currentStep.y);\r\n }\r\n /**\r\n * Evaluate the functions and derivatives at `X_n = (u_n, v_n)`, and solve the Jacobian matrix equation to\r\n * compute `dX = (du, dv)`.\r\n */\r\n public computeStep(): boolean {\r\n if (!this._func.evaluate(this._currentUV.x, this._currentUV.y))\r\n return false;\r\n const fA = this._func.currentF;\r\n const jCol0 = fA.vectorU;\r\n const jCol1 = fA.vectorV;\r\n const fX = fA.origin;\r\n // Given X_{n+1} = X_n - dX = X_n - JInv(X_n) F(X_n), we solve J(X_n) dX = F(X_n) for dX:\r\n if (SmallSystem.linearSystem2d(jCol0.x, jCol1.x, jCol0.y, jCol1.y, fX.x, fX.y, this._currentStep))\r\n return true;\r\n return false;\r\n }\r\n /**\r\n * Return the current relative step size, i.e., the larger absolute component of `dX / (1 + |X_n|)`\r\n */\r\n public currentStepSize(): number {\r\n return Geometry.maxAbsXY(\r\n this._currentStep.x / (1.0 + Math.abs(this._currentUV.x)),\r\n this._currentStep.y / (1.0 + Math.abs(this._currentUV.y)),\r\n );\r\n }\r\n}\r\n/**\r\n * SimpleNewton has static methods for newton methods with evaluated functions presented as immediate arguments\r\n * (not function object).\r\n * @internal\r\n */\r\nexport class SimpleNewton {\r\n /**\r\n * Run a one-dimensional newton iteration with separate functions for function and derivative.\r\n * * Completion is at 2 (TWO) successive passes at `absoluteTolerance + relTol * abs(x)`, where relTol is\r\n * chosen internally.\r\n * * `absoluteTolerance` is usually aggressively tight -- should come into play only for x near zero.\r\n * * The `relTol` is fluffy (for instance around 1e-11) but in properly converging cases the extra pass after\r\n * first success normally moves to full machine precision.\r\n * * This is an open-loop newton -- it just runs, and returns undefined if anything bad happens.\r\n */\r\n public static runNewton1D(\r\n x: number,\r\n func: (x: number) => number | undefined,\r\n derivative: (x: number) => number | undefined,\r\n absoluteTolerance: number = Geometry.smallFloatingPoint,\r\n ): number | undefined {\r\n let numConverged = 0;\r\n let tolerance: number;\r\n const relTol = 1.0e-11;\r\n for (let iteration = 0; iteration < 20; iteration++) {\r\n const f = func(x);\r\n const df = derivative(x);\r\n if (f !== undefined && df !== undefined) {\r\n const dx = Geometry.conditionalDivideCoordinate(f, df);\r\n if (dx === undefined)\r\n return undefined;\r\n x -= dx;\r\n // console.log(x); // print approximations for debug\r\n tolerance = absoluteTolerance + Math.abs(x) * relTol;\r\n if (Math.abs(dx) < tolerance) {\r\n numConverged++;\r\n if (dx === 0.0 || numConverged > 1) // bypass convergence count on true 0 dx\r\n return x;\r\n } else {\r\n numConverged = 0;\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\n\r\n/**\r\n * Class to evaluate XY intersection between 2 curve primitives using the Newton method.\r\n * @internal\r\n */\r\nexport class CurveCurveIntersectionXYRRToRRD extends NewtonEvaluatorRRtoRRD {\r\n private _curveP: CurvePrimitive;\r\n private _curveQ: CurvePrimitive;\r\n private _rayP: Ray3d;\r\n private _rayQ: Ray3d;\r\n constructor(curveP: CurvePrimitive, curveQ: CurvePrimitive) {\r\n super();\r\n this._curveP = curveP;\r\n this._curveQ = curveQ;\r\n this._rayP = Ray3d.createZero();\r\n this._rayQ = Ray3d.createZero();\r\n }\r\n public evaluate(fractionU: number, fractionV: number): boolean {\r\n /**\r\n * To find an intersection between xy-curves P(u) = (x_p(u), y_p(u)) and Q(v) = (x_q(v), y_q(v)) we should solve\r\n * F(u,v) := P(u) - Q(v) = (0,0)\r\n * Using the Newton method we can find the fractions u and v at the intersection via\r\n * [u_{n+1}] [u_n] [x_p'(u_n) -x_q'(v_n)] [x_p(u_n) - x_q(v_n)]\r\n * = - Inv( )\r\n * [v_{n+1}] [v_n] [y_p'(u_n) -y_q'(v_n)] [y_p(u_n) - y_q(v_n)]\r\n * Note that this is xy intersection so we can ignore z.\r\n */\r\n this._curveP.fractionToPointAndDerivative(fractionU, this._rayP);\r\n this._curveQ.fractionToPointAndDerivative(fractionV, this._rayQ);\r\n this.currentF.setOriginAndVectorsXYZ(\r\n this._rayP.origin.x - this._rayQ.origin.x, this._rayP.origin.y - this._rayQ.origin.y, 0.0,\r\n this._rayP.direction.x, this._rayP.direction.y, 0.0,\r\n -this._rayQ.direction.x, -this._rayQ.direction.y, 0.0,\r\n );\r\n return true;\r\n }\r\n}\r\n\r\n/**\r\n * Class to evaluate XY close approach between a curve primitive and a point using the Newton method.\r\n * @internal\r\n */\r\nexport class CurvePointCloseApproachXYRtoRD extends NewtonEvaluatorRtoRD {\r\n private _curveP: CurvePrimitive;\r\n private _pointQ: Point3d;\r\n private _planeP: Plane3dByOriginAndVectors;\r\n constructor(curveP: CurvePrimitive, pointQ: Point3d) {\r\n super();\r\n this._curveP = curveP;\r\n this._pointQ = pointQ;\r\n this._planeP = Plane3dByOriginAndVectors.createXYPlane();\r\n }\r\n public evaluate(fractionU: number): boolean {\r\n /**\r\n * To find a close approach between xy-curve P(u) and xy-point q we should solve\r\n * F(u) := P'(u).(P(u) - q) = 0\r\n * For a solution u, the segment S(u) := P(u) - q is perpendicular to the curve tangent P'(u), which means S(u) is a close approach.\r\n * Using the Newton method we can find the fractions u at the close approach location via\r\n * u_{n+1} = u_n + F(u_n)/F'(u_n) = u_n + [ P'(u_n).S(u_n) ]/[ P''(u_n).S(u_n) + P'(u_n).P'(u_n) ]\r\n * Note that this is xy close approach so we can ignore z.\r\n */\r\n this._curveP.fractionToPointAnd2Derivatives(fractionU, this._planeP);\r\n const segX = this._planeP.origin.x - this._pointQ.x;\r\n const segY = this._planeP.origin.y - this._pointQ.y;\r\n const pDerivX = this._planeP.vectorU.x;\r\n const pDerivY = this._planeP.vectorU.y;\r\n const p2DerivX = this._planeP.vectorV.x;\r\n const p2DerivY = this._planeP.vectorV.y;\r\n this.currentF = pDerivX * segX + pDerivY * segY;\r\n this.currentdFdX = p2DerivX * segX + pDerivX * pDerivX + p2DerivY * segY + pDerivY * pDerivY;\r\n return true;\r\n }\r\n}\r\n\r\n/**\r\n * Class to evaluate XY close approach between 2 curve primitives using the Newton method.\r\n * @internal\r\n */\r\nexport class CurveCurveCloseApproachXYRRtoRRD extends NewtonEvaluatorRRtoRRD {\r\n private _curveP: CurvePrimitive;\r\n private _curveQ: CurvePrimitive;\r\n private _planeP: Plane3dByOriginAndVectors;\r\n private _planeQ: Plane3dByOriginAndVectors;\r\n constructor(curveP: CurvePrimitive, curveQ: CurvePrimitive) {\r\n super();\r\n this._curveP = curveP;\r\n this._curveQ = curveQ;\r\n this._planeP = Plane3dByOriginAndVectors.createXYPlane();\r\n this._planeQ = Plane3dByOriginAndVectors.createXYPlane();\r\n }\r\n public evaluate(fractionU: number, fractionV: number): boolean {\r\n /**\r\n * To find a close approach between xy-curves P(u) and Q(v) we should solve\r\n * F(u,v) := (P'(u).(P(u) - Q(v)), Q'(v).(P(u) - Q(v))) = (0,0)\r\n * For a solution (u,v), the segment S(u,v) := P(u) - Q(v) is perpendicular to the curve tangents P'(u) and Q'(v),\r\n * which means S(u,v) is a close approach.\r\n * Using the Newton method we can find the fractions u and v at the close approach location via\r\n * [u_{n+1}] [u_n] [P''(u_n).S(u_n,v_n) + P'(u_n).P'(u_n) -P'(u_n).Q'(v_n)] [P'(u_n).S(u_n,v_n)]\r\n * = - Inv( )\r\n * [v_{n+1}] [v_n] [Q'(v_n).P'(u_n) Q''(v_n).S(u_n,v_n) - Q'(v_n).Q'(v_n)] [Q'(v_n).S(u_n,v_n)]\r\n * Note that this is xy close approach so we can ignore z.\r\n */\r\n this._curveP.fractionToPointAnd2Derivatives(fractionU, this._planeP);\r\n this._curveQ.fractionToPointAnd2Derivatives(fractionV, this._planeQ);\r\n const segX = this._planeP.origin.x - this._planeQ.origin.x;\r\n const segY = this._planeP.origin.y - this._planeQ.origin.y;\r\n const pDerivX = this._planeP.vectorU.x;\r\n const pDerivY = this._planeP.vectorU.y;\r\n const qDerivX = this._planeQ.vectorU.x;\r\n const qDerivY = this._planeQ.vectorU.y;\r\n const p2DerivX = this._planeP.vectorV.x;\r\n const p2DerivY = this._planeP.vectorV.y;\r\n const q2DerivX = this._planeQ.vectorV.x;\r\n const q2DerivY = this._planeQ.vectorV.y;\r\n this.currentF.setOriginAndVectorsXYZ(\r\n pDerivX * segX + pDerivY * segY,\r\n qDerivX * segX + qDerivY * segY,\r\n 0.0,\r\n p2DerivX * segX + p2DerivY * segY + pDerivX * pDerivX + pDerivY * pDerivY,\r\n qDerivX * pDerivX + qDerivY * pDerivY,\r\n 0.0,\r\n -(pDerivX * qDerivX + pDerivY * qDerivY),\r\n q2DerivX * segX + q2DerivY * segY - qDerivX * qDerivX - qDerivY * qDerivY,\r\n 0.0,\r\n );\r\n return true;\r\n }\r\n}\r\n"]}
@@ -1,18 +1,17 @@
1
1
  import { AngleSweep } from "../geometry3d/AngleSweep";
2
2
  import { GrowableFloat64Array, OptionalGrowableFloat64Array } from "../geometry3d/GrowableFloat64Array";
3
3
  import { LongitudeLatitudeNumber } from "../geometry3d/LongitudeLatitudeAltitude";
4
- import { Point2d, Vector2d } from "../geometry3d/Point2dVector2d";
4
+ import { Point2d } from "../geometry3d/Point2dVector2d";
5
5
  import { Point3d, Vector3d, XYZ } from "../geometry3d/Point3dVector3d";
6
6
  import { Range1d, Range3d } from "../geometry3d/Range";
7
7
  import { Ray3d } from "../geometry3d/Ray3d";
8
8
  import { XAndY } from "../geometry3d/XYZProps";
9
- import { Point4d } from "../geometry4d/Point4d";
10
9
  /**
11
10
  * degree 2 (quadratic) polynomial in for y = c0 + c1*x + c2*x^2
12
11
  * @internal
13
12
  */
14
13
  export declare class Degree2PowerPolynomial {
15
- /** The three coefficients for the quartic */
14
+ /** The three coefficients for the quadratic */
16
15
  coffs: number[];
17
16
  constructor(c0?: number, c1?: number, c2?: number);
18
17
  /**
@@ -268,7 +267,7 @@ export declare class AnalyticRoots {
268
267
  private static appendFullCubicSolutions;
269
268
  /** Compute roots of cubic 'c[0] + c[1] * x + c[2] * x^2 + c[3] * x^3 */
270
269
  static appendCubicRoots(c: Float64Array | number[], results: GrowableFloat64Array): void;
271
- /** Compute roots of quartic 'c[0] + c[1] * x + c[2] * x^2 + c[3] * x^3 + c[4] * x^4 */
270
+ /** Compute roots of quartic `c[0] + c[1] * x + c[2] * x^2 + c[3] * x^3 + c[4] * x^4` */
272
271
  static appendQuarticRoots(c: Float64Array | number[], results: GrowableFloat64Array): void;
273
272
  private static appendCosSinRadians;
274
273
  /**
@@ -306,9 +305,9 @@ export declare class PowerPolynomial {
306
305
  /** Evaluate the standard basis polynomial of degree `coff.length` at `x` */
307
306
  static evaluate(coff: Float64Array, x: number): number;
308
307
  /**
309
- * * Accumulate Q*scale into P. Both are treated as full degree.
310
- * * (Expect Address exceptions if P is smaller than Q)
311
- * * Returns degree of result as determined by comparing trailing coefficients to zero
308
+ * Accumulate `coffQ*scaleQ` into `coffP`.
309
+ * * The length of `coffP` must be at least length of `coffQ`.
310
+ * * Returns degree of result as determined by comparing trailing coefficients to zero.
312
311
  */
313
312
  static accumulate(coffP: Float64Array, coffQ: Float64Array, scaleQ: number): number;
314
313
  /** Zero all coefficients */
@@ -320,55 +319,54 @@ export declare class PowerPolynomial {
320
319
  */
321
320
  export declare class TrigPolynomial {
322
321
  private static readonly _smallAngle;
323
- /** Standard Basis coefficients for rational sine numerator. */
322
+ /** Standard Basis coefficients for the numerator of the y-coordinate y(t) = S(t)/W(t) in the rational semicircle parameterization. */
324
323
  static readonly S: Float64Array;
325
- /** Standard Basis coefficients for rational cosine numerator. */
324
+ /** Standard Basis coefficients for the numerator of the x-coordinate x(t) = C(t)/W(t) in the rational semicircle parameterization. */
326
325
  static readonly C: Float64Array;
327
- /** Standard Basis coefficients for rational denominator. */
326
+ /** Standard Basis coefficients for the denominator of x(t) and y(t) in the rational semicircle parameterization. */
328
327
  static readonly W: Float64Array;
329
- /** Standard Basis coefficients for cosine*weight numerator */
328
+ /** Standard Basis coefficients for C(t) * W(t). */
330
329
  static readonly CW: Float64Array;
331
- /** Standard Basis coefficients for sine*weight numerator */
330
+ /** Standard Basis coefficients for S(t) * W(t). */
332
331
  static readonly SW: Float64Array;
333
- /** Standard Basis coefficients for sine*cosine numerator */
332
+ /** Standard Basis coefficients for S(t) * C(t). */
334
333
  static readonly SC: Float64Array;
335
- /** Standard Basis coefficients for sine^2 numerator */
334
+ /** Standard Basis coefficients for S(t) * S(t). */
336
335
  static readonly SS: Float64Array;
337
- /** Standard Basis coefficients for cosine^2 numerator */
336
+ /** Standard Basis coefficients for C(t) * C(t). */
338
337
  static readonly CC: Float64Array;
339
- /** Standard Basis coefficients for weight^2 */
338
+ /** Standard Basis coefficients for W(t) * W(t). */
340
339
  static readonly WW: Float64Array;
341
- /** Standard Basis coefficients for (Math.Cos^2 - sine^2) numerator */
342
- static readonly CCminusSS: Float64Array;
343
- /**
344
- * Solve a polynomial created from trigonometric condition using
345
- * Trig.S, Trig.C, Trig.W. Solution logic includes inferring angular roots
346
- * corresponding zero leading coefficients (roots at infinity)
347
- * @param coff Coefficients
348
- * @param nominalDegree degree of the polynomial under most complex
349
- * root case. If there are any zero coefficients up to this degree, a single root
350
- * "at infinity" is recorded as its corresponding angular parameter at negative pi/2
351
- * @param referenceCoefficient A number which represents the size of coefficients
352
- * at various stages of computation. A small fraction of this will be used as a zero
353
- * tolerance
354
- * @param radians Roots are placed here
340
+ /** Standard Basis coefficients for C(t) * C(t) - S(t) * S(t). */
341
+ static readonly CCMinusSS: Float64Array;
342
+ /**
343
+ * Find the roots of a univariate polynomial created from substituting the rational parameterization of the unit
344
+ * circle into a trigonometric polynomial. Roots are returned as radian angles.
345
+ * * Currently implemented for polynomials of degree <= 4.
346
+ * * For example, the ellipse-ellipse intersection problem reduces to finding the roots of a quartic polynomial:
347
+ * `p(t) = coff[0] + coff[1] t + coff[2] t^2 + coff[3] t^3 + coff[4] t^4`.
348
+ * * Particular care is given to report a root at t = +/-infinity, which corresponds to the returned angle -pi/2.
349
+ * @param coff coefficients in the power basis
350
+ * @param nominalDegree degree of the polynomial under the most complex root case.
351
+ * @param referenceCoefficient a number which represents the size of coefficients at various stages of computation.
352
+ * A small fraction of this number will be used as a zero tolerance.
353
+ * @param radians roots are placed here.
355
354
  * @return false if equation is all zeros. This usually means any angle is a solution.
356
355
  */
357
356
  static solveAngles(coff: Float64Array, nominalDegree: number, referenceCoefficient: number, radians: number[]): boolean;
358
357
  private static readonly _coefficientRelTol;
359
358
  /**
360
- * Compute intersections of unit circle `x^2 + y^2 = 1` with general quadric
361
- * `axx * x^2 + axy * x * y + ayy * y^2 + ax * x + ay * y + a1 = 0`
362
- * Solutions are returned as angles. Sine and Cosine of the angles are the x, y results.
363
- * @param axx Coefficient of x^2
364
- * @param axy Coefficient of xy
365
- * @param ayy Coefficient of y^2
366
- * @param ax Coefficient of x
367
- * @param ay Coefficient of y
368
- * @param a1 Constant coefficient
369
- * @param radians solution angles
359
+ * Compute intersections of the unit circle `x^2 + y^2 = 1` with the general quadric (conic)
360
+ * `axx x^2 + axy xy + ayy y^2 + ax x + ay y + a = 0`.
361
+ * @param axx coefficient of x^2
362
+ * @param axy coefficient of xy
363
+ * @param ayy coefficient of y^2
364
+ * @param ax coefficient of x
365
+ * @param ay coefficient of y
366
+ * @param a constant coefficient
367
+ * @param radians up to 4 solution angles t in the quadric parameterization: x = cos(t), y = sin(t)
370
368
  */
371
- static solveUnitCircleImplicitQuadricIntersection(axx: number, axy: number, ayy: number, ax: number, ay: number, a1: number, radians: number[]): boolean;
369
+ static solveUnitCircleImplicitQuadricIntersection(axx: number, axy: number, ayy: number, ax: number, ay: number, a: number, radians: number[]): boolean;
372
370
  /**
373
371
  * Compute intersections of unit circle x^2 + y 2 = 1 with the ellipse
374
372
  * (x,y) = (cx + ux Math.Cos + vx sin, cy + uy Math.Cos + vy sin)
@@ -384,7 +382,7 @@ export declare class TrigPolynomial {
384
382
  */
385
383
  static solveUnitCircleEllipseIntersection(cx: number, cy: number, ux: number, uy: number, vx: number, vy: number, ellipseRadians: number[], circleRadians: number[]): boolean;
386
384
  /**
387
- * Compute intersections of unit circle `x^2 + y^2 = w^2` with the ellipse
385
+ * Compute intersections of unit circle `x^2 + y^2 = w^2` (in homogeneous coordinates) with the ellipse
388
386
  * `F(t) = (cx + ux cos(t) + vx sin(t), cy + uy cos(t) + vy sin(t)) / (cw + uw cos(t) + vw sin(t))`.
389
387
  * @param cx center x
390
388
  * @param cy center y
@@ -400,165 +398,6 @@ export declare class TrigPolynomial {
400
398
  */
401
399
  static solveUnitCircleHomogeneousEllipseIntersection(cx: number, cy: number, cw: number, ux: number, uy: number, uw: number, vx: number, vy: number, vw: number, ellipseRadians: number[], circleRadians: number[]): boolean;
402
400
  }
403
- /**
404
- * static methods for commonly appearing sets of equations in 2 or 3 variables
405
- * @public
406
- */
407
- export declare class SmallSystem {
408
- /**
409
- * Return true if lines (a0,a1) to (b0, b1) have a simple intersection.
410
- * Return the fractional (not xy) coordinates in result.x, result.y
411
- * @param a0 start point of line a
412
- * @param a1 end point of line a
413
- * @param b0 start point of line b
414
- * @param b1 end point of line b
415
- * @param result point to receive fractional coordinates of intersection. result.x is fraction on line a. result.y is fraction on line b.
416
- */
417
- static lineSegment2dXYTransverseIntersectionUnbounded(a0: Point2d, a1: Point2d, b0: Point2d, b1: Point2d, result: Vector2d): boolean;
418
- /**
419
- * * (ax0,ay0) to (ax0+ux,ay0+uy) are line A.
420
- * * (bx0,by0) to (bx0+vx,by0+vy) are lineB.
421
- * * Return true if the lines have a simple intersection.
422
- * * Return the fractional (not xy) coordinates in result.x, result.y
423
- * @param result point to receive fractional coordinates of intersection. result.x is fraction on line a. result.y is fraction on line b.
424
- */
425
- static lineSegmentXYUVTransverseIntersectionUnbounded(ax0: number, ay0: number, ux: number, uy: number, bx0: number, by0: number, vx: number, vy: number, result: Vector2d): boolean;
426
- /**
427
- * Return true if lines (a0,a1) to (b0, b1) have a simple intersection using only xy parts
428
- * Return the fractional (not xy) coordinates in result.x, result.y
429
- * @param a0 start point of line a
430
- * @param a1 end point of line a
431
- * @param b0 start point of line b
432
- * @param b1 end point of line b
433
- * @param result point to receive fractional coordinates of intersection. result.x is fraction on line a. result.y is fraction on line b.
434
- */
435
- static lineSegment3dXYTransverseIntersectionUnbounded(a0: Point3d, a1: Point3d, b0: Point3d, b1: Point3d, result: Vector2d): boolean;
436
- /**
437
- * Return true if lines (a0,a1) to (b0, b1) have a simple intersection using only xy parts of WEIGHTED 4D Points
438
- * Return the fractional (not xy) coordinates in result.x, result.y
439
- * @param hA0 homogeneous start point of line a
440
- * @param hA1 homogeneous end point of line a
441
- * @param hB0 homogeneous start point of line b
442
- * @param hB1 homogeneous end point of line b
443
- * @param result point to receive fractional coordinates of intersection. result.x is fraction on line a. result.y is fraction on line b.
444
- */
445
- static lineSegment3dHXYTransverseIntersectionUnbounded(hA0: Point4d, hA1: Point4d, hB0: Point4d, hB1: Point4d, result?: Vector2d): Vector2d | undefined;
446
- /**
447
- * Return the line fraction at which the (homogeneous) line is closest to a space point as viewed in xy only.
448
- * @param hA0 homogeneous start point of line a
449
- * @param hA1 homogeneous end point of line a
450
- * @param spacePoint homogeneous point in space
451
- */
452
- static lineSegment3dHXYClosestPointUnbounded(hA0: Point4d, hA1: Point4d, spacePoint: Point4d): number | undefined;
453
- /**
454
- * Return the line fraction at which the line is closest to a space point as viewed in xy only.
455
- * @param pointA0 start point
456
- * @param pointA1 end point
457
- * @param spacePoint point in space
458
- */
459
- static lineSegment3dXYClosestPointUnbounded(pointA0: XAndY, pointA1: XAndY, spacePoint: XAndY): number | undefined;
460
- /**
461
- * Return the line fraction at which the line is closest to a space point
462
- * @param pointA0 start point
463
- * @param pointA1 end point
464
- * @param spacePoint point in space
465
- */
466
- static lineSegment3dClosestPointUnbounded(pointA0: Point3d, pointA1: Point3d, spacePoint: Point3d): number | undefined;
467
- /**
468
- * Return true if lines (a0,a1) to (b0, b1) have closest approach (go by each other) in 3d
469
- * Return the fractional (not xy) coordinates in result.x, result.y
470
- * @param a0 start point of line a
471
- * @param a1 end point of line a
472
- * @param b0 start point of line b
473
- * @param b1 end point of line b
474
- * @param result point to receive fractional coordinates of intersection. result.x is fraction on line a. result.y is fraction on line b.
475
- */
476
- static lineSegment3dClosestApproachUnbounded(a0: Point3d, a1: Point3d, b0: Point3d, b1: Point3d, result: Vector2d): boolean;
477
- /**
478
- * Return true if the given rays have closest approach (go by each other) in 3d
479
- * Return the fractional (not xy) coordinates as x and y parts of a Point2d.
480
- * @param ax x-coordinate of the origin of the first ray
481
- * @param ay y-coordinate of the origin of the first ray
482
- * @param az z-coordinate of the origin of the first ray
483
- * @param au x-coordinate of the direction vector of the first ray
484
- * @param av y-coordinate of the direction vector of the first ray
485
- * @param aw z-coordinate of the direction vector of the first ray
486
- * @param bx x-coordinate of the origin of the second ray
487
- * @param by y-coordinate of the origin of the second ray
488
- * @param bz z-coordinate of the origin of the second ray
489
- * @param bu x-coordinate of the direction vector of the second ray
490
- * @param bv y-coordinate of the direction vector of the second ray
491
- * @param bw z-coordinate of the direction vector of the second ray
492
- * @param result point to receive fractional coordinates of intersection. result.x is fraction on line a. result.y is fraction on line b.
493
- */
494
- static ray3dXYZUVWClosestApproachUnbounded(ax: number, ay: number, az: number, au: number, av: number, aw: number, bx: number, by: number, bz: number, bu: number, bv: number, bw: number, result: Vector2d): boolean;
495
- /**
496
- * Solve the pair of linear equations
497
- * * `ux * x + vx * y = cx`
498
- * * `uy * x + vy * y = cy`
499
- * @param ux xx coefficient
500
- * @param vx xy coefficient
501
- * @param uy yx coefficient
502
- * @param vy yy coefficient
503
- * @param cx x right hand side
504
- * @param cy y right hand side
505
- * @param result (x,y) solution (MUST be preallocated by caller)
506
- */
507
- static linearSystem2d(ux: number, vx: number, // first row of matrix
508
- uy: number, vy: number, // second row of matrix
509
- cx: number, cy: number, // right side
510
- result: Vector2d): boolean;
511
- /**
512
- * Solve a linear system:
513
- * * x equation: `axx * u + axy * v + axz * w = cx`
514
- * * y equation: `ayx * u + ayy * v + ayz * w = cy`
515
- * * z equation: `azx * u + azy * v + azz * w = cz`
516
- * @param axx row 0, column 0 coefficient
517
- * @param axy row 0, column 1 coefficient
518
- * @param axz row 0, column 1 coefficient
519
- * @param ayx row 1, column 0 coefficient
520
- * @param ayy row 1, column 1 coefficient
521
- * @param ayz row 1, column 2 coefficient
522
- * @param azx row 2, column 0 coefficient
523
- * @param azy row 2, column 1 coefficient
524
- * @param azz row 2, column 2 coefficient
525
- * @param cx right hand side row 0 coefficient
526
- * @param cy right hand side row 1 coefficient
527
- * @param cz right hand side row 2 coefficient
528
- * @param result optional result.
529
- * @returns solution vector (u,v,w) or `undefined` if system is singular.
530
- */
531
- static linearSystem3d(axx: number, axy: number, axz: number, // first row of matrix
532
- ayx: number, ayy: number, ayz: number, // second row of matrix
533
- azx: number, azy: number, azz: number, // second row of matrix
534
- cx: number, cy: number, cz: number, // right side
535
- result?: Vector3d): Vector3d | undefined;
536
- /**
537
- * Compute the intersection of three planes.
538
- * @param xyzA point on the first plane
539
- * @param normalA normal of the first plane
540
- * @param xyzB point on the second plane
541
- * @param normalB normal of the second plane
542
- * @param xyzC point on the third plane
543
- * @param normalC normal of the third plane
544
- * @param result optional result
545
- * @returns intersection point of the three planes (as a Vector3d), or undefined if at least two planes are parallel.
546
- */
547
- static intersect3Planes(xyzA: Point3d, normalA: Vector3d, xyzB: Point3d, normalB: Vector3d, xyzC: Point3d, normalC: Vector3d, result?: Vector3d): Vector3d | undefined;
548
- /**
549
- * * in rowB, replace `rowB[j] += a * rowB[pivot] * rowA[j] / rowA[pivot]` for `j>pivot`
550
- * @param rowA row that does not change
551
- * @param pivotIndex index of pivot (divisor) in rowA.
552
- * @param rowB row where elimination occurs.
553
- */
554
- static eliminateFromPivot(rowA: Float64Array, pivotIndex: number, rowB: Float64Array, a: number): boolean;
555
- /**
556
- * Solve a pair of bilinear equations
557
- * * First equation: `a0 + b0 * u + c0 * v + d0 * u * v = 0`
558
- * * Second equation: `a0 + b0 * u + c0 * v + d0 * u * v = 0`
559
- */
560
- static solveBilinearPair(a0: number, b0: number, c0: number, d0: number, a1: number, b1: number, c1: number, d1: number): Point2d[] | undefined;
561
- }
562
401
  /**
563
402
  * * bilinear expression
564
403
  * * `f(u,v) = a + b * u * c * v + d * u * v`
@@ -588,6 +427,12 @@ export declare class BilinearPolynomial {
588
427
  /** Create a bilinear polynomial z=f(u,v) given z values at 00, 10, 01, 11.
589
428
  */
590
429
  static createUnitSquareValues(f00: number, f10: number, f01: number, f11: number): BilinearPolynomial;
430
+ /**
431
+ * Solve a pair of bilinear equations
432
+ * * First equation: `a0 + b0 * u + c0 * v + d0 * u * v = 0`
433
+ * * Second equation: `a1 + b1 * u + c1 * v + d1 * u * v = 0`
434
+ */
435
+ static solveBilinearPair(a0: number, b0: number, c0: number, d0: number, a1: number, b1: number, c1: number, d1: number): Point2d[] | undefined;
591
436
  /**
592
437
  * Solve the simultaneous equations
593
438
  * * `p(u,v) = pValue`
@@ -1 +1 @@
1
- {"version":3,"file":"Polynomials.d.ts","sourceRoot":"","sources":["../../../src/numerics/Polynomials.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,UAAU,EAAE,MAAM,0B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