@itwin/core-geometry 5.3.0-dev.2 → 5.3.0-dev.23

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 (608) hide show
  1. package/CHANGELOG.md +21 -1
  2. package/lib/cjs/Constant.js.map +1 -1
  3. package/lib/cjs/Geometry.js.map +1 -1
  4. package/lib/cjs/bspline/AkimaCurve3d.js.map +1 -1
  5. package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
  6. package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
  7. package/lib/cjs/bspline/BSplineCurve3dH.js.map +1 -1
  8. package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
  9. package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
  10. package/lib/cjs/bspline/Bezier1dNd.js.map +1 -1
  11. package/lib/cjs/bspline/BezierCurve3d.js.map +1 -1
  12. package/lib/cjs/bspline/BezierCurve3dH.js.map +1 -1
  13. package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
  14. package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
  15. package/lib/cjs/bspline/KnotVector.js.map +1 -1
  16. package/lib/cjs/bspline/SurfaceLocationDetail.js.map +1 -1
  17. package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
  18. package/lib/cjs/clipping/BooleanClipFactory.js.map +1 -1
  19. package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
  20. package/lib/cjs/clipping/ClipPlane.js.map +1 -1
  21. package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
  22. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  23. package/lib/cjs/clipping/ClipVector.js.map +1 -1
  24. package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
  25. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  26. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  27. package/lib/cjs/core-geometry.js.map +1 -1
  28. package/lib/cjs/curve/Arc3d.d.ts +15 -1
  29. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  30. package/lib/cjs/curve/Arc3d.js +36 -9
  31. package/lib/cjs/curve/Arc3d.js.map +1 -1
  32. package/lib/cjs/curve/ConstructCurveBetweenCurves.js.map +1 -1
  33. package/lib/cjs/curve/CoordinateXYZ.js.map +1 -1
  34. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  35. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  36. package/lib/cjs/curve/CurveCurve.js.map +1 -1
  37. package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
  38. package/lib/cjs/curve/CurveFactory.d.ts +25 -8
  39. package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
  40. package/lib/cjs/curve/CurveFactory.js +51 -55
  41. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  42. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  43. package/lib/cjs/curve/CurveOps.d.ts +2 -5
  44. package/lib/cjs/curve/CurveOps.d.ts.map +1 -1
  45. package/lib/cjs/curve/CurveOps.js +2 -5
  46. package/lib/cjs/curve/CurveOps.js.map +1 -1
  47. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  48. package/lib/cjs/curve/CurveProcessor.js.map +1 -1
  49. package/lib/cjs/curve/CurveTypes.js.map +1 -1
  50. package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
  51. package/lib/cjs/curve/GeometryQuery.js.map +1 -1
  52. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  53. package/lib/cjs/curve/LineString3d.js.map +1 -1
  54. package/lib/cjs/curve/Loop.js.map +1 -1
  55. package/lib/cjs/curve/OffsetOptions.js.map +1 -1
  56. package/lib/cjs/curve/ParityRegion.js.map +1 -1
  57. package/lib/cjs/curve/Path.js.map +1 -1
  58. package/lib/cjs/curve/PointString3d.js.map +1 -1
  59. package/lib/cjs/curve/ProxyCurve.js.map +1 -1
  60. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  61. package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
  62. package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
  63. package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
  64. package/lib/cjs/curve/Query/PlanarSubdivision.d.ts +50 -15
  65. package/lib/cjs/curve/Query/PlanarSubdivision.d.ts.map +1 -1
  66. package/lib/cjs/curve/Query/PlanarSubdivision.js +102 -84
  67. package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
  68. package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
  69. package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
  70. package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
  71. package/lib/cjs/curve/RegionOps.d.ts +44 -25
  72. package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
  73. package/lib/cjs/curve/RegionOps.js +74 -39
  74. package/lib/cjs/curve/RegionOps.js.map +1 -1
  75. package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
  76. package/lib/cjs/curve/RegionOpsClassificationSweeps.js +8 -8
  77. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  78. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  79. package/lib/cjs/curve/UnionRegion.js.map +1 -1
  80. package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
  81. package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  82. package/lib/cjs/curve/internalContexts/ChainCollectorContext.js.map +1 -1
  83. package/lib/cjs/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  84. package/lib/cjs/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
  85. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  86. package/lib/cjs/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  87. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  88. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts +1 -0
  89. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  90. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +102 -92
  91. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  92. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  93. package/lib/cjs/curve/internalContexts/CurveLengthContext.js.map +1 -1
  94. package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  95. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  96. package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
  97. package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
  98. package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
  99. package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  100. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  101. package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
  102. package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.js.map +1 -1
  103. package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  104. package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.d.ts +10 -13
  105. package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.d.ts.map +1 -1
  106. package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js +23 -22
  107. package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  108. package/lib/cjs/curve/spiral/ClothoidSeries.d.ts +10 -6
  109. package/lib/cjs/curve/spiral/ClothoidSeries.d.ts.map +1 -1
  110. package/lib/cjs/curve/spiral/ClothoidSeries.js +36 -19
  111. package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
  112. package/lib/cjs/curve/spiral/CubicEvaluator.d.ts +7 -6
  113. package/lib/cjs/curve/spiral/CubicEvaluator.d.ts.map +1 -1
  114. package/lib/cjs/curve/spiral/CubicEvaluator.js +29 -14
  115. package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
  116. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.d.ts +34 -44
  117. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.d.ts.map +1 -1
  118. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js +47 -53
  119. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  120. package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.d.ts +2 -2
  121. package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.d.ts.map +1 -1
  122. package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js +17 -7
  123. package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  124. package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts +112 -104
  125. package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
  126. package/lib/cjs/curve/spiral/DirectSpiral3d.js +143 -117
  127. package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
  128. package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts +71 -53
  129. package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
  130. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js +99 -66
  131. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  132. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.d.ts +8 -12
  133. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.d.ts.map +1 -1
  134. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js +11 -13
  135. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  136. package/lib/cjs/curve/spiral/NormalizedTransition.d.ts +36 -29
  137. package/lib/cjs/curve/spiral/NormalizedTransition.d.ts.map +1 -1
  138. package/lib/cjs/curve/spiral/NormalizedTransition.js +62 -40
  139. package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
  140. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.d.ts +13 -18
  141. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.d.ts.map +1 -1
  142. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js +21 -24
  143. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  144. package/lib/cjs/curve/spiral/TransitionConditionalProperties.d.ts +41 -27
  145. package/lib/cjs/curve/spiral/TransitionConditionalProperties.d.ts.map +1 -1
  146. package/lib/cjs/curve/spiral/TransitionConditionalProperties.js +50 -33
  147. package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  148. package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts +45 -34
  149. package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
  150. package/lib/cjs/curve/spiral/TransitionSpiral3d.js +56 -38
  151. package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
  152. package/lib/cjs/curve/spiral/XYCurveEvaluator.d.ts +27 -21
  153. package/lib/cjs/curve/spiral/XYCurveEvaluator.d.ts.map +1 -1
  154. package/lib/cjs/curve/spiral/XYCurveEvaluator.js +23 -18
  155. package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
  156. package/lib/cjs/geometry3d/Angle.js.map +1 -1
  157. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  158. package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
  159. package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
  160. package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
  161. package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
  162. package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
  163. package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
  164. package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
  165. package/lib/cjs/geometry3d/GrowableBlockedArray.js.map +1 -1
  166. package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
  167. package/lib/cjs/geometry3d/GrowableXYArray.d.ts +98 -99
  168. package/lib/cjs/geometry3d/GrowableXYArray.d.ts.map +1 -1
  169. package/lib/cjs/geometry3d/GrowableXYArray.js +123 -111
  170. package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
  171. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +137 -143
  172. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  173. package/lib/cjs/geometry3d/GrowableXYZArray.js +167 -161
  174. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  175. package/lib/cjs/geometry3d/IndexedCollectionInterval.js.map +1 -1
  176. package/lib/cjs/geometry3d/IndexedXYCollection.d.ts +51 -34
  177. package/lib/cjs/geometry3d/IndexedXYCollection.d.ts.map +1 -1
  178. package/lib/cjs/geometry3d/IndexedXYCollection.js +16 -6
  179. package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
  180. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +87 -93
  181. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  182. package/lib/cjs/geometry3d/IndexedXYZCollection.js +41 -38
  183. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  184. package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  185. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  186. package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
  187. package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
  188. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  189. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  190. package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
  191. package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
  192. package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
  193. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  194. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  195. package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
  196. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  197. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  198. package/lib/cjs/geometry3d/PolylineOps.d.ts +2 -2
  199. package/lib/cjs/geometry3d/PolylineOps.js +2 -2
  200. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  201. package/lib/cjs/geometry3d/Range.js.map +1 -1
  202. package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
  203. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  204. package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
  205. package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
  206. package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
  207. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  208. package/lib/cjs/geometry3d/UVSurfaceOps.js.map +1 -1
  209. package/lib/cjs/geometry3d/XYZProps.js.map +1 -1
  210. package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
  211. package/lib/cjs/geometry4d/Map4d.js.map +1 -1
  212. package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
  213. package/lib/cjs/geometry4d/MomentData.js.map +1 -1
  214. package/lib/cjs/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  215. package/lib/cjs/geometry4d/Point4d.js.map +1 -1
  216. package/lib/cjs/numerics/BandedSystem.js.map +1 -1
  217. package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
  218. package/lib/cjs/numerics/ClusterableArray.d.ts.map +1 -1
  219. package/lib/cjs/numerics/ClusterableArray.js +2 -2
  220. package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
  221. package/lib/cjs/numerics/Complex.js.map +1 -1
  222. package/lib/cjs/numerics/ConvexPolygon2d.js.map +1 -1
  223. package/lib/cjs/numerics/Newton.js.map +1 -1
  224. package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
  225. package/lib/cjs/numerics/PolarData.js.map +1 -1
  226. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  227. package/lib/cjs/numerics/Quadrature.js.map +1 -1
  228. package/lib/cjs/numerics/Range1dArray.js.map +1 -1
  229. package/lib/cjs/numerics/SmallSystem.js.map +1 -1
  230. package/lib/cjs/numerics/TriDiagonalSystem.js.map +1 -1
  231. package/lib/cjs/numerics/UnionFind.js.map +1 -1
  232. package/lib/cjs/numerics/UsageSums.js.map +1 -1
  233. package/lib/cjs/polyface/AuxData.js.map +1 -1
  234. package/lib/cjs/polyface/BoxTopology.js.map +1 -1
  235. package/lib/cjs/polyface/FacetFaceData.js.map +1 -1
  236. package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -1
  237. package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
  238. package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  239. package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
  240. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  241. package/lib/cjs/polyface/IndexedPolyfaceWalker.js.map +1 -1
  242. package/lib/cjs/polyface/Polyface.js.map +1 -1
  243. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  244. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  245. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  246. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  247. package/lib/cjs/polyface/RangeLengthData.js.map +1 -1
  248. package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  249. package/lib/cjs/polyface/RangeTree/MinimumValueTester.js.map +1 -1
  250. package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
  251. package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
  252. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  253. package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  254. package/lib/cjs/polyface/TaggedNumericData.js.map +1 -1
  255. package/lib/cjs/polyface/TriangleCandidate.js.map +1 -1
  256. package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  257. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  258. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  259. package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  260. package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  261. package/lib/cjs/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
  262. package/lib/cjs/polyface/multiclip/RangeSearch.js.map +1 -1
  263. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  264. package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
  265. package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
  266. package/lib/cjs/serialization/BGFBReader.js.map +1 -1
  267. package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
  268. package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
  269. package/lib/cjs/serialization/DeepCompare.js.map +1 -1
  270. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  271. package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
  272. package/lib/cjs/serialization/SerializationHelpers.js.map +1 -1
  273. package/lib/cjs/solid/Box.js.map +1 -1
  274. package/lib/cjs/solid/Cone.js.map +1 -1
  275. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  276. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  277. package/lib/cjs/solid/RuledSweep.js.map +1 -1
  278. package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
  279. package/lib/cjs/solid/Sphere.js.map +1 -1
  280. package/lib/cjs/solid/SweepContour.js.map +1 -1
  281. package/lib/cjs/solid/TorusPipe.js.map +1 -1
  282. package/lib/cjs/topology/ChainMerge.js.map +1 -1
  283. package/lib/cjs/topology/Graph.js.map +1 -1
  284. package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  285. package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
  286. package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  287. package/lib/cjs/topology/HalfEdgeGraphValidation.js.map +1 -1
  288. package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
  289. package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  290. package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  291. package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
  292. package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
  293. package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
  294. package/lib/cjs/topology/MaskManager.js.map +1 -1
  295. package/lib/cjs/topology/Merging.d.ts +15 -7
  296. package/lib/cjs/topology/Merging.d.ts.map +1 -1
  297. package/lib/cjs/topology/Merging.js +15 -10
  298. package/lib/cjs/topology/Merging.js.map +1 -1
  299. package/lib/cjs/topology/RegularizeFace.js.map +1 -1
  300. package/lib/cjs/topology/SignedDataSummary.js.map +1 -1
  301. package/lib/cjs/topology/SpaceTriangulation.js.map +1 -1
  302. package/lib/cjs/topology/Triangulation.js.map +1 -1
  303. package/lib/cjs/topology/Voronoi.js.map +1 -1
  304. package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
  305. package/lib/esm/Constant.js.map +1 -1
  306. package/lib/esm/Geometry.js.map +1 -1
  307. package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
  308. package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
  309. package/lib/esm/bspline/BSplineCurve.js.map +1 -1
  310. package/lib/esm/bspline/BSplineCurve3dH.js.map +1 -1
  311. package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
  312. package/lib/esm/bspline/BSplineSurface.js.map +1 -1
  313. package/lib/esm/bspline/Bezier1dNd.js.map +1 -1
  314. package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
  315. package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
  316. package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
  317. package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
  318. package/lib/esm/bspline/KnotVector.js.map +1 -1
  319. package/lib/esm/bspline/SurfaceLocationDetail.js.map +1 -1
  320. package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
  321. package/lib/esm/clipping/BooleanClipFactory.js.map +1 -1
  322. package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
  323. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  324. package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
  325. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  326. package/lib/esm/clipping/ClipVector.js.map +1 -1
  327. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  328. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  329. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  330. package/lib/esm/core-geometry.js.map +1 -1
  331. package/lib/esm/curve/Arc3d.d.ts +15 -1
  332. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  333. package/lib/esm/curve/Arc3d.js +36 -9
  334. package/lib/esm/curve/Arc3d.js.map +1 -1
  335. package/lib/esm/curve/ConstructCurveBetweenCurves.js.map +1 -1
  336. package/lib/esm/curve/CoordinateXYZ.js.map +1 -1
  337. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  338. package/lib/esm/curve/CurveCollection.js.map +1 -1
  339. package/lib/esm/curve/CurveCurve.js.map +1 -1
  340. package/lib/esm/curve/CurveExtendMode.js.map +1 -1
  341. package/lib/esm/curve/CurveFactory.d.ts +25 -8
  342. package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
  343. package/lib/esm/curve/CurveFactory.js +51 -55
  344. package/lib/esm/curve/CurveFactory.js.map +1 -1
  345. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  346. package/lib/esm/curve/CurveOps.d.ts +2 -5
  347. package/lib/esm/curve/CurveOps.d.ts.map +1 -1
  348. package/lib/esm/curve/CurveOps.js +2 -5
  349. package/lib/esm/curve/CurveOps.js.map +1 -1
  350. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  351. package/lib/esm/curve/CurveProcessor.js.map +1 -1
  352. package/lib/esm/curve/CurveTypes.js.map +1 -1
  353. package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
  354. package/lib/esm/curve/GeometryQuery.js.map +1 -1
  355. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  356. package/lib/esm/curve/LineString3d.js.map +1 -1
  357. package/lib/esm/curve/Loop.js.map +1 -1
  358. package/lib/esm/curve/OffsetOptions.js.map +1 -1
  359. package/lib/esm/curve/ParityRegion.js.map +1 -1
  360. package/lib/esm/curve/Path.js.map +1 -1
  361. package/lib/esm/curve/PointString3d.js.map +1 -1
  362. package/lib/esm/curve/ProxyCurve.js.map +1 -1
  363. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  364. package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
  365. package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
  366. package/lib/esm/curve/Query/InOutTests.js.map +1 -1
  367. package/lib/esm/curve/Query/PlanarSubdivision.d.ts +50 -15
  368. package/lib/esm/curve/Query/PlanarSubdivision.d.ts.map +1 -1
  369. package/lib/esm/curve/Query/PlanarSubdivision.js +102 -84
  370. package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
  371. package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
  372. package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
  373. package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
  374. package/lib/esm/curve/RegionOps.d.ts +44 -25
  375. package/lib/esm/curve/RegionOps.d.ts.map +1 -1
  376. package/lib/esm/curve/RegionOps.js +72 -37
  377. package/lib/esm/curve/RegionOps.js.map +1 -1
  378. package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
  379. package/lib/esm/curve/RegionOpsClassificationSweeps.js +8 -8
  380. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  381. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  382. package/lib/esm/curve/UnionRegion.js.map +1 -1
  383. package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
  384. package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  385. package/lib/esm/curve/internalContexts/ChainCollectorContext.js.map +1 -1
  386. package/lib/esm/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  387. package/lib/esm/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
  388. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  389. package/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  390. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  391. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts +1 -0
  392. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  393. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +102 -92
  394. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  395. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  396. package/lib/esm/curve/internalContexts/CurveLengthContext.js.map +1 -1
  397. package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  398. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  399. package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
  400. package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
  401. package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
  402. package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  403. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  404. package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
  405. package/lib/esm/curve/internalContexts/TransferWithSplitArcs.js.map +1 -1
  406. package/lib/esm/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  407. package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.d.ts +10 -13
  408. package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.d.ts.map +1 -1
  409. package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js +23 -22
  410. package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  411. package/lib/esm/curve/spiral/ClothoidSeries.d.ts +10 -6
  412. package/lib/esm/curve/spiral/ClothoidSeries.d.ts.map +1 -1
  413. package/lib/esm/curve/spiral/ClothoidSeries.js +36 -19
  414. package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
  415. package/lib/esm/curve/spiral/CubicEvaluator.d.ts +7 -6
  416. package/lib/esm/curve/spiral/CubicEvaluator.d.ts.map +1 -1
  417. package/lib/esm/curve/spiral/CubicEvaluator.js +29 -14
  418. package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
  419. package/lib/esm/curve/spiral/CzechSpiralEvaluator.d.ts +34 -44
  420. package/lib/esm/curve/spiral/CzechSpiralEvaluator.d.ts.map +1 -1
  421. package/lib/esm/curve/spiral/CzechSpiralEvaluator.js +47 -53
  422. package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  423. package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.d.ts +2 -2
  424. package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.d.ts.map +1 -1
  425. package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js +17 -7
  426. package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  427. package/lib/esm/curve/spiral/DirectSpiral3d.d.ts +112 -104
  428. package/lib/esm/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
  429. package/lib/esm/curve/spiral/DirectSpiral3d.js +143 -117
  430. package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
  431. package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts +71 -53
  432. package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
  433. package/lib/esm/curve/spiral/IntegratedSpiral3d.js +99 -66
  434. package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  435. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.d.ts +8 -12
  436. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.d.ts.map +1 -1
  437. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js +11 -13
  438. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  439. package/lib/esm/curve/spiral/NormalizedTransition.d.ts +36 -29
  440. package/lib/esm/curve/spiral/NormalizedTransition.d.ts.map +1 -1
  441. package/lib/esm/curve/spiral/NormalizedTransition.js +62 -40
  442. package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
  443. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.d.ts +13 -18
  444. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.d.ts.map +1 -1
  445. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js +21 -24
  446. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  447. package/lib/esm/curve/spiral/TransitionConditionalProperties.d.ts +41 -27
  448. package/lib/esm/curve/spiral/TransitionConditionalProperties.d.ts.map +1 -1
  449. package/lib/esm/curve/spiral/TransitionConditionalProperties.js +50 -33
  450. package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  451. package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts +45 -34
  452. package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
  453. package/lib/esm/curve/spiral/TransitionSpiral3d.js +56 -38
  454. package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
  455. package/lib/esm/curve/spiral/XYCurveEvaluator.d.ts +27 -21
  456. package/lib/esm/curve/spiral/XYCurveEvaluator.d.ts.map +1 -1
  457. package/lib/esm/curve/spiral/XYCurveEvaluator.js +23 -18
  458. package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
  459. package/lib/esm/geometry3d/Angle.js.map +1 -1
  460. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  461. package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
  462. package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
  463. package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
  464. package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
  465. package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
  466. package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
  467. package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
  468. package/lib/esm/geometry3d/GrowableBlockedArray.js.map +1 -1
  469. package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
  470. package/lib/esm/geometry3d/GrowableXYArray.d.ts +98 -99
  471. package/lib/esm/geometry3d/GrowableXYArray.d.ts.map +1 -1
  472. package/lib/esm/geometry3d/GrowableXYArray.js +124 -112
  473. package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
  474. package/lib/esm/geometry3d/GrowableXYZArray.d.ts +137 -143
  475. package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  476. package/lib/esm/geometry3d/GrowableXYZArray.js +167 -161
  477. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  478. package/lib/esm/geometry3d/IndexedCollectionInterval.js.map +1 -1
  479. package/lib/esm/geometry3d/IndexedXYCollection.d.ts +51 -34
  480. package/lib/esm/geometry3d/IndexedXYCollection.d.ts.map +1 -1
  481. package/lib/esm/geometry3d/IndexedXYCollection.js +14 -5
  482. package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
  483. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +87 -93
  484. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  485. package/lib/esm/geometry3d/IndexedXYZCollection.js +41 -38
  486. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  487. package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  488. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  489. package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
  490. package/lib/esm/geometry3d/Plane3d.js.map +1 -1
  491. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  492. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  493. package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
  494. package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
  495. package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
  496. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  497. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  498. package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
  499. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  500. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  501. package/lib/esm/geometry3d/PolylineOps.d.ts +2 -2
  502. package/lib/esm/geometry3d/PolylineOps.js +2 -2
  503. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  504. package/lib/esm/geometry3d/Range.js.map +1 -1
  505. package/lib/esm/geometry3d/Ray2d.js.map +1 -1
  506. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  507. package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
  508. package/lib/esm/geometry3d/Segment1d.js.map +1 -1
  509. package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
  510. package/lib/esm/geometry3d/Transform.js.map +1 -1
  511. package/lib/esm/geometry3d/UVSurfaceOps.js.map +1 -1
  512. package/lib/esm/geometry3d/XYZProps.js.map +1 -1
  513. package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
  514. package/lib/esm/geometry4d/Map4d.js.map +1 -1
  515. package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
  516. package/lib/esm/geometry4d/MomentData.js.map +1 -1
  517. package/lib/esm/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  518. package/lib/esm/geometry4d/Point4d.js.map +1 -1
  519. package/lib/esm/numerics/BandedSystem.js.map +1 -1
  520. package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
  521. package/lib/esm/numerics/ClusterableArray.d.ts.map +1 -1
  522. package/lib/esm/numerics/ClusterableArray.js +2 -2
  523. package/lib/esm/numerics/ClusterableArray.js.map +1 -1
  524. package/lib/esm/numerics/Complex.js.map +1 -1
  525. package/lib/esm/numerics/ConvexPolygon2d.js.map +1 -1
  526. package/lib/esm/numerics/Newton.js.map +1 -1
  527. package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
  528. package/lib/esm/numerics/PolarData.js.map +1 -1
  529. package/lib/esm/numerics/Polynomials.js.map +1 -1
  530. package/lib/esm/numerics/Quadrature.js.map +1 -1
  531. package/lib/esm/numerics/Range1dArray.js.map +1 -1
  532. package/lib/esm/numerics/SmallSystem.js.map +1 -1
  533. package/lib/esm/numerics/TriDiagonalSystem.js.map +1 -1
  534. package/lib/esm/numerics/UnionFind.js.map +1 -1
  535. package/lib/esm/numerics/UsageSums.js.map +1 -1
  536. package/lib/esm/polyface/AuxData.js.map +1 -1
  537. package/lib/esm/polyface/BoxTopology.js.map +1 -1
  538. package/lib/esm/polyface/FacetFaceData.js.map +1 -1
  539. package/lib/esm/polyface/FacetLocationDetail.js.map +1 -1
  540. package/lib/esm/polyface/FacetOrientation.js.map +1 -1
  541. package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  542. package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
  543. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  544. package/lib/esm/polyface/IndexedPolyfaceWalker.js.map +1 -1
  545. package/lib/esm/polyface/Polyface.js.map +1 -1
  546. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  547. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  548. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  549. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  550. package/lib/esm/polyface/RangeLengthData.js.map +1 -1
  551. package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  552. package/lib/esm/polyface/RangeTree/MinimumValueTester.js.map +1 -1
  553. package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
  554. package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
  555. package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  556. package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  557. package/lib/esm/polyface/TaggedNumericData.js.map +1 -1
  558. package/lib/esm/polyface/TriangleCandidate.js.map +1 -1
  559. package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  560. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  561. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  562. package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  563. package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  564. package/lib/esm/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
  565. package/lib/esm/polyface/multiclip/RangeSearch.js.map +1 -1
  566. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  567. package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
  568. package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
  569. package/lib/esm/serialization/BGFBReader.js.map +1 -1
  570. package/lib/esm/serialization/BGFBWriter.js.map +1 -1
  571. package/lib/esm/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
  572. package/lib/esm/serialization/DeepCompare.js.map +1 -1
  573. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  574. package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
  575. package/lib/esm/serialization/SerializationHelpers.js.map +1 -1
  576. package/lib/esm/solid/Box.js.map +1 -1
  577. package/lib/esm/solid/Cone.js.map +1 -1
  578. package/lib/esm/solid/LinearSweep.js.map +1 -1
  579. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  580. package/lib/esm/solid/RuledSweep.js.map +1 -1
  581. package/lib/esm/solid/SolidPrimitive.js.map +1 -1
  582. package/lib/esm/solid/Sphere.js.map +1 -1
  583. package/lib/esm/solid/SweepContour.js.map +1 -1
  584. package/lib/esm/solid/TorusPipe.js.map +1 -1
  585. package/lib/esm/topology/ChainMerge.js.map +1 -1
  586. package/lib/esm/topology/Graph.js.map +1 -1
  587. package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  588. package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
  589. package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  590. package/lib/esm/topology/HalfEdgeGraphValidation.js.map +1 -1
  591. package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
  592. package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  593. package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  594. package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
  595. package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
  596. package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
  597. package/lib/esm/topology/MaskManager.js.map +1 -1
  598. package/lib/esm/topology/Merging.d.ts +15 -7
  599. package/lib/esm/topology/Merging.d.ts.map +1 -1
  600. package/lib/esm/topology/Merging.js +15 -10
  601. package/lib/esm/topology/Merging.js.map +1 -1
  602. package/lib/esm/topology/RegularizeFace.js.map +1 -1
  603. package/lib/esm/topology/SignedDataSummary.js.map +1 -1
  604. package/lib/esm/topology/SpaceTriangulation.js.map +1 -1
  605. package/lib/esm/topology/Triangulation.js.map +1 -1
  606. package/lib/esm/topology/Voronoi.js.map +1 -1
  607. package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
  608. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"Point4d.js","sourceRoot":"","sources":["../../../src/geometry4d/Point4d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAmB,QAAQ,EAA0B,MAAM,aAAa,CAAC;AAChF,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAQ5C;;;;;;;;;GASG;AACH,SAAS,mBAAmB,CAAC,GAAW,EAAE,EAAU,EAAE,GAAW,EAC/D,CAAS,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eAAe;QACf,IAAI,GAAG,GAAG,CAAC,GAAG;YACZ,GAAG,GAAG,CAAC,GAAG,CAAC;aACR,IAAI,GAAG,GAAG,GAAG;YAChB,GAAG,GAAG,GAAG,CAAC;QAEZ,oCAAoC;QACpC,MAAM,EAAE,GAAG,IAAI,OAAO,EAAE,CAAC;QACzB,EAAE,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAE,0DAA0D;QACxF,EAAE,CAAC,mBAAmB,EAAE,CAAC;QAEzB,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC7B,MAAM,oBAAoB,GAAG,KAAK,GAAG,iBAAiB,CAAC;QACvD,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,oBAAoB,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,CAAC;QAC1G,OAAO,MAAM,CAAC;IAChB,CAAC;IACD;;OAEG;IACI,oBAAoB,CAAC,KAAc;QACxC,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;QAClC,MAAM,IAAI,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC;QACnC,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAE,+BAA+B;QACpE,MAAM,GAAG,GAAG,QAAQ,CAAC,yBAAyB,CAAC,GAAG,EAAE,IAAI,GAAG,IAAI,CAAC,CAAC;QACjE,IAAI,GAAG,KAAK,SAAS;YACnB,OAAO,SAAS,CAAC;QACnB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;CACF","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 Numerics\n */\nimport { BeJSONFunctions, Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\nimport { Plane3d } from \"../geometry3d/Plane3d\";\nimport { Plane3dByOriginAndUnitNormal } from \"../geometry3d/Plane3dByOriginAndUnitNormal\";\nimport { Plane3dByOriginAndVectors } from \"../geometry3d/Plane3dByOriginAndVectors\";\nimport { Point2d } from \"../geometry3d/Point2dVector2d\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { Ray3d } from \"../geometry3d/Ray3d\";\nimport { XAndY, XYAndZ } from \"../geometry3d/XYZProps\";\n\n/**\n * 4d point packed in an array of 4 numbers.\n * @public\n */\nexport type Point4dProps = number[];\n/**\n *\n * @param ddg numerator second derivative\n * @param dh denominator derivative\n * @param ddh denominator second derivative\n * @param f primary function (g/h)\n * @param df derivative of (g/h)\n * @param divH = (1/h)\n * @internal\n */\nfunction quotientDerivative2(ddg: number, dh: number, ddh: number,\n f: number, df: number, divH: number): number {\n return divH * (ddg - 2.0 * df * dh - f * ddh);\n}\n\n/** 4 Dimensional point (x,y,z,w) used in perspective calculations.\n * * the coordinates are stored in a Float64Array of length 4.\n * * properties `x`, `y`, `z`, `w` access array members.\n * *\n * * The coordinates are physically stored as a single Float64Array with 4 entries. (w last)\n * *\n * @public\n */\nexport class Point4d extends Plane3d implements BeJSONFunctions {\n /** x,y,z,w are packed into a Float64Array */\n public xyzw: Float64Array;\n /** Set x,y,z,w of this point. */\n public set(x: number = 0, y: number = 0, z: number = 0, w: number = 0): Point4d {\n this.xyzw[0] = x;\n this.xyzw[1] = y;\n this.xyzw[2] = z;\n this.xyzw[3] = w;\n return this;\n }\n /** Set a component by index.\n * * No change if index is out of range.\n */\n public setComponent(index: number, value: number) {\n if (index >= 0 && index < 4) {\n this.xyzw[index] = value;\n }\n }\n /** The x component. */\n public get x() { return this.xyzw[0]; }\n public set x(val: number) { this.xyzw[0] = val; }\n /** The y component. */\n public get y() { return this.xyzw[1]; }\n public set y(val: number) { this.xyzw[1] = val; }\n /** The z component. */\n public get z() { return this.xyzw[2]; }\n public set z(val: number) { this.xyzw[2] = val; }\n /** The w component of this point. */\n public get w() { return this.xyzw[3]; }\n public set w(val: number) { this.xyzw[3] = val; }\n /** Construct from coordinates. */\n protected constructor(x: number = 0, y: number = 0, z: number = 0, w: number = 0) {\n super();\n this.xyzw = new Float64Array(4);\n this.xyzw[0] = x;\n this.xyzw[1] = y;\n this.xyzw[2] = z;\n this.xyzw[3] = w;\n }\n /** Return a Point4d with specified x,y,z,w */\n public static create(x: number = 0, y: number = 0, z: number = 0, w: number = 0, result?: Point4d): Point4d {\n return result ? result.set(x, y, z, w) : new Point4d(x, y, z, w);\n }\n /**\n * Create a \"Point4d as a plane\" from \"any\" other [[PlaneAltitudeEvaluator]] type.\n * @param source\n * @returns\n */\n public static createPlaneFrom(source: PlaneAltitudeEvaluator): Point4d | undefined {\n return new Point4d(source.normalX(), source.normalY(), source.normalZ(), source.altitudeXYZ(0, 0, 0));\n }\n /** Copy coordinates from `other`. */\n public setFrom(other: Point4d): Point4d {\n this.xyzw[0] = other.xyzw[0];\n this.xyzw[1] = other.xyzw[1];\n this.xyzw[2] = other.xyzw[2];\n this.xyzw[3] = other.xyzw[3];\n return this;\n }\n /** Clone this point */\n public clone(result?: Point4d): Point4d {\n return result ? result.setFrom(this) : new Point4d(this.xyzw[0], this.xyzw[1], this.xyzw[2], this.xyzw[3]);\n }\n /** Set this point's xyzw from a json array `[x,y,z,w]` */\n public setFromJSON(json?: Point4dProps) {\n if (Geometry.isNumberArray(json, 4))\n this.set(json[0], json[1], json[2], json[3]);\n else\n this.set(0, 0, 0, 0);\n }\n\n /** Create a new point with coordinates from a json array `[x,y,z,w]` */\n public static fromJSON(json?: Point4dProps): Point4d {\n const result = new Point4d();\n result.setFromJSON(json);\n return result;\n }\n /** Near-equality test, using `Geometry.isSameCoordinate` on all 4 x,y,z,w */\n public isAlmostEqual(other: Point4d, tolerance: number = Geometry.smallMetricDistance): boolean {\n return Geometry.isSameCoordinate(this.x, other.x, tolerance)\n && Geometry.isSameCoordinate(this.y, other.y, tolerance)\n && Geometry.isSameCoordinate(this.z, other.z, tolerance)\n && Geometry.isSameCoordinate(this.w, other.w, tolerance);\n }\n /**\n * Test for same coordinate by direct x,y,z,w args\n * @param x x to test\n * @param y y to test\n * @param z z to test\n * @param w w to test\n */\n public isAlmostEqualXYZW(x: number, y: number, z: number, w: number, tolerance: number = Geometry.smallMetricDistance): boolean {\n return Geometry.isSameCoordinate(this.x, x, tolerance)\n && Geometry.isSameCoordinate(this.y, y, tolerance)\n && Geometry.isSameCoordinate(this.z, z, tolerance)\n && Geometry.isSameCoordinate(this.w, w, tolerance);\n }\n\n /**\n * Convert an Angle to a JSON object.\n * @return {*} [x,y,z,w]\n */\n public toJSON(): Point4dProps {\n return [this.xyzw[0], this.xyzw[1], this.xyzw[2], this.xyzw[3]];\n }\n /** Return the 4d distance from this point to other, with all 4 components squared into the hypotenuse.\n * * x,y,z,w all participate without normalization.\n */\n public distanceXYZW(other: Point4d): number {\n return Geometry.hypotenuseXYZW(other.xyzw[0] - this.xyzw[0], other.xyzw[1] - this.xyzw[1], other.xyzw[2] - this.xyzw[2], other.xyzw[3] - this.xyzw[3]);\n }\n /** Return the squared 4d distance from this point to other, with all 4 components squared into the hypotenuse.\n * * x,y,z,w all participate without normalization.\n */\n public distanceSquaredXYZW(other: Point4d): number {\n return Geometry.hypotenuseSquaredXYZW(other.xyzw[0] - this.xyzw[0], other.xyzw[1] - this.xyzw[1], other.xyzw[2] - this.xyzw[2], other.xyzw[3] - this.xyzw[3]);\n }\n /** Return the xy distance between the instance and `other` after normalizing by weights */\n public realDistanceXY(other: Point4d): number | undefined {\n const wA = this.w;\n const wB = other.w;\n if (Geometry.isSmallMetricDistance(wA) || Geometry.isSmallMetricDistance(wB))\n return undefined;\n return Geometry.hypotenuseXY(other.xyzw[0] / wB - this.xyzw[0] / wA, other.xyzw[1] / wB - this.xyzw[1] / wA);\n }\n /** Return the xy squared distance between the instance and `other` after normalizing by weights */\n public realDistanceSquaredXY(other: Point4d): number | undefined {\n const wA = this.w;\n const wB = other.w;\n if (Geometry.isSmallMetricDistance(wA) || Geometry.isSmallMetricDistance(wB))\n return undefined;\n return Geometry.hypotenuseSquaredXY(other.xyzw[0] / wB - this.xyzw[0] / wA, other.xyzw[1] / wB - this.xyzw[1] / wA);\n }\n /** Return the largest absolute distance between corresponding components\n * * x,y,z,w all participate without normalization.\n */\n public maxDiff(other: Point4d): number {\n return Math.max(Math.abs(other.xyzw[0] - this.xyzw[0]), Math.abs(other.xyzw[1] - this.xyzw[1]), Math.abs(other.xyzw[2] - this.xyzw[2]), Math.abs(other.xyzw[3] - this.xyzw[3]));\n }\n /** Return the largest absolute entry of all 4 components x,y,z,w */\n public maxAbs(): number {\n return Math.max(Math.abs(this.xyzw[0]), Math.abs(this.xyzw[1]), Math.abs(this.xyzw[2]), Math.abs(this.xyzw[3]));\n }\n /** Returns the magnitude including all 4 components x,y,z,w */\n public magnitudeXYZW(): number {\n return Geometry.hypotenuseXYZW(this.xyzw[0], this.xyzw[1], this.xyzw[2], this.xyzw[3]);\n }\n /** Returns the magnitude of the leading xyz components. w is ignored. (i.e. the leading xyz are NOT divided by w.) */\n public magnitudeSquaredXYZ(): number {\n return Geometry.hypotenuseSquaredXYZ(this.xyzw[0], this.xyzw[1], this.xyzw[2]);\n }\n\n /** Return the difference (this-other) using all 4 components x,y,z,w */\n public minus(other: Point4d, result?: Point4d): Point4d {\n return Point4d.create(this.xyzw[0] - other.xyzw[0], this.xyzw[1] - other.xyzw[1], this.xyzw[2] - other.xyzw[2], this.xyzw[3] - other.xyzw[3], result);\n }\n /** Return `((other.w * this) - (this.w * other))` */\n public crossWeightedMinus(other: Point4d, result?: Vector3d): Vector3d {\n const wa = this.xyzw[3];\n const wb = other.xyzw[3];\n return Vector3d.create(wb * this.xyzw[0] - wa * other.xyzw[0], wb * this.xyzw[1] - wa * other.xyzw[1], wb * this.xyzw[2] - wa * other.xyzw[2], result);\n }\n /** Return `((other.w * this) - (this.w * other))`, with other.w known to be 1 */\n public crossWeightedMinusPoint3d(other: Point3d, result?: Vector3d): Vector3d {\n const wa = this.xyzw[3];\n return Vector3d.create(this.xyzw[0] - wa * other.x, this.xyzw[1] - wa * other.y, this.xyzw[2] - wa * other.z, result);\n }\n /** Return the sum of this and other, using all 4 components x,y,z,w */\n public plus(other: Point4d, result?: Point4d): Point4d {\n return Point4d.create(this.xyzw[0] + other.xyzw[0], this.xyzw[1] + other.xyzw[1], this.xyzw[2] + other.xyzw[2], this.xyzw[3] + other.xyzw[3], result);\n }\n /** Test if all components are nearly zero. */\n public get isAlmostZero(): boolean {\n return Geometry.isSmallMetricDistance(this.maxAbs());\n }\n /** Create a point with zero in all coordinates. */\n public static createZero(): Point4d { return new Point4d(0, 0, 0, 0); }\n /**\n * Create plane coefficients for the plane containing pointA, pointB, and 0010.\n * @param pointA first point\n * @param pointB second point\n */\n public static createPlanePointPointZ(pointA: Point4d, pointB: Point4d, result?: Point4d) {\n return Point4d.create(pointA.y * pointB.w - pointA.w * pointB.y, pointA.w * pointB.x - pointA.x * pointB.w, 0.0, pointA.x * pointB.y - pointA.y * pointB.x, result);\n }\n /**\n * extract 3 consecutive numbers from a Float64Array into the xyz values of a Point4d with w = 1.\n * @param data buffer of numbers\n * @param xIndex first index for x,y,z sequence\n */\n public static createFromPackedXYZ(data: Float64Array, xIndex: number = 0, result?: Point4d): Point4d | undefined {\n if (xIndex >= 0 && xIndex + 2 < data.length)\n return Point4d.create(data[xIndex], data[xIndex + 1], data[xIndex + 2], 1.0, result);\n return undefined;\n }\n /**\n * extract 4 consecutive numbers from a Float64Array into a Point4d.\n * @param data buffer of numbers\n * @param xIndex first index for x,y,z,w sequence\n */\n public static createFromPacked(data: Float64Array, xIndex: number = 0, result?: Point4d): Point4d | undefined {\n if (xIndex >= 0 && xIndex + 3 < data.length)\n return Point4d.create(data[xIndex], data[xIndex + 1], data[xIndex + 2], data[xIndex + 3], result);\n return undefined;\n }\n /**\n * extract 4 consecutive numbers from a Float64Array into a Point4d.\n * @param data buffer of numbers\n * @param xIndex first index for x,y,z,w sequence. Assumed to be a valid index!\n * @deprecated in 4.3.0 - will not be removed until after 2026-06-13. Use createFromPacked instead.\n */\n public static createFromPackedXYZW(data: Float64Array, xIndex: number = 0, result?: Point4d): Point4d {\n return Point4d.create(data[xIndex], data[xIndex + 1], data[xIndex + 2], data[xIndex + 3], result);\n }\n /** Create a `Point4d` with x,y,z from an `XYAndZ` input, and w from a separate number. */\n public static createFromPointAndWeight(xyz: XYAndZ, w: number): Point4d {\n return new Point4d(xyz.x, xyz.y, xyz.z, w);\n }\n /** Create a `Point4d` from\n * * Point2d, Point3d, or Point4d\n * * other structure with members x,y and optional z,w\n * * array of numbers\n * * default z is 0.0\n * * default w is 1.0 (array[3] can replace)\n */\n public static createFromPoint(point: XAndY | XYAndZ | Point4d | number[]): Point4d {\n if (point instanceof Point2d)\n return new Point4d(point.x, point.y, 0, 1);\n if (point instanceof Point3d)\n return new Point4d(point.x, point.y, point.z, 1);\n if (point instanceof Point4d)\n return point.clone();\n // hm ... some flavor of x,y,z subset ...\n if (Array.isArray(point)) {\n const x1 = point.length > 0 ? point[0] : 0.0;\n const y1 = point.length > 1 ? point[1] : 0.0;\n const z1 = point.length > 2 ? point[2] : 0.0;\n const w1 = point.length > 3 ? point[3] : 1.0;\n return new Point4d(x1, y1, z1, w1);\n }\n const x = point.x;\n const y = point.y;\n const z = point.hasOwnProperty(\"z\") ? (point as any).z : 0.0;\n const w = point.hasOwnProperty(\"w\") ? (point as any).w : 1.0;\n return new Point4d(x, y, z, w);\n\n }\n /** Return `point + vector * scalar` */\n public plusScaled(vector: Point4d, scaleFactor: number, result?: Point4d): Point4d {\n return Point4d.create(this.xyzw[0] + vector.xyzw[0] * scaleFactor, this.xyzw[1] + vector.xyzw[1] * scaleFactor, this.xyzw[2] + vector.xyzw[2] * scaleFactor, this.xyzw[3] + vector.xyzw[3] * scaleFactor, result);\n }\n /** Return interpolation between instance and pointB at fraction\n */\n public interpolate(fraction: number, pointB: Point4d, result?: Point4d): Point4d {\n const v = 1.0 - fraction;\n return Point4d.create(this.xyzw[0] * v + pointB.xyzw[0] * fraction, this.xyzw[1] * v + pointB.xyzw[1] * fraction, this.xyzw[2] * v + pointB.xyzw[2] * fraction, this.xyzw[3] * v + pointB.xyzw[3] * fraction, result);\n }\n /** Return `point + vectorA * scalarA + vectorB * scalarB` */\n public plus2Scaled(vectorA: Point4d, scalarA: number, vectorB: Point4d, scalarB: number, result?: Point4d): Point4d {\n return Point4d.create(this.xyzw[0] + vectorA.xyzw[0] * scalarA + vectorB.xyzw[0] * scalarB, this.xyzw[1] + vectorA.xyzw[1] * scalarA + vectorB.xyzw[1] * scalarB, this.xyzw[2] + vectorA.xyzw[2] * scalarA + vectorB.xyzw[2] * scalarB, this.xyzw[3] + vectorA.xyzw[3] * scalarA + vectorB.xyzw[3] * scalarB, result);\n }\n /** Return `point + vectorA * scalarA + vectorB * scalarB + vectorC * scalarC` */\n public plus3Scaled(vectorA: Point4d, scalarA: number, vectorB: Point4d, scalarB: number, vectorC: Point4d, scalarC: number, result?: Point4d): Point4d {\n return Point4d.create(this.xyzw[0] + vectorA.xyzw[0] * scalarA + vectorB.xyzw[0] * scalarB + vectorC.xyzw[0] * scalarC, this.xyzw[1] + vectorA.xyzw[1] * scalarA + vectorB.xyzw[1] * scalarB + vectorC.xyzw[1] * scalarC, this.xyzw[2] + vectorA.xyzw[2] * scalarA + vectorB.xyzw[2] * scalarB + vectorC.xyzw[2] * scalarC, this.xyzw[3] + vectorA.xyzw[3] * scalarA + vectorB.xyzw[3] * scalarB + vectorC.xyzw[3] * scalarC, result);\n }\n /** Return `point + vectorA * scalarA + vectorB * scalarB` */\n public static createAdd2Scaled(vectorA: Point4d, scalarA: number, vectorB: Point4d, scalarB: number, result?: Point4d): Point4d {\n return Point4d.create(vectorA.xyzw[0] * scalarA + vectorB.xyzw[0] * scalarB, vectorA.xyzw[1] * scalarA + vectorB.xyzw[1] * scalarB, vectorA.xyzw[2] * scalarA + vectorB.xyzw[2] * scalarB, vectorA.xyzw[3] * scalarA + vectorB.xyzw[3] * scalarB, result);\n }\n /** Return `point + vectorA \\ scalarA + vectorB * scalarB + vectorC * scalarC` */\n public static createAdd3Scaled(vectorA: Point4d, scalarA: number, vectorB: Point4d, scalarB: number, vectorC: Point4d, scalarC: number, result?: Point4d): Point4d {\n return Point4d.create(vectorA.xyzw[0] * scalarA + vectorB.xyzw[0] * scalarB + vectorC.xyzw[0] * scalarC, vectorA.xyzw[1] * scalarA + vectorB.xyzw[1] * scalarB + vectorC.xyzw[1] * scalarC, vectorA.xyzw[2] * scalarA + vectorB.xyzw[2] * scalarB + vectorC.xyzw[2] * scalarC, vectorA.xyzw[3] * scalarA + vectorB.xyzw[3] * scalarB + vectorC.xyzw[3] * scalarC, result);\n }\n /** Return dot product of (4d) vectors from the instance to targetA and targetB */\n public dotVectorsToTargets(targetA: Point4d, targetB: Point4d): number {\n return (targetA.xyzw[0] - this.xyzw[0]) * (targetB.xyzw[0] - this.xyzw[0]) +\n (targetA.xyzw[1] - this.xyzw[1]) * (targetB.xyzw[1] - this.xyzw[1]) +\n (targetA.xyzw[2] - this.xyzw[2]) * (targetB.xyzw[2] - this.xyzw[2]) +\n (targetA.xyzw[3] - this.xyzw[3]) * (targetB.xyzw[3] - this.xyzw[3]);\n }\n /** return (4d) dot product of the instance and other point. */\n public dotProduct(other: Point4d): number {\n return this.xyzw[0] * other.xyzw[0] + this.xyzw[1] * other.xyzw[1] + this.xyzw[2] * other.xyzw[2] + this.xyzw[3] * other.xyzw[3];\n }\n /** return (4d) dot product of the instance with xyzw */\n public dotProductXYZW(x: number, y: number, z: number, w: number): number {\n return this.xyzw[0] * x + this.xyzw[1] * y + this.xyzw[2] * z + this.xyzw[3] * w;\n }\n /** dotProduct with (point.x, point.y, point.z, 1) Used in PlaneAltitudeEvaluator interface */\n public altitude(point: Point3d): number {\n return this.xyzw[0] * point.x + this.xyzw[1] * point.y + this.xyzw[2] * point.z + this.xyzw[3];\n }\n /** dotProduct with (x, y, z, 1) Used in PlaneAltitudeEvaluator interface */\n public altitudeXYZ(x: number, y: number, z: number): number {\n return this.xyzw[0] * x + this.xyzw[1] * y + this.xyzw[2] * z + this.xyzw[3];\n }\n /** dotProduct with (point.x, point.y, point.z, point.w) Used in PlaneAltitudeEvaluator interface */\n public weightedAltitude(point: Point4d): number {\n return this.xyzw[0] * point.x + this.xyzw[1] * point.y + this.xyzw[2] * point.z + this.xyzw[3] * point.w;\n }\n /** dotProduct with (vector.x, vector.y, vector.z, 0). Used in PlaneAltitudeEvaluator interface */\n public velocity(vector: Vector3d): number {\n return this.xyzw[0] * vector.x + this.xyzw[1] * vector.y + this.xyzw[2] * vector.z;\n }\n /** dotProduct with (x,y,z, 0). Used in PlaneAltitudeEvaluator interface */\n public velocityXYZ(x: number, y: number, z: number): number {\n return this.xyzw[0] * x + this.xyzw[1] * y + this.xyzw[2] * z;\n }\n /**\n * Return the x component of the normal used to evaluate altitude.\n */\n public normalX(): number { return this.x; }\n /**\n * Return the x component of the normal used to evaluate altitude.\n */\n public normalY(): number { return this.y; }\n /**\n * Return the z component of the normal used to evaluate altitude.\n */\n public normalZ(): number { return this.z; }\n\n /** unit X vector */\n public static unitX(): Point4d { return new Point4d(1, 0, 0, 0); }\n /** unit Y vector */\n public static unitY(): Point4d { return new Point4d(0, 1, 0, 0); }\n /** unit Z vector */\n public static unitZ(): Point4d { return new Point4d(0, 0, 1, 0); }\n /** unit W vector */\n public static unitW(): Point4d { return new Point4d(0, 0, 0, 1); }\n /** Divide by denominator, but return undefined if denominator is zero. */\n public safeDivideOrNull(denominator: number, result?: Point4d): Point4d | undefined {\n if (denominator !== 0.0) {\n return this.scale(1.0 / denominator, result);\n }\n return undefined;\n }\n /**\n * * Return xyz projection of spacePoint to the plane (this Point4d is understood as plane coefficients, not point coordinates)\n * * If the xyz part of `this` are all zero, (a clone of) `spacePoint` is returned.\n */\n public projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d {\n return this.projectXYZToPlane(spacePoint.x, spacePoint.y, spacePoint.z, result);\n }\n /** Return the projection of (x,y,z) onto the plane. */\n public override projectXYZToPlane(x: number, y: number, z: number, result?: Point3d): Point3d {\n const h = this.altitudeXYZ(x, y, z);\n const nn = this.magnitudeSquaredXYZ();\n // this unusual tol is needed so that toPlane3dByOriginAndUnitNormal agrees with its original implementation\n const alpha = Geometry.conditionalDivideCoordinate(-h, nn, Geometry.largeFractionResult * Geometry.largeFractionResult);\n if (alpha === undefined)\n return Point3d.create(x, y, z, result);\n return Point3d.create(x + alpha * this.x, y + alpha * this.y, z + alpha * this.z, result);\n }\n /** scale all components (including w!!) */\n public scale(scale: number, result?: Point4d): Point4d {\n result = result ? result : new Point4d();\n result.xyzw[0] = this.xyzw[0] * scale;\n result.xyzw[1] = this.xyzw[1] * scale;\n result.xyzw[2] = this.xyzw[2] * scale;\n result.xyzw[3] = this.xyzw[3] * scale;\n return result;\n }\n /** Negate components (including w!!) */\n public negate(result?: Point4d): Point4d {\n result = result ? result : new Point4d();\n result.xyzw[0] = -this.xyzw[0];\n result.xyzw[1] = -this.xyzw[1];\n result.xyzw[2] = -this.xyzw[2];\n result.xyzw[3] = -this.xyzw[3];\n return result;\n }\n /**\n * If `this.w` is nonzero, return a 4d point `(x/w,y/w,z/w, 1)`\n * If `this.w` is zero, return undefined.\n * @param result optional result\n */\n public normalizeWeight(result?: Point4d): Point4d | undefined {\n const mag = Geometry.correctSmallFraction(this.xyzw[3]);\n result = result ? result : new Point4d();\n return this.safeDivideOrNull(mag, result);\n }\n /**\n * If `this.w` is nonzero, return a 3d point `(x/w,y/w,z/w)`\n * If `this.w` is zero, return undefined.\n * @param result optional result\n */\n public realPoint(result?: Point3d): Point3d | undefined {\n const mag = Geometry.correctSmallFraction(this.xyzw[3]);\n if (mag === 0.0)\n return undefined;\n const a = 1.0 / mag; // in zero case everything multiplies right back to true zero.\n return Point3d.create(this.xyzw[0] * a, this.xyzw[1] * a, this.xyzw[2] * a, result);\n }\n\n /** Convert the homogeneous point to a (strongly typed) point or vector.\n * * If `this.w` is nonzero, return a Point3d `(x/w,y/w,z/w)`\n * * If `this.w` is zero, return a Vector3d `(x,y,z)`\n */\n public realPointOrVector(): Point3d | Vector3d {\n const mag = Geometry.correctSmallFraction(this.xyzw[3]);\n if (mag === 0.0)\n return Vector3d.create(this.x, this.y, this.z);\n const a = 1.0 / mag; // in zero case everything multiplies right back to true zero.\n return Point3d.create(this.x * a, this.y * a, this.z * a);\n }\n /**\n * * If w is nonzero, return Point3d with x/w,y/w,z/w.\n * * If w is zero, return 000\n * @param x x coordinate\n * @param y y coordinate\n * @param z z coordinate\n * @param w w coordinate\n * @param result optional result\n */\n public static createRealPoint3dDefault000(x: number, y: number, z: number, w: number, result?: Point3d): Point3d {\n const mag = Geometry.correctSmallFraction(w);\n const a = mag === 0 ? 0.0 : (1.0 / mag); // in zero case everything multiplies right back to true zero.\n return Point3d.create(x * a, y * a, z * a, result);\n }\n /**\n * * If w is nonzero, return Vector3d which is the derivative of the projected xyz with given w and 4d derivatives.\n * * If w is zero, return 000\n * @param x x coordinate\n * @param y y coordinate\n * @param z z coordinate\n * @param w w coordinate\n * @param dx x coordinate of derivative\n * @param dy y coordinate of derivative\n * @param dz z coordinate of derivative\n * @param dw w coordinate of derivative\n * @param result optional result\n */\n public static createRealDerivativeRay3dDefault000(x: number, y: number, z: number, w: number, dx: number, dy: number, dz: number, dw: number, result?: Ray3d): Ray3d {\n const mag = Geometry.correctSmallFraction(w);\n // real point is X/w.\n // real derivative is (X' * w - X *w) / ww, and weight is always 0 by cross products.\n const a = mag === 0 ? 0.0 : (1.0 / mag); // in zero case everything multiplies right back to true zero.\n const aa = a * a;\n return Ray3d.createXYZUVW(x * a, y * a, z * a, (dx * w - dw * x) * aa, (dy * w - dw * y) * aa, (dz * w - dw * z) * aa, result);\n }\n /**\n * * If w is nonzero, return Vector3d which is the derivative of the projected xyz with given w and 4d derivatives.\n * * If w is zero, return 000\n * @param x x coordinate\n * @param y y coordinate\n * @param z z coordinate\n * @param w w coordinate\n * @param dx x coordinate of derivative\n * @param dy y coordinate of derivative\n * @param dz z coordinate of derivative\n * @param dw w coordinate of derivative\n * @param result optional result\n */\n public static createRealDerivativePlane3dByOriginAndVectorsDefault000(x: number, y: number, z: number, w: number, dx: number, dy: number, dz: number, dw: number, ddx: number, ddy: number, ddz: number, ddw: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\n const mag = Geometry.correctSmallFraction(w);\n // real point is X/w.\n // real derivative is (X' * w - X *w) / ww, and weight is always 0 by cross products.\n const a = mag === 0 ? 0.0 : (1.0 / mag); // in zero case everything multiplies right back to true zero.\n const aa = a * a;\n const fx = x * a;\n const fy = y * a;\n const fz = z * a;\n const dfx = (dx * w - dw * x) * aa;\n const dfy = (dy * w - dw * y) * aa;\n const dfz = (dz * w - dw * z) * aa;\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(fx, fy, fz, dfx, dfy, dfz, quotientDerivative2(ddx, dw, ddw, fx, dfx, a), quotientDerivative2(ddy, dw, ddw, fy, dfy, a), quotientDerivative2(ddz, dw, ddw, fz, dfz, a), result);\n }\n /**\n * * If this.w is nonzero, return Point3d with x/w,y/w,z/w.\n * * If this.w is zero, return 000\n */\n public realPointDefault000(result?: Point3d): Point3d {\n const mag = Geometry.correctSmallFraction(this.xyzw[3]);\n if (mag === 0.0)\n return Point3d.create(0, 0, 0, result);\n result = result ? result : new Point3d();\n const a = 1.0 / mag;\n return Point3d.create(this.xyzw[0] * a, this.xyzw[1] * a, this.xyzw[2] * a, result);\n }\n /** divide all components (x,y,z,w) by the 4d magnitude.\n *\n * * This is appropriate for normalizing a quaternion\n * * Use normalizeWeight to divide by the w component.\n */\n public normalizeXYZW(result?: Point4d): Point4d | undefined {\n const mag = Geometry.correctSmallFraction(this.magnitudeXYZW());\n result = result ? result : new Point4d();\n return this.safeDivideOrNull(mag, result);\n }\n\n /**\n * Return the determinant of the 3x3 matrix using components i,j,k of the 3 inputs.\n */\n public static determinantIndexed3X3(pointA: Point4d, pointB: Point4d, pointC: Point4d, i: number, j: number, k: number) {\n return Geometry.tripleProduct(\n pointA.xyzw[i], pointA.xyzw[j], pointA.xyzw[k],\n pointB.xyzw[i], pointB.xyzw[j], pointB.xyzw[k],\n pointC.xyzw[i], pointC.xyzw[j], pointC.xyzw[k]);\n }\n /**\n * Return a Point4d perpendicular to all 3 inputs. (A higher level cross product concept)\n * @param pointA first point\n * @param pointB second point\n * @param pointC third point\n */\n public static perpendicularPoint4dPlane(pointA: Point4d, pointB: Point4d, pointC: Point4d): Point4d {\n return Point4d.create(\n Point4d.determinantIndexed3X3(pointA, pointB, pointC, 1, 2, 3),\n -Point4d.determinantIndexed3X3(pointA, pointB, pointC, 2, 3, 0),\n Point4d.determinantIndexed3X3(pointA, pointB, pointC, 3, 0, 1),\n -Point4d.determinantIndexed3X3(pointA, pointB, pointC, 0, 1, 2));\n }\n /** Treating this Point4d as plane coefficients, convert to origin and normal form. */\n public toPlane3dByOriginAndUnitNormal(result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal | undefined {\n return Plane3dByOriginAndUnitNormal.createFrom(this, result);\n }\n /** Normalize so sum of squares of all 4 coordinates is 1. */\n public normalizeQuaternion() {\n const magnitude = Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);\n\n if (magnitude > 0.0) {\n const f = 1.0 / magnitude;\n this.x *= f;\n this.y *= f;\n this.z *= f;\n this.w *= f;\n }\n return magnitude;\n }\n /** Return a (normalized) quaternion interpolated between two quaternions. */\n public static interpolateQuaternions(quaternion0: Point4d, fractionParameter: number, quaternion1: Point4d, result?: Point4d): Point4d {\n if (!result)\n result = new Point4d();\n const maxSafeCosine = 0.9995;\n\n // return exact quaternions for special values\n if (0.0 === fractionParameter) {\n result = quaternion0;\n return result;\n }\n if (1.0 === fractionParameter) {\n result = quaternion1;\n return result;\n }\n if (0.5 === fractionParameter) {\n quaternion0.plus(quaternion1, result);\n result.normalizeQuaternion();\n return result;\n }\n\n const q0 = quaternion0.clone();\n const q1 = quaternion1.clone();\n let dot = quaternion0.dotProduct(quaternion1);\n\n // prevent interpolation through the longer great arc\n if (dot < 0.0) {\n q1.negate(q1);\n dot = -dot;\n }\n\n // if nearly parallel, use interpolate and renormalize .\n if (dot > maxSafeCosine) {\n q0.interpolate(fractionParameter, q1, result);\n result.normalizeQuaternion();\n return result;\n }\n\n // safety check\n if (dot < -1.0)\n dot = -1.0;\n else if (dot > 1.0)\n dot = 1.0;\n\n // create orthonormal basis {q0, q2}\n const q2 = new Point4d();\n q1.plusScaled(q0, -dot, q2); // bsiDPoint4d_addScaledDPoint4d(& q2, & q1, & q0, -dot);\n q2.normalizeQuaternion();\n\n const angle = Math.acos(dot);\n const angleOfInterpolation = angle * fractionParameter;\n result = Point4d.createAdd2Scaled(q0, Math.cos(angleOfInterpolation), q2, Math.sin(angleOfInterpolation));\n return result;\n }\n /** Measure the \"angle\" between two points, using all 4 components in the dot product that\n * gives the cosine of the angle.\n */\n public radiansToPoint4dXYZW(other: Point4d): number | undefined {\n const magA = this.magnitudeXYZW();\n const magB = other.magnitudeXYZW();\n const dot = this.dotProduct(other); // == cos (theta) * magA * magB\n const cos = Geometry.conditionalDivideFraction(dot, magA * magB);\n if (cos === undefined)\n return undefined;\n return Math.acos(cos);\n }\n}\n"]}
1
+ {"version":3,"file":"Point4d.js","sourceRoot":"","sources":["../../../src/geometry4d/Point4d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAmB,QAAQ,EAA0B,MAAM,aAAa,CAAC;AAChF,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;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jE,IAAI,GAAG,KAAK,SAAS;YACnB,OAAO,SAAS,CAAC;QACnB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;CACF","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\nimport { BeJSONFunctions, Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\r\nimport { Plane3d } from \"../geometry3d/Plane3d\";\r\nimport { Plane3dByOriginAndUnitNormal } from \"../geometry3d/Plane3dByOriginAndUnitNormal\";\r\nimport { Plane3dByOriginAndVectors } from \"../geometry3d/Plane3dByOriginAndVectors\";\r\nimport { Point2d } from \"../geometry3d/Point2dVector2d\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { XAndY, XYAndZ } from \"../geometry3d/XYZProps\";\r\n\r\n/**\r\n * 4d point packed in an array of 4 numbers.\r\n * @public\r\n */\r\nexport type Point4dProps = number[];\r\n/**\r\n *\r\n * @param ddg numerator second derivative\r\n * @param dh denominator derivative\r\n * @param ddh denominator second derivative\r\n * @param f primary function (g/h)\r\n * @param df derivative of (g/h)\r\n * @param divH = (1/h)\r\n * @internal\r\n */\r\nfunction quotientDerivative2(ddg: number, dh: number, ddh: number,\r\n f: number, df: number, divH: number): number {\r\n return divH * (ddg - 2.0 * df * dh - f * ddh);\r\n}\r\n\r\n/** 4 Dimensional point (x,y,z,w) used in perspective calculations.\r\n * * the coordinates are stored in a Float64Array of length 4.\r\n * * properties `x`, `y`, `z`, `w` access array members.\r\n * *\r\n * * The coordinates are physically stored as a single Float64Array with 4 entries. (w last)\r\n * *\r\n * @public\r\n */\r\nexport class Point4d extends Plane3d implements BeJSONFunctions {\r\n /** x,y,z,w are packed into a Float64Array */\r\n public xyzw: Float64Array;\r\n /** Set x,y,z,w of this point. */\r\n public set(x: number = 0, y: number = 0, z: number = 0, w: number = 0): Point4d {\r\n this.xyzw[0] = x;\r\n this.xyzw[1] = y;\r\n this.xyzw[2] = z;\r\n this.xyzw[3] = w;\r\n return this;\r\n }\r\n /** Set a component by index.\r\n * * No change if index is out of range.\r\n */\r\n public setComponent(index: number, value: number) {\r\n if (index >= 0 && index < 4) {\r\n this.xyzw[index] = value;\r\n }\r\n }\r\n /** The x component. */\r\n public get x() { return this.xyzw[0]; }\r\n public set x(val: number) { this.xyzw[0] = val; }\r\n /** The y component. */\r\n public get y() { return this.xyzw[1]; }\r\n public set y(val: number) { this.xyzw[1] = val; }\r\n /** The z component. */\r\n public get z() { return this.xyzw[2]; }\r\n public set z(val: number) { this.xyzw[2] = val; }\r\n /** The w component of this point. */\r\n public get w() { return this.xyzw[3]; }\r\n public set w(val: number) { this.xyzw[3] = val; }\r\n /** Construct from coordinates. */\r\n protected constructor(x: number = 0, y: number = 0, z: number = 0, w: number = 0) {\r\n super();\r\n this.xyzw = new Float64Array(4);\r\n this.xyzw[0] = x;\r\n this.xyzw[1] = y;\r\n this.xyzw[2] = z;\r\n this.xyzw[3] = w;\r\n }\r\n /** Return a Point4d with specified x,y,z,w */\r\n public static create(x: number = 0, y: number = 0, z: number = 0, w: number = 0, result?: Point4d): Point4d {\r\n return result ? result.set(x, y, z, w) : new Point4d(x, y, z, w);\r\n }\r\n /**\r\n * Create a \"Point4d as a plane\" from \"any\" other [[PlaneAltitudeEvaluator]] type.\r\n * @param source\r\n * @returns\r\n */\r\n public static createPlaneFrom(source: PlaneAltitudeEvaluator): Point4d | undefined {\r\n return new Point4d(source.normalX(), source.normalY(), source.normalZ(), source.altitudeXYZ(0, 0, 0));\r\n }\r\n /** Copy coordinates from `other`. */\r\n public setFrom(other: Point4d): Point4d {\r\n this.xyzw[0] = other.xyzw[0];\r\n this.xyzw[1] = other.xyzw[1];\r\n this.xyzw[2] = other.xyzw[2];\r\n this.xyzw[3] = other.xyzw[3];\r\n return this;\r\n }\r\n /** Clone this point */\r\n public clone(result?: Point4d): Point4d {\r\n return result ? result.setFrom(this) : new Point4d(this.xyzw[0], this.xyzw[1], this.xyzw[2], this.xyzw[3]);\r\n }\r\n /** Set this point's xyzw from a json array `[x,y,z,w]` */\r\n public setFromJSON(json?: Point4dProps) {\r\n if (Geometry.isNumberArray(json, 4))\r\n this.set(json[0], json[1], json[2], json[3]);\r\n else\r\n this.set(0, 0, 0, 0);\r\n }\r\n\r\n /** Create a new point with coordinates from a json array `[x,y,z,w]` */\r\n public static fromJSON(json?: Point4dProps): Point4d {\r\n const result = new Point4d();\r\n result.setFromJSON(json);\r\n return result;\r\n }\r\n /** Near-equality test, using `Geometry.isSameCoordinate` on all 4 x,y,z,w */\r\n public isAlmostEqual(other: Point4d, tolerance: number = Geometry.smallMetricDistance): boolean {\r\n return Geometry.isSameCoordinate(this.x, other.x, tolerance)\r\n && Geometry.isSameCoordinate(this.y, other.y, tolerance)\r\n && Geometry.isSameCoordinate(this.z, other.z, tolerance)\r\n && Geometry.isSameCoordinate(this.w, other.w, tolerance);\r\n }\r\n /**\r\n * Test for same coordinate by direct x,y,z,w args\r\n * @param x x to test\r\n * @param y y to test\r\n * @param z z to test\r\n * @param w w to test\r\n */\r\n public isAlmostEqualXYZW(x: number, y: number, z: number, w: number, tolerance: number = Geometry.smallMetricDistance): boolean {\r\n return Geometry.isSameCoordinate(this.x, x, tolerance)\r\n && Geometry.isSameCoordinate(this.y, y, tolerance)\r\n && Geometry.isSameCoordinate(this.z, z, tolerance)\r\n && Geometry.isSameCoordinate(this.w, w, tolerance);\r\n }\r\n\r\n /**\r\n * Convert an Angle to a JSON object.\r\n * @return {*} [x,y,z,w]\r\n */\r\n public toJSON(): Point4dProps {\r\n return [this.xyzw[0], this.xyzw[1], this.xyzw[2], this.xyzw[3]];\r\n }\r\n /** Return the 4d distance from this point to other, with all 4 components squared into the hypotenuse.\r\n * * x,y,z,w all participate without normalization.\r\n */\r\n public distanceXYZW(other: Point4d): number {\r\n return Geometry.hypotenuseXYZW(other.xyzw[0] - this.xyzw[0], other.xyzw[1] - this.xyzw[1], other.xyzw[2] - this.xyzw[2], other.xyzw[3] - this.xyzw[3]);\r\n }\r\n /** Return the squared 4d distance from this point to other, with all 4 components squared into the hypotenuse.\r\n * * x,y,z,w all participate without normalization.\r\n */\r\n public distanceSquaredXYZW(other: Point4d): number {\r\n return Geometry.hypotenuseSquaredXYZW(other.xyzw[0] - this.xyzw[0], other.xyzw[1] - this.xyzw[1], other.xyzw[2] - this.xyzw[2], other.xyzw[3] - this.xyzw[3]);\r\n }\r\n /** Return the xy distance between the instance and `other` after normalizing by weights */\r\n public realDistanceXY(other: Point4d): number | undefined {\r\n const wA = this.w;\r\n const wB = other.w;\r\n if (Geometry.isSmallMetricDistance(wA) || Geometry.isSmallMetricDistance(wB))\r\n return undefined;\r\n return Geometry.hypotenuseXY(other.xyzw[0] / wB - this.xyzw[0] / wA, other.xyzw[1] / wB - this.xyzw[1] / wA);\r\n }\r\n /** Return the xy squared distance between the instance and `other` after normalizing by weights */\r\n public realDistanceSquaredXY(other: Point4d): number | undefined {\r\n const wA = this.w;\r\n const wB = other.w;\r\n if (Geometry.isSmallMetricDistance(wA) || Geometry.isSmallMetricDistance(wB))\r\n return undefined;\r\n return Geometry.hypotenuseSquaredXY(other.xyzw[0] / wB - this.xyzw[0] / wA, other.xyzw[1] / wB - this.xyzw[1] / wA);\r\n }\r\n /** Return the largest absolute distance between corresponding components\r\n * * x,y,z,w all participate without normalization.\r\n */\r\n public maxDiff(other: Point4d): number {\r\n return Math.max(Math.abs(other.xyzw[0] - this.xyzw[0]), Math.abs(other.xyzw[1] - this.xyzw[1]), Math.abs(other.xyzw[2] - this.xyzw[2]), Math.abs(other.xyzw[3] - this.xyzw[3]));\r\n }\r\n /** Return the largest absolute entry of all 4 components x,y,z,w */\r\n public maxAbs(): number {\r\n return Math.max(Math.abs(this.xyzw[0]), Math.abs(this.xyzw[1]), Math.abs(this.xyzw[2]), Math.abs(this.xyzw[3]));\r\n }\r\n /** Returns the magnitude including all 4 components x,y,z,w */\r\n public magnitudeXYZW(): number {\r\n return Geometry.hypotenuseXYZW(this.xyzw[0], this.xyzw[1], this.xyzw[2], this.xyzw[3]);\r\n }\r\n /** Returns the magnitude of the leading xyz components. w is ignored. (i.e. the leading xyz are NOT divided by w.) */\r\n public magnitudeSquaredXYZ(): number {\r\n return Geometry.hypotenuseSquaredXYZ(this.xyzw[0], this.xyzw[1], this.xyzw[2]);\r\n }\r\n\r\n /** Return the difference (this-other) using all 4 components x,y,z,w */\r\n public minus(other: Point4d, result?: Point4d): Point4d {\r\n return Point4d.create(this.xyzw[0] - other.xyzw[0], this.xyzw[1] - other.xyzw[1], this.xyzw[2] - other.xyzw[2], this.xyzw[3] - other.xyzw[3], result);\r\n }\r\n /** Return `((other.w * this) - (this.w * other))` */\r\n public crossWeightedMinus(other: Point4d, result?: Vector3d): Vector3d {\r\n const wa = this.xyzw[3];\r\n const wb = other.xyzw[3];\r\n return Vector3d.create(wb * this.xyzw[0] - wa * other.xyzw[0], wb * this.xyzw[1] - wa * other.xyzw[1], wb * this.xyzw[2] - wa * other.xyzw[2], result);\r\n }\r\n /** Return `((other.w * this) - (this.w * other))`, with other.w known to be 1 */\r\n public crossWeightedMinusPoint3d(other: Point3d, result?: Vector3d): Vector3d {\r\n const wa = this.xyzw[3];\r\n return Vector3d.create(this.xyzw[0] - wa * other.x, this.xyzw[1] - wa * other.y, this.xyzw[2] - wa * other.z, result);\r\n }\r\n /** Return the sum of this and other, using all 4 components x,y,z,w */\r\n public plus(other: Point4d, result?: Point4d): Point4d {\r\n return Point4d.create(this.xyzw[0] + other.xyzw[0], this.xyzw[1] + other.xyzw[1], this.xyzw[2] + other.xyzw[2], this.xyzw[3] + other.xyzw[3], result);\r\n }\r\n /** Test if all components are nearly zero. */\r\n public get isAlmostZero(): boolean {\r\n return Geometry.isSmallMetricDistance(this.maxAbs());\r\n }\r\n /** Create a point with zero in all coordinates. */\r\n public static createZero(): Point4d { return new Point4d(0, 0, 0, 0); }\r\n /**\r\n * Create plane coefficients for the plane containing pointA, pointB, and 0010.\r\n * @param pointA first point\r\n * @param pointB second point\r\n */\r\n public static createPlanePointPointZ(pointA: Point4d, pointB: Point4d, result?: Point4d) {\r\n return Point4d.create(pointA.y * pointB.w - pointA.w * pointB.y, pointA.w * pointB.x - pointA.x * pointB.w, 0.0, pointA.x * pointB.y - pointA.y * pointB.x, result);\r\n }\r\n /**\r\n * extract 3 consecutive numbers from a Float64Array into the xyz values of a Point4d with w = 1.\r\n * @param data buffer of numbers\r\n * @param xIndex first index for x,y,z sequence\r\n */\r\n public static createFromPackedXYZ(data: Float64Array, xIndex: number = 0, result?: Point4d): Point4d | undefined {\r\n if (xIndex >= 0 && xIndex + 2 < data.length)\r\n return Point4d.create(data[xIndex], data[xIndex + 1], data[xIndex + 2], 1.0, result);\r\n return undefined;\r\n }\r\n /**\r\n * extract 4 consecutive numbers from a Float64Array into a Point4d.\r\n * @param data buffer of numbers\r\n * @param xIndex first index for x,y,z,w sequence\r\n */\r\n public static createFromPacked(data: Float64Array, xIndex: number = 0, result?: Point4d): Point4d | undefined {\r\n if (xIndex >= 0 && xIndex + 3 < data.length)\r\n return Point4d.create(data[xIndex], data[xIndex + 1], data[xIndex + 2], data[xIndex + 3], result);\r\n return undefined;\r\n }\r\n /**\r\n * extract 4 consecutive numbers from a Float64Array into a Point4d.\r\n * @param data buffer of numbers\r\n * @param xIndex first index for x,y,z,w sequence. Assumed to be a valid index!\r\n * @deprecated in 4.3.0 - will not be removed until after 2026-06-13. Use createFromPacked instead.\r\n */\r\n public static createFromPackedXYZW(data: Float64Array, xIndex: number = 0, result?: Point4d): Point4d {\r\n return Point4d.create(data[xIndex], data[xIndex + 1], data[xIndex + 2], data[xIndex + 3], result);\r\n }\r\n /** Create a `Point4d` with x,y,z from an `XYAndZ` input, and w from a separate number. */\r\n public static createFromPointAndWeight(xyz: XYAndZ, w: number): Point4d {\r\n return new Point4d(xyz.x, xyz.y, xyz.z, w);\r\n }\r\n /** Create a `Point4d` from\r\n * * Point2d, Point3d, or Point4d\r\n * * other structure with members x,y and optional z,w\r\n * * array of numbers\r\n * * default z is 0.0\r\n * * default w is 1.0 (array[3] can replace)\r\n */\r\n public static createFromPoint(point: XAndY | XYAndZ | Point4d | number[]): Point4d {\r\n if (point instanceof Point2d)\r\n return new Point4d(point.x, point.y, 0, 1);\r\n if (point instanceof Point3d)\r\n return new Point4d(point.x, point.y, point.z, 1);\r\n if (point instanceof Point4d)\r\n return point.clone();\r\n // hm ... some flavor of x,y,z subset ...\r\n if (Array.isArray(point)) {\r\n const x1 = point.length > 0 ? point[0] : 0.0;\r\n const y1 = point.length > 1 ? point[1] : 0.0;\r\n const z1 = point.length > 2 ? point[2] : 0.0;\r\n const w1 = point.length > 3 ? point[3] : 1.0;\r\n return new Point4d(x1, y1, z1, w1);\r\n }\r\n const x = point.x;\r\n const y = point.y;\r\n const z = point.hasOwnProperty(\"z\") ? (point as any).z : 0.0;\r\n const w = point.hasOwnProperty(\"w\") ? (point as any).w : 1.0;\r\n return new Point4d(x, y, z, w);\r\n\r\n }\r\n /** Return `point + vector * scalar` */\r\n public plusScaled(vector: Point4d, scaleFactor: number, result?: Point4d): Point4d {\r\n return Point4d.create(this.xyzw[0] + vector.xyzw[0] * scaleFactor, this.xyzw[1] + vector.xyzw[1] * scaleFactor, this.xyzw[2] + vector.xyzw[2] * scaleFactor, this.xyzw[3] + vector.xyzw[3] * scaleFactor, result);\r\n }\r\n /** Return interpolation between instance and pointB at fraction\r\n */\r\n public interpolate(fraction: number, pointB: Point4d, result?: Point4d): Point4d {\r\n const v = 1.0 - fraction;\r\n return Point4d.create(this.xyzw[0] * v + pointB.xyzw[0] * fraction, this.xyzw[1] * v + pointB.xyzw[1] * fraction, this.xyzw[2] * v + pointB.xyzw[2] * fraction, this.xyzw[3] * v + pointB.xyzw[3] * fraction, result);\r\n }\r\n /** Return `point + vectorA * scalarA + vectorB * scalarB` */\r\n public plus2Scaled(vectorA: Point4d, scalarA: number, vectorB: Point4d, scalarB: number, result?: Point4d): Point4d {\r\n return Point4d.create(this.xyzw[0] + vectorA.xyzw[0] * scalarA + vectorB.xyzw[0] * scalarB, this.xyzw[1] + vectorA.xyzw[1] * scalarA + vectorB.xyzw[1] * scalarB, this.xyzw[2] + vectorA.xyzw[2] * scalarA + vectorB.xyzw[2] * scalarB, this.xyzw[3] + vectorA.xyzw[3] * scalarA + vectorB.xyzw[3] * scalarB, result);\r\n }\r\n /** Return `point + vectorA * scalarA + vectorB * scalarB + vectorC * scalarC` */\r\n public plus3Scaled(vectorA: Point4d, scalarA: number, vectorB: Point4d, scalarB: number, vectorC: Point4d, scalarC: number, result?: Point4d): Point4d {\r\n return Point4d.create(this.xyzw[0] + vectorA.xyzw[0] * scalarA + vectorB.xyzw[0] * scalarB + vectorC.xyzw[0] * scalarC, this.xyzw[1] + vectorA.xyzw[1] * scalarA + vectorB.xyzw[1] * scalarB + vectorC.xyzw[1] * scalarC, this.xyzw[2] + vectorA.xyzw[2] * scalarA + vectorB.xyzw[2] * scalarB + vectorC.xyzw[2] * scalarC, this.xyzw[3] + vectorA.xyzw[3] * scalarA + vectorB.xyzw[3] * scalarB + vectorC.xyzw[3] * scalarC, result);\r\n }\r\n /** Return `point + vectorA * scalarA + vectorB * scalarB` */\r\n public static createAdd2Scaled(vectorA: Point4d, scalarA: number, vectorB: Point4d, scalarB: number, result?: Point4d): Point4d {\r\n return Point4d.create(vectorA.xyzw[0] * scalarA + vectorB.xyzw[0] * scalarB, vectorA.xyzw[1] * scalarA + vectorB.xyzw[1] * scalarB, vectorA.xyzw[2] * scalarA + vectorB.xyzw[2] * scalarB, vectorA.xyzw[3] * scalarA + vectorB.xyzw[3] * scalarB, result);\r\n }\r\n /** Return `point + vectorA \\ scalarA + vectorB * scalarB + vectorC * scalarC` */\r\n public static createAdd3Scaled(vectorA: Point4d, scalarA: number, vectorB: Point4d, scalarB: number, vectorC: Point4d, scalarC: number, result?: Point4d): Point4d {\r\n return Point4d.create(vectorA.xyzw[0] * scalarA + vectorB.xyzw[0] * scalarB + vectorC.xyzw[0] * scalarC, vectorA.xyzw[1] * scalarA + vectorB.xyzw[1] * scalarB + vectorC.xyzw[1] * scalarC, vectorA.xyzw[2] * scalarA + vectorB.xyzw[2] * scalarB + vectorC.xyzw[2] * scalarC, vectorA.xyzw[3] * scalarA + vectorB.xyzw[3] * scalarB + vectorC.xyzw[3] * scalarC, result);\r\n }\r\n /** Return dot product of (4d) vectors from the instance to targetA and targetB */\r\n public dotVectorsToTargets(targetA: Point4d, targetB: Point4d): number {\r\n return (targetA.xyzw[0] - this.xyzw[0]) * (targetB.xyzw[0] - this.xyzw[0]) +\r\n (targetA.xyzw[1] - this.xyzw[1]) * (targetB.xyzw[1] - this.xyzw[1]) +\r\n (targetA.xyzw[2] - this.xyzw[2]) * (targetB.xyzw[2] - this.xyzw[2]) +\r\n (targetA.xyzw[3] - this.xyzw[3]) * (targetB.xyzw[3] - this.xyzw[3]);\r\n }\r\n /** return (4d) dot product of the instance and other point. */\r\n public dotProduct(other: Point4d): number {\r\n return this.xyzw[0] * other.xyzw[0] + this.xyzw[1] * other.xyzw[1] + this.xyzw[2] * other.xyzw[2] + this.xyzw[3] * other.xyzw[3];\r\n }\r\n /** return (4d) dot product of the instance with xyzw */\r\n public dotProductXYZW(x: number, y: number, z: number, w: number): number {\r\n return this.xyzw[0] * x + this.xyzw[1] * y + this.xyzw[2] * z + this.xyzw[3] * w;\r\n }\r\n /** dotProduct with (point.x, point.y, point.z, 1) Used in PlaneAltitudeEvaluator interface */\r\n public altitude(point: Point3d): number {\r\n return this.xyzw[0] * point.x + this.xyzw[1] * point.y + this.xyzw[2] * point.z + this.xyzw[3];\r\n }\r\n /** dotProduct with (x, y, z, 1) Used in PlaneAltitudeEvaluator interface */\r\n public altitudeXYZ(x: number, y: number, z: number): number {\r\n return this.xyzw[0] * x + this.xyzw[1] * y + this.xyzw[2] * z + this.xyzw[3];\r\n }\r\n /** dotProduct with (point.x, point.y, point.z, point.w) Used in PlaneAltitudeEvaluator interface */\r\n public weightedAltitude(point: Point4d): number {\r\n return this.xyzw[0] * point.x + this.xyzw[1] * point.y + this.xyzw[2] * point.z + this.xyzw[3] * point.w;\r\n }\r\n /** dotProduct with (vector.x, vector.y, vector.z, 0). Used in PlaneAltitudeEvaluator interface */\r\n public velocity(vector: Vector3d): number {\r\n return this.xyzw[0] * vector.x + this.xyzw[1] * vector.y + this.xyzw[2] * vector.z;\r\n }\r\n /** dotProduct with (x,y,z, 0). Used in PlaneAltitudeEvaluator interface */\r\n public velocityXYZ(x: number, y: number, z: number): number {\r\n return this.xyzw[0] * x + this.xyzw[1] * y + this.xyzw[2] * z;\r\n }\r\n /**\r\n * Return the x component of the normal used to evaluate altitude.\r\n */\r\n public normalX(): number { return this.x; }\r\n /**\r\n * Return the x component of the normal used to evaluate altitude.\r\n */\r\n public normalY(): number { return this.y; }\r\n /**\r\n * Return the z component of the normal used to evaluate altitude.\r\n */\r\n public normalZ(): number { return this.z; }\r\n\r\n /** unit X vector */\r\n public static unitX(): Point4d { return new Point4d(1, 0, 0, 0); }\r\n /** unit Y vector */\r\n public static unitY(): Point4d { return new Point4d(0, 1, 0, 0); }\r\n /** unit Z vector */\r\n public static unitZ(): Point4d { return new Point4d(0, 0, 1, 0); }\r\n /** unit W vector */\r\n public static unitW(): Point4d { return new Point4d(0, 0, 0, 1); }\r\n /** Divide by denominator, but return undefined if denominator is zero. */\r\n public safeDivideOrNull(denominator: number, result?: Point4d): Point4d | undefined {\r\n if (denominator !== 0.0) {\r\n return this.scale(1.0 / denominator, result);\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * * Return xyz projection of spacePoint to the plane (this Point4d is understood as plane coefficients, not point coordinates)\r\n * * If the xyz part of `this` are all zero, (a clone of) `spacePoint` is returned.\r\n */\r\n public projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d {\r\n return this.projectXYZToPlane(spacePoint.x, spacePoint.y, spacePoint.z, result);\r\n }\r\n /** Return the projection of (x,y,z) onto the plane. */\r\n public override projectXYZToPlane(x: number, y: number, z: number, result?: Point3d): Point3d {\r\n const h = this.altitudeXYZ(x, y, z);\r\n const nn = this.magnitudeSquaredXYZ();\r\n // this unusual tol is needed so that toPlane3dByOriginAndUnitNormal agrees with its original implementation\r\n const alpha = Geometry.conditionalDivideCoordinate(-h, nn, Geometry.largeFractionResult * Geometry.largeFractionResult);\r\n if (alpha === undefined)\r\n return Point3d.create(x, y, z, result);\r\n return Point3d.create(x + alpha * this.x, y + alpha * this.y, z + alpha * this.z, result);\r\n }\r\n /** scale all components (including w!!) */\r\n public scale(scale: number, result?: Point4d): Point4d {\r\n result = result ? result : new Point4d();\r\n result.xyzw[0] = this.xyzw[0] * scale;\r\n result.xyzw[1] = this.xyzw[1] * scale;\r\n result.xyzw[2] = this.xyzw[2] * scale;\r\n result.xyzw[3] = this.xyzw[3] * scale;\r\n return result;\r\n }\r\n /** Negate components (including w!!) */\r\n public negate(result?: Point4d): Point4d {\r\n result = result ? result : new Point4d();\r\n result.xyzw[0] = -this.xyzw[0];\r\n result.xyzw[1] = -this.xyzw[1];\r\n result.xyzw[2] = -this.xyzw[2];\r\n result.xyzw[3] = -this.xyzw[3];\r\n return result;\r\n }\r\n /**\r\n * If `this.w` is nonzero, return a 4d point `(x/w,y/w,z/w, 1)`\r\n * If `this.w` is zero, return undefined.\r\n * @param result optional result\r\n */\r\n public normalizeWeight(result?: Point4d): Point4d | undefined {\r\n const mag = Geometry.correctSmallFraction(this.xyzw[3]);\r\n result = result ? result : new Point4d();\r\n return this.safeDivideOrNull(mag, result);\r\n }\r\n /**\r\n * If `this.w` is nonzero, return a 3d point `(x/w,y/w,z/w)`\r\n * If `this.w` is zero, return undefined.\r\n * @param result optional result\r\n */\r\n public realPoint(result?: Point3d): Point3d | undefined {\r\n const mag = Geometry.correctSmallFraction(this.xyzw[3]);\r\n if (mag === 0.0)\r\n return undefined;\r\n const a = 1.0 / mag; // in zero case everything multiplies right back to true zero.\r\n return Point3d.create(this.xyzw[0] * a, this.xyzw[1] * a, this.xyzw[2] * a, result);\r\n }\r\n\r\n /** Convert the homogeneous point to a (strongly typed) point or vector.\r\n * * If `this.w` is nonzero, return a Point3d `(x/w,y/w,z/w)`\r\n * * If `this.w` is zero, return a Vector3d `(x,y,z)`\r\n */\r\n public realPointOrVector(): Point3d | Vector3d {\r\n const mag = Geometry.correctSmallFraction(this.xyzw[3]);\r\n if (mag === 0.0)\r\n return Vector3d.create(this.x, this.y, this.z);\r\n const a = 1.0 / mag; // in zero case everything multiplies right back to true zero.\r\n return Point3d.create(this.x * a, this.y * a, this.z * a);\r\n }\r\n /**\r\n * * If w is nonzero, return Point3d with x/w,y/w,z/w.\r\n * * If w is zero, return 000\r\n * @param x x coordinate\r\n * @param y y coordinate\r\n * @param z z coordinate\r\n * @param w w coordinate\r\n * @param result optional result\r\n */\r\n public static createRealPoint3dDefault000(x: number, y: number, z: number, w: number, result?: Point3d): Point3d {\r\n const mag = Geometry.correctSmallFraction(w);\r\n const a = mag === 0 ? 0.0 : (1.0 / mag); // in zero case everything multiplies right back to true zero.\r\n return Point3d.create(x * a, y * a, z * a, result);\r\n }\r\n /**\r\n * * If w is nonzero, return Vector3d which is the derivative of the projected xyz with given w and 4d derivatives.\r\n * * If w is zero, return 000\r\n * @param x x coordinate\r\n * @param y y coordinate\r\n * @param z z coordinate\r\n * @param w w coordinate\r\n * @param dx x coordinate of derivative\r\n * @param dy y coordinate of derivative\r\n * @param dz z coordinate of derivative\r\n * @param dw w coordinate of derivative\r\n * @param result optional result\r\n */\r\n public static createRealDerivativeRay3dDefault000(x: number, y: number, z: number, w: number, dx: number, dy: number, dz: number, dw: number, result?: Ray3d): Ray3d {\r\n const mag = Geometry.correctSmallFraction(w);\r\n // real point is X/w.\r\n // real derivative is (X' * w - X *w) / ww, and weight is always 0 by cross products.\r\n const a = mag === 0 ? 0.0 : (1.0 / mag); // in zero case everything multiplies right back to true zero.\r\n const aa = a * a;\r\n return Ray3d.createXYZUVW(x * a, y * a, z * a, (dx * w - dw * x) * aa, (dy * w - dw * y) * aa, (dz * w - dw * z) * aa, result);\r\n }\r\n /**\r\n * * If w is nonzero, return Vector3d which is the derivative of the projected xyz with given w and 4d derivatives.\r\n * * If w is zero, return 000\r\n * @param x x coordinate\r\n * @param y y coordinate\r\n * @param z z coordinate\r\n * @param w w coordinate\r\n * @param dx x coordinate of derivative\r\n * @param dy y coordinate of derivative\r\n * @param dz z coordinate of derivative\r\n * @param dw w coordinate of derivative\r\n * @param result optional result\r\n */\r\n public static createRealDerivativePlane3dByOriginAndVectorsDefault000(x: number, y: number, z: number, w: number, dx: number, dy: number, dz: number, dw: number, ddx: number, ddy: number, ddz: number, ddw: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\r\n const mag = Geometry.correctSmallFraction(w);\r\n // real point is X/w.\r\n // real derivative is (X' * w - X *w) / ww, and weight is always 0 by cross products.\r\n const a = mag === 0 ? 0.0 : (1.0 / mag); // in zero case everything multiplies right back to true zero.\r\n const aa = a * a;\r\n const fx = x * a;\r\n const fy = y * a;\r\n const fz = z * a;\r\n const dfx = (dx * w - dw * x) * aa;\r\n const dfy = (dy * w - dw * y) * aa;\r\n const dfz = (dz * w - dw * z) * aa;\r\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(fx, fy, fz, dfx, dfy, dfz, quotientDerivative2(ddx, dw, ddw, fx, dfx, a), quotientDerivative2(ddy, dw, ddw, fy, dfy, a), quotientDerivative2(ddz, dw, ddw, fz, dfz, a), result);\r\n }\r\n /**\r\n * * If this.w is nonzero, return Point3d with x/w,y/w,z/w.\r\n * * If this.w is zero, return 000\r\n */\r\n public realPointDefault000(result?: Point3d): Point3d {\r\n const mag = Geometry.correctSmallFraction(this.xyzw[3]);\r\n if (mag === 0.0)\r\n return Point3d.create(0, 0, 0, result);\r\n result = result ? result : new Point3d();\r\n const a = 1.0 / mag;\r\n return Point3d.create(this.xyzw[0] * a, this.xyzw[1] * a, this.xyzw[2] * a, result);\r\n }\r\n /** divide all components (x,y,z,w) by the 4d magnitude.\r\n *\r\n * * This is appropriate for normalizing a quaternion\r\n * * Use normalizeWeight to divide by the w component.\r\n */\r\n public normalizeXYZW(result?: Point4d): Point4d | undefined {\r\n const mag = Geometry.correctSmallFraction(this.magnitudeXYZW());\r\n result = result ? result : new Point4d();\r\n return this.safeDivideOrNull(mag, result);\r\n }\r\n\r\n /**\r\n * Return the determinant of the 3x3 matrix using components i,j,k of the 3 inputs.\r\n */\r\n public static determinantIndexed3X3(pointA: Point4d, pointB: Point4d, pointC: Point4d, i: number, j: number, k: number) {\r\n return Geometry.tripleProduct(\r\n pointA.xyzw[i], pointA.xyzw[j], pointA.xyzw[k],\r\n pointB.xyzw[i], pointB.xyzw[j], pointB.xyzw[k],\r\n pointC.xyzw[i], pointC.xyzw[j], pointC.xyzw[k]);\r\n }\r\n /**\r\n * Return a Point4d perpendicular to all 3 inputs. (A higher level cross product concept)\r\n * @param pointA first point\r\n * @param pointB second point\r\n * @param pointC third point\r\n */\r\n public static perpendicularPoint4dPlane(pointA: Point4d, pointB: Point4d, pointC: Point4d): Point4d {\r\n return Point4d.create(\r\n Point4d.determinantIndexed3X3(pointA, pointB, pointC, 1, 2, 3),\r\n -Point4d.determinantIndexed3X3(pointA, pointB, pointC, 2, 3, 0),\r\n Point4d.determinantIndexed3X3(pointA, pointB, pointC, 3, 0, 1),\r\n -Point4d.determinantIndexed3X3(pointA, pointB, pointC, 0, 1, 2));\r\n }\r\n /** Treating this Point4d as plane coefficients, convert to origin and normal form. */\r\n public toPlane3dByOriginAndUnitNormal(result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal | undefined {\r\n return Plane3dByOriginAndUnitNormal.createFrom(this, result);\r\n }\r\n /** Normalize so sum of squares of all 4 coordinates is 1. */\r\n public normalizeQuaternion() {\r\n const magnitude = Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);\r\n\r\n if (magnitude > 0.0) {\r\n const f = 1.0 / magnitude;\r\n this.x *= f;\r\n this.y *= f;\r\n this.z *= f;\r\n this.w *= f;\r\n }\r\n return magnitude;\r\n }\r\n /** Return a (normalized) quaternion interpolated between two quaternions. */\r\n public static interpolateQuaternions(quaternion0: Point4d, fractionParameter: number, quaternion1: Point4d, result?: Point4d): Point4d {\r\n if (!result)\r\n result = new Point4d();\r\n const maxSafeCosine = 0.9995;\r\n\r\n // return exact quaternions for special values\r\n if (0.0 === fractionParameter) {\r\n result = quaternion0;\r\n return result;\r\n }\r\n if (1.0 === fractionParameter) {\r\n result = quaternion1;\r\n return result;\r\n }\r\n if (0.5 === fractionParameter) {\r\n quaternion0.plus(quaternion1, result);\r\n result.normalizeQuaternion();\r\n return result;\r\n }\r\n\r\n const q0 = quaternion0.clone();\r\n const q1 = quaternion1.clone();\r\n let dot = quaternion0.dotProduct(quaternion1);\r\n\r\n // prevent interpolation through the longer great arc\r\n if (dot < 0.0) {\r\n q1.negate(q1);\r\n dot = -dot;\r\n }\r\n\r\n // if nearly parallel, use interpolate and renormalize .\r\n if (dot > maxSafeCosine) {\r\n q0.interpolate(fractionParameter, q1, result);\r\n result.normalizeQuaternion();\r\n return result;\r\n }\r\n\r\n // safety check\r\n if (dot < -1.0)\r\n dot = -1.0;\r\n else if (dot > 1.0)\r\n dot = 1.0;\r\n\r\n // create orthonormal basis {q0, q2}\r\n const q2 = new Point4d();\r\n q1.plusScaled(q0, -dot, q2); // bsiDPoint4d_addScaledDPoint4d(& q2, & q1, & q0, -dot);\r\n q2.normalizeQuaternion();\r\n\r\n const angle = Math.acos(dot);\r\n const angleOfInterpolation = angle * fractionParameter;\r\n result = Point4d.createAdd2Scaled(q0, Math.cos(angleOfInterpolation), q2, Math.sin(angleOfInterpolation));\r\n return result;\r\n }\r\n /** Measure the \"angle\" between two points, using all 4 components in the dot product that\r\n * gives the cosine of the angle.\r\n */\r\n public radiansToPoint4dXYZW(other: Point4d): number | undefined {\r\n const magA = this.magnitudeXYZW();\r\n const magB = other.magnitudeXYZW();\r\n const dot = this.dotProduct(other); // == cos (theta) * magA * magB\r\n const cos = Geometry.conditionalDivideFraction(dot, magA * magB);\r\n if (cos === undefined)\r\n return undefined;\r\n return Math.acos(cos);\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"BandedSystem.js","sourceRoot":"","sources":["../../../src/numerics/BandedSystem.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC;;;;GAIG;AACH,MAAM,OAAO,YAAY;IACvB,gDAAgD;IACzC,MAAM,CAAC,WAAW,CACvB,MAAc,EACd,EAAU,EAAI,gBAAgB,CAC9B,IAAkB;QAElB,MAAM,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC;QACrB,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,qBAAqB;QACrD,IAAI,GAAG,CAAC;QACR,WAAW;QACX,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,yBAAyB;QACzB,uBAAuB;QACvB,mBAAmB;QACnB,0BAA0B;QAC1B,+BAA+B;QAC/B,0BAA0B;QAC1B,6FAA6F;QAC7F,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAC5B,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC;YAChC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC7B,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC;gBAChC,GA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AgB,CAC9B,YAA0B,EAC1B,MAAc,EAAE,wCAAwC;IACxD,GAAiB;QAEjB,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC5C,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;QACzC,IAAI,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC;QAEtB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;YAC5C,yFAAyF;YACzF,EAAE,GAAG,KAAK,GAAG,aAAa,CAAC;YAC3B,IAAI,EAAE,GAAG,CAAC;gBAAE,EAAE,GAAG,CAAC,CAAC;YACnB,EAAE,GAAG,KAAK,GAAG,aAAa,GAAG,CAAC,CAAC;YAC/B,IAAI,EAAE,GAAG,MAAM;gBAAE,EAAE,GAAG,MAAM,CAAC;YAC7B,IAAI,GAAG,aAAa,GAAG,KAAK,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;YACxC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAChC,GAAG,GAAG,CAAC,CAAC;gBACR,KAAK,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;oBAC7B,GAAG,IAAI,YAAY,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC;gBACtD,CAAC;gBACD,MAAM,CAAC,KAAK,GAAG,MAAM,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;YACnC,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","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*--------------------------------------------------------------------------------------------*/\nimport { Geometry } from \"../Geometry\";\n/**\n * `BandedSystem` is a class with static methods for solving banded linear systems, such as in computing\n * Bspline poles for pass-through points\n * @internal\n */\nexport class BandedSystem {\n /** apply LU decomposition to a banded system */\n public static decomposeLU(\n numRow: number,\n bw: number, /* band width */\n data: Float64Array,\n ): boolean {\n const n = numRow - 1;\n const sbw = Math.floor(bw / 2); // ASSUMES bw is odd?\n let sum;\n // Phase 1:\n // [A b C]\n // [d q f]\n // [G h I]\n // q is a diagonal (pivot\n // d, f are row vectors\n // A,C,I are blocks\n // b,h are column vectors.\n // Phase 1: [q,f] -= d * [b,C]\n // Phase 2: h = (h- G*b)/q\n // This is standard gaussian elimination, but in row-think rather than the usual column-think\n for (let i = 0; i <= n; i++) {\n const jh = Math.min(n, i + sbw);\n for (let j = i; j <= jh; j++) {\n const kl = Math.max(0, j - sbw);\n sum = 0.0;\n for (let k = kl; k < i; k++)\n sum += data[i * bw + k - i + sbw] * data[k * bw + j - k + sbw];\n data[i * bw + j - i + sbw] -= sum;\n }\n\n for (let j = i + 1; j <= jh; j++) {\n const kl = Math.max(0, j - sbw);\n sum = 0.0;\n for (let k = kl; k < i; k++)\n sum += data[j * bw + k - j + sbw] * data[k * bw + i - k + sbw];\n\n if (Math.abs(data[i * bw + sbw]) < 1e-9) // TODO -- tolerance !!!\n return false;\n\n data[j * bw + i - j + sbw] = (data[j * bw + i - j + sbw] - sum) / data[i * bw + sbw];\n }\n }\n return true;\n }\n\n /**\n *\n * @param sum evolving sum. sum.length\n * @param source data being added\n * @param sourceRow row in source. Plain offset is sourceRow * sum.length\n * @param scale scale factor to apply.\n */\n private static arrayAddScaledBlock(sum: Float64Array, source: Float64Array, sourceRow: number, scale: number) {\n const n = sum.length;\n let k = n * sourceRow;\n for (let i = 0; i < n; i++, k++) {\n sum[i] += source[k] * scale;\n }\n }\n // dest[destRow][*] = sourceA[sourceRow][*] - sourceB[*]\n private static blockAssignBlockMinusArray(dest: Float64Array, destRow: number, sourceA: Float64Array, sourceARow: number, sourceB: Float64Array) {\n const n = sourceB.length;\n let destIndex = destRow * n;\n let sourceIndex = sourceARow * n;\n for (let i = 0; i < n; i++, sourceIndex++, destIndex++) {\n dest[destIndex] = sourceA[sourceIndex] - sourceB[i];\n }\n }\n // dest[destRow][*] = sourceA[sourceBRow][*] * scaleA - sourceB[*] * scaleB\n private static blockSumOfScaledBlockScaledArray(dest: Float64Array, destRow: number, sourceA: Float64Array, sourceBRow: number, scaleA: number, sourceB: Float64Array, scaleB: number) {\n const n = sourceB.length;\n let destIndex = destRow * n;\n let sourceBIndex = sourceBRow * n;\n for (let i = 0; i < n; i++, sourceBIndex++, destIndex++) {\n dest[destIndex] = sourceA[sourceBIndex] * scaleA + sourceB[i] * scaleB;\n }\n }\n\n /**\n * Solve a linear system A*X=B where\n * * A is nominally an `numRow*numRow` matrix, but is stored in banded row-major form\n * * The band storage is `bw` numbers per row, with the middle value being the diagonal of that row.\n * * Hence rows near top and bottom have band values `outside` the matrix.\n * * The right hand side is an `numRow*numRHS` matrix in row-major order.\n * @param numRow number of rows (and columns) of the nominal full matrix.\n * @param bw total bandwidth (diagonal + equal number of values to left and right)\n * @param matrix the banded matrix, as packed row-major\n * @param numRHS the number of right hand sides.\n * @param rhs the right hand sides\n */\n public static solveBandedSystemMultipleRHS(\n numRow: number,\n bw: number, /* band width */\n matrix: Float64Array,\n numRHS: number, // number of components in each RHS row.\n rhs: Float64Array, // RHS data, packed, overwritten by solution\n ): Float64Array | undefined {\n if (!this.decomposeLU(numRow, bw, matrix))\n return undefined;\n\n const n = numRow - 1;\n const sbw = Math.floor(bw / 2);\n const rhsRowS = new Float64Array(numRHS);\n\n /* Compute solution vector */\n // Z is solution vector . . .\n const reducedRHS = new Float64Array(numRHS * numRow);\n const result = new Float64Array(numRHS * numRow);\n\n for (let i = 0; i <= n; i++) {\n rhsRowS.fill(0);\n\n const jl = Math.max(0, i - sbw);\n for (let j = jl; j < i; j++) {\n this.arrayAddScaledBlock(rhsRowS, reducedRHS, j, matrix[i * bw + j - i + sbw]);\n // S.SumOf(S, Z[j], data[i * bw + j - i + sbw]);\n }\n this.blockAssignBlockMinusArray(reducedRHS, i, rhs, i, rhsRowS);\n }\n for (let i = n; i >= 0; i--) {\n const fact = Geometry.conditionalDivideCoordinate(1.0, matrix[i * bw + sbw]);\n if (fact === undefined)\n return undefined;\n\n rhsRowS.fill(0);\n\n const jh = Math.min(n, i + sbw);\n for (let j = i + 1; j <= jh; j++) {\n // S.SumOf(S, Q[j], data[i * bw + j - i + sbw]);\n this.arrayAddScaledBlock(rhsRowS, result, j, matrix[i * bw + j - i + sbw]);\n }\n this.blockSumOfScaledBlockScaledArray(result, i, reducedRHS, i, fact, rhsRowS, -fact);\n // Q[i].SumOf(O, Z[i], fact, S, -fact);\n }\n\n return result;\n }\n /**\n * Multiply a banded numRow*numRow matrix times a full numRow*numRHS, return as new matrix\n */\n public static multiplyBandedTimesFull(\n numRow: number,\n bw: number, /* band width */\n bandedMatrix: Float64Array,\n numRHS: number, // number of components in each RHS row.\n rhs: Float64Array, // RHS data, packed, overwritten by solution\n ): Float64Array {\n const result = new Float64Array(rhs.length);\n const halfBandWidth = Math.floor(bw / 2);\n let sum, k0, k1, kRef;\n\n for (let pivot = 0; pivot < numRow; pivot++) {\n // \"k\" vars are nominal column indices in the matrix, and nominal row indices in the rhs.\n k0 = pivot - halfBandWidth;\n if (k0 < 0) k0 = 0;\n k1 = pivot + halfBandWidth + 1;\n if (k1 > numRow) k1 = numRow;\n kRef = halfBandWidth + pivot * (bw - 1);\n for (let m = 0; m < numRHS; m++) {\n sum = 0;\n for (let k = k0; k < k1; k++) {\n sum += bandedMatrix[kRef + k] * rhs[k * numRHS + m];\n }\n result[pivot * numRHS + m] = sum;\n }\n }\n return result;\n }\n}\n"]}
1
+ {"version":3,"file":"BandedSystem.js","sourceRoot":"","sources":["../../../src/numerics/BandedSystem.ts"],"names":[],"mappings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AK,EAAE,EAAE,CAAC;YAC5C,yFAAyF;YACzF,EAAE,GAAG,KAAK,GAAG,aAAa,CAAC;YAC3B,IAAI,EAAE,GAAG,CAAC;gBAAE,EAAE,GAAG,CAAC,CAAC;YACnB,EAAE,GAAG,KAAK,GAAG,aAAa,GAAG,CAAC,CAAC;YAC/B,IAAI,EAAE,GAAG,MAAM;gBAAE,EAAE,GAAG,MAAM,CAAC;YAC7B,IAAI,GAAG,aAAa,GAAG,KAAK,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;YACxC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAChC,GAAG,GAAG,CAAC,CAAC;gBACR,KAAK,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;oBAC7B,GAAG,IAAI,YAAY,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC;gBACtD,CAAC;gBACD,MAAM,CAAC,KAAK,GAAG,MAAM,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;YACnC,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","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\nimport { Geometry } from \"../Geometry\";\r\n/**\r\n * `BandedSystem` is a class with static methods for solving banded linear systems, such as in computing\r\n * Bspline poles for pass-through points\r\n * @internal\r\n */\r\nexport class BandedSystem {\r\n /** apply LU decomposition to a banded system */\r\n public static decomposeLU(\r\n numRow: number,\r\n bw: number, /* band width */\r\n data: Float64Array,\r\n ): boolean {\r\n const n = numRow - 1;\r\n const sbw = Math.floor(bw / 2); // ASSUMES bw is odd?\r\n let sum;\r\n // Phase 1:\r\n // [A b C]\r\n // [d q f]\r\n // [G h I]\r\n // q is a diagonal (pivot\r\n // d, f are row vectors\r\n // A,C,I are blocks\r\n // b,h are column vectors.\r\n // Phase 1: [q,f] -= d * [b,C]\r\n // Phase 2: h = (h- G*b)/q\r\n // This is standard gaussian elimination, but in row-think rather than the usual column-think\r\n for (let i = 0; i <= n; i++) {\r\n const jh = Math.min(n, i + sbw);\r\n for (let j = i; j <= jh; j++) {\r\n const kl = Math.max(0, j - sbw);\r\n sum = 0.0;\r\n for (let k = kl; k < i; k++)\r\n sum += data[i * bw + k - i + sbw] * data[k * bw + j - k + sbw];\r\n data[i * bw + j - i + sbw] -= sum;\r\n }\r\n\r\n for (let j = i + 1; j <= jh; j++) {\r\n const kl = Math.max(0, j - sbw);\r\n sum = 0.0;\r\n for (let k = kl; k < i; k++)\r\n sum += data[j * bw + k - j + sbw] * data[k * bw + i - k + sbw];\r\n\r\n if (Math.abs(data[i * bw + sbw]) < 1e-9) // TODO -- tolerance !!!\r\n return false;\r\n\r\n data[j * bw + i - j + sbw] = (data[j * bw + i - j + sbw] - sum) / data[i * bw + sbw];\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n /**\r\n *\r\n * @param sum evolving sum. sum.length\r\n * @param source data being added\r\n * @param sourceRow row in source. Plain offset is sourceRow * sum.length\r\n * @param scale scale factor to apply.\r\n */\r\n private static arrayAddScaledBlock(sum: Float64Array, source: Float64Array, sourceRow: number, scale: number) {\r\n const n = sum.length;\r\n let k = n * sourceRow;\r\n for (let i = 0; i < n; i++, k++) {\r\n sum[i] += source[k] * scale;\r\n }\r\n }\r\n // dest[destRow][*] = sourceA[sourceRow][*] - sourceB[*]\r\n private static blockAssignBlockMinusArray(dest: Float64Array, destRow: number, sourceA: Float64Array, sourceARow: number, sourceB: Float64Array) {\r\n const n = sourceB.length;\r\n let destIndex = destRow * n;\r\n let sourceIndex = sourceARow * n;\r\n for (let i = 0; i < n; i++, sourceIndex++, destIndex++) {\r\n dest[destIndex] = sourceA[sourceIndex] - sourceB[i];\r\n }\r\n }\r\n // dest[destRow][*] = sourceA[sourceBRow][*] * scaleA - sourceB[*] * scaleB\r\n private static blockSumOfScaledBlockScaledArray(dest: Float64Array, destRow: number, sourceA: Float64Array, sourceBRow: number, scaleA: number, sourceB: Float64Array, scaleB: number) {\r\n const n = sourceB.length;\r\n let destIndex = destRow * n;\r\n let sourceBIndex = sourceBRow * n;\r\n for (let i = 0; i < n; i++, sourceBIndex++, destIndex++) {\r\n dest[destIndex] = sourceA[sourceBIndex] * scaleA + sourceB[i] * scaleB;\r\n }\r\n }\r\n\r\n /**\r\n * Solve a linear system A*X=B where\r\n * * A is nominally an `numRow*numRow` matrix, but is stored in banded row-major form\r\n * * The band storage is `bw` numbers per row, with the middle value being the diagonal of that row.\r\n * * Hence rows near top and bottom have band values `outside` the matrix.\r\n * * The right hand side is an `numRow*numRHS` matrix in row-major order.\r\n * @param numRow number of rows (and columns) of the nominal full matrix.\r\n * @param bw total bandwidth (diagonal + equal number of values to left and right)\r\n * @param matrix the banded matrix, as packed row-major\r\n * @param numRHS the number of right hand sides.\r\n * @param rhs the right hand sides\r\n */\r\n public static solveBandedSystemMultipleRHS(\r\n numRow: number,\r\n bw: number, /* band width */\r\n matrix: Float64Array,\r\n numRHS: number, // number of components in each RHS row.\r\n rhs: Float64Array, // RHS data, packed, overwritten by solution\r\n ): Float64Array | undefined {\r\n if (!this.decomposeLU(numRow, bw, matrix))\r\n return undefined;\r\n\r\n const n = numRow - 1;\r\n const sbw = Math.floor(bw / 2);\r\n const rhsRowS = new Float64Array(numRHS);\r\n\r\n /* Compute solution vector */\r\n // Z is solution vector . . .\r\n const reducedRHS = new Float64Array(numRHS * numRow);\r\n const result = new Float64Array(numRHS * numRow);\r\n\r\n for (let i = 0; i <= n; i++) {\r\n rhsRowS.fill(0);\r\n\r\n const jl = Math.max(0, i - sbw);\r\n for (let j = jl; j < i; j++) {\r\n this.arrayAddScaledBlock(rhsRowS, reducedRHS, j, matrix[i * bw + j - i + sbw]);\r\n // S.SumOf(S, Z[j], data[i * bw + j - i + sbw]);\r\n }\r\n this.blockAssignBlockMinusArray(reducedRHS, i, rhs, i, rhsRowS);\r\n }\r\n for (let i = n; i >= 0; i--) {\r\n const fact = Geometry.conditionalDivideCoordinate(1.0, matrix[i * bw + sbw]);\r\n if (fact === undefined)\r\n return undefined;\r\n\r\n rhsRowS.fill(0);\r\n\r\n const jh = Math.min(n, i + sbw);\r\n for (let j = i + 1; j <= jh; j++) {\r\n // S.SumOf(S, Q[j], data[i * bw + j - i + sbw]);\r\n this.arrayAddScaledBlock(rhsRowS, result, j, matrix[i * bw + j - i + sbw]);\r\n }\r\n this.blockSumOfScaledBlockScaledArray(result, i, reducedRHS, i, fact, rhsRowS, -fact);\r\n // Q[i].SumOf(O, Z[i], fact, S, -fact);\r\n }\r\n\r\n return result;\r\n }\r\n /**\r\n * Multiply a banded numRow*numRow matrix times a full numRow*numRHS, return as new matrix\r\n */\r\n public static multiplyBandedTimesFull(\r\n numRow: number,\r\n bw: number, /* band width */\r\n bandedMatrix: Float64Array,\r\n numRHS: number, // number of components in each RHS row.\r\n rhs: Float64Array, // RHS data, packed, overwritten by solution\r\n ): Float64Array {\r\n const result = new Float64Array(rhs.length);\r\n const halfBandWidth = Math.floor(bw / 2);\r\n let sum, k0, k1, kRef;\r\n\r\n for (let pivot = 0; pivot < numRow; pivot++) {\r\n // \"k\" vars are nominal column indices in the matrix, and nominal row indices in the rhs.\r\n k0 = pivot - halfBandWidth;\r\n if (k0 < 0) k0 = 0;\r\n k1 = pivot + halfBandWidth + 1;\r\n if (k1 > numRow) k1 = numRow;\r\n kRef = halfBandWidth + pivot * (bw - 1);\r\n for (let m = 0; m < numRHS; m++) {\r\n sum = 0;\r\n for (let k = k0; k < k1; k++) {\r\n sum += bandedMatrix[kRef + k] * rhs[k * numRHS + m];\r\n }\r\n result[pivot * numRHS + m] = sum;\r\n }\r\n }\r\n return result;\r\n }\r\n}\r\n"]}