@itwin/core-geometry 5.2.0-dev.29 → 5.2.0-dev.30
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.
- package/lib/cjs/Constant.js.map +1 -1
- package/lib/cjs/Geometry.d.ts +30 -10
- package/lib/cjs/Geometry.d.ts.map +1 -1
- package/lib/cjs/Geometry.js +74 -10
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/bspline/AkimaCurve3d.d.ts +19 -6
- package/lib/cjs/bspline/AkimaCurve3d.d.ts.map +1 -1
- package/lib/cjs/bspline/AkimaCurve3d.js +21 -5
- package/lib/cjs/bspline/AkimaCurve3d.js.map +1 -1
- package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.d.ts +3 -3
- package/lib/cjs/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.js +6 -6
- package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve3dH.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurveOps.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineCurveOps.js +1 -1
- package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
- package/lib/cjs/bspline/Bezier1dNd.js.map +1 -1
- package/lib/cjs/bspline/BezierCurve3d.js.map +1 -1
- package/lib/cjs/bspline/BezierCurve3dH.js.map +1 -1
- package/lib/cjs/bspline/BezierCurveBase.d.ts +2 -2
- package/lib/cjs/bspline/BezierCurveBase.d.ts.map +1 -1
- package/lib/cjs/bspline/BezierCurveBase.js +4 -6
- package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
- package/lib/cjs/bspline/InterpolationCurve3d.d.ts +27 -17
- package/lib/cjs/bspline/InterpolationCurve3d.d.ts.map +1 -1
- package/lib/cjs/bspline/InterpolationCurve3d.js +17 -7
- package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/cjs/bspline/KnotVector.js.map +1 -1
- package/lib/cjs/bspline/SurfaceLocationDetail.js.map +1 -1
- package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/cjs/clipping/BooleanClipFactory.js.map +1 -1
- package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
- package/lib/cjs/clipping/ClipPlane.d.ts +9 -3
- package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPlane.js +8 -0
- package/lib/cjs/clipping/ClipPlane.js.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
- package/lib/cjs/clipping/ClipUtils.d.ts +14 -1
- package/lib/cjs/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js +21 -3
- package/lib/cjs/clipping/ClipUtils.js.map +1 -1
- package/lib/cjs/clipping/ClipVector.js.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts +2 -2
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.js +6 -4
- package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
- package/lib/cjs/core-geometry.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts +27 -17
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +61 -35
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/ConstructCurveBetweenCurves.js.map +1 -1
- package/lib/cjs/curve/CoordinateXYZ.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.d.ts +1 -0
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +1 -0
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveCurve.js.map +1 -1
- package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
- package/lib/cjs/curve/CurveFactory.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.d.ts +8 -7
- package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurveOps.d.ts +51 -1
- package/lib/cjs/curve/CurveOps.d.ts.map +1 -1
- package/lib/cjs/curve/CurveOps.js +97 -3
- package/lib/cjs/curve/CurveOps.js.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
- package/lib/cjs/curve/CurveProcessor.js.map +1 -1
- package/lib/cjs/curve/CurveTypes.js.map +1 -1
- package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/cjs/curve/GeometryQuery.js.map +1 -1
- package/lib/cjs/curve/LineSegment3d.js.map +1 -1
- package/lib/cjs/curve/LineString3d.d.ts +4 -4
- package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineString3d.js +8 -8
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/Loop.js.map +1 -1
- package/lib/cjs/curve/OffsetOptions.js.map +1 -1
- package/lib/cjs/curve/ParityRegion.js.map +1 -1
- package/lib/cjs/curve/Path.js.map +1 -1
- package/lib/cjs/curve/PointString3d.js.map +1 -1
- package/lib/cjs/curve/ProxyCurve.js.map +1 -1
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js +3 -3
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
- package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
- package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.d.ts +6 -2
- package/lib/cjs/curve/Query/PlanarSubdivision.d.ts.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.js +12 -7
- package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
- package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
- package/lib/cjs/curve/RegionOps.d.ts +9 -4
- package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOps.js +10 -5
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/cjs/curve/StrokeOptions.js.map +1 -1
- package/lib/cjs/curve/UnionRegion.js.map +1 -1
- package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/ChainCollectorContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CloneCurvesContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +2 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveLengthContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts +4 -4
- package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js +21 -18
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.js.map +1 -1
- package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
- package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
- package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts +2 -2
- package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/DirectSpiral3d.js +6 -2
- package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts +2 -2
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js +6 -2
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
- package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts +5 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js +0 -3
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
- package/lib/cjs/geometry3d/Angle.js.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.d.ts +6 -2
- package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js +12 -3
- package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
- package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.d.ts +2 -1
- package/lib/cjs/geometry3d/FrameBuilder.d.ts.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.js +14 -18
- package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
- package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableBlockedArray.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedCollectionInterval.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.d.ts +18 -2
- package/lib/cjs/geometry3d/Point2dVector2d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.js +37 -4
- package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +1 -0
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
- package/lib/cjs/geometry3d/PointStreaming.d.ts +8 -0
- package/lib/cjs/geometry3d/PointStreaming.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PointStreaming.js +18 -2
- package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.d.ts +8 -2
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js +10 -4
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.d.ts +14 -3
- package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.js +20 -4
- package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
- package/lib/cjs/geometry3d/Range.d.ts +34 -32
- package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Range.js +28 -21
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Ray2d.d.ts +16 -6
- package/lib/cjs/geometry3d/Ray2d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ray2d.js +28 -4
- package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js +3 -4
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
- package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.d.ts +1 -1
- package/lib/cjs/geometry3d/Transform.js +1 -1
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/geometry3d/UVSurfaceOps.js.map +1 -1
- package/lib/cjs/geometry3d/XYZProps.d.ts +12 -1
- package/lib/cjs/geometry3d/XYZProps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/XYZProps.js +17 -2
- package/lib/cjs/geometry3d/XYZProps.js.map +1 -1
- package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/cjs/geometry4d/Map4d.js.map +1 -1
- package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
- package/lib/cjs/geometry4d/MomentData.js.map +1 -1
- package/lib/cjs/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
- package/lib/cjs/geometry4d/Point4d.js.map +1 -1
- package/lib/cjs/numerics/BandedSystem.js.map +1 -1
- package/lib/cjs/numerics/BezierPolynomials.d.ts.map +1 -1
- package/lib/cjs/numerics/BezierPolynomials.js +5 -9
- package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
- package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
- package/lib/cjs/numerics/Complex.js.map +1 -1
- package/lib/cjs/numerics/ConvexPolygon2d.js.map +1 -1
- package/lib/cjs/numerics/Newton.js.map +1 -1
- package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
- package/lib/cjs/numerics/PolarData.js.map +1 -1
- package/lib/cjs/numerics/Polynomials.js.map +1 -1
- package/lib/cjs/numerics/Quadrature.js.map +1 -1
- package/lib/cjs/numerics/Range1dArray.js.map +1 -1
- package/lib/cjs/numerics/SmallSystem.d.ts +13 -7
- package/lib/cjs/numerics/SmallSystem.d.ts.map +1 -1
- package/lib/cjs/numerics/SmallSystem.js +13 -7
- package/lib/cjs/numerics/SmallSystem.js.map +1 -1
- package/lib/cjs/numerics/TriDiagonalSystem.js.map +1 -1
- package/lib/cjs/numerics/UnionFind.js.map +1 -1
- package/lib/cjs/numerics/UsageSums.js.map +1 -1
- package/lib/cjs/polyface/AuxData.js.map +1 -1
- package/lib/cjs/polyface/BoxTopology.js.map +1 -1
- package/lib/cjs/polyface/FacetFaceData.js.map +1 -1
- package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -1
- package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
- package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceWalker.js.map +1 -1
- package/lib/cjs/polyface/Polyface.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts +25 -6
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js +59 -8
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js +8 -10
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/polyface/RangeLengthData.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/MinimumValueTester.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.d.ts +8 -5
- package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.d.ts.map +1 -1
- package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js +8 -4
- package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.d.ts +3 -3
- package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.d.ts.map +1 -1
- package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js +1 -1
- package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts +4 -2
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.js +9 -12
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.d.ts +8 -3
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.d.ts.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js +13 -6
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
- package/lib/cjs/polyface/TaggedNumericData.js.map +1 -1
- package/lib/cjs/polyface/TriangleCandidate.js.map +1 -1
- package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
- package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
- package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
- package/lib/cjs/polyface/multiclip/RangeSearch.js.map +1 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
- package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
- package/lib/cjs/serialization/BGFBReader.js.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
- package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
- package/lib/cjs/serialization/DeepCompare.js +1 -1
- package/lib/cjs/serialization/DeepCompare.js.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts +2 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js +2 -1
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/cjs/serialization/SerializationHelpers.js.map +1 -1
- package/lib/cjs/solid/Box.js.map +1 -1
- package/lib/cjs/solid/Cone.js.map +1 -1
- package/lib/cjs/solid/LinearSweep.js.map +1 -1
- package/lib/cjs/solid/RotationalSweep.js.map +1 -1
- package/lib/cjs/solid/RuledSweep.js.map +1 -1
- package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
- package/lib/cjs/solid/Sphere.js.map +1 -1
- package/lib/cjs/solid/SweepContour.js.map +1 -1
- package/lib/cjs/solid/TorusPipe.js.map +1 -1
- package/lib/cjs/topology/ChainMerge.js.map +1 -1
- package/lib/cjs/topology/Graph.d.ts +38 -12
- package/lib/cjs/topology/Graph.d.ts.map +1 -1
- package/lib/cjs/topology/Graph.js +91 -23
- package/lib/cjs/topology/Graph.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts +5 -4
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js +6 -5
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts +20 -11
- package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.js +43 -39
- package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphValidation.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
- package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/cjs/topology/MaskManager.js.map +1 -1
- package/lib/cjs/topology/Merging.d.ts +7 -4
- package/lib/cjs/topology/Merging.d.ts.map +1 -1
- package/lib/cjs/topology/Merging.js +16 -11
- package/lib/cjs/topology/Merging.js.map +1 -1
- package/lib/cjs/topology/RegularizeFace.js.map +1 -1
- package/lib/cjs/topology/SignedDataSummary.js.map +1 -1
- package/lib/cjs/topology/SpaceTriangulation.js.map +1 -1
- package/lib/cjs/topology/Triangulation.d.ts +13 -11
- package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
- package/lib/cjs/topology/Triangulation.js +40 -36
- package/lib/cjs/topology/Triangulation.js.map +1 -1
- package/lib/cjs/topology/Voronoi.d.ts +195 -0
- package/lib/cjs/topology/Voronoi.d.ts.map +1 -0
- package/lib/cjs/topology/Voronoi.js +700 -0
- package/lib/cjs/topology/Voronoi.js.map +1 -0
- package/lib/cjs/topology/XYParitySearchContext.d.ts +1 -1
- package/lib/cjs/topology/XYParitySearchContext.d.ts.map +1 -1
- package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
- package/lib/esm/Constant.js.map +1 -1
- package/lib/esm/Geometry.d.ts +30 -10
- package/lib/esm/Geometry.d.ts.map +1 -1
- package/lib/esm/Geometry.js +74 -10
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/bspline/AkimaCurve3d.d.ts +19 -6
- package/lib/esm/bspline/AkimaCurve3d.d.ts.map +1 -1
- package/lib/esm/bspline/AkimaCurve3d.js +21 -5
- package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
- package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve.d.ts +3 -3
- package/lib/esm/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineCurve.js +6 -6
- package/lib/esm/bspline/BSplineCurve.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve3dH.js.map +1 -1
- package/lib/esm/bspline/BSplineCurveOps.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineCurveOps.js +1 -1
- package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/esm/bspline/BSplineSurface.js.map +1 -1
- package/lib/esm/bspline/Bezier1dNd.js.map +1 -1
- package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
- package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.d.ts +2 -2
- package/lib/esm/bspline/BezierCurveBase.d.ts.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.js +4 -6
- package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
- package/lib/esm/bspline/InterpolationCurve3d.d.ts +27 -17
- package/lib/esm/bspline/InterpolationCurve3d.d.ts.map +1 -1
- package/lib/esm/bspline/InterpolationCurve3d.js +17 -7
- package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/esm/bspline/KnotVector.js.map +1 -1
- package/lib/esm/bspline/SurfaceLocationDetail.js.map +1 -1
- package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/esm/clipping/BooleanClipFactory.js.map +1 -1
- package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
- package/lib/esm/clipping/ClipPlane.d.ts +9 -3
- package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPlane.js +8 -0
- package/lib/esm/clipping/ClipPlane.js.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
- package/lib/esm/clipping/ClipUtils.d.ts +14 -1
- package/lib/esm/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/esm/clipping/ClipUtils.js +21 -3
- package/lib/esm/clipping/ClipUtils.js.map +1 -1
- package/lib/esm/clipping/ClipVector.js.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts +2 -2
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.js +6 -4
- package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
- package/lib/esm/core-geometry.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts +27 -17
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +61 -35
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/ConstructCurveBetweenCurves.js.map +1 -1
- package/lib/esm/curve/CoordinateXYZ.js.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/CurveCollection.d.ts +1 -0
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +1 -0
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveCurve.js.map +1 -1
- package/lib/esm/curve/CurveExtendMode.js.map +1 -1
- package/lib/esm/curve/CurveFactory.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.d.ts +8 -7
- package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurveOps.d.ts +51 -1
- package/lib/esm/curve/CurveOps.d.ts.map +1 -1
- package/lib/esm/curve/CurveOps.js +98 -4
- package/lib/esm/curve/CurveOps.js.map +1 -1
- package/lib/esm/curve/CurvePrimitive.js.map +1 -1
- package/lib/esm/curve/CurveProcessor.js.map +1 -1
- package/lib/esm/curve/CurveTypes.js.map +1 -1
- package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/esm/curve/GeometryQuery.js.map +1 -1
- package/lib/esm/curve/LineSegment3d.js.map +1 -1
- package/lib/esm/curve/LineString3d.d.ts +4 -4
- package/lib/esm/curve/LineString3d.d.ts.map +1 -1
- package/lib/esm/curve/LineString3d.js +8 -8
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/Loop.js.map +1 -1
- package/lib/esm/curve/OffsetOptions.js.map +1 -1
- package/lib/esm/curve/ParityRegion.js.map +1 -1
- package/lib/esm/curve/Path.js.map +1 -1
- package/lib/esm/curve/PointString3d.js.map +1 -1
- package/lib/esm/curve/ProxyCurve.js.map +1 -1
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js +3 -3
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
- package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
- package/lib/esm/curve/Query/InOutTests.js.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.d.ts +6 -2
- package/lib/esm/curve/Query/PlanarSubdivision.d.ts.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.js +12 -7
- package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
- package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
- package/lib/esm/curve/RegionOps.d.ts +9 -4
- package/lib/esm/curve/RegionOps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOps.js +10 -5
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/esm/curve/StrokeOptions.js.map +1 -1
- package/lib/esm/curve/UnionRegion.js.map +1 -1
- package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/ChainCollectorContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CloneCurvesContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +2 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveLengthContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts +4 -4
- package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.js +21 -18
- package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/TransferWithSplitArcs.js.map +1 -1
- package/lib/esm/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
- package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
- package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/DirectSpiral3d.d.ts +2 -2
- package/lib/esm/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
- package/lib/esm/curve/spiral/DirectSpiral3d.js +6 -2
- package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts +2 -2
- package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js +6 -2
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
- package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts +5 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.js +0 -3
- package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
- package/lib/esm/geometry3d/Angle.js.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.d.ts +6 -2
- package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.js +12 -3
- package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
- package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.d.ts +2 -1
- package/lib/esm/geometry3d/FrameBuilder.d.ts.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.js +14 -18
- package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
- package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/esm/geometry3d/GrowableBlockedArray.js.map +1 -1
- package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/esm/geometry3d/IndexedCollectionInterval.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +1 -1
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/esm/geometry3d/Plane3d.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.d.ts +18 -2
- package/lib/esm/geometry3d/Point2dVector2d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.js +37 -4
- package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +1 -0
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
- package/lib/esm/geometry3d/PointStreaming.d.ts +8 -0
- package/lib/esm/geometry3d/PointStreaming.d.ts.map +1 -1
- package/lib/esm/geometry3d/PointStreaming.js +18 -2
- package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.d.ts +8 -2
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js +10 -4
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.d.ts +14 -3
- package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.js +20 -4
- package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
- package/lib/esm/geometry3d/Range.d.ts +34 -32
- package/lib/esm/geometry3d/Range.d.ts.map +1 -1
- package/lib/esm/geometry3d/Range.js +28 -21
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Ray2d.d.ts +16 -6
- package/lib/esm/geometry3d/Ray2d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ray2d.js +28 -4
- package/lib/esm/geometry3d/Ray2d.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js +3 -4
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/esm/geometry3d/Segment1d.js.map +1 -1
- package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/esm/geometry3d/Transform.d.ts +1 -1
- package/lib/esm/geometry3d/Transform.js +1 -1
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/geometry3d/UVSurfaceOps.js.map +1 -1
- package/lib/esm/geometry3d/XYZProps.d.ts +12 -1
- package/lib/esm/geometry3d/XYZProps.d.ts.map +1 -1
- package/lib/esm/geometry3d/XYZProps.js +16 -1
- package/lib/esm/geometry3d/XYZProps.js.map +1 -1
- package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/esm/geometry4d/Map4d.js.map +1 -1
- package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
- package/lib/esm/geometry4d/MomentData.js.map +1 -1
- package/lib/esm/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
- package/lib/esm/geometry4d/Point4d.js.map +1 -1
- package/lib/esm/numerics/BandedSystem.js.map +1 -1
- package/lib/esm/numerics/BezierPolynomials.d.ts.map +1 -1
- package/lib/esm/numerics/BezierPolynomials.js +5 -9
- package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
- package/lib/esm/numerics/ClusterableArray.js.map +1 -1
- package/lib/esm/numerics/Complex.js.map +1 -1
- package/lib/esm/numerics/ConvexPolygon2d.js.map +1 -1
- package/lib/esm/numerics/Newton.js.map +1 -1
- package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
- package/lib/esm/numerics/PolarData.js.map +1 -1
- package/lib/esm/numerics/Polynomials.js.map +1 -1
- package/lib/esm/numerics/Quadrature.js.map +1 -1
- package/lib/esm/numerics/Range1dArray.js.map +1 -1
- package/lib/esm/numerics/SmallSystem.d.ts +13 -7
- package/lib/esm/numerics/SmallSystem.d.ts.map +1 -1
- package/lib/esm/numerics/SmallSystem.js +13 -7
- package/lib/esm/numerics/SmallSystem.js.map +1 -1
- package/lib/esm/numerics/TriDiagonalSystem.js.map +1 -1
- package/lib/esm/numerics/UnionFind.js.map +1 -1
- package/lib/esm/numerics/UsageSums.js.map +1 -1
- package/lib/esm/polyface/AuxData.js.map +1 -1
- package/lib/esm/polyface/BoxTopology.js.map +1 -1
- package/lib/esm/polyface/FacetFaceData.js.map +1 -1
- package/lib/esm/polyface/FacetLocationDetail.js.map +1 -1
- package/lib/esm/polyface/FacetOrientation.js.map +1 -1
- package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceWalker.js.map +1 -1
- package/lib/esm/polyface/Polyface.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts +25 -6
- package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js +59 -8
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
- package/lib/esm/polyface/PolyfaceData.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js +8 -10
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/polyface/RangeLengthData.js.map +1 -1
- package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/MinimumValueTester.js.map +1 -1
- package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.d.ts +8 -5
- package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.d.ts.map +1 -1
- package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js +8 -4
- package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.d.ts +3 -3
- package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.d.ts.map +1 -1
- package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js +1 -1
- package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts +4 -2
- package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeNode.js +9 -12
- package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.d.ts +8 -3
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.d.ts.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js +13 -6
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
- package/lib/esm/polyface/TaggedNumericData.js.map +1 -1
- package/lib/esm/polyface/TriangleCandidate.js.map +1 -1
- package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
- package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
- package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
- package/lib/esm/polyface/multiclip/RangeSearch.js.map +1 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
- package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
- package/lib/esm/serialization/BGFBReader.js.map +1 -1
- package/lib/esm/serialization/BGFBWriter.js.map +1 -1
- package/lib/esm/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
- package/lib/esm/serialization/DeepCompare.js +1 -1
- package/lib/esm/serialization/DeepCompare.js.map +1 -1
- package/lib/esm/serialization/GeometrySamples.d.ts +2 -1
- package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js +2 -1
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/esm/serialization/SerializationHelpers.js.map +1 -1
- package/lib/esm/solid/Box.js.map +1 -1
- package/lib/esm/solid/Cone.js.map +1 -1
- package/lib/esm/solid/LinearSweep.js.map +1 -1
- package/lib/esm/solid/RotationalSweep.js.map +1 -1
- package/lib/esm/solid/RuledSweep.js.map +1 -1
- package/lib/esm/solid/SolidPrimitive.js.map +1 -1
- package/lib/esm/solid/Sphere.js.map +1 -1
- package/lib/esm/solid/SweepContour.js.map +1 -1
- package/lib/esm/solid/TorusPipe.js.map +1 -1
- package/lib/esm/topology/ChainMerge.js.map +1 -1
- package/lib/esm/topology/Graph.d.ts +38 -12
- package/lib/esm/topology/Graph.d.ts.map +1 -1
- package/lib/esm/topology/Graph.js +92 -24
- package/lib/esm/topology/Graph.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts +5 -4
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js +6 -5
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.d.ts +20 -11
- package/lib/esm/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.js +43 -39
- package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphValidation.js.map +1 -1
- package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
- package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
- package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
- package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
- package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
- package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/esm/topology/MaskManager.js.map +1 -1
- package/lib/esm/topology/Merging.d.ts +7 -4
- package/lib/esm/topology/Merging.d.ts.map +1 -1
- package/lib/esm/topology/Merging.js +17 -12
- package/lib/esm/topology/Merging.js.map +1 -1
- package/lib/esm/topology/RegularizeFace.js.map +1 -1
- package/lib/esm/topology/SignedDataSummary.js.map +1 -1
- package/lib/esm/topology/SpaceTriangulation.js.map +1 -1
- package/lib/esm/topology/Triangulation.d.ts +13 -11
- package/lib/esm/topology/Triangulation.d.ts.map +1 -1
- package/lib/esm/topology/Triangulation.js +40 -36
- package/lib/esm/topology/Triangulation.js.map +1 -1
- package/lib/esm/topology/Voronoi.d.ts +195 -0
- package/lib/esm/topology/Voronoi.d.ts.map +1 -0
- package/lib/esm/topology/Voronoi.js +696 -0
- package/lib/esm/topology/Voronoi.js.map +1 -0
- package/lib/esm/topology/XYParitySearchContext.d.ts +1 -1
- package/lib/esm/topology/XYParitySearchContext.d.ts.map +1 -1
- package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MomentData.js","sourceRoot":"","sources":["../../../src/geometry4d/MomentData.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,yDAAyD;AACzD,mBAAmB;AAEnB,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAO,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,UAAU;IACrB,4BAA4B;IACrB,MAAM,CAAU;IACvB,6CAA6C;IACtC,UAAU,CAAU;IAC3B;;;;OAIG;IACI,IAAI,CAAW;IACtB;;;OAGG;IACI,eAAe,CAAY;IAClC,oEAAoE;IAC7D,gBAAgB,CAAW;IAClC;;;OAGG;IACI,gBAAgB,CAAU;IACjC,oBAAoB;IACZ,MAAM,CAAC,QAAQ,CAAW;IAC1B,MAAM,CAAC,QAAQ,CAAW;IAC1B,MAAM,CAAC,QAAQ,CAAW;IAC1B,OAAO,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAC3B,OAAO,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IACnC,mBAAmB;IACnB;QACE,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QACnC,IAAI,CAAC,UAAU,GAAG,KAAK,CA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IACJ,CAAC;IACD;;;;OAIG;IACI,4BAA4B,CAAC,MAAe,EAAE,QAAkB,EAAE,KAAa;QACpF,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAC/B,IAAI,CAAC,IAAI,CAAC,6BAA6B,CACrC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,KAAK,CAC9F,CAAC;IACJ,CAAC;IACD,qCAAqC;IAC9B,MAAM;QACX,OAAO;YACL,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YACxB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE;YAChD,YAAY,EAAE,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE;SAC5C,CAAC;IACJ,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 */\n\n/* eslint-disable @typescript-eslint/naming-convention */\n// cspell:word ABAT\n\nimport { Geometry } from \"../Geometry\";\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\nimport { Point3d, Vector3d, XYZ } from \"../geometry3d/Point3dVector3d\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { XAndY, XYAndZ } from \"../geometry3d/XYZProps\";\nimport { Matrix4d } from \"./Matrix4d\";\nimport { Point4d } from \"./Point4d\";\n\n/**\n * A MomentData structure exists in several levels:\n * * First level: as a carrier of sums of inertial products that determine moments.\n * * origin = local origin used as moments are summed.\n * * sums = array of summed moments.\n * * The [i,j] entry of the sums is a summed or integrated moment for product of axis i and j.\n * * axes 0,1,2 are x,y,z.\n * * e.g. entry [0,1] is summed product xy\n * * axis 3 is \"w\", which is 1 in sums.\n * * e.g. entry 03 is summed x.\n * * In this level:\n * * the `absoluteQuantity` member is undefined.\n * * the `localToWorldMap` and `radiiOfGyration` are created but have undefined contents.\n * * Second level: after a call to `inertiaProductsToPrincipalAxes`, the `localToWorldMap`, `absoluteQuantity` and\n * `radiiOfGyration` are filled in.\n * @public\n */\nexport class MomentData {\n /** Origin used for sums. */\n public origin: Point3d;\n /** Flag to request deferred origin setup. */\n public needOrigin: boolean;\n /**\n * Moment sums.\n * * Set to zero at initialization and if requested later.\n * * Accumulated during data entry phase.\n */\n public sums: Matrix4d;\n /**\n * The mapping between principal and world system.\n * * This set up with its inverse already constructed.\n */\n public localToWorldMap: Transform;\n /** Radii of gyration (square roots of principal second moments). */\n public radiusOfGyration: Vector3d;\n /**\n * Principal quantity (e.g. length, area, or volume). This is undefined in raw moments, and becomes defined by\n * inertiaProductsToPrincipalAxes.\n */\n public absoluteQuantity?: number;\n // private variables\n private static _vectorA?: Point4d;\n private static _vectorB?: Point4d;\n private static _vectorC?: Point4d;\n private _point0 = Point3d.create();\n private _point1 = Point3d.create();\n /** Constructor. */\n private constructor() {\n this.origin = Point3d.createZero();\n this.needOrigin = false;\n this.sums = Matrix4d.createZero();\n this.localToWorldMap = Transform.createIdentity();\n this.radiusOfGyration = Vector3d.create();\n this.absoluteQuantity = 0.1; // so optimizer sees its type\n this.absoluteQuantity = undefined;\n }\n /**\n * Return the lower-right (3,3) entry in the sums.\n * * This is the quantity (i.e. length, area, or volume) summed.\n */\n public get quantitySum(): number {\n return this.sums.weight();\n }\n /**\n * Return a scale factor to make these sums match the target orientation sign.\n * * 1.0 if `this.quantitySum` has the same sign as `targetSign`.\n * * -1.0 if `this.quantitySum` has the opposite sign from `targetSign`\n */\n public signFactor(targetSign: number): number {\n return targetSign * this.quantitySum > 0 ? 1.0 : -1.0;\n }\n /** If `this.needOrigin` flag is set, copy `origin` to `this.origin` and clear the flag. */\n public setOriginIfNeeded(origin: Point3d) {\n if (this.needOrigin) {\n this.origin.setFromPoint3d(origin);\n this.needOrigin = false;\n }\n }\n /** If `this.needOrigin` flag is set, copy `origin` to `this.origin` and clear the flag. */\n public setOriginFromGrowableXYZArrayIfNeeded(points: GrowableXYZArray) {\n if (this.needOrigin && points.length > 0) {\n points.getPoint3dAtCheckedPointIndex(0, this.origin);\n this.needOrigin = false;\n }\n }\n /** If `this.needOrigin` flag is set, copy `origin` to `this.origin` and clear the flag. */\n public setOriginXYZIfNeeded(x: number, y: number, z: number) {\n if (this.needOrigin) {\n this.origin.set(x, y, z);\n this.needOrigin = false;\n }\n }\n /**\n * Create moments with optional origin.\n * * Origin and needOrigin are quirky.\n * * (undefined, true) sets up to use first incoming point as origin.\n * * (origin) sets up to use that durable origin, set needsOrigin flag false.\n * * (origin, true) the \"true\" is meaningless.\n * * (undefined, false) makes 000 the durable origin.\n */\n public static create(origin?: Point3d | undefined, needOrigin: boolean = false): MomentData {\n const data = new MomentData();\n data.needOrigin = needOrigin;\n if (origin) {\n data.origin.setFromPoint3d(origin);\n data.needOrigin = false;\n }\n return data;\n }\n /**\n * Return the formal tensor of integrated values `[yy+zz,xy,xz][yx,xx+zz,yz][zx,xy,xx+yy]`.\n * @param products matrix of (integrated) `[xx,xy,xz][yx,yy,yz][zx,xy,zz]`.\n */\n public static momentTensorFromInertiaProducts(products: Matrix3d): Matrix3d {\n const rr = products.sumDiagonal();\n const result = Matrix3d.createScale(rr, rr, rr);\n result.addScaledInPlace(products, -1.0);\n return result;\n }\n /** Sort the columns of the matrix for increasing moments. */\n public static sortColumnsForIncreasingMoments(axes: Matrix3d, moments: Vector3d) {\n const points = [\n axes.indexedColumnWithWeight(0, moments.x),\n axes.indexedColumnWithWeight(1, moments.y),\n axes.indexedColumnWithWeight(2, moments.z),\n ].sort((dataA: Point4d, dataB: Point4d): number => {\n if (dataA.w < dataB.w) return -1;\n if (dataA.w > dataB.w) return 1;\n return 0;\n });\n axes.setColumnsPoint4dXYZ(points[0], points[1], points[2]);\n if (axes.determinant() < 0)\n axes.scaleColumnsInPlace(-1.0, -1.0, -1.0);\n // prefer x and z positive; y falls wherever\n if (axes.at(0, 0) < 0.0)\n axes.scaleColumnsInPlace(-1.0, -1.0, 1.0);\n if (axes.at(2, 2) < 0.0)\n axes.scaleColumnsInPlace(1.0, -1.0, -1.0);\n moments.set(points[0].w, points[1].w, points[2].w);\n }\n /**\n * Return the principal moment data for an array of points.\n * @param points array of points.\n */\n public static pointsToPrincipalAxes(points: Point3d[]): MomentData | undefined {\n const moments = new MomentData();\n if (points.length === 0)\n return moments;\n moments.clearSums(points[0]);\n moments.accumulatePointMomentsFromOrigin(points);\n return this.inertiaProductsToPrincipalAxes(moments.origin, moments.sums);\n }\n /**\n * Compute principal axes from inertial products.\n * * The radii of gyration are sorted smallest to largest.\n * * Hence x axis is long direction.\n * * Hence planar data generates large moment as Z.\n * @param origin The origin used for the inertia products.\n * @param inertiaProducts The inertia products: sums or integrals of\n * [xx,xy,xz,xw; yx,yy,yz,yw; zx,zy,zz,zw; wx,wy,wz,w].\n */\n public static inertiaProductsToPrincipalAxes(origin: XYZ, inertiaProducts: Matrix4d): MomentData | undefined {\n const moments = new MomentData();\n moments.sums.setFrom(inertiaProducts);\n moments.origin.setFrom(origin);\n if (!moments.shiftOriginAndSumsToCentroidOfSums())\n return undefined;\n const products = moments.sums.matrixPart();\n const w = moments.sums.weight();\n if (w < 0.0)\n products.scaleColumnsInPlace(-1, -1, -1);\n const tensor = MomentData.momentTensorFromInertiaProducts(products);\n const moment2 = Vector3d.create();\n const axisVectors = Matrix3d.createZero();\n tensor.fastSymmetricEigenvalues(axisVectors, moment2);\n if (moment2.x < 0.0)\n return undefined;\n MomentData.sortColumnsForIncreasingMoments(axisVectors, moment2);\n if (w < 0.0)\n axisVectors.scaleColumnsInPlace(1, -1, -1);\n moments.localToWorldMap = Transform.createOriginAndMatrix(moments.origin, axisVectors);\n moments.radiusOfGyration.set(\n Math.sqrt(Math.abs(moment2.x)), Math.sqrt(Math.abs(moment2.y)), Math.sqrt(Math.abs(moment2.z)),\n );\n moments.radiusOfGyration.scaleInPlace(1.0 / Math.sqrt(Math.abs(w)));\n moments.absoluteQuantity = Math.abs(w);\n return moments;\n }\n /**\n * Test for match among selected members as they exist after `inertiaProductsToPrincipalAxes`.\n * * The members considered are:\n * * origin of local to world map (i.e. centroid),\n * * radius of gyration,\n * * axes of localToWorldMap.\n * * Axis direction tests allow these quirks:\n * * opposite orientation is considered matched.\n * * Full xyz symmetry: If x,y,z radii are matched, axes are not tested.\n * * Symmetry in xy plane: If x and y radii are matched, the x and y axes area allowed to spin freely. Only Z direction\n * is tested.\n * * If either or both are undefined, returns false.\n * @param dataA first set of moments.\n * @param dataB second set of moments.\n */\n public static areEquivalentPrincipalAxes(dataA: MomentData | undefined, dataB: MomentData | undefined): boolean {\n if (dataA && dataB\n && Geometry.isSameCoordinate(dataA.quantitySum, dataB.quantitySum)) { // TODO: need different tolerance for area, volume?\n if (dataA.localToWorldMap.getOrigin().isAlmostEqual(dataB.localToWorldMap.getOrigin())\n && dataA.radiusOfGyration.isAlmostEqual(dataB.radiusOfGyration)) {\n if (Geometry.isSameCoordinate(dataA.radiusOfGyration.x, dataA.radiusOfGyration.y)) {\n // we have at least xy symmetry\n if (Geometry.isSameCoordinate(dataA.radiusOfGyration.x, dataA.radiusOfGyration.z))\n return true;\n // just xy; allow opposite z directions; if the z's are aligned, x and y can spin freely\n const zA = dataA.localToWorldMap.matrix.columnZ();\n const zB = dataB.localToWorldMap.matrix.columnZ();\n if (zA.isParallelTo(zB, true))\n return true;\n return false;\n }\n // no symmetry; test all three axes\n const vectorA = Vector3d.create();\n const vectorB = Vector3d.create();\n for (let i = 0; i < 3; i++) {\n dataA.localToWorldMap.matrix.getColumn(i, vectorA);\n dataB.localToWorldMap.matrix.getColumn(i, vectorB);\n if (!vectorA.isParallelTo(vectorB, true))\n return false;\n }\n return true;\n }\n }\n return false;\n }\n /** Clear the MomentData sums to zero, and establish a new origin. */\n public clearSums(origin?: Point3d) {\n this.sums.setZero();\n if (origin)\n this.origin.setFrom(origin);\n else\n this.origin.setZero();\n }\n /** Accumulate products-of-components for given points. */\n public accumulatePointMomentsFromOrigin(points: Point3d[]) {\n for (const p of points) {\n this.sums.addMomentsInPlace(\n p.x - this.origin.x,\n p.y - this.origin.y,\n p.z - this.origin.z,\n 1.0,\n );\n }\n }\n /** Revise the accumulated sums to be \"around the centroid\". */\n public shiftOriginAndSumsToCentroidOfSums(): boolean {\n const xyz = this.sums.columnW().realPoint(); // centroid of the geometry\n if (xyz) {\n this.shiftOriginAndSumsByXYZ(xyz.x, xyz.y, xyz.z);\n return true;\n }\n return false;\n }\n /**\n * Revise the accumulated sums.\n * * Add (ax,ay,az) to the origin coordinates.\n * * Apply the negative translation to the sums.\n */\n public shiftOriginAndSumsByXYZ(ax: number, ay: number, az: number) {\n this.origin.addXYZInPlace(ax, ay, az);\n this.sums.multiplyTranslationSandwichInPlace(-ax, -ay, -az);\n }\n /** Revise the accumulated sums so they are based at a specified origin. */\n public shiftOriginAndSumsToNewOrigin(newOrigin: XYAndZ) {\n this.shiftOriginAndSumsByXYZ(newOrigin.x - this.origin.x, newOrigin.y - this.origin.y, newOrigin.z - this.origin.z);\n }\n /**\n * Compute moments of a triangle from the origin. Accumulate them to `this.sums`.\n * * If `this.needOrigin` is set, `this.origin` is set to `pointB`.\n * * If `pointA` is undefined, use `this.origin` as `pointA`.\n */\n public accumulateTriangleMomentsXY(pointA: XAndY | undefined, pointB: XAndY, pointC: XAndY) {\n this.setOriginXYZIfNeeded(pointB.x, pointB.y, 0.0);\n const x0 = this.origin.x;\n const y0 = this.origin.y;\n const vectorA = MomentData._vectorA = (pointA !== undefined) ?\n Point4d.create(pointA.x - x0, pointA.y - y0, 0.0, 1.0, MomentData._vectorA) :\n Point4d.create(0.0, 0.0, 0.0, 1.0, MomentData._vectorA);\n const vectorB = MomentData._vectorB = Point4d.create(pointB.x - x0, pointB.y - y0, 0.0, 1.0, MomentData._vectorB);\n const vectorC = MomentData._vectorC = Point4d.create(pointC.x - x0, pointC.y - y0, 0.0, 1.0, MomentData._vectorC);\n // Below we calculate 16 double integrals: \\iint_T [x y 0 1]^ [x y 0 1] dT over triangle T=(A,B,C).\n // Each accumulates contributions from 9 scaled outer products. Integration computations use the barycentric\n // change of variables [B-A C-A][u,v]^ = [x,y]^ with Jacobian detJ = B-A x C-A = twice the area of T.\n // This converts the integration domain from T to the triangle bounded by u=0, v=0 and v=1-u, yielding e.g.,\n // \\iint_T x^2 dT = detJ \\int_0^1 \\int_0^{1-u} u^2 dv du = detJ / 12, and similarly \\iint_T xy dT = detJ / 24.\n const detJ = Geometry.crossProductXYXY(\n vectorB.x - vectorA.x, vectorB.y - vectorA.y, vectorC.x - vectorA.x, vectorC.y - vectorA.y,\n );\n if (detJ !== 0.0) {\n const r1_12 = detJ / 12.0;\n const r1_24 = detJ / 24.0;\n\n this.sums.addScaledOuterProductInPlace(vectorA, vectorA, r1_12);\n this.sums.addScaledOuterProductInPlace(vectorA, vectorB, r1_24);\n this.sums.addScaledOuterProductInPlace(vectorA, vectorC, r1_24);\n\n this.sums.addScaledOuterProductInPlace(vectorB, vectorA, r1_24);\n this.sums.addScaledOuterProductInPlace(vectorB, vectorB, r1_12);\n this.sums.addScaledOuterProductInPlace(vectorB, vectorC, r1_24);\n\n this.sums.addScaledOuterProductInPlace(vectorC, vectorA, r1_24);\n this.sums.addScaledOuterProductInPlace(vectorC, vectorB, r1_24);\n this.sums.addScaledOuterProductInPlace(vectorC, vectorC, r1_12);\n }\n }\n /** Add scaled outer product of (4d, unit weight) point to `this.sums`. */\n public accumulateScaledOuterProduct(point: XYAndZ, scaleFactor: number) {\n this.setOriginXYZIfNeeded(point.x, point.y, 0.0);\n const vectorA = MomentData._vectorA = Point4d.create(\n point.x - this.origin.x, point.y - this.origin.y, point.z - this.origin.z, 1.0, MomentData._vectorA,\n );\n this.sums.addScaledOuterProductInPlace(vectorA, vectorA, scaleFactor);\n }\n /** Accumulate wire moment integral from pointA to pointB */\n public accumulateLineMomentsXYZ(pointA: Point3d, pointB: Point3d) {\n this.setOriginXYZIfNeeded(pointA.x, pointA.y, pointA.z);\n const x0 = this.origin.x;\n const y0 = this.origin.y;\n const z0 = this.origin.z;\n const vectorA = MomentData._vectorA = Point4d.create(\n pointA.x - x0, pointA.y - y0, pointA.z - z0, 1.0, MomentData._vectorA,\n );\n const vectorB = MomentData._vectorB = Point4d.create(\n pointB.x - x0, pointB.y - y0, pointB.z - z0, 1.0, MomentData._vectorB,\n );\n const detJ = pointA.distance(pointB);\n const r1_3 = detJ / 3.0;\n const r1_6 = detJ / 6.0;\n this.sums.addScaledOuterProductInPlace(vectorA, vectorA, r1_3);\n this.sums.addScaledOuterProductInPlace(vectorA, vectorB, r1_6);\n this.sums.addScaledOuterProductInPlace(vectorB, vectorA, r1_6);\n this.sums.addScaledOuterProductInPlace(vectorB, vectorB, r1_3);\n }\n /**\n * Compute moments of triangles from a base point to the given linestring. Accumulate them to `this.sums`.\n * * If `this.needOrigin` is set, `this.origin` is set to the first point of the array.\n * * If `sweepBase` is undefined, use `this.origin` as `sweepBase`.\n */\n public accumulateTriangleToLineStringMomentsXY(sweepBase: XAndY | undefined, points: GrowableXYZArray) {\n const n = points.length;\n if (n > 1) {\n points.getPoint3dAtUncheckedPointIndex(0, this._point0);\n // The linestring forms a polygon with sweepBase. Integrate over this polygon using Shoelace algorithm.\n for (let i = 1; i < n; i++) {\n points.getPoint3dAtUncheckedPointIndex(i, this._point1);\n this.accumulateTriangleMomentsXY(sweepBase, this._point0, this._point1);\n this._point0.setFromPoint3d(this._point1);\n }\n }\n }\n /**\n * Assemble XX, YY, XY products into a full matrix form [xx,xy,0,0; xy,yy,0,0; 0,0,0,0; 0,0,0,1].\n * * Sandwich this between transforms with columns [vectorU, vectorV, 0000, origin].\n * (column weights 0001; only xy parts of vectors).\n * * Scale by detJ for the xy-only determinant of the vectors.\n * @param productXX\n * @param productXY\n * @param productYY\n * @param area area in caller's system.\n * @param origin caller's origin.\n * @param vectorU caller's U axis (not necessarily unit).\n * @param vectorV caller's V axis (not necessarily unit).\n */\n public accumulateXYProductsInCentroidalFrame(\n productXX: number, productXY: number, productYY: number,\n area: number, origin: XAndY, vectorU: XAndY, vectorV: XAndY,\n ) {\n const centroidalProducts = Matrix4d.createRowValues(\n productXX, productXY, 0, 0,\n productXY, productYY, 0, 0,\n 0, 0, 0, 0,\n 0, 0, 0, area,\n );\n const detJ = Geometry.crossProductXYXY(vectorU.x, vectorV.x, vectorU.y, vectorV.y);\n const placement = Matrix4d.createRowValues(\n vectorU.x, vectorV.x, 0, origin.x - this.origin.x,\n vectorU.y, vectorV.y, 0, origin.y - this.origin.y,\n 0, 0, 0, 0,\n 0, 0, 0, 1,\n );\n const AB = placement.multiplyMatrixMatrix(centroidalProducts);\n const ABAT = AB.multiplyMatrixMatrixTranspose(placement);\n this.sums.addScaledInPlace(ABAT, detJ);\n }\n /**\n * Accumulate sums from other moments.\n * * Scale by given scaleFactor (e.g. sign to correct orientation).\n * * Pull the origin from `other` if `this` needs an origin.\n */\n public accumulateProducts(other: MomentData, scale: number) {\n this.setOriginIfNeeded(other.origin);\n this.sums.addTranslationSandwichInPlace(\n other.sums, this.origin.x - other.origin.x, this.origin.y - other.origin.y, this.origin.z - other.origin.z, scale,\n );\n }\n /**\n * Accumulate sums from Matrix4d and origin.\n * * Scale by given scaleFactor (e.g. sign to correct orientation).\n * * Trap the origin if `this` needs an origin.\n */\n public accumulateProductsFromOrigin(origin: Point3d, products: Matrix4d, scale: number) {\n this.setOriginIfNeeded(origin);\n this.sums.addTranslationSandwichInPlace(\n products, this.origin.x - origin.x, this.origin.y - origin.y, this.origin.z - origin.z, scale,\n );\n }\n /** Convert to a json data object. */\n public toJSON(): any {\n return {\n origin: this.origin,\n sums: this.sums.toJSON(),\n radiusOfGyration: this.radiusOfGyration.toJSON(),\n localToWorld: this.localToWorldMap.toJSON(),\n };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"MomentData.js","sourceRoot":"","sources":["../../../src/geometry4d/MomentData.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,yDAAyD;AACzD,mBAAmB;AAEnB,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAO,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,UAAU;IACrB,4BAA4B;IACrB,MAAM,CAAU;IACvB,6CAA6C;IACtC,UAAU,CAAU;IAC3B;;;;OAIG;IACI,IAAI,CAAW;IACtB;;;OAGG;IACI,eAAe,CAAY;IAClC,oEAAoE;IAC7D,gBAAgB,CAAW;IAClC;;;OAGG;IACI,gBAAgB,CAAU;IACjC,oBAAoB;IACZ,MAAM,CAAC,QAAQ,CAAW;IAC1B,MAAM,CAAC,QAAQ,CAAW;IAC1B,MAAM,CAAC,QAAQ,CAAW;IAC1B,OAAO,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAC3B,OAAO,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IACnC,mBAAmB;IACnB;QACE,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QACnC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,UAAU,EAAE,CAAC;QAClC,IAAI,CAAC,eAAe,GAAG,SAAS,C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,CAAC,MAAM,CAAC,CAAC;QAC/B,IAAI,CAAC,IAAI,CAAC,6BAA6B,CACrC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,KAAK,CAC9F,CAAC;IACJ,CAAC;IACD,qCAAqC;IAC9B,MAAM;QACX,OAAO;YACL,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YACxB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE;YAChD,YAAY,EAAE,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE;SAC5C,CAAC;IACJ,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\n\r\n/* eslint-disable @typescript-eslint/naming-convention */\r\n// cspell:word ABAT\r\n\r\nimport { Geometry } from \"../Geometry\";\r\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\r\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\r\nimport { Point3d, Vector3d, XYZ } from \"../geometry3d/Point3dVector3d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { XAndY, XYAndZ } from \"../geometry3d/XYZProps\";\r\nimport { Matrix4d } from \"./Matrix4d\";\r\nimport { Point4d } from \"./Point4d\";\r\n\r\n/**\r\n * A MomentData structure exists in several levels:\r\n * * First level: as a carrier of sums of inertial products that determine moments.\r\n * * origin = local origin used as moments are summed.\r\n * * sums = array of summed moments.\r\n * * The [i,j] entry of the sums is a summed or integrated moment for product of axis i and j.\r\n * * axes 0,1,2 are x,y,z.\r\n * * e.g. entry [0,1] is summed product xy\r\n * * axis 3 is \"w\", which is 1 in sums.\r\n * * e.g. entry 03 is summed x.\r\n * * In this level:\r\n * * the `absoluteQuantity` member is undefined.\r\n * * the `localToWorldMap` and `radiiOfGyration` are created but have undefined contents.\r\n * * Second level: after a call to `inertiaProductsToPrincipalAxes`, the `localToWorldMap`, `absoluteQuantity` and\r\n * `radiiOfGyration` are filled in.\r\n * @public\r\n */\r\nexport class MomentData {\r\n /** Origin used for sums. */\r\n public origin: Point3d;\r\n /** Flag to request deferred origin setup. */\r\n public needOrigin: boolean;\r\n /**\r\n * Moment sums.\r\n * * Set to zero at initialization and if requested later.\r\n * * Accumulated during data entry phase.\r\n */\r\n public sums: Matrix4d;\r\n /**\r\n * The mapping between principal and world system.\r\n * * This set up with its inverse already constructed.\r\n */\r\n public localToWorldMap: Transform;\r\n /** Radii of gyration (square roots of principal second moments). */\r\n public radiusOfGyration: Vector3d;\r\n /**\r\n * Principal quantity (e.g. length, area, or volume). This is undefined in raw moments, and becomes defined by\r\n * inertiaProductsToPrincipalAxes.\r\n */\r\n public absoluteQuantity?: number;\r\n // private variables\r\n private static _vectorA?: Point4d;\r\n private static _vectorB?: Point4d;\r\n private static _vectorC?: Point4d;\r\n private _point0 = Point3d.create();\r\n private _point1 = Point3d.create();\r\n /** Constructor. */\r\n private constructor() {\r\n this.origin = Point3d.createZero();\r\n this.needOrigin = false;\r\n this.sums = Matrix4d.createZero();\r\n this.localToWorldMap = Transform.createIdentity();\r\n this.radiusOfGyration = Vector3d.create();\r\n this.absoluteQuantity = 0.1; // so optimizer sees its type\r\n this.absoluteQuantity = undefined;\r\n }\r\n /**\r\n * Return the lower-right (3,3) entry in the sums.\r\n * * This is the quantity (i.e. length, area, or volume) summed.\r\n */\r\n public get quantitySum(): number {\r\n return this.sums.weight();\r\n }\r\n /**\r\n * Return a scale factor to make these sums match the target orientation sign.\r\n * * 1.0 if `this.quantitySum` has the same sign as `targetSign`.\r\n * * -1.0 if `this.quantitySum` has the opposite sign from `targetSign`\r\n */\r\n public signFactor(targetSign: number): number {\r\n return targetSign * this.quantitySum > 0 ? 1.0 : -1.0;\r\n }\r\n /** If `this.needOrigin` flag is set, copy `origin` to `this.origin` and clear the flag. */\r\n public setOriginIfNeeded(origin: Point3d) {\r\n if (this.needOrigin) {\r\n this.origin.setFromPoint3d(origin);\r\n this.needOrigin = false;\r\n }\r\n }\r\n /** If `this.needOrigin` flag is set, copy `origin` to `this.origin` and clear the flag. */\r\n public setOriginFromGrowableXYZArrayIfNeeded(points: GrowableXYZArray) {\r\n if (this.needOrigin && points.length > 0) {\r\n points.getPoint3dAtCheckedPointIndex(0, this.origin);\r\n this.needOrigin = false;\r\n }\r\n }\r\n /** If `this.needOrigin` flag is set, copy `origin` to `this.origin` and clear the flag. */\r\n public setOriginXYZIfNeeded(x: number, y: number, z: number) {\r\n if (this.needOrigin) {\r\n this.origin.set(x, y, z);\r\n this.needOrigin = false;\r\n }\r\n }\r\n /**\r\n * Create moments with optional origin.\r\n * * Origin and needOrigin are quirky.\r\n * * (undefined, true) sets up to use first incoming point as origin.\r\n * * (origin) sets up to use that durable origin, set needsOrigin flag false.\r\n * * (origin, true) the \"true\" is meaningless.\r\n * * (undefined, false) makes 000 the durable origin.\r\n */\r\n public static create(origin?: Point3d | undefined, needOrigin: boolean = false): MomentData {\r\n const data = new MomentData();\r\n data.needOrigin = needOrigin;\r\n if (origin) {\r\n data.origin.setFromPoint3d(origin);\r\n data.needOrigin = false;\r\n }\r\n return data;\r\n }\r\n /**\r\n * Return the formal tensor of integrated values `[yy+zz,xy,xz][yx,xx+zz,yz][zx,xy,xx+yy]`.\r\n * @param products matrix of (integrated) `[xx,xy,xz][yx,yy,yz][zx,xy,zz]`.\r\n */\r\n public static momentTensorFromInertiaProducts(products: Matrix3d): Matrix3d {\r\n const rr = products.sumDiagonal();\r\n const result = Matrix3d.createScale(rr, rr, rr);\r\n result.addScaledInPlace(products, -1.0);\r\n return result;\r\n }\r\n /** Sort the columns of the matrix for increasing moments. */\r\n public static sortColumnsForIncreasingMoments(axes: Matrix3d, moments: Vector3d) {\r\n const points = [\r\n axes.indexedColumnWithWeight(0, moments.x),\r\n axes.indexedColumnWithWeight(1, moments.y),\r\n axes.indexedColumnWithWeight(2, moments.z),\r\n ].sort((dataA: Point4d, dataB: Point4d): number => {\r\n if (dataA.w < dataB.w) return -1;\r\n if (dataA.w > dataB.w) return 1;\r\n return 0;\r\n });\r\n axes.setColumnsPoint4dXYZ(points[0], points[1], points[2]);\r\n if (axes.determinant() < 0)\r\n axes.scaleColumnsInPlace(-1.0, -1.0, -1.0);\r\n // prefer x and z positive; y falls wherever\r\n if (axes.at(0, 0) < 0.0)\r\n axes.scaleColumnsInPlace(-1.0, -1.0, 1.0);\r\n if (axes.at(2, 2) < 0.0)\r\n axes.scaleColumnsInPlace(1.0, -1.0, -1.0);\r\n moments.set(points[0].w, points[1].w, points[2].w);\r\n }\r\n /**\r\n * Return the principal moment data for an array of points.\r\n * @param points array of points.\r\n */\r\n public static pointsToPrincipalAxes(points: Point3d[]): MomentData | undefined {\r\n const moments = new MomentData();\r\n if (points.length === 0)\r\n return moments;\r\n moments.clearSums(points[0]);\r\n moments.accumulatePointMomentsFromOrigin(points);\r\n return this.inertiaProductsToPrincipalAxes(moments.origin, moments.sums);\r\n }\r\n /**\r\n * Compute principal axes from inertial products.\r\n * * The radii of gyration are sorted smallest to largest.\r\n * * Hence x axis is long direction.\r\n * * Hence planar data generates large moment as Z.\r\n * @param origin The origin used for the inertia products.\r\n * @param inertiaProducts The inertia products: sums or integrals of\r\n * [xx,xy,xz,xw; yx,yy,yz,yw; zx,zy,zz,zw; wx,wy,wz,w].\r\n */\r\n public static inertiaProductsToPrincipalAxes(origin: XYZ, inertiaProducts: Matrix4d): MomentData | undefined {\r\n const moments = new MomentData();\r\n moments.sums.setFrom(inertiaProducts);\r\n moments.origin.setFrom(origin);\r\n if (!moments.shiftOriginAndSumsToCentroidOfSums())\r\n return undefined;\r\n const products = moments.sums.matrixPart();\r\n const w = moments.sums.weight();\r\n if (w < 0.0)\r\n products.scaleColumnsInPlace(-1, -1, -1);\r\n const tensor = MomentData.momentTensorFromInertiaProducts(products);\r\n const moment2 = Vector3d.create();\r\n const axisVectors = Matrix3d.createZero();\r\n tensor.fastSymmetricEigenvalues(axisVectors, moment2);\r\n if (moment2.x < 0.0)\r\n return undefined;\r\n MomentData.sortColumnsForIncreasingMoments(axisVectors, moment2);\r\n if (w < 0.0)\r\n axisVectors.scaleColumnsInPlace(1, -1, -1);\r\n moments.localToWorldMap = Transform.createOriginAndMatrix(moments.origin, axisVectors);\r\n moments.radiusOfGyration.set(\r\n Math.sqrt(Math.abs(moment2.x)), Math.sqrt(Math.abs(moment2.y)), Math.sqrt(Math.abs(moment2.z)),\r\n );\r\n moments.radiusOfGyration.scaleInPlace(1.0 / Math.sqrt(Math.abs(w)));\r\n moments.absoluteQuantity = Math.abs(w);\r\n return moments;\r\n }\r\n /**\r\n * Test for match among selected members as they exist after `inertiaProductsToPrincipalAxes`.\r\n * * The members considered are:\r\n * * origin of local to world map (i.e. centroid),\r\n * * radius of gyration,\r\n * * axes of localToWorldMap.\r\n * * Axis direction tests allow these quirks:\r\n * * opposite orientation is considered matched.\r\n * * Full xyz symmetry: If x,y,z radii are matched, axes are not tested.\r\n * * Symmetry in xy plane: If x and y radii are matched, the x and y axes area allowed to spin freely. Only Z direction\r\n * is tested.\r\n * * If either or both are undefined, returns false.\r\n * @param dataA first set of moments.\r\n * @param dataB second set of moments.\r\n */\r\n public static areEquivalentPrincipalAxes(dataA: MomentData | undefined, dataB: MomentData | undefined): boolean {\r\n if (dataA && dataB\r\n && Geometry.isSameCoordinate(dataA.quantitySum, dataB.quantitySum)) { // TODO: need different tolerance for area, volume?\r\n if (dataA.localToWorldMap.getOrigin().isAlmostEqual(dataB.localToWorldMap.getOrigin())\r\n && dataA.radiusOfGyration.isAlmostEqual(dataB.radiusOfGyration)) {\r\n if (Geometry.isSameCoordinate(dataA.radiusOfGyration.x, dataA.radiusOfGyration.y)) {\r\n // we have at least xy symmetry\r\n if (Geometry.isSameCoordinate(dataA.radiusOfGyration.x, dataA.radiusOfGyration.z))\r\n return true;\r\n // just xy; allow opposite z directions; if the z's are aligned, x and y can spin freely\r\n const zA = dataA.localToWorldMap.matrix.columnZ();\r\n const zB = dataB.localToWorldMap.matrix.columnZ();\r\n if (zA.isParallelTo(zB, true))\r\n return true;\r\n return false;\r\n }\r\n // no symmetry; test all three axes\r\n const vectorA = Vector3d.create();\r\n const vectorB = Vector3d.create();\r\n for (let i = 0; i < 3; i++) {\r\n dataA.localToWorldMap.matrix.getColumn(i, vectorA);\r\n dataB.localToWorldMap.matrix.getColumn(i, vectorB);\r\n if (!vectorA.isParallelTo(vectorB, true))\r\n return false;\r\n }\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n /** Clear the MomentData sums to zero, and establish a new origin. */\r\n public clearSums(origin?: Point3d) {\r\n this.sums.setZero();\r\n if (origin)\r\n this.origin.setFrom(origin);\r\n else\r\n this.origin.setZero();\r\n }\r\n /** Accumulate products-of-components for given points. */\r\n public accumulatePointMomentsFromOrigin(points: Point3d[]) {\r\n for (const p of points) {\r\n this.sums.addMomentsInPlace(\r\n p.x - this.origin.x,\r\n p.y - this.origin.y,\r\n p.z - this.origin.z,\r\n 1.0,\r\n );\r\n }\r\n }\r\n /** Revise the accumulated sums to be \"around the centroid\". */\r\n public shiftOriginAndSumsToCentroidOfSums(): boolean {\r\n const xyz = this.sums.columnW().realPoint(); // centroid of the geometry\r\n if (xyz) {\r\n this.shiftOriginAndSumsByXYZ(xyz.x, xyz.y, xyz.z);\r\n return true;\r\n }\r\n return false;\r\n }\r\n /**\r\n * Revise the accumulated sums.\r\n * * Add (ax,ay,az) to the origin coordinates.\r\n * * Apply the negative translation to the sums.\r\n */\r\n public shiftOriginAndSumsByXYZ(ax: number, ay: number, az: number) {\r\n this.origin.addXYZInPlace(ax, ay, az);\r\n this.sums.multiplyTranslationSandwichInPlace(-ax, -ay, -az);\r\n }\r\n /** Revise the accumulated sums so they are based at a specified origin. */\r\n public shiftOriginAndSumsToNewOrigin(newOrigin: XYAndZ) {\r\n this.shiftOriginAndSumsByXYZ(newOrigin.x - this.origin.x, newOrigin.y - this.origin.y, newOrigin.z - this.origin.z);\r\n }\r\n /**\r\n * Compute moments of a triangle from the origin. Accumulate them to `this.sums`.\r\n * * If `this.needOrigin` is set, `this.origin` is set to `pointB`.\r\n * * If `pointA` is undefined, use `this.origin` as `pointA`.\r\n */\r\n public accumulateTriangleMomentsXY(pointA: XAndY | undefined, pointB: XAndY, pointC: XAndY) {\r\n this.setOriginXYZIfNeeded(pointB.x, pointB.y, 0.0);\r\n const x0 = this.origin.x;\r\n const y0 = this.origin.y;\r\n const vectorA = MomentData._vectorA = (pointA !== undefined) ?\r\n Point4d.create(pointA.x - x0, pointA.y - y0, 0.0, 1.0, MomentData._vectorA) :\r\n Point4d.create(0.0, 0.0, 0.0, 1.0, MomentData._vectorA);\r\n const vectorB = MomentData._vectorB = Point4d.create(pointB.x - x0, pointB.y - y0, 0.0, 1.0, MomentData._vectorB);\r\n const vectorC = MomentData._vectorC = Point4d.create(pointC.x - x0, pointC.y - y0, 0.0, 1.0, MomentData._vectorC);\r\n // Below we calculate 16 double integrals: \\iint_T [x y 0 1]^ [x y 0 1] dT over triangle T=(A,B,C).\r\n // Each accumulates contributions from 9 scaled outer products. Integration computations use the barycentric\r\n // change of variables [B-A C-A][u,v]^ = [x,y]^ with Jacobian detJ = B-A x C-A = twice the area of T.\r\n // This converts the integration domain from T to the triangle bounded by u=0, v=0 and v=1-u, yielding e.g.,\r\n // \\iint_T x^2 dT = detJ \\int_0^1 \\int_0^{1-u} u^2 dv du = detJ / 12, and similarly \\iint_T xy dT = detJ / 24.\r\n const detJ = Geometry.crossProductXYXY(\r\n vectorB.x - vectorA.x, vectorB.y - vectorA.y, vectorC.x - vectorA.x, vectorC.y - vectorA.y,\r\n );\r\n if (detJ !== 0.0) {\r\n const r1_12 = detJ / 12.0;\r\n const r1_24 = detJ / 24.0;\r\n\r\n this.sums.addScaledOuterProductInPlace(vectorA, vectorA, r1_12);\r\n this.sums.addScaledOuterProductInPlace(vectorA, vectorB, r1_24);\r\n this.sums.addScaledOuterProductInPlace(vectorA, vectorC, r1_24);\r\n\r\n this.sums.addScaledOuterProductInPlace(vectorB, vectorA, r1_24);\r\n this.sums.addScaledOuterProductInPlace(vectorB, vectorB, r1_12);\r\n this.sums.addScaledOuterProductInPlace(vectorB, vectorC, r1_24);\r\n\r\n this.sums.addScaledOuterProductInPlace(vectorC, vectorA, r1_24);\r\n this.sums.addScaledOuterProductInPlace(vectorC, vectorB, r1_24);\r\n this.sums.addScaledOuterProductInPlace(vectorC, vectorC, r1_12);\r\n }\r\n }\r\n /** Add scaled outer product of (4d, unit weight) point to `this.sums`. */\r\n public accumulateScaledOuterProduct(point: XYAndZ, scaleFactor: number) {\r\n this.setOriginXYZIfNeeded(point.x, point.y, 0.0);\r\n const vectorA = MomentData._vectorA = Point4d.create(\r\n point.x - this.origin.x, point.y - this.origin.y, point.z - this.origin.z, 1.0, MomentData._vectorA,\r\n );\r\n this.sums.addScaledOuterProductInPlace(vectorA, vectorA, scaleFactor);\r\n }\r\n /** Accumulate wire moment integral from pointA to pointB */\r\n public accumulateLineMomentsXYZ(pointA: Point3d, pointB: Point3d) {\r\n this.setOriginXYZIfNeeded(pointA.x, pointA.y, pointA.z);\r\n const x0 = this.origin.x;\r\n const y0 = this.origin.y;\r\n const z0 = this.origin.z;\r\n const vectorA = MomentData._vectorA = Point4d.create(\r\n pointA.x - x0, pointA.y - y0, pointA.z - z0, 1.0, MomentData._vectorA,\r\n );\r\n const vectorB = MomentData._vectorB = Point4d.create(\r\n pointB.x - x0, pointB.y - y0, pointB.z - z0, 1.0, MomentData._vectorB,\r\n );\r\n const detJ = pointA.distance(pointB);\r\n const r1_3 = detJ / 3.0;\r\n const r1_6 = detJ / 6.0;\r\n this.sums.addScaledOuterProductInPlace(vectorA, vectorA, r1_3);\r\n this.sums.addScaledOuterProductInPlace(vectorA, vectorB, r1_6);\r\n this.sums.addScaledOuterProductInPlace(vectorB, vectorA, r1_6);\r\n this.sums.addScaledOuterProductInPlace(vectorB, vectorB, r1_3);\r\n }\r\n /**\r\n * Compute moments of triangles from a base point to the given linestring. Accumulate them to `this.sums`.\r\n * * If `this.needOrigin` is set, `this.origin` is set to the first point of the array.\r\n * * If `sweepBase` is undefined, use `this.origin` as `sweepBase`.\r\n */\r\n public accumulateTriangleToLineStringMomentsXY(sweepBase: XAndY | undefined, points: GrowableXYZArray) {\r\n const n = points.length;\r\n if (n > 1) {\r\n points.getPoint3dAtUncheckedPointIndex(0, this._point0);\r\n // The linestring forms a polygon with sweepBase. Integrate over this polygon using Shoelace algorithm.\r\n for (let i = 1; i < n; i++) {\r\n points.getPoint3dAtUncheckedPointIndex(i, this._point1);\r\n this.accumulateTriangleMomentsXY(sweepBase, this._point0, this._point1);\r\n this._point0.setFromPoint3d(this._point1);\r\n }\r\n }\r\n }\r\n /**\r\n * Assemble XX, YY, XY products into a full matrix form [xx,xy,0,0; xy,yy,0,0; 0,0,0,0; 0,0,0,1].\r\n * * Sandwich this between transforms with columns [vectorU, vectorV, 0000, origin].\r\n * (column weights 0001; only xy parts of vectors).\r\n * * Scale by detJ for the xy-only determinant of the vectors.\r\n * @param productXX\r\n * @param productXY\r\n * @param productYY\r\n * @param area area in caller's system.\r\n * @param origin caller's origin.\r\n * @param vectorU caller's U axis (not necessarily unit).\r\n * @param vectorV caller's V axis (not necessarily unit).\r\n */\r\n public accumulateXYProductsInCentroidalFrame(\r\n productXX: number, productXY: number, productYY: number,\r\n area: number, origin: XAndY, vectorU: XAndY, vectorV: XAndY,\r\n ) {\r\n const centroidalProducts = Matrix4d.createRowValues(\r\n productXX, productXY, 0, 0,\r\n productXY, productYY, 0, 0,\r\n 0, 0, 0, 0,\r\n 0, 0, 0, area,\r\n );\r\n const detJ = Geometry.crossProductXYXY(vectorU.x, vectorV.x, vectorU.y, vectorV.y);\r\n const placement = Matrix4d.createRowValues(\r\n vectorU.x, vectorV.x, 0, origin.x - this.origin.x,\r\n vectorU.y, vectorV.y, 0, origin.y - this.origin.y,\r\n 0, 0, 0, 0,\r\n 0, 0, 0, 1,\r\n );\r\n const AB = placement.multiplyMatrixMatrix(centroidalProducts);\r\n const ABAT = AB.multiplyMatrixMatrixTranspose(placement);\r\n this.sums.addScaledInPlace(ABAT, detJ);\r\n }\r\n /**\r\n * Accumulate sums from other moments.\r\n * * Scale by given scaleFactor (e.g. sign to correct orientation).\r\n * * Pull the origin from `other` if `this` needs an origin.\r\n */\r\n public accumulateProducts(other: MomentData, scale: number) {\r\n this.setOriginIfNeeded(other.origin);\r\n this.sums.addTranslationSandwichInPlace(\r\n other.sums, this.origin.x - other.origin.x, this.origin.y - other.origin.y, this.origin.z - other.origin.z, scale,\r\n );\r\n }\r\n /**\r\n * Accumulate sums from Matrix4d and origin.\r\n * * Scale by given scaleFactor (e.g. sign to correct orientation).\r\n * * Trap the origin if `this` needs an origin.\r\n */\r\n public accumulateProductsFromOrigin(origin: Point3d, products: Matrix4d, scale: number) {\r\n this.setOriginIfNeeded(origin);\r\n this.sums.addTranslationSandwichInPlace(\r\n products, this.origin.x - origin.x, this.origin.y - origin.y, this.origin.z - origin.z, scale,\r\n );\r\n }\r\n /** Convert to a json data object. */\r\n public toJSON(): any {\r\n return {\r\n origin: this.origin,\r\n sums: this.sums.toJSON(),\r\n radiusOfGyration: this.radiusOfGyration.toJSON(),\r\n localToWorld: this.localToWorldMap.toJSON(),\r\n };\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlaneByOriginAndVectors4d.js","sourceRoot":"","sources":["../../../src/geometry4d/PlaneByOriginAndVectors4d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAO/F,OAAO,EAAE,OAAO,EA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C,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IAC3E,CAAC;IACD,+DAA+D;IACxD,MAAM,CAAC,aAAa,CAAC,MAAkC;QAC5D,OAAO,yBAAyB,CAAC,0BAA0B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IAC1G,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 */\n\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\nimport { Point4d } from \"./Point4d\";\n\n/**\n * A PlaneByOriginAndVectors4d is a 4d origin and pair of 4d \"vectors\" defining a 4d plane.\n * * The parameterization of the plane is `X = origin + vectorU * u + vectorV * v`\n * * With particular weight values `origin.w === 1, vectorU.w === 0, vectorV.w === 0` this is like `Plane3dByOriginAndVectors`\n * * With other weights, the deweighted xyz coordinates of points on the 4d plane still form a 3d plane.\n * @public\n */\nexport class PlaneByOriginAndVectors4d {\n /** homogeneous origin */\n public origin: Point4d;\n /** homogeneous u-direction vector */\n public vectorU: Point4d;\n /** homogeneous v-direction vector */\n public vectorV: Point4d;\n private constructor(origin: Point4d, vectorU: Point4d, vectorV: Point4d) {\n this.origin = origin;\n this.vectorU = vectorU;\n this.vectorV = vectorV;\n }\n /** Return a clone of this plane */\n public clone(result?: PlaneByOriginAndVectors4d): PlaneByOriginAndVectors4d {\n if (result) {\n result.setFrom(this);\n return result;\n }\n return new PlaneByOriginAndVectors4d(this.origin.clone(), this.vectorU.clone(), this.vectorV.clone());\n }\n /** copy all content from other plane */\n public setFrom(other: PlaneByOriginAndVectors4d): void {\n this.origin.setFrom(other.origin);\n this.vectorU.setFrom(other.vectorU);\n this.vectorV.setFrom(other.vectorV);\n }\n /** Return true if origin, vectorU, and vectorV pass isAlmostEqual. */\n public isAlmostEqual(other: PlaneByOriginAndVectors4d): boolean {\n return this.origin.isAlmostEqual(other.origin)\n && this.vectorU.isAlmostEqual(other.vectorU)\n && this.vectorV.isAlmostEqual(other.vectorV);\n }\n /** Create a plane with (copies of) origin, vectorU, vectorV parameters, all given as full 4d points.\n */\n public static createOriginAndVectors(origin: Point4d, vectorU: Point4d, vectorV: Point4d, result?: PlaneByOriginAndVectors4d): PlaneByOriginAndVectors4d {\n if (result) {\n result.setOriginAndVectors(origin, vectorU, vectorV);\n return result;\n }\n return new PlaneByOriginAndVectors4d(origin.clone(), vectorU.clone(), vectorV.clone());\n }\n /** Set all numeric data from complete list of (x,y,z,w) in origin, vectorU, and vectorV */\n public setOriginAndVectorsXYZW(x0: number, y0: number, z0: number, w0: number, ux: number, uy: number, uz: number, uw: number, vx: number, vy: number, vz: number, vw: number): PlaneByOriginAndVectors4d {\n this.origin.set(x0, y0, z0, w0);\n this.vectorU.set(ux, uy, uz, uw);\n this.vectorV.set(vx, vy, vz, vw);\n return this;\n }\n /** Copy the contents of origin, vectorU, vectorV parameters to respective member variables */\n public setOriginAndVectors(origin: Point4d, vectorU: Point4d, vectorV: Point4d): PlaneByOriginAndVectors4d {\n this.origin.setFrom(origin);\n this.vectorU.setFrom(vectorU);\n this.vectorV.setFrom(vectorV);\n return this;\n }\n /** Create from complete list of (x,y,z,w) in origin, vectorU, and vectorV */\n public static createOriginAndVectorsXYZW(x0: number, y0: number, z0: number, w0: number, ux: number, uy: number, uz: number, uw: number, vx: number, vy: number, vz: number, vw: number, result?: PlaneByOriginAndVectors4d): PlaneByOriginAndVectors4d {\n if (result)\n return result.setOriginAndVectorsXYZW(x0, y0, z0, w0, ux, uy, uz, uw, vx, vy, vz, vw);\n return new PlaneByOriginAndVectors4d(Point4d.create(x0, y0, z0, w0), Point4d.create(ux, uy, uz, uw), Point4d.create(vx, vy, vz, uw));\n }\n /** create from origin point, (u=1,v=0) point, and (u=0,v=1) point. */\n public static createOriginAndTargets3d(origin: Point3d, targetU: Point3d, targetV: Point3d, result?: PlaneByOriginAndVectors4d): PlaneByOriginAndVectors4d {\n return PlaneByOriginAndVectors4d.createOriginAndVectorsXYZW(origin.x, origin.y, origin.z, 1.0, targetU.x - origin.x, targetU.y - origin.y, targetU.z - origin.z, 0.0, targetV.x - origin.x, targetV.y - origin.y, targetV.z - origin.z, 0.0, result);\n }\n /** evaluate plane point (full 3d) at given (u,v) coordinate. */\n public fractionToPoint(u: number, v: number, result?: Point4d): Point4d {\n return this.origin.plus2Scaled(this.vectorU, u, this.vectorV, v, result);\n }\n /** create a new plane which maps to the cartesian xy plane. */\n public static createXYPlane(result?: PlaneByOriginAndVectors4d): PlaneByOriginAndVectors4d {\n return PlaneByOriginAndVectors4d.createOriginAndVectorsXYZW(0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, result);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"PlaneByOriginAndVectors4d.js","sourceRoot":"","sources":["../../../src/geometry4d/PlaneByOriginAndVectors4d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAO/F,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;;;GAMG;AACH,MAAM,OAAO,yBAAyB;IACpC,yBAAyB;IAClB,MAAM,CAAU;IACvB,qCAAqC;IAC9B,OAAO,CAAU;IACxB,qCAAqC;IAC9B,OAAO,CAAU;IACxB,YAAoB,MAAe,EAAE,OAAgB,EAAE,OAAgB;QACrE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IACD,mCAAmC;IAC5B,KA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CAAC,CAAC;IAC1G,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\n\r\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Point4d } from \"./Point4d\";\r\n\r\n/**\r\n * A PlaneByOriginAndVectors4d is a 4d origin and pair of 4d \"vectors\" defining a 4d plane.\r\n * * The parameterization of the plane is `X = origin + vectorU * u + vectorV * v`\r\n * * With particular weight values `origin.w === 1, vectorU.w === 0, vectorV.w === 0` this is like `Plane3dByOriginAndVectors`\r\n * * With other weights, the deweighted xyz coordinates of points on the 4d plane still form a 3d plane.\r\n * @public\r\n */\r\nexport class PlaneByOriginAndVectors4d {\r\n /** homogeneous origin */\r\n public origin: Point4d;\r\n /** homogeneous u-direction vector */\r\n public vectorU: Point4d;\r\n /** homogeneous v-direction vector */\r\n public vectorV: Point4d;\r\n private constructor(origin: Point4d, vectorU: Point4d, vectorV: Point4d) {\r\n this.origin = origin;\r\n this.vectorU = vectorU;\r\n this.vectorV = vectorV;\r\n }\r\n /** Return a clone of this plane */\r\n public clone(result?: PlaneByOriginAndVectors4d): PlaneByOriginAndVectors4d {\r\n if (result) {\r\n result.setFrom(this);\r\n return result;\r\n }\r\n return new PlaneByOriginAndVectors4d(this.origin.clone(), this.vectorU.clone(), this.vectorV.clone());\r\n }\r\n /** copy all content from other plane */\r\n public setFrom(other: PlaneByOriginAndVectors4d): void {\r\n this.origin.setFrom(other.origin);\r\n this.vectorU.setFrom(other.vectorU);\r\n this.vectorV.setFrom(other.vectorV);\r\n }\r\n /** Return true if origin, vectorU, and vectorV pass isAlmostEqual. */\r\n public isAlmostEqual(other: PlaneByOriginAndVectors4d): boolean {\r\n return this.origin.isAlmostEqual(other.origin)\r\n && this.vectorU.isAlmostEqual(other.vectorU)\r\n && this.vectorV.isAlmostEqual(other.vectorV);\r\n }\r\n /** Create a plane with (copies of) origin, vectorU, vectorV parameters, all given as full 4d points.\r\n */\r\n public static createOriginAndVectors(origin: Point4d, vectorU: Point4d, vectorV: Point4d, result?: PlaneByOriginAndVectors4d): PlaneByOriginAndVectors4d {\r\n if (result) {\r\n result.setOriginAndVectors(origin, vectorU, vectorV);\r\n return result;\r\n }\r\n return new PlaneByOriginAndVectors4d(origin.clone(), vectorU.clone(), vectorV.clone());\r\n }\r\n /** Set all numeric data from complete list of (x,y,z,w) in origin, vectorU, and vectorV */\r\n public setOriginAndVectorsXYZW(x0: number, y0: number, z0: number, w0: number, ux: number, uy: number, uz: number, uw: number, vx: number, vy: number, vz: number, vw: number): PlaneByOriginAndVectors4d {\r\n this.origin.set(x0, y0, z0, w0);\r\n this.vectorU.set(ux, uy, uz, uw);\r\n this.vectorV.set(vx, vy, vz, vw);\r\n return this;\r\n }\r\n /** Copy the contents of origin, vectorU, vectorV parameters to respective member variables */\r\n public setOriginAndVectors(origin: Point4d, vectorU: Point4d, vectorV: Point4d): PlaneByOriginAndVectors4d {\r\n this.origin.setFrom(origin);\r\n this.vectorU.setFrom(vectorU);\r\n this.vectorV.setFrom(vectorV);\r\n return this;\r\n }\r\n /** Create from complete list of (x,y,z,w) in origin, vectorU, and vectorV */\r\n public static createOriginAndVectorsXYZW(x0: number, y0: number, z0: number, w0: number, ux: number, uy: number, uz: number, uw: number, vx: number, vy: number, vz: number, vw: number, result?: PlaneByOriginAndVectors4d): PlaneByOriginAndVectors4d {\r\n if (result)\r\n return result.setOriginAndVectorsXYZW(x0, y0, z0, w0, ux, uy, uz, uw, vx, vy, vz, vw);\r\n return new PlaneByOriginAndVectors4d(Point4d.create(x0, y0, z0, w0), Point4d.create(ux, uy, uz, uw), Point4d.create(vx, vy, vz, uw));\r\n }\r\n /** create from origin point, (u=1,v=0) point, and (u=0,v=1) point. */\r\n public static createOriginAndTargets3d(origin: Point3d, targetU: Point3d, targetV: Point3d, result?: PlaneByOriginAndVectors4d): PlaneByOriginAndVectors4d {\r\n return PlaneByOriginAndVectors4d.createOriginAndVectorsXYZW(origin.x, origin.y, origin.z, 1.0, targetU.x - origin.x, targetU.y - origin.y, targetU.z - origin.z, 0.0, targetV.x - origin.x, targetV.y - origin.y, targetV.z - origin.z, 0.0, result);\r\n }\r\n /** evaluate plane point (full 3d) at given (u,v) coordinate. */\r\n public fractionToPoint(u: number, v: number, result?: Point4d): Point4d {\r\n return this.origin.plus2Scaled(this.vectorU, u, this.vectorV, v, result);\r\n }\r\n /** create a new plane which maps to the cartesian xy plane. */\r\n public static createXYPlane(result?: PlaneByOriginAndVectors4d): PlaneByOriginAndVectors4d {\r\n return PlaneByOriginAndVectors4d.createOriginAndVectorsXYZW(0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, result);\r\n }\r\n}\r\n"]}
|
|
@@ -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,EAAE,EAAU,EAAE,IAAY;IACnC,OAAO,IAAI,GAAG,CAAC,GAAG,GAAG,GAAG,GAA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;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;AACpF,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,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,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,GAAG,GAAG,GAAG,CAAC;gBACV,KAAK,IAAI,CAAC,GAAG,E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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":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,QAAQ,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AE,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"]}
|