@itwin/core-geometry 5.3.0-dev.9 → 5.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -1
- package/lib/cjs/Constant.js.map +1 -1
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/bspline/AkimaCurve3d.js.map +1 -1
- package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve3dH.js.map +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.js.map +1 -1
- 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.js.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js.map +1 -1
- package/lib/cjs/clipping/ClipVector.js.map +1 -1
- 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 +15 -1
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +31 -2
- 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.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.d.ts +25 -8
- package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
- package/lib/cjs/curve/CurveFactory.js +51 -55
- package/lib/cjs/curve/CurveFactory.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- 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.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.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.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.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.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.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.d.ts +10 -13
- package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js +23 -22
- package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/ClothoidSeries.d.ts +10 -6
- package/lib/cjs/curve/spiral/ClothoidSeries.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/ClothoidSeries.js +36 -19
- package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
- package/lib/cjs/curve/spiral/CubicEvaluator.d.ts +7 -6
- package/lib/cjs/curve/spiral/CubicEvaluator.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/CubicEvaluator.js +29 -14
- package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/CzechSpiralEvaluator.d.ts +34 -44
- package/lib/cjs/curve/spiral/CzechSpiralEvaluator.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js +47 -53
- package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.d.ts +2 -2
- package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js +17 -7
- package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts +112 -104
- package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/DirectSpiral3d.js +143 -117
- package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts +71 -53
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js +99 -66
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.d.ts +8 -12
- package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js +11 -13
- package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/NormalizedTransition.d.ts +36 -29
- package/lib/cjs/curve/spiral/NormalizedTransition.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/NormalizedTransition.js +62 -40
- package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
- package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.d.ts +13 -18
- package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js +21 -24
- package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionConditionalProperties.d.ts +41 -27
- package/lib/cjs/curve/spiral/TransitionConditionalProperties.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/TransitionConditionalProperties.js +50 -33
- package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts +45 -34
- package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js +56 -38
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/XYCurveEvaluator.d.ts +27 -21
- package/lib/cjs/curve/spiral/XYCurveEvaluator.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/XYCurveEvaluator.js +23 -18
- package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
- package/lib/cjs/geometry3d/Angle.js.map +1 -1
- 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.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.d.ts +96 -98
- package/lib/cjs/geometry3d/GrowableXYArray.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js +121 -110
- package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +135 -142
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.js +165 -160
- package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedCollectionInterval.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYCollection.d.ts +51 -34
- package/lib/cjs/geometry3d/IndexedXYCollection.d.ts.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYCollection.js +16 -6
- package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +78 -77
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.js +38 -35
- package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js.map +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.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
- package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.d.ts +27 -7
- package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js +30 -9
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
- 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.js.map +1 -1
- package/lib/cjs/geometry3d/UVSurfaceOps.js.map +1 -1
- 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.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.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.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.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.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- 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.map +1 -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.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- 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.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.js.map +1 -1
- package/lib/cjs/topology/Voronoi.js.map +1 -1
- package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
- package/lib/esm/Constant.js.map +1 -1
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
- package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve3dH.js.map +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.js.map +1 -1
- 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.js.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
- package/lib/esm/clipping/ClipUtils.js.map +1 -1
- package/lib/esm/clipping/ClipVector.js.map +1 -1
- 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 +15 -1
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +31 -2
- 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.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.d.ts +25 -8
- package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
- package/lib/esm/curve/CurveFactory.js +51 -55
- package/lib/esm/curve/CurveFactory.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- 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.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.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.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.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.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.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.d.ts +10 -13
- package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.d.ts.map +1 -1
- package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js +23 -22
- package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/ClothoidSeries.d.ts +10 -6
- package/lib/esm/curve/spiral/ClothoidSeries.d.ts.map +1 -1
- package/lib/esm/curve/spiral/ClothoidSeries.js +36 -19
- package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
- package/lib/esm/curve/spiral/CubicEvaluator.d.ts +7 -6
- package/lib/esm/curve/spiral/CubicEvaluator.d.ts.map +1 -1
- package/lib/esm/curve/spiral/CubicEvaluator.js +29 -14
- package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/CzechSpiralEvaluator.d.ts +34 -44
- package/lib/esm/curve/spiral/CzechSpiralEvaluator.d.ts.map +1 -1
- package/lib/esm/curve/spiral/CzechSpiralEvaluator.js +47 -53
- package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.d.ts +2 -2
- package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.d.ts.map +1 -1
- package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js +17 -7
- package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/DirectSpiral3d.d.ts +112 -104
- package/lib/esm/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
- package/lib/esm/curve/spiral/DirectSpiral3d.js +143 -117
- package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts +71 -53
- package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js +99 -66
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.d.ts +8 -12
- package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.d.ts.map +1 -1
- package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js +11 -13
- package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/NormalizedTransition.d.ts +36 -29
- package/lib/esm/curve/spiral/NormalizedTransition.d.ts.map +1 -1
- package/lib/esm/curve/spiral/NormalizedTransition.js +62 -40
- package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
- package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.d.ts +13 -18
- package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.d.ts.map +1 -1
- package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js +21 -24
- package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionConditionalProperties.d.ts +41 -27
- package/lib/esm/curve/spiral/TransitionConditionalProperties.d.ts.map +1 -1
- package/lib/esm/curve/spiral/TransitionConditionalProperties.js +50 -33
- package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts +45 -34
- package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.js +56 -38
- package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/XYCurveEvaluator.d.ts +27 -21
- package/lib/esm/curve/spiral/XYCurveEvaluator.d.ts.map +1 -1
- package/lib/esm/curve/spiral/XYCurveEvaluator.js +23 -18
- package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
- package/lib/esm/geometry3d/Angle.js.map +1 -1
- 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.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.d.ts +96 -98
- package/lib/esm/geometry3d/GrowableXYArray.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js +122 -111
- package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts +135 -142
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.js +165 -160
- package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/esm/geometry3d/IndexedCollectionInterval.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYCollection.d.ts +51 -34
- package/lib/esm/geometry3d/IndexedXYCollection.d.ts.map +1 -1
- package/lib/esm/geometry3d/IndexedXYCollection.js +14 -5
- package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +78 -77
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.js +38 -35
- package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js.map +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.js.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
- package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.d.ts +27 -7
- package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js +30 -9
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Ray2d.js.map +1 -1
- 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.js.map +1 -1
- package/lib/esm/geometry3d/UVSurfaceOps.js.map +1 -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.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.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.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.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.js.map +1 -1
- package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- 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.map +1 -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.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- 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.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.js.map +1 -1
- package/lib/esm/topology/Voronoi.js.map +1 -1
- package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Matrix4d.js","sourceRoot":"","sources":["../../../src/geometry4d/Matrix4d.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,0CAAwD;AACxD,qDAAkD;AAClD,mEAAuE;AACvE,uDAAoD;AAEpD,uCAAkD;AAQlD;;;;;;;;;;;;;;GAcG;AACH,MAAa,QAAQ;IACX,MAAM,CAAe;IAC7B,gBAAwB,IAAI,CAAC,MAAM,GAAG,IAAI,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7D,uCAAuC;IAChC,OAAO,CAAC,KAAe;QAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE;YACzB,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;IACD,2BAA2B;IACpB,KAAK,CAAC,MAAiB;QAC5B,IAAI,MAAM,KAAK,IAAI;YACjB,OAAO,IAAI,CAAC;QACd,IAAI,MAAM,KAAK,SAAS;YACtB,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE;YACzB,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACpC,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,mCAAmC;IAC5B,OAAO;QACZ,KA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CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC,CAAC;QACpD,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC,CAAC;QACpD,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC,CAAC;QACrD,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC;QAE1B,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC;QAC1B,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC;QAC1B,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC;QAC1B,yBAAyB;IAC3B,CAAC;CACF;AA5vBD,4BA4vBC","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/** @packageDocumentation\n * @module Numerics\n */\n\nimport { BeJSONFunctions, Geometry } from \"../Geometry\";\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\nimport { Point3d, Vector3d, XYZ } from \"../geometry3d/Point3dVector3d\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { XYAndZ } from \"../geometry3d/XYZProps\";\nimport { Point4d, Point4dProps } from \"./Point4d\";\n\n/**\n * Coordinate data with `Point4d` numeric data as an array `[x,y,z,w]`\n * @public\n */\nexport type Matrix4dProps = Point4dProps[];\n\n/**\n * * A Matrix4d is a matrix with 4 rows and 4 columns.\n * * The 4 rows may be described as the x,y,z,w rows.\n * * The 4 columns may be described as the x,y,z,w columns.\n * * The matrix is physically stored as a Float64Array with 16 numbers.\n * * The layout in the Float64Array is \"by row\"\n * * indices 0,1,2,3 are the \"x row\". They may be called the xx,xy,xz,xw entries\n * * indices 4,5,6,7 are the \"y row\" They may be called the yx,yy,yz,yw entries\n * * indices 8,9,10,11 are the \"z row\" They may be called the zx,zy,zz,zw entries\n * * indices 12,13,14,15 are the \"w row\". They may be called the wx,wy,wz,ww entries\n * * If \"w row\" contains numeric values 0,0,0,1, the Matrix4d is equivalent to a Transform with\n * * The upper left 3x3 matrix (entries 0,1,2,4,5,6,8,9,10) are the 3x3 matrix part of the transform\n * * The far right column entries xw,yw,zw are the \"origin\" (sometimes called \"translation\") part of the transform.\n * @public\n */\nexport class Matrix4d implements BeJSONFunctions {\n private _coffs: Float64Array;\n private constructor() { this._coffs = new Float64Array(16); }\n /** Copy matrix entries from `other` */\n public setFrom(other: Matrix4d): void {\n for (let i = 0; i < 16; i++)\n this._coffs[i] = other._coffs[i];\n }\n /** Return a deep clone. */\n public clone(result?: Matrix4d): Matrix4d {\n if (result === this)\n return this;\n if (result === undefined)\n result = new Matrix4d();\n for (let i = 0; i < 16; i++)\n result._coffs[i] = this._coffs[i];\n return result;\n }\n /** zero this matrix4d in place. */\n public setZero(): void {\n for (let i = 0; i < 16; i++)\n this._coffs[i] = 0;\n }\n /** set to identity. */\n public setIdentity(): void {\n for (let i = 0; i < 16; i++)\n this._coffs[i] = 0;\n this._coffs[0] = this._coffs[5] = this._coffs[10] = this._coffs[15] = 1.0;\n }\n private static is1000(a: number, b: number, c: number, d: number, tol: number): boolean {\n return Math.abs(a - 1.0) <= tol\n && Math.abs(b) <= tol\n && Math.abs(c) <= tol\n && Math.abs(d) <= tol;\n }\n /** set to identity. */\n public isIdentity(tol: number = 1.0e-10): boolean {\n return Matrix4d.is1000(this._coffs[0], this._coffs[1], this._coffs[2], this._coffs[3], tol)\n && Matrix4d.is1000(this._coffs[5], this._coffs[6], this._coffs[7], this._coffs[4], tol)\n && Matrix4d.is1000(this._coffs[10], this._coffs[11], this._coffs[8], this._coffs[9], tol)\n && Matrix4d.is1000(this._coffs[15], this._coffs[12], this._coffs[13], this._coffs[14], tol);\n }\n /** create a Matrix4d filled with zeros. */\n public static createZero(result?: Matrix4d): Matrix4d {\n if (result) {\n result.setZero();\n return result;\n }\n return new Matrix4d(); // this is zero.\n }\n /** create a Matrix4d with values supplied \"across the rows\" */\n public static createRowValues(cxx: number, cxy: number, cxz: number, cxw: number, cyx: number, cyy: number, cyz: number, cyw: number, czx: number, czy: number, czz: number, czw: number, cwx: number, cwy: number, cwz: number, cww: number, result?: Matrix4d): Matrix4d {\n result = result ? result : new Matrix4d();\n result._coffs[0] = cxx;\n result._coffs[1] = cxy;\n result._coffs[2] = cxz;\n result._coffs[3] = cxw;\n result._coffs[4] = cyx;\n result._coffs[5] = cyy;\n result._coffs[6] = cyz;\n result._coffs[7] = cyw;\n result._coffs[8] = czx;\n result._coffs[9] = czy;\n result._coffs[10] = czz;\n result._coffs[11] = czw;\n result._coffs[12] = cwx;\n result._coffs[13] = cwy;\n result._coffs[14] = cwz;\n result._coffs[15] = cww;\n return result;\n }\n /** Create a `Matrix4d` from 16 values appearing as `Point4d` for each row. */\n public static createRows(rowX: Point4d, rowY: Point4d, rowZ: Point4d, rowW: Point4d, result?: Matrix4d): Matrix4d {\n return this.createRowValues(\n rowX.x, rowX.y, rowX.z, rowX.w,\n rowY.x, rowY.y, rowY.z, rowY.w,\n rowZ.x, rowZ.y, rowZ.z, rowZ.w,\n rowW.x, rowW.y, rowW.z, rowW.w, result);\n }\n /** directly set columns from typical 3d data:\n *\n * * vectorX, vectorY, vectorZ as columns 0,1,2, with weight0.\n * * origin as column3, with weight 1\n */\n public setOriginAndVectors(origin: XYZ, vectorX: Vector3d, vectorY: Vector3d, vectorZ: Vector3d) {\n this._coffs[0] = vectorX.x;\n this._coffs[1] = vectorY.x;\n this._coffs[2] = vectorZ.x;\n this._coffs[3] = origin.x;\n this._coffs[4] = vectorX.y;\n this._coffs[5] = vectorY.y;\n this._coffs[6] = vectorZ.y;\n this._coffs[7] = origin.y;\n this._coffs[8] = vectorX.z;\n this._coffs[9] = vectorY.z;\n this._coffs[10] = vectorZ.z;\n this._coffs[11] = origin.z;\n this._coffs[12] = 0.0;\n this._coffs[13] = 0.0;\n this._coffs[14] = 0.0;\n this._coffs[15] = 1.0;\n }\n /** promote a transform to full Matrix4d (with 0001 in final row) */\n public static createTransform(source: Transform, result?: Matrix4d): Matrix4d {\n const matrix = source.matrix;\n const point = source.origin;\n return Matrix4d.createRowValues(matrix.coffs[0], matrix.coffs[1], matrix.coffs[2], point.x, matrix.coffs[3], matrix.coffs[4], matrix.coffs[5], point.y, matrix.coffs[6], matrix.coffs[7], matrix.coffs[8], point.z, 0, 0, 0, 1, result);\n }\n /** return an identity matrix. */\n public static createIdentity(result?: Matrix4d): Matrix4d {\n result = Matrix4d.createZero(result);\n result._coffs[0] = 1.0;\n result._coffs[5] = 1.0;\n result._coffs[10] = 1.0;\n result._coffs[15] = 1.0;\n return result;\n }\n /** return matrix with translation directly inserted (along with 1 on diagonal) */\n public static createTranslationXYZ(x: number, y: number, z: number, result?: Matrix4d): Matrix4d {\n result = Matrix4d.createZero(result);\n result._coffs[0] = 1.0;\n result._coffs[5] = 1.0;\n result._coffs[10] = 1.0;\n result._coffs[15] = 1.0;\n result._coffs[3] = x;\n result._coffs[7] = y;\n result._coffs[11] = z;\n return result;\n }\n\n /** return this matrix plus scale times matrixB. */\n public plusScaled(matrixB: Matrix4d, scale: number, result?: Matrix4d): Matrix4d {\n // If result is undefined, a real clone is created.\n // If result is \"this\" we get the pointer to this right back.\n // If result is other, \"this\" coffs are copied.\n // Then we can add matrixB. (Which we assume is different from this?)\n result = this.clone(result);\n for (let i = 0; i < 16; i++)\n result._coffs[i] += scale * matrixB._coffs[i];\n return result;\n }\n\n /**\n * Create a Matrix4d with translation and scaling values directly inserted (along with 1 as final diagonal entry)\n * @param tx x entry for translation column\n * @param ty y entry for translation column\n * @param tz z entry for translation column\n * @param scaleX x diagonal entry\n * @param scaleY y diagonal entry\n * @param scaleZ z diagonal entry\n * @param result optional result.\n */\n public static createTranslationAndScaleXYZ(tx: number, ty: number, tz: number, scaleX: number, scaleY: number, scaleZ: number, result?: Matrix4d): Matrix4d {\n return Matrix4d.createRowValues(scaleX, 0, 0, tx, 0, scaleY, 0, ty, 0, 0, scaleZ, tz, 0, 0, 0, 1, result);\n }\n /**\n * Create a mapping that scales and translates (no rotation) from box A to box B\n * @param lowA low point of box A\n * @param highA high point of box A\n * @param lowB low point of box B\n * @param highB high point of box B\n */\n public static createBoxToBox(lowA: Point3d, highA: Point3d, lowB: Point3d, highB: Point3d, result?: Matrix4d): Matrix4d | undefined {\n const ax = highA.x - lowA.x;\n const ay = highA.y - lowA.y;\n const az = highA.z - lowA.z;\n const bx = highB.x - lowB.x;\n const by = highB.y - lowB.y;\n const bz = highB.z - lowB.z;\n const abx = Geometry.conditionalDivideFraction(bx, ax);\n const aby = Geometry.conditionalDivideFraction(by, ay);\n const abz = Geometry.conditionalDivideFraction(bz, az);\n if (abx !== undefined && aby !== undefined && abz !== undefined) {\n return Matrix4d.createTranslationAndScaleXYZ(lowB.x - abx * lowA.x, lowB.y - aby * lowA.y, lowB.z - abz * lowA.z, abx, aby, abz, result);\n }\n return undefined;\n }\n /** Set from nested array json e.g. `[[1,2,3,4],[0,1,2,4],[0,2,5,1],[0,0,1,2]]` */\n public setFromJSON(json?: Matrix4dProps) {\n if (Geometry.isArrayOfNumberArray(json, 4, 4)) {\n for (let i = 0; i < 4; ++i) {\n for (let j = 0; j < 4; ++j)\n this._coffs[i * 4 + j] = json[i][j];\n }\n } else {\n this.setZero();\n }\n }\n /**\n * Return the largest (absolute) difference between this and other Matrix4d.\n * @param other matrix to compare to\n */\n public maxDiff(other: Matrix4d): number {\n let a = 0.0;\n for (let i = 0; i < 16; i++)\n a = Math.max(a, Math.abs(this._coffs[i] - other._coffs[i]));\n return a;\n }\n /**\n * Return the largest absolute value in the Matrix4d\n */\n public maxAbs(): number {\n let a = 0.0;\n for (let i = 0; i < 16; i++)\n a = Math.max(a, Math.abs(this._coffs[i]));\n return a;\n }\n /** Test for near-equality with `other` */\n public isAlmostEqual(other: Matrix4d): boolean {\n return Geometry.isSmallMetricDistance(this.maxDiff(other));\n }\n /** Test for exact (bitwise) equality with other. */\n public isExactEqual(other: Matrix4d): boolean { return this.maxDiff(other) === 0.0; }\n /**\n * Convert an Matrix4d to a Matrix4dProps.\n */\n public toJSON(): Matrix4dProps {\n const value = [];\n for (let i = 0; i < 4; ++i) {\n const row = i * 4;\n value.push([this._coffs[row], this._coffs[row + 1], this._coffs[row + 2], this._coffs[row + 3]]);\n }\n return value;\n }\n /** Create from nested array json e.g. `[[1,2,3,4],[0,1,2,4],[0,2,5,1],[0,0,1,2]]` */\n public static fromJSON(json?: Matrix4dProps) {\n const result = new Matrix4d();\n result.setFromJSON(json);\n return result;\n }\n /**\n * Return a point with entries from positions [i0, i0+step, i0+2*step, i0+3*step].\n * * There are no tests for index going out of the 0..15 range.\n * * Usual uses are:\n * * * i0 at left of row (0,4,8,12), step = 1 to extract a row.\n * * * i0 at top of row (0,1,2,3), step = 4 to extract a column\n * * * i0 = 0, step = 5 to extract the diagonal\n * @returns a Point4d with 4 entries taken from positions at steps in the flat 16-member array.\n * @param i0 start index (for 16 member array)\n * @param step step between members\n * @param result optional preallocated point.\n */\n public getSteppedPoint(i0: number, step: number, result?: Point4d): Point4d {\n return Point4d.create(this._coffs[i0], this._coffs[i0 + step], this._coffs[i0 + 2 * step], this._coffs[i0 + 3 * step], result);\n }\n /** Return column 0 as Point4d. */\n public columnX(): Point4d { return this.getSteppedPoint(0, 4); }\n /** Return column 1 as Point4d. */\n public columnY(): Point4d { return this.getSteppedPoint(1, 4); }\n /** Return column 2 as Point4d. */\n public columnZ(): Point4d { return this.getSteppedPoint(2, 4); }\n /** Return column 3 as Point4d. */\n public columnW(): Point4d { return this.getSteppedPoint(3, 4); }\n /** Return row 0 as Point4d. */\n public rowX(): Point4d { return this.getSteppedPoint(0, 1); }\n /** Return row 1 as Point4d. */\n public rowY(): Point4d { return this.getSteppedPoint(4, 1); }\n /** Return row 2 as Point4d. */\n public rowZ(): Point4d { return this.getSteppedPoint(8, 1); }\n /** Return row 3 as Point4d. */\n public rowW(): Point4d { return this.getSteppedPoint(12, 1); }\n /**\n * Returns true if the w row has content other than [0,0,0,1]\n */\n public get hasPerspective(): boolean {\n return this._coffs[12] !== 0.0\n || this._coffs[13] !== 0.0\n || this._coffs[14] !== 0.0\n || this._coffs[15] !== 1.0;\n }\n /**\n * Return a Point4d with the diagonal entries of the matrix\n */\n public diagonal(): Point4d { return this.getSteppedPoint(0, 5); }\n /** return the weight component of this matrix */\n public weight(): number { return this._coffs[15]; }\n /** return the leading 3x3 matrix part of this matrix */\n public matrixPart(): Matrix3d {\n return Matrix3d.createRowValues(this._coffs[0], this._coffs[1], this._coffs[2], this._coffs[4], this._coffs[5], this._coffs[6], this._coffs[8], this._coffs[9], this._coffs[10]);\n }\n /**\n * Return the (affine, non-perspective) Transform with the upper 3 rows of this matrix\n * @return undefined if this Matrix4d has perspective effects in the w row.\n * @see toTransform\n */\n public get asTransform(): Transform | undefined {\n if (this.hasPerspective)\n return undefined;\n return Transform.createRowValues(this._coffs[0], this._coffs[1], this._coffs[2], this._coffs[3], this._coffs[4], this._coffs[5], this._coffs[6], this._coffs[7], this._coffs[8], this._coffs[9], this._coffs[10], this._coffs[11]);\n }\n /**\n * Populate a [[Transform]] from the instance, even if the transformations aren't equivalent.\n * * A Transform cannot encode perspective, but this method returns one even if it isn't equivalent to the instance.\n * * Compare to the [[asTransform]] property, which returns `undefined` when there is perspective.\n * @param result optional preallocated object to populate and return.\n * @returns derived `Transform` and a flag indicating its validity:\n * * `transform` is filled with the top three rows of the instance's entries scaled by the reciprocal of nonzero [[weight]];\n * if [[weight]] is zero, `transform` is set to the identity.\n * * `isValid` is true if and only if the last row of the instance is essentially `[000w]` for nonzero `w` = [[weight]].\n * @see asTransform\n */\n public toTransform(result?: Transform): { transform: Transform, isValid: boolean } {\n const transform = Transform.createIdentity(result);\n let isValid = false;\n if (this.weight() !== 0.0) {\n const scale = 1.0 / this.weight();\n for (let i = 0; i < 3; i++) {\n for (let j = 0; j < 3; j++)\n transform.matrix.setAt(i, j, scale * this.atIJ(i, j));\n }\n transform.origin.set(scale * this.atIJ(0, 3), scale * this.atIJ(1, 3), scale * this.atIJ(2, 3));\n isValid = Geometry.isSmallMetricDistance(scale * (Math.abs(this.atIJ(3, 0) + Math.abs(this.atIJ(3, 1)) + Math.abs(this.atIJ(3, 2)))));\n }\n return { transform, isValid };\n }\n /** multiply this * other. */\n public multiplyMatrixMatrix(other: Matrix4d, result?: Matrix4d): Matrix4d {\n result = (result && result !== this && result !== other) ? result : new Matrix4d();\n for (let i0 = 0; i0 < 16; i0 += 4) {\n for (let k = 0; k < 4; k++)\n result._coffs[i0 + k] =\n this._coffs[i0] * other._coffs[k] +\n this._coffs[i0 + 1] * other._coffs[k + 4] +\n this._coffs[i0 + 2] * other._coffs[k + 8] +\n this._coffs[i0 + 3] * other._coffs[k + 12];\n }\n return result;\n }\n /** multiply this * transpose(other). */\n public multiplyMatrixMatrixTranspose(other: Matrix4d, result?: Matrix4d): Matrix4d {\n result = (result && result !== this && result !== other) ? result : new Matrix4d();\n let j = 0;\n for (let i0 = 0; i0 < 16; i0 += 4) {\n for (let k = 0; k < 16; k += 4)\n result._coffs[j++] =\n this._coffs[i0] * other._coffs[k] +\n this._coffs[i0 + 1] * other._coffs[k + 1] +\n this._coffs[i0 + 2] * other._coffs[k + 2] +\n this._coffs[i0 + 3] * other._coffs[k + 3];\n }\n return result;\n }\n /** multiply transpose (this) * other. */\n public multiplyMatrixTransposeMatrix(other: Matrix4d, result?: Matrix4d): Matrix4d {\n result = (result && result !== this && result !== other) ? result : new Matrix4d();\n let j = 0;\n for (let i0 = 0; i0 < 4; i0 += 1) {\n for (let k0 = 0; k0 < 4; k0 += 1)\n result._coffs[j++] =\n this._coffs[i0] * other._coffs[k0] +\n this._coffs[i0 + 4] * other._coffs[k0 + 4] +\n this._coffs[i0 + 8] * other._coffs[k0 + 8] +\n this._coffs[i0 + 12] * other._coffs[k0 + 12];\n }\n return result;\n }\n /** Return a transposed matrix. */\n public cloneTransposed(result?: Matrix4d): Matrix4d {\n return Matrix4d.createRowValues(this._coffs[0], this._coffs[4], this._coffs[8], this._coffs[12], this._coffs[1], this._coffs[5], this._coffs[9], this._coffs[13], this._coffs[2], this._coffs[6], this._coffs[10], this._coffs[14], this._coffs[3], this._coffs[7], this._coffs[11], this._coffs[15], result);\n }\n /** multiply matrix times column [x,y,z,w]. return as Point4d. (And the returned value is NOT normalized down to unit w) */\n public multiplyXYZW(x: number, y: number, z: number, w: number, result?: Point4d): Point4d {\n result = result ? result : Point4d.createZero();\n return result.set(this._coffs[0] * x + this._coffs[1] * y + this._coffs[2] * z + this._coffs[3] * w, this._coffs[4] * x + this._coffs[5] * y + this._coffs[6] * z + this._coffs[7] * w, this._coffs[8] * x + this._coffs[9] * y + this._coffs[10] * z + this._coffs[11] * w, this._coffs[12] * x + this._coffs[13] * y + this._coffs[14] * z + this._coffs[15] * w);\n }\n /** multiply matrix times column vectors [x,y,z,w] where [x,y,z,w] appear in blocks in an array.\n * replace the xyzw in the block\n */\n public multiplyBlockedFloat64ArrayInPlace(data: Float64Array) {\n const n = data.length;\n let x, y, z, w;\n for (let i = 0; i + 3 < n; i += 4) {\n x = data[i];\n y = data[i + 1];\n z = data[i + 2];\n w = data[i + 3];\n data[i] = this._coffs[0] * x + this._coffs[1] * y + this._coffs[2] * z + this._coffs[3] * w;\n data[i + 1] = this._coffs[4] * x + this._coffs[5] * y + this._coffs[6] * z + this._coffs[7] * w;\n data[i + 2] = this._coffs[8] * x + this._coffs[9] * y + this._coffs[10] * z + this._coffs[11] * w;\n data[i + 3] = this._coffs[12] * x + this._coffs[13] * y + this._coffs[14] * z + this._coffs[15] * w;\n }\n }\n /** multiply matrix times XYAndZ and w. return as Point4d (And the returned value is NOT normalized down to unit w) */\n public multiplyPoint3d(pt: XYAndZ, w: number, result?: Point4d): Point4d {\n return this.multiplyXYZW(pt.x, pt.y, pt.z, w, result);\n }\n /** multiply matrix times and array of XYAndZ. return as array of Point4d (And the returned value is NOT normalized down to unit w) */\n public multiplyPoint3dArray(pts: XYAndZ[], results: Point4d[], w: number = 1.0): void {\n pts.forEach((pt, i) => { results[i] = this.multiplyXYZW(pt.x, pt.y, pt.z, w, results[i]); });\n }\n /** multiply [x,y,z,w] times matrix. return as Point4d. (And the returned value is NOT normalized down to unit w) */\n public multiplyTransposeXYZW(x: number, y: number, z: number, w: number, result?: Point4d): Point4d {\n result = result ? result : Point4d.createZero();\n return result.set(this._coffs[0] * x + this._coffs[4] * y + this._coffs[8] * z + this._coffs[12] * w, this._coffs[1] * x + this._coffs[5] * y + this._coffs[9] * z + this._coffs[13] * w, this._coffs[2] * x + this._coffs[6] * y + this._coffs[10] * z + this._coffs[14] * w, this._coffs[3] * x + this._coffs[7] * y + this._coffs[11] * z + this._coffs[15] * w);\n }\n /** Returns dot product of row rowIndex of this with column columnIndex of other.\n */\n public rowDotColumn(rowIndex: number, other: Matrix4d, columnIndex: number): number {\n const i = rowIndex * 4;\n const j = columnIndex;\n return this._coffs[i] * other._coffs[j]\n + this._coffs[i + 1] * other._coffs[j + 4]\n + this._coffs[i + 2] * other._coffs[j + 8]\n + this._coffs[i + 3] * other._coffs[j + 12];\n }\n /** Returns dot product of row rowIndex of this with [x y z w]\n */\n public rowDotXYZW(rowIndex: number, x: number, y: number, z: number, w: number): number {\n const i = rowIndex * 4;\n return this._coffs[i] * x\n + this._coffs[i + 1] * y\n + this._coffs[i + 2] * z\n + this._coffs[i + 3] * w;\n }\n\n /** Returns dot product of row rowIndexThis of this with row rowIndexOther of other.\n */\n public rowDotRow(rowIndexThis: number, other: Matrix4d, rowIndexOther: number): number {\n const i = rowIndexThis * 4;\n const j = rowIndexOther * 4;\n return this._coffs[i] * other._coffs[j]\n + this._coffs[i + 1] * other._coffs[j + 1]\n + this._coffs[i + 2] * other._coffs[j + 2]\n + this._coffs[i + 3] * other._coffs[j + 3];\n }\n /** Returns dot product of row rowIndexThis of this with row rowIndexOther of other.\n */\n public columnDotColumn(columnIndexThis: number, other: Matrix4d, columnIndexOther: number): number {\n const i = columnIndexThis;\n const j = columnIndexOther;\n return this._coffs[i] * other._coffs[j]\n + this._coffs[i + 4] * other._coffs[j + 4]\n + this._coffs[i + 8] * other._coffs[j + 8]\n + this._coffs[i + 12] * other._coffs[j + 12];\n }\n /** Returns dot product of column columnIndexThis of this with row rowIndexOther other.\n */\n public columnDotRow(columnIndexThis: number, other: Matrix4d, rowIndexOther: number): number {\n const i = columnIndexThis;\n const j = 4 * rowIndexOther;\n return this._coffs[i] * other._coffs[j]\n + this._coffs[i + 4] * other._coffs[j + 1]\n + this._coffs[i + 8] * other._coffs[j + 2]\n + this._coffs[i + 12] * other._coffs[j + 3];\n }\n /** Return a matrix entry by row and column index.\n */\n public atIJ(rowIndex: number, columnIndex: number): number {\n return this._coffs[rowIndex * 4 + columnIndex];\n }\n\n /** Set a matrix entry by row and column index.\n */\n public setAtIJ(rowIndex: number, columnIndex: number, value: number) {\n this._coffs[rowIndex * 4 + columnIndex] = value;\n }\n /** multiply matrix * [x,y,z,w]. immediately renormalize to return in a Point3d.\n * If zero weight appears in the result (i.e. input is on eyeplane) leave the mapped xyz untouched.\n */\n public multiplyXYZWQuietRenormalize(x: number, y: number, z: number, w: number, result?: Point3d): Point3d {\n result = result ? result : Point3d.createZero();\n result.set(this._coffs[0] * x + this._coffs[1] * y + this._coffs[2] * z + this._coffs[3] * w, this._coffs[4] * x + this._coffs[5] * y + this._coffs[6] * z + this._coffs[7] * w, this._coffs[8] * x + this._coffs[9] * y + this._coffs[10] * z + this._coffs[11] * w);\n const w1 = this._coffs[12] * x + this._coffs[13] * y + this._coffs[14] * z + this._coffs[15] * w;\n const qx = Geometry.conditionalDivideCoordinate(result.x, w1);\n const qy = Geometry.conditionalDivideCoordinate(result.y, w1);\n const qz = Geometry.conditionalDivideCoordinate(result.z, w1);\n if (qx !== undefined && qy !== undefined && qz !== undefined) {\n result.x = qx;\n result.y = qy;\n result.z = qz;\n }\n return result;\n }\n /** multiply matrix * an array of Point4d. immediately renormalize to return in an array of Point3d. */\n public multiplyPoint4dArrayQuietRenormalize(pts: Point4d[], results: Point3d[]): void {\n pts.forEach((pt, i) => { results[i] = this.multiplyXYZWQuietRenormalize(pt.x, pt.y, pt.z, pt.w, results[i]); });\n }\n /** multiply a Point4d, return with the optional result convention. */\n public multiplyPoint4d(point: Point4d, result?: Point4d): Point4d {\n return this.multiplyXYZW(point.xyzw[0], point.xyzw[1], point.xyzw[2], point.xyzw[3], result);\n }\n /** multiply a Point4d, return with the optional result convention. */\n public multiplyTransposePoint4d(point: Point4d, result?: Point4d): Point4d {\n return this.multiplyTransposeXYZW(point.xyzw[0], point.xyzw[1], point.xyzw[2], point.xyzw[3], result);\n }\n /** multiply matrix * point. This produces a weighted xyzw.\n * Immediately renormalize back to xyz and return (with optional result convention).\n * If zero weight appears in the result (i.e. input is on eyeplane)leave the mapped xyz untouched.\n */\n public multiplyPoint3dQuietNormalize(point: XYAndZ, result?: Point3d): Point3d {\n return this.multiplyXYZWQuietRenormalize(point.x, point.y, point.z, 1.0, result);\n }\n /** multiply each matrix * points[i]. This produces a weighted xyzw.\n * Immediately renormalize back to xyz and replace the original point.\n * If zero weight appears in the result (i.e. input is on eyeplane) leave the mapped xyz untouched.\n */\n public multiplyPoint3dArrayQuietNormalize(points: Point3d[]) {\n points.forEach((point) => this.multiplyXYZWQuietRenormalize(point.x, point.y, point.z, 1.0, point));\n }\n /**\n * Add the product terms [xx,xy,xz,xw, yx, yy, yz, yw, zx, zy, zz, zs, wx, wy, wz, ww] to respective entries in the matrix\n * @param x x component for products\n * @param y y component for products\n * @param z z component for products\n * @param w w component for products\n */\n public addMomentsInPlace(x: number, y: number, z: number, w: number) {\n this._coffs[0] += x * x;\n this._coffs[1] += x * y;\n this._coffs[2] += x * z;\n this._coffs[3] += x * w;\n this._coffs[4] += y * x;\n this._coffs[5] += y * y;\n this._coffs[6] += y * z;\n this._coffs[7] += y * w;\n this._coffs[8] += z * x;\n this._coffs[9] += z * y;\n this._coffs[10] += z * z;\n this._coffs[11] += z * w;\n this._coffs[12] += w * x;\n this._coffs[13] += w * y;\n this._coffs[14] += w * z;\n this._coffs[15] += w * w;\n }\n /** accumulate all coefficients of other to this. */\n public addScaledInPlace(other: Matrix4d, scale: number = 1.0) {\n for (let i = 0; i < 16; i++)\n this._coffs[i] += scale * other._coffs[i];\n }\n /**\n * Add scale times rowA to rowB.\n * @param rowIndexA row that is not modified\n * @param rowIndexB row that is modified.\n * @param firstColumnIndex first column modified. All from there to the right are updated\n * @param scale scale\n */\n public rowOperation(rowIndexA: number, rowIndexB: number, firstColumnIndex: number, scale: number) {\n if (scale === 0.0)\n return;\n let iA = rowIndexA * 4 + firstColumnIndex;\n let iB = rowIndexB * 4 + firstColumnIndex;\n for (let i = firstColumnIndex; i < 4; i++ , iA++ , iB++)\n this._coffs[iB] += scale * this._coffs[iA];\n }\n /** Return the determinant of the matrix. */\n public determinant(): number {\n const c = this._coffs;\n return Geometry.determinant4x4(\n c[0], c[1], c[2], c[3],\n c[4], c[5], c[6], c[7],\n c[8], c[9], c[10], c[11],\n c[12], c[13], c[14], c[15]);\n }\n /** Compute an inverse matrix.\n * * This uses direct formulas with various determinants.\n * * If result is given, it is ALWAYS filled with values \"prior to dividing by the determinant\".\n * *\n * @returns undefined if dividing by the determinant looks unsafe.\n */\n public createInverse(result?: Matrix4d): Matrix4d | undefined {\n // dividing each column by its maxAbs is more robust than dividing them by this.maxAbs()\n let maxAbs0 = this.columnX().maxAbs();\n if (maxAbs0 === 0.0) return undefined;\n const divMaxAbsA = 1.0 / maxAbs0;\n maxAbs0 = this.columnY().maxAbs();\n if (maxAbs0 === 0.0) return undefined;\n const divMaxAbsB = 1.0 / maxAbs0;\n maxAbs0 = this.columnZ().maxAbs();\n if (maxAbs0 === 0.0) return undefined;\n const divMaxAbsC = 1.0 / maxAbs0;\n maxAbs0 = this.columnW().maxAbs();\n if (maxAbs0 === 0.0) return undefined;\n const divMaxAbsD = 1.0 / maxAbs0;\n const columnA = this.columnX();\n const columnB = this.columnY();\n const columnC = this.columnZ();\n const columnD = this.columnW();\n columnA.scale(divMaxAbsA, columnA);\n columnB.scale(divMaxAbsB, columnB);\n columnC.scale(divMaxAbsC, columnC);\n columnD.scale(divMaxAbsD, columnD);\n const rowBCD = Point4d.perpendicularPoint4dPlane(columnB, columnC, columnD);\n const rowCDA = Point4d.perpendicularPoint4dPlane(columnA, columnD, columnC); // order for negation !\n const rowDAB = Point4d.perpendicularPoint4dPlane(columnD, columnA, columnB);\n const rowABC = Point4d.perpendicularPoint4dPlane(columnC, columnB, columnA); // order for negation !\n // The matrix is singular if the determinant is zero.\n // But what is the proper tolerance for zero?\n // The row values are generally cubes of entries. And the typical perspective matrix\n // has very different magnitudes in various parts. So a typical cube size is really hard.\n // Compute 4 different determinants. They should match.\n // If they are near zero, maybe a sign change is a red flag for singular case.\n // (And there's a lot less work to do that than was done to make the rows)\n result = Matrix4d.createRows(rowBCD, rowCDA, rowDAB, rowABC, result);\n const determinantA = rowBCD.dotProduct(columnA);\n const determinantB = rowCDA.dotProduct(columnB);\n const determinantC = rowDAB.dotProduct(columnC);\n const determinantD = rowABC.dotProduct(columnD);\n const maxAbs1 = result.maxAbs();\n if (determinantA * determinantB > 0.0\n && determinantA * determinantC > 0.0\n && determinantA * determinantD > 0.0) {\n const divisionTest = Geometry.conditionalDivideCoordinate(maxAbs1, determinantA);\n if (divisionTest !== undefined) {\n const divDet = 1.0 / determinantA;\n result.scaleRowsInPlace(divMaxAbsA * divDet, divMaxAbsB * divDet, divMaxAbsC * divDet, divMaxAbsD * divDet);\n return result;\n }\n } else {\n return undefined; // this is a useful spot to break to see if the 4 determinant test is effective.\n }\n return undefined;\n }\n /** Returns an array-of-arrays of the matrix rows, optionally passing each value through a function.\n * @param f optional function to provide alternate values for each entry (e.g. force fuzz to zero.)\n */\n public rowArrays(f?: (value: number) => any): any {\n if (f)\n return [\n [f(this._coffs[0]), f(this._coffs[1]), f(this._coffs[2]), f(this._coffs[3])],\n [f(this._coffs[4]), f(this._coffs[5]), f(this._coffs[6]), f(this._coffs[7])],\n [f(this._coffs[8]), f(this._coffs[9]), f(this._coffs[10]), f(this._coffs[11])],\n [f(this._coffs[12]), f(this._coffs[13]), f(this._coffs[14]), f(this._coffs[15])]];\n else\n return [\n [this._coffs[0], this._coffs[1], this._coffs[2], this._coffs[3]],\n [this._coffs[4], this._coffs[5], this._coffs[6], this._coffs[7]],\n [this._coffs[8], this._coffs[9], this._coffs[10], this._coffs[11]],\n [this._coffs[12], this._coffs[13], this._coffs[14], this._coffs[15]]];\n }\n /**\n * Scale each row by respective scale factors.\n * @param ax scale factor for row 0\n * @param ay scale factor for row 1\n * @param az scale factor for row 2\n * @param aw scale factor for row 3\n */\n public scaleRowsInPlace(ax: number, ay: number, az: number, aw: number) {\n for (let i = 0; i < 4; i++)\n this._coffs[i] *= ax;\n for (let i = 4; i < 8; i++)\n this._coffs[i] *= ay;\n for (let i = 8; i < 12; i++)\n this._coffs[i] *= az;\n for (let i = 12; i < 16; i++)\n this._coffs[i] *= aw;\n }\n /**\n * add an outer product (single column times single row times scale factor) to this matrix.\n * @param vectorU column vector\n * @param vectorV row vector\n * @param scale scale factor\n */\n public addScaledOuterProductInPlace(vectorU: Point4d, vectorV: Point4d, scale: number) {\n let a = vectorU.x * scale;\n this._coffs[0] += a * vectorV.x;\n this._coffs[1] += a * vectorV.y;\n this._coffs[2] += a * vectorV.z;\n this._coffs[3] += a * vectorV.w;\n\n a = vectorU.y * scale;\n this._coffs[4] += a * vectorV.x;\n this._coffs[5] += a * vectorV.y;\n this._coffs[6] += a * vectorV.z;\n this._coffs[7] += a * vectorV.w;\n\n a = vectorU.z * scale;\n this._coffs[8] += a * vectorV.x;\n this._coffs[9] += a * vectorV.y;\n this._coffs[10] += a * vectorV.z;\n this._coffs[11] += a * vectorV.w;\n\n a = vectorU.w * scale;\n this._coffs[12] += a * vectorV.x;\n this._coffs[13] += a * vectorV.y;\n this._coffs[14] += a * vectorV.z;\n this._coffs[15] += a * vectorV.w;\n }\n /**\n * Add (in place) scale*A*B*AT where\n * * A is a pure translation with final column [x,y,z,1]\n * * B is the given `matrixB`\n * * AT is the transpose of A.\n * * scale is a multiplier.\n * @param matrixB the middle matrix.\n * @param ax x part of translation\n * @param ay y part of translation\n * @param az z part of translation\n * @param scale scale factor for entire product\n */\n public addTranslationSandwichInPlace(matrixB: Matrix4d, ax: number, ay: number, az: number, scale: number) {\n const bx = matrixB._coffs[3];\n const by = matrixB._coffs[7];\n const bz = matrixB._coffs[11];\n // matrixB can be non-symmetric!!\n const cx = matrixB._coffs[12];\n const cy = matrixB._coffs[13];\n const cz = matrixB._coffs[14];\n\n const beta = matrixB._coffs[15];\n const axBeta = ax * beta;\n const ayBeta = ay * beta;\n const azBeta = az * beta;\n this._coffs[0] += scale * (matrixB._coffs[0] + ax * bx + cx * ax + ax * axBeta);\n this._coffs[1] += scale * (matrixB._coffs[1] + ay * bx + cy * ax + ax * ayBeta);\n this._coffs[2] += scale * (matrixB._coffs[2] + az * bx + cz * ax + ax * azBeta);\n this._coffs[3] += scale * (bx + axBeta);\n\n this._coffs[4] += scale * (matrixB._coffs[4] + ax * by + cx * ay + ay * axBeta);\n this._coffs[5] += scale * (matrixB._coffs[5] + ay * by + cy * ay + ay * ayBeta);\n this._coffs[6] += scale * (matrixB._coffs[6] + az * by + cz * ay + ay * azBeta);\n this._coffs[7] += scale * (by + ayBeta);\n\n this._coffs[8] += scale * (matrixB._coffs[8] + ax * bz + cx * az + az * axBeta);\n this._coffs[9] += scale * (matrixB._coffs[9] + ay * bz + cy * az + az * ayBeta);\n this._coffs[10] += scale * (matrixB._coffs[10] + az * bz + cz * az + az * azBeta);\n this._coffs[11] += scale * (bz + azBeta);\n\n this._coffs[12] += scale * (cx + axBeta);\n this._coffs[13] += scale * (cy + ayBeta);\n this._coffs[14] += scale * (cz + azBeta);\n this._coffs[15] += scale * beta;\n }\n /**\n * Multiply and replace contents of ` this` matrix by `A*this*AT` where\n * * `A` is a pure translation with final column [x,y,z,1].\n * * `this` is this matrix.\n * * `AT` is the transpose of A.\n * @param ax x part of translation.\n * @param ay y part of translation.\n * @param az z part of translation.\n */\n public multiplyTranslationSandwichInPlace(ax: number, ay: number, az: number) : void {\n const bx = this._coffs[3];\n const by = this._coffs[7];\n const bz = this._coffs[11];\n // matrixB can be non-symmetric\n const cx = this._coffs[12];\n const cy = this._coffs[13];\n const cz = this._coffs[14];\n\n const beta = this._coffs[15];\n const axBeta = ax * beta;\n const ayBeta = ay * beta;\n const azBeta = az * beta;\n this._coffs[0] += (ax * bx + cx * ax + ax * axBeta);\n this._coffs[1] += (ay * bx + cy * ax + ax * ayBeta);\n this._coffs[2] += (az * bx + cz * ax + ax * azBeta);\n this._coffs[3] += axBeta;\n\n this._coffs[4] += (ax * by + cx * ay + ay * axBeta);\n this._coffs[5] += (ay * by + cy * ay + ay * ayBeta);\n this._coffs[6] += (az * by + cz * ay + ay * azBeta);\n this._coffs[7] += ayBeta;\n\n this._coffs[8] += (ax * bz + cx * az + az * axBeta);\n this._coffs[9] += (ay * bz + cy * az + az * ayBeta);\n this._coffs[10] += (az * bz + cz * az + az * azBeta);\n this._coffs[11] += azBeta;\n\n this._coffs[12] += axBeta;\n this._coffs[13] += ayBeta;\n this._coffs[14] += azBeta;\n // coffs[15] is unchanged\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Matrix4d.js","sourceRoot":"","sources":["../../../src/geometry4d/Matrix4d.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,0CAAwD;AACxD,qDAAkD;AAClD,mEAAuE;AACvE,uDAAoD;AAEpD,uCAAkD;AAQlD;;;;;;;;;;;;;;GAcG;A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MAAM,CAAC;QAC1B,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC;QAC1B,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC;QAC1B,yBAAyB;IAC3B,CAAC;CACF;AA5vBD,4BA4vBC","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/** @packageDocumentation\r\n * @module Numerics\r\n */\r\n\r\nimport { BeJSONFunctions, Geometry } from \"../Geometry\";\r\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\r\nimport { Point3d, Vector3d, XYZ } from \"../geometry3d/Point3dVector3d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { XYAndZ } from \"../geometry3d/XYZProps\";\r\nimport { Point4d, Point4dProps } from \"./Point4d\";\r\n\r\n/**\r\n * Coordinate data with `Point4d` numeric data as an array `[x,y,z,w]`\r\n * @public\r\n */\r\nexport type Matrix4dProps = Point4dProps[];\r\n\r\n/**\r\n * * A Matrix4d is a matrix with 4 rows and 4 columns.\r\n * * The 4 rows may be described as the x,y,z,w rows.\r\n * * The 4 columns may be described as the x,y,z,w columns.\r\n * * The matrix is physically stored as a Float64Array with 16 numbers.\r\n * * The layout in the Float64Array is \"by row\"\r\n * * indices 0,1,2,3 are the \"x row\". They may be called the xx,xy,xz,xw entries\r\n * * indices 4,5,6,7 are the \"y row\" They may be called the yx,yy,yz,yw entries\r\n * * indices 8,9,10,11 are the \"z row\" They may be called the zx,zy,zz,zw entries\r\n * * indices 12,13,14,15 are the \"w row\". They may be called the wx,wy,wz,ww entries\r\n * * If \"w row\" contains numeric values 0,0,0,1, the Matrix4d is equivalent to a Transform with\r\n * * The upper left 3x3 matrix (entries 0,1,2,4,5,6,8,9,10) are the 3x3 matrix part of the transform\r\n * * The far right column entries xw,yw,zw are the \"origin\" (sometimes called \"translation\") part of the transform.\r\n * @public\r\n */\r\nexport class Matrix4d implements BeJSONFunctions {\r\n private _coffs: Float64Array;\r\n private constructor() { this._coffs = new Float64Array(16); }\r\n /** Copy matrix entries from `other` */\r\n public setFrom(other: Matrix4d): void {\r\n for (let i = 0; i < 16; i++)\r\n this._coffs[i] = other._coffs[i];\r\n }\r\n /** Return a deep clone. */\r\n public clone(result?: Matrix4d): Matrix4d {\r\n if (result === this)\r\n return this;\r\n if (result === undefined)\r\n result = new Matrix4d();\r\n for (let i = 0; i < 16; i++)\r\n result._coffs[i] = this._coffs[i];\r\n return result;\r\n }\r\n /** zero this matrix4d in place. */\r\n public setZero(): void {\r\n for (let i = 0; i < 16; i++)\r\n this._coffs[i] = 0;\r\n }\r\n /** set to identity. */\r\n public setIdentity(): void {\r\n for (let i = 0; i < 16; i++)\r\n this._coffs[i] = 0;\r\n this._coffs[0] = this._coffs[5] = this._coffs[10] = this._coffs[15] = 1.0;\r\n }\r\n private static is1000(a: number, b: number, c: number, d: number, tol: number): boolean {\r\n return Math.abs(a - 1.0) <= tol\r\n && Math.abs(b) <= tol\r\n && Math.abs(c) <= tol\r\n && Math.abs(d) <= tol;\r\n }\r\n /** set to identity. */\r\n public isIdentity(tol: number = 1.0e-10): boolean {\r\n return Matrix4d.is1000(this._coffs[0], this._coffs[1], this._coffs[2], this._coffs[3], tol)\r\n && Matrix4d.is1000(this._coffs[5], this._coffs[6], this._coffs[7], this._coffs[4], tol)\r\n && Matrix4d.is1000(this._coffs[10], this._coffs[11], this._coffs[8], this._coffs[9], tol)\r\n && Matrix4d.is1000(this._coffs[15], this._coffs[12], this._coffs[13], this._coffs[14], tol);\r\n }\r\n /** create a Matrix4d filled with zeros. */\r\n public static createZero(result?: Matrix4d): Matrix4d {\r\n if (result) {\r\n result.setZero();\r\n return result;\r\n }\r\n return new Matrix4d(); // this is zero.\r\n }\r\n /** create a Matrix4d with values supplied \"across the rows\" */\r\n public static createRowValues(cxx: number, cxy: number, cxz: number, cxw: number, cyx: number, cyy: number, cyz: number, cyw: number, czx: number, czy: number, czz: number, czw: number, cwx: number, cwy: number, cwz: number, cww: number, result?: Matrix4d): Matrix4d {\r\n result = result ? result : new Matrix4d();\r\n result._coffs[0] = cxx;\r\n result._coffs[1] = cxy;\r\n result._coffs[2] = cxz;\r\n result._coffs[3] = cxw;\r\n result._coffs[4] = cyx;\r\n result._coffs[5] = cyy;\r\n result._coffs[6] = cyz;\r\n result._coffs[7] = cyw;\r\n result._coffs[8] = czx;\r\n result._coffs[9] = czy;\r\n result._coffs[10] = czz;\r\n result._coffs[11] = czw;\r\n result._coffs[12] = cwx;\r\n result._coffs[13] = cwy;\r\n result._coffs[14] = cwz;\r\n result._coffs[15] = cww;\r\n return result;\r\n }\r\n /** Create a `Matrix4d` from 16 values appearing as `Point4d` for each row. */\r\n public static createRows(rowX: Point4d, rowY: Point4d, rowZ: Point4d, rowW: Point4d, result?: Matrix4d): Matrix4d {\r\n return this.createRowValues(\r\n rowX.x, rowX.y, rowX.z, rowX.w,\r\n rowY.x, rowY.y, rowY.z, rowY.w,\r\n rowZ.x, rowZ.y, rowZ.z, rowZ.w,\r\n rowW.x, rowW.y, rowW.z, rowW.w, result);\r\n }\r\n /** directly set columns from typical 3d data:\r\n *\r\n * * vectorX, vectorY, vectorZ as columns 0,1,2, with weight0.\r\n * * origin as column3, with weight 1\r\n */\r\n public setOriginAndVectors(origin: XYZ, vectorX: Vector3d, vectorY: Vector3d, vectorZ: Vector3d) {\r\n this._coffs[0] = vectorX.x;\r\n this._coffs[1] = vectorY.x;\r\n this._coffs[2] = vectorZ.x;\r\n this._coffs[3] = origin.x;\r\n this._coffs[4] = vectorX.y;\r\n this._coffs[5] = vectorY.y;\r\n this._coffs[6] = vectorZ.y;\r\n this._coffs[7] = origin.y;\r\n this._coffs[8] = vectorX.z;\r\n this._coffs[9] = vectorY.z;\r\n this._coffs[10] = vectorZ.z;\r\n this._coffs[11] = origin.z;\r\n this._coffs[12] = 0.0;\r\n this._coffs[13] = 0.0;\r\n this._coffs[14] = 0.0;\r\n this._coffs[15] = 1.0;\r\n }\r\n /** promote a transform to full Matrix4d (with 0001 in final row) */\r\n public static createTransform(source: Transform, result?: Matrix4d): Matrix4d {\r\n const matrix = source.matrix;\r\n const point = source.origin;\r\n return Matrix4d.createRowValues(matrix.coffs[0], matrix.coffs[1], matrix.coffs[2], point.x, matrix.coffs[3], matrix.coffs[4], matrix.coffs[5], point.y, matrix.coffs[6], matrix.coffs[7], matrix.coffs[8], point.z, 0, 0, 0, 1, result);\r\n }\r\n /** return an identity matrix. */\r\n public static createIdentity(result?: Matrix4d): Matrix4d {\r\n result = Matrix4d.createZero(result);\r\n result._coffs[0] = 1.0;\r\n result._coffs[5] = 1.0;\r\n result._coffs[10] = 1.0;\r\n result._coffs[15] = 1.0;\r\n return result;\r\n }\r\n /** return matrix with translation directly inserted (along with 1 on diagonal) */\r\n public static createTranslationXYZ(x: number, y: number, z: number, result?: Matrix4d): Matrix4d {\r\n result = Matrix4d.createZero(result);\r\n result._coffs[0] = 1.0;\r\n result._coffs[5] = 1.0;\r\n result._coffs[10] = 1.0;\r\n result._coffs[15] = 1.0;\r\n result._coffs[3] = x;\r\n result._coffs[7] = y;\r\n result._coffs[11] = z;\r\n return result;\r\n }\r\n\r\n /** return this matrix plus scale times matrixB. */\r\n public plusScaled(matrixB: Matrix4d, scale: number, result?: Matrix4d): Matrix4d {\r\n // If result is undefined, a real clone is created.\r\n // If result is \"this\" we get the pointer to this right back.\r\n // If result is other, \"this\" coffs are copied.\r\n // Then we can add matrixB. (Which we assume is different from this?)\r\n result = this.clone(result);\r\n for (let i = 0; i < 16; i++)\r\n result._coffs[i] += scale * matrixB._coffs[i];\r\n return result;\r\n }\r\n\r\n /**\r\n * Create a Matrix4d with translation and scaling values directly inserted (along with 1 as final diagonal entry)\r\n * @param tx x entry for translation column\r\n * @param ty y entry for translation column\r\n * @param tz z entry for translation column\r\n * @param scaleX x diagonal entry\r\n * @param scaleY y diagonal entry\r\n * @param scaleZ z diagonal entry\r\n * @param result optional result.\r\n */\r\n public static createTranslationAndScaleXYZ(tx: number, ty: number, tz: number, scaleX: number, scaleY: number, scaleZ: number, result?: Matrix4d): Matrix4d {\r\n return Matrix4d.createRowValues(scaleX, 0, 0, tx, 0, scaleY, 0, ty, 0, 0, scaleZ, tz, 0, 0, 0, 1, result);\r\n }\r\n /**\r\n * Create a mapping that scales and translates (no rotation) from box A to box B\r\n * @param lowA low point of box A\r\n * @param highA high point of box A\r\n * @param lowB low point of box B\r\n * @param highB high point of box B\r\n */\r\n public static createBoxToBox(lowA: Point3d, highA: Point3d, lowB: Point3d, highB: Point3d, result?: Matrix4d): Matrix4d | undefined {\r\n const ax = highA.x - lowA.x;\r\n const ay = highA.y - lowA.y;\r\n const az = highA.z - lowA.z;\r\n const bx = highB.x - lowB.x;\r\n const by = highB.y - lowB.y;\r\n const bz = highB.z - lowB.z;\r\n const abx = Geometry.conditionalDivideFraction(bx, ax);\r\n const aby = Geometry.conditionalDivideFraction(by, ay);\r\n const abz = Geometry.conditionalDivideFraction(bz, az);\r\n if (abx !== undefined && aby !== undefined && abz !== undefined) {\r\n return Matrix4d.createTranslationAndScaleXYZ(lowB.x - abx * lowA.x, lowB.y - aby * lowA.y, lowB.z - abz * lowA.z, abx, aby, abz, result);\r\n }\r\n return undefined;\r\n }\r\n /** Set from nested array json e.g. `[[1,2,3,4],[0,1,2,4],[0,2,5,1],[0,0,1,2]]` */\r\n public setFromJSON(json?: Matrix4dProps) {\r\n if (Geometry.isArrayOfNumberArray(json, 4, 4)) {\r\n for (let i = 0; i < 4; ++i) {\r\n for (let j = 0; j < 4; ++j)\r\n this._coffs[i * 4 + j] = json[i][j];\r\n }\r\n } else {\r\n this.setZero();\r\n }\r\n }\r\n /**\r\n * Return the largest (absolute) difference between this and other Matrix4d.\r\n * @param other matrix to compare to\r\n */\r\n public maxDiff(other: Matrix4d): number {\r\n let a = 0.0;\r\n for (let i = 0; i < 16; i++)\r\n a = Math.max(a, Math.abs(this._coffs[i] - other._coffs[i]));\r\n return a;\r\n }\r\n /**\r\n * Return the largest absolute value in the Matrix4d\r\n */\r\n public maxAbs(): number {\r\n let a = 0.0;\r\n for (let i = 0; i < 16; i++)\r\n a = Math.max(a, Math.abs(this._coffs[i]));\r\n return a;\r\n }\r\n /** Test for near-equality with `other` */\r\n public isAlmostEqual(other: Matrix4d): boolean {\r\n return Geometry.isSmallMetricDistance(this.maxDiff(other));\r\n }\r\n /** Test for exact (bitwise) equality with other. */\r\n public isExactEqual(other: Matrix4d): boolean { return this.maxDiff(other) === 0.0; }\r\n /**\r\n * Convert an Matrix4d to a Matrix4dProps.\r\n */\r\n public toJSON(): Matrix4dProps {\r\n const value = [];\r\n for (let i = 0; i < 4; ++i) {\r\n const row = i * 4;\r\n value.push([this._coffs[row], this._coffs[row + 1], this._coffs[row + 2], this._coffs[row + 3]]);\r\n }\r\n return value;\r\n }\r\n /** Create from nested array json e.g. `[[1,2,3,4],[0,1,2,4],[0,2,5,1],[0,0,1,2]]` */\r\n public static fromJSON(json?: Matrix4dProps) {\r\n const result = new Matrix4d();\r\n result.setFromJSON(json);\r\n return result;\r\n }\r\n /**\r\n * Return a point with entries from positions [i0, i0+step, i0+2*step, i0+3*step].\r\n * * There are no tests for index going out of the 0..15 range.\r\n * * Usual uses are:\r\n * * * i0 at left of row (0,4,8,12), step = 1 to extract a row.\r\n * * * i0 at top of row (0,1,2,3), step = 4 to extract a column\r\n * * * i0 = 0, step = 5 to extract the diagonal\r\n * @returns a Point4d with 4 entries taken from positions at steps in the flat 16-member array.\r\n * @param i0 start index (for 16 member array)\r\n * @param step step between members\r\n * @param result optional preallocated point.\r\n */\r\n public getSteppedPoint(i0: number, step: number, result?: Point4d): Point4d {\r\n return Point4d.create(this._coffs[i0], this._coffs[i0 + step], this._coffs[i0 + 2 * step], this._coffs[i0 + 3 * step], result);\r\n }\r\n /** Return column 0 as Point4d. */\r\n public columnX(): Point4d { return this.getSteppedPoint(0, 4); }\r\n /** Return column 1 as Point4d. */\r\n public columnY(): Point4d { return this.getSteppedPoint(1, 4); }\r\n /** Return column 2 as Point4d. */\r\n public columnZ(): Point4d { return this.getSteppedPoint(2, 4); }\r\n /** Return column 3 as Point4d. */\r\n public columnW(): Point4d { return this.getSteppedPoint(3, 4); }\r\n /** Return row 0 as Point4d. */\r\n public rowX(): Point4d { return this.getSteppedPoint(0, 1); }\r\n /** Return row 1 as Point4d. */\r\n public rowY(): Point4d { return this.getSteppedPoint(4, 1); }\r\n /** Return row 2 as Point4d. */\r\n public rowZ(): Point4d { return this.getSteppedPoint(8, 1); }\r\n /** Return row 3 as Point4d. */\r\n public rowW(): Point4d { return this.getSteppedPoint(12, 1); }\r\n /**\r\n * Returns true if the w row has content other than [0,0,0,1]\r\n */\r\n public get hasPerspective(): boolean {\r\n return this._coffs[12] !== 0.0\r\n || this._coffs[13] !== 0.0\r\n || this._coffs[14] !== 0.0\r\n || this._coffs[15] !== 1.0;\r\n }\r\n /**\r\n * Return a Point4d with the diagonal entries of the matrix\r\n */\r\n public diagonal(): Point4d { return this.getSteppedPoint(0, 5); }\r\n /** return the weight component of this matrix */\r\n public weight(): number { return this._coffs[15]; }\r\n /** return the leading 3x3 matrix part of this matrix */\r\n public matrixPart(): Matrix3d {\r\n return Matrix3d.createRowValues(this._coffs[0], this._coffs[1], this._coffs[2], this._coffs[4], this._coffs[5], this._coffs[6], this._coffs[8], this._coffs[9], this._coffs[10]);\r\n }\r\n /**\r\n * Return the (affine, non-perspective) Transform with the upper 3 rows of this matrix\r\n * @return undefined if this Matrix4d has perspective effects in the w row.\r\n * @see toTransform\r\n */\r\n public get asTransform(): Transform | undefined {\r\n if (this.hasPerspective)\r\n return undefined;\r\n return Transform.createRowValues(this._coffs[0], this._coffs[1], this._coffs[2], this._coffs[3], this._coffs[4], this._coffs[5], this._coffs[6], this._coffs[7], this._coffs[8], this._coffs[9], this._coffs[10], this._coffs[11]);\r\n }\r\n /**\r\n * Populate a [[Transform]] from the instance, even if the transformations aren't equivalent.\r\n * * A Transform cannot encode perspective, but this method returns one even if it isn't equivalent to the instance.\r\n * * Compare to the [[asTransform]] property, which returns `undefined` when there is perspective.\r\n * @param result optional preallocated object to populate and return.\r\n * @returns derived `Transform` and a flag indicating its validity:\r\n * * `transform` is filled with the top three rows of the instance's entries scaled by the reciprocal of nonzero [[weight]];\r\n * if [[weight]] is zero, `transform` is set to the identity.\r\n * * `isValid` is true if and only if the last row of the instance is essentially `[000w]` for nonzero `w` = [[weight]].\r\n * @see asTransform\r\n */\r\n public toTransform(result?: Transform): { transform: Transform, isValid: boolean } {\r\n const transform = Transform.createIdentity(result);\r\n let isValid = false;\r\n if (this.weight() !== 0.0) {\r\n const scale = 1.0 / this.weight();\r\n for (let i = 0; i < 3; i++) {\r\n for (let j = 0; j < 3; j++)\r\n transform.matrix.setAt(i, j, scale * this.atIJ(i, j));\r\n }\r\n transform.origin.set(scale * this.atIJ(0, 3), scale * this.atIJ(1, 3), scale * this.atIJ(2, 3));\r\n isValid = Geometry.isSmallMetricDistance(scale * (Math.abs(this.atIJ(3, 0) + Math.abs(this.atIJ(3, 1)) + Math.abs(this.atIJ(3, 2)))));\r\n }\r\n return { transform, isValid };\r\n }\r\n /** multiply this * other. */\r\n public multiplyMatrixMatrix(other: Matrix4d, result?: Matrix4d): Matrix4d {\r\n result = (result && result !== this && result !== other) ? result : new Matrix4d();\r\n for (let i0 = 0; i0 < 16; i0 += 4) {\r\n for (let k = 0; k < 4; k++)\r\n result._coffs[i0 + k] =\r\n this._coffs[i0] * other._coffs[k] +\r\n this._coffs[i0 + 1] * other._coffs[k + 4] +\r\n this._coffs[i0 + 2] * other._coffs[k + 8] +\r\n this._coffs[i0 + 3] * other._coffs[k + 12];\r\n }\r\n return result;\r\n }\r\n /** multiply this * transpose(other). */\r\n public multiplyMatrixMatrixTranspose(other: Matrix4d, result?: Matrix4d): Matrix4d {\r\n result = (result && result !== this && result !== other) ? result : new Matrix4d();\r\n let j = 0;\r\n for (let i0 = 0; i0 < 16; i0 += 4) {\r\n for (let k = 0; k < 16; k += 4)\r\n result._coffs[j++] =\r\n this._coffs[i0] * other._coffs[k] +\r\n this._coffs[i0 + 1] * other._coffs[k + 1] +\r\n this._coffs[i0 + 2] * other._coffs[k + 2] +\r\n this._coffs[i0 + 3] * other._coffs[k + 3];\r\n }\r\n return result;\r\n }\r\n /** multiply transpose (this) * other. */\r\n public multiplyMatrixTransposeMatrix(other: Matrix4d, result?: Matrix4d): Matrix4d {\r\n result = (result && result !== this && result !== other) ? result : new Matrix4d();\r\n let j = 0;\r\n for (let i0 = 0; i0 < 4; i0 += 1) {\r\n for (let k0 = 0; k0 < 4; k0 += 1)\r\n result._coffs[j++] =\r\n this._coffs[i0] * other._coffs[k0] +\r\n this._coffs[i0 + 4] * other._coffs[k0 + 4] +\r\n this._coffs[i0 + 8] * other._coffs[k0 + 8] +\r\n this._coffs[i0 + 12] * other._coffs[k0 + 12];\r\n }\r\n return result;\r\n }\r\n /** Return a transposed matrix. */\r\n public cloneTransposed(result?: Matrix4d): Matrix4d {\r\n return Matrix4d.createRowValues(this._coffs[0], this._coffs[4], this._coffs[8], this._coffs[12], this._coffs[1], this._coffs[5], this._coffs[9], this._coffs[13], this._coffs[2], this._coffs[6], this._coffs[10], this._coffs[14], this._coffs[3], this._coffs[7], this._coffs[11], this._coffs[15], result);\r\n }\r\n /** multiply matrix times column [x,y,z,w]. return as Point4d. (And the returned value is NOT normalized down to unit w) */\r\n public multiplyXYZW(x: number, y: number, z: number, w: number, result?: Point4d): Point4d {\r\n result = result ? result : Point4d.createZero();\r\n return result.set(this._coffs[0] * x + this._coffs[1] * y + this._coffs[2] * z + this._coffs[3] * w, this._coffs[4] * x + this._coffs[5] * y + this._coffs[6] * z + this._coffs[7] * w, this._coffs[8] * x + this._coffs[9] * y + this._coffs[10] * z + this._coffs[11] * w, this._coffs[12] * x + this._coffs[13] * y + this._coffs[14] * z + this._coffs[15] * w);\r\n }\r\n /** multiply matrix times column vectors [x,y,z,w] where [x,y,z,w] appear in blocks in an array.\r\n * replace the xyzw in the block\r\n */\r\n public multiplyBlockedFloat64ArrayInPlace(data: Float64Array) {\r\n const n = data.length;\r\n let x, y, z, w;\r\n for (let i = 0; i + 3 < n; i += 4) {\r\n x = data[i];\r\n y = data[i + 1];\r\n z = data[i + 2];\r\n w = data[i + 3];\r\n data[i] = this._coffs[0] * x + this._coffs[1] * y + this._coffs[2] * z + this._coffs[3] * w;\r\n data[i + 1] = this._coffs[4] * x + this._coffs[5] * y + this._coffs[6] * z + this._coffs[7] * w;\r\n data[i + 2] = this._coffs[8] * x + this._coffs[9] * y + this._coffs[10] * z + this._coffs[11] * w;\r\n data[i + 3] = this._coffs[12] * x + this._coffs[13] * y + this._coffs[14] * z + this._coffs[15] * w;\r\n }\r\n }\r\n /** multiply matrix times XYAndZ and w. return as Point4d (And the returned value is NOT normalized down to unit w) */\r\n public multiplyPoint3d(pt: XYAndZ, w: number, result?: Point4d): Point4d {\r\n return this.multiplyXYZW(pt.x, pt.y, pt.z, w, result);\r\n }\r\n /** multiply matrix times and array of XYAndZ. return as array of Point4d (And the returned value is NOT normalized down to unit w) */\r\n public multiplyPoint3dArray(pts: XYAndZ[], results: Point4d[], w: number = 1.0): void {\r\n pts.forEach((pt, i) => { results[i] = this.multiplyXYZW(pt.x, pt.y, pt.z, w, results[i]); });\r\n }\r\n /** multiply [x,y,z,w] times matrix. return as Point4d. (And the returned value is NOT normalized down to unit w) */\r\n public multiplyTransposeXYZW(x: number, y: number, z: number, w: number, result?: Point4d): Point4d {\r\n result = result ? result : Point4d.createZero();\r\n return result.set(this._coffs[0] * x + this._coffs[4] * y + this._coffs[8] * z + this._coffs[12] * w, this._coffs[1] * x + this._coffs[5] * y + this._coffs[9] * z + this._coffs[13] * w, this._coffs[2] * x + this._coffs[6] * y + this._coffs[10] * z + this._coffs[14] * w, this._coffs[3] * x + this._coffs[7] * y + this._coffs[11] * z + this._coffs[15] * w);\r\n }\r\n /** Returns dot product of row rowIndex of this with column columnIndex of other.\r\n */\r\n public rowDotColumn(rowIndex: number, other: Matrix4d, columnIndex: number): number {\r\n const i = rowIndex * 4;\r\n const j = columnIndex;\r\n return this._coffs[i] * other._coffs[j]\r\n + this._coffs[i + 1] * other._coffs[j + 4]\r\n + this._coffs[i + 2] * other._coffs[j + 8]\r\n + this._coffs[i + 3] * other._coffs[j + 12];\r\n }\r\n /** Returns dot product of row rowIndex of this with [x y z w]\r\n */\r\n public rowDotXYZW(rowIndex: number, x: number, y: number, z: number, w: number): number {\r\n const i = rowIndex * 4;\r\n return this._coffs[i] * x\r\n + this._coffs[i + 1] * y\r\n + this._coffs[i + 2] * z\r\n + this._coffs[i + 3] * w;\r\n }\r\n\r\n /** Returns dot product of row rowIndexThis of this with row rowIndexOther of other.\r\n */\r\n public rowDotRow(rowIndexThis: number, other: Matrix4d, rowIndexOther: number): number {\r\n const i = rowIndexThis * 4;\r\n const j = rowIndexOther * 4;\r\n return this._coffs[i] * other._coffs[j]\r\n + this._coffs[i + 1] * other._coffs[j + 1]\r\n + this._coffs[i + 2] * other._coffs[j + 2]\r\n + this._coffs[i + 3] * other._coffs[j + 3];\r\n }\r\n /** Returns dot product of row rowIndexThis of this with row rowIndexOther of other.\r\n */\r\n public columnDotColumn(columnIndexThis: number, other: Matrix4d, columnIndexOther: number): number {\r\n const i = columnIndexThis;\r\n const j = columnIndexOther;\r\n return this._coffs[i] * other._coffs[j]\r\n + this._coffs[i + 4] * other._coffs[j + 4]\r\n + this._coffs[i + 8] * other._coffs[j + 8]\r\n + this._coffs[i + 12] * other._coffs[j + 12];\r\n }\r\n /** Returns dot product of column columnIndexThis of this with row rowIndexOther other.\r\n */\r\n public columnDotRow(columnIndexThis: number, other: Matrix4d, rowIndexOther: number): number {\r\n const i = columnIndexThis;\r\n const j = 4 * rowIndexOther;\r\n return this._coffs[i] * other._coffs[j]\r\n + this._coffs[i + 4] * other._coffs[j + 1]\r\n + this._coffs[i + 8] * other._coffs[j + 2]\r\n + this._coffs[i + 12] * other._coffs[j + 3];\r\n }\r\n /** Return a matrix entry by row and column index.\r\n */\r\n public atIJ(rowIndex: number, columnIndex: number): number {\r\n return this._coffs[rowIndex * 4 + columnIndex];\r\n }\r\n\r\n /** Set a matrix entry by row and column index.\r\n */\r\n public setAtIJ(rowIndex: number, columnIndex: number, value: number) {\r\n this._coffs[rowIndex * 4 + columnIndex] = value;\r\n }\r\n /** multiply matrix * [x,y,z,w]. immediately renormalize to return in a Point3d.\r\n * If zero weight appears in the result (i.e. input is on eyeplane) leave the mapped xyz untouched.\r\n */\r\n public multiplyXYZWQuietRenormalize(x: number, y: number, z: number, w: number, result?: Point3d): Point3d {\r\n result = result ? result : Point3d.createZero();\r\n result.set(this._coffs[0] * x + this._coffs[1] * y + this._coffs[2] * z + this._coffs[3] * w, this._coffs[4] * x + this._coffs[5] * y + this._coffs[6] * z + this._coffs[7] * w, this._coffs[8] * x + this._coffs[9] * y + this._coffs[10] * z + this._coffs[11] * w);\r\n const w1 = this._coffs[12] * x + this._coffs[13] * y + this._coffs[14] * z + this._coffs[15] * w;\r\n const qx = Geometry.conditionalDivideCoordinate(result.x, w1);\r\n const qy = Geometry.conditionalDivideCoordinate(result.y, w1);\r\n const qz = Geometry.conditionalDivideCoordinate(result.z, w1);\r\n if (qx !== undefined && qy !== undefined && qz !== undefined) {\r\n result.x = qx;\r\n result.y = qy;\r\n result.z = qz;\r\n }\r\n return result;\r\n }\r\n /** multiply matrix * an array of Point4d. immediately renormalize to return in an array of Point3d. */\r\n public multiplyPoint4dArrayQuietRenormalize(pts: Point4d[], results: Point3d[]): void {\r\n pts.forEach((pt, i) => { results[i] = this.multiplyXYZWQuietRenormalize(pt.x, pt.y, pt.z, pt.w, results[i]); });\r\n }\r\n /** multiply a Point4d, return with the optional result convention. */\r\n public multiplyPoint4d(point: Point4d, result?: Point4d): Point4d {\r\n return this.multiplyXYZW(point.xyzw[0], point.xyzw[1], point.xyzw[2], point.xyzw[3], result);\r\n }\r\n /** multiply a Point4d, return with the optional result convention. */\r\n public multiplyTransposePoint4d(point: Point4d, result?: Point4d): Point4d {\r\n return this.multiplyTransposeXYZW(point.xyzw[0], point.xyzw[1], point.xyzw[2], point.xyzw[3], result);\r\n }\r\n /** multiply matrix * point. This produces a weighted xyzw.\r\n * Immediately renormalize back to xyz and return (with optional result convention).\r\n * If zero weight appears in the result (i.e. input is on eyeplane)leave the mapped xyz untouched.\r\n */\r\n public multiplyPoint3dQuietNormalize(point: XYAndZ, result?: Point3d): Point3d {\r\n return this.multiplyXYZWQuietRenormalize(point.x, point.y, point.z, 1.0, result);\r\n }\r\n /** multiply each matrix * points[i]. This produces a weighted xyzw.\r\n * Immediately renormalize back to xyz and replace the original point.\r\n * If zero weight appears in the result (i.e. input is on eyeplane) leave the mapped xyz untouched.\r\n */\r\n public multiplyPoint3dArrayQuietNormalize(points: Point3d[]) {\r\n points.forEach((point) => this.multiplyXYZWQuietRenormalize(point.x, point.y, point.z, 1.0, point));\r\n }\r\n /**\r\n * Add the product terms [xx,xy,xz,xw, yx, yy, yz, yw, zx, zy, zz, zs, wx, wy, wz, ww] to respective entries in the matrix\r\n * @param x x component for products\r\n * @param y y component for products\r\n * @param z z component for products\r\n * @param w w component for products\r\n */\r\n public addMomentsInPlace(x: number, y: number, z: number, w: number) {\r\n this._coffs[0] += x * x;\r\n this._coffs[1] += x * y;\r\n this._coffs[2] += x * z;\r\n this._coffs[3] += x * w;\r\n this._coffs[4] += y * x;\r\n this._coffs[5] += y * y;\r\n this._coffs[6] += y * z;\r\n this._coffs[7] += y * w;\r\n this._coffs[8] += z * x;\r\n this._coffs[9] += z * y;\r\n this._coffs[10] += z * z;\r\n this._coffs[11] += z * w;\r\n this._coffs[12] += w * x;\r\n this._coffs[13] += w * y;\r\n this._coffs[14] += w * z;\r\n this._coffs[15] += w * w;\r\n }\r\n /** accumulate all coefficients of other to this. */\r\n public addScaledInPlace(other: Matrix4d, scale: number = 1.0) {\r\n for (let i = 0; i < 16; i++)\r\n this._coffs[i] += scale * other._coffs[i];\r\n }\r\n /**\r\n * Add scale times rowA to rowB.\r\n * @param rowIndexA row that is not modified\r\n * @param rowIndexB row that is modified.\r\n * @param firstColumnIndex first column modified. All from there to the right are updated\r\n * @param scale scale\r\n */\r\n public rowOperation(rowIndexA: number, rowIndexB: number, firstColumnIndex: number, scale: number) {\r\n if (scale === 0.0)\r\n return;\r\n let iA = rowIndexA * 4 + firstColumnIndex;\r\n let iB = rowIndexB * 4 + firstColumnIndex;\r\n for (let i = firstColumnIndex; i < 4; i++ , iA++ , iB++)\r\n this._coffs[iB] += scale * this._coffs[iA];\r\n }\r\n /** Return the determinant of the matrix. */\r\n public determinant(): number {\r\n const c = this._coffs;\r\n return Geometry.determinant4x4(\r\n c[0], c[1], c[2], c[3],\r\n c[4], c[5], c[6], c[7],\r\n c[8], c[9], c[10], c[11],\r\n c[12], c[13], c[14], c[15]);\r\n }\r\n /** Compute an inverse matrix.\r\n * * This uses direct formulas with various determinants.\r\n * * If result is given, it is ALWAYS filled with values \"prior to dividing by the determinant\".\r\n * *\r\n * @returns undefined if dividing by the determinant looks unsafe.\r\n */\r\n public createInverse(result?: Matrix4d): Matrix4d | undefined {\r\n // dividing each column by its maxAbs is more robust than dividing them by this.maxAbs()\r\n let maxAbs0 = this.columnX().maxAbs();\r\n if (maxAbs0 === 0.0) return undefined;\r\n const divMaxAbsA = 1.0 / maxAbs0;\r\n maxAbs0 = this.columnY().maxAbs();\r\n if (maxAbs0 === 0.0) return undefined;\r\n const divMaxAbsB = 1.0 / maxAbs0;\r\n maxAbs0 = this.columnZ().maxAbs();\r\n if (maxAbs0 === 0.0) return undefined;\r\n const divMaxAbsC = 1.0 / maxAbs0;\r\n maxAbs0 = this.columnW().maxAbs();\r\n if (maxAbs0 === 0.0) return undefined;\r\n const divMaxAbsD = 1.0 / maxAbs0;\r\n const columnA = this.columnX();\r\n const columnB = this.columnY();\r\n const columnC = this.columnZ();\r\n const columnD = this.columnW();\r\n columnA.scale(divMaxAbsA, columnA);\r\n columnB.scale(divMaxAbsB, columnB);\r\n columnC.scale(divMaxAbsC, columnC);\r\n columnD.scale(divMaxAbsD, columnD);\r\n const rowBCD = Point4d.perpendicularPoint4dPlane(columnB, columnC, columnD);\r\n const rowCDA = Point4d.perpendicularPoint4dPlane(columnA, columnD, columnC); // order for negation !\r\n const rowDAB = Point4d.perpendicularPoint4dPlane(columnD, columnA, columnB);\r\n const rowABC = Point4d.perpendicularPoint4dPlane(columnC, columnB, columnA); // order for negation !\r\n // The matrix is singular if the determinant is zero.\r\n // But what is the proper tolerance for zero?\r\n // The row values are generally cubes of entries. And the typical perspective matrix\r\n // has very different magnitudes in various parts. So a typical cube size is really hard.\r\n // Compute 4 different determinants. They should match.\r\n // If they are near zero, maybe a sign change is a red flag for singular case.\r\n // (And there's a lot less work to do that than was done to make the rows)\r\n result = Matrix4d.createRows(rowBCD, rowCDA, rowDAB, rowABC, result);\r\n const determinantA = rowBCD.dotProduct(columnA);\r\n const determinantB = rowCDA.dotProduct(columnB);\r\n const determinantC = rowDAB.dotProduct(columnC);\r\n const determinantD = rowABC.dotProduct(columnD);\r\n const maxAbs1 = result.maxAbs();\r\n if (determinantA * determinantB > 0.0\r\n && determinantA * determinantC > 0.0\r\n && determinantA * determinantD > 0.0) {\r\n const divisionTest = Geometry.conditionalDivideCoordinate(maxAbs1, determinantA);\r\n if (divisionTest !== undefined) {\r\n const divDet = 1.0 / determinantA;\r\n result.scaleRowsInPlace(divMaxAbsA * divDet, divMaxAbsB * divDet, divMaxAbsC * divDet, divMaxAbsD * divDet);\r\n return result;\r\n }\r\n } else {\r\n return undefined; // this is a useful spot to break to see if the 4 determinant test is effective.\r\n }\r\n return undefined;\r\n }\r\n /** Returns an array-of-arrays of the matrix rows, optionally passing each value through a function.\r\n * @param f optional function to provide alternate values for each entry (e.g. force fuzz to zero.)\r\n */\r\n public rowArrays(f?: (value: number) => any): any {\r\n if (f)\r\n return [\r\n [f(this._coffs[0]), f(this._coffs[1]), f(this._coffs[2]), f(this._coffs[3])],\r\n [f(this._coffs[4]), f(this._coffs[5]), f(this._coffs[6]), f(this._coffs[7])],\r\n [f(this._coffs[8]), f(this._coffs[9]), f(this._coffs[10]), f(this._coffs[11])],\r\n [f(this._coffs[12]), f(this._coffs[13]), f(this._coffs[14]), f(this._coffs[15])]];\r\n else\r\n return [\r\n [this._coffs[0], this._coffs[1], this._coffs[2], this._coffs[3]],\r\n [this._coffs[4], this._coffs[5], this._coffs[6], this._coffs[7]],\r\n [this._coffs[8], this._coffs[9], this._coffs[10], this._coffs[11]],\r\n [this._coffs[12], this._coffs[13], this._coffs[14], this._coffs[15]]];\r\n }\r\n /**\r\n * Scale each row by respective scale factors.\r\n * @param ax scale factor for row 0\r\n * @param ay scale factor for row 1\r\n * @param az scale factor for row 2\r\n * @param aw scale factor for row 3\r\n */\r\n public scaleRowsInPlace(ax: number, ay: number, az: number, aw: number) {\r\n for (let i = 0; i < 4; i++)\r\n this._coffs[i] *= ax;\r\n for (let i = 4; i < 8; i++)\r\n this._coffs[i] *= ay;\r\n for (let i = 8; i < 12; i++)\r\n this._coffs[i] *= az;\r\n for (let i = 12; i < 16; i++)\r\n this._coffs[i] *= aw;\r\n }\r\n /**\r\n * add an outer product (single column times single row times scale factor) to this matrix.\r\n * @param vectorU column vector\r\n * @param vectorV row vector\r\n * @param scale scale factor\r\n */\r\n public addScaledOuterProductInPlace(vectorU: Point4d, vectorV: Point4d, scale: number) {\r\n let a = vectorU.x * scale;\r\n this._coffs[0] += a * vectorV.x;\r\n this._coffs[1] += a * vectorV.y;\r\n this._coffs[2] += a * vectorV.z;\r\n this._coffs[3] += a * vectorV.w;\r\n\r\n a = vectorU.y * scale;\r\n this._coffs[4] += a * vectorV.x;\r\n this._coffs[5] += a * vectorV.y;\r\n this._coffs[6] += a * vectorV.z;\r\n this._coffs[7] += a * vectorV.w;\r\n\r\n a = vectorU.z * scale;\r\n this._coffs[8] += a * vectorV.x;\r\n this._coffs[9] += a * vectorV.y;\r\n this._coffs[10] += a * vectorV.z;\r\n this._coffs[11] += a * vectorV.w;\r\n\r\n a = vectorU.w * scale;\r\n this._coffs[12] += a * vectorV.x;\r\n this._coffs[13] += a * vectorV.y;\r\n this._coffs[14] += a * vectorV.z;\r\n this._coffs[15] += a * vectorV.w;\r\n }\r\n /**\r\n * Add (in place) scale*A*B*AT where\r\n * * A is a pure translation with final column [x,y,z,1]\r\n * * B is the given `matrixB`\r\n * * AT is the transpose of A.\r\n * * scale is a multiplier.\r\n * @param matrixB the middle matrix.\r\n * @param ax x part of translation\r\n * @param ay y part of translation\r\n * @param az z part of translation\r\n * @param scale scale factor for entire product\r\n */\r\n public addTranslationSandwichInPlace(matrixB: Matrix4d, ax: number, ay: number, az: number, scale: number) {\r\n const bx = matrixB._coffs[3];\r\n const by = matrixB._coffs[7];\r\n const bz = matrixB._coffs[11];\r\n // matrixB can be non-symmetric!!\r\n const cx = matrixB._coffs[12];\r\n const cy = matrixB._coffs[13];\r\n const cz = matrixB._coffs[14];\r\n\r\n const beta = matrixB._coffs[15];\r\n const axBeta = ax * beta;\r\n const ayBeta = ay * beta;\r\n const azBeta = az * beta;\r\n this._coffs[0] += scale * (matrixB._coffs[0] + ax * bx + cx * ax + ax * axBeta);\r\n this._coffs[1] += scale * (matrixB._coffs[1] + ay * bx + cy * ax + ax * ayBeta);\r\n this._coffs[2] += scale * (matrixB._coffs[2] + az * bx + cz * ax + ax * azBeta);\r\n this._coffs[3] += scale * (bx + axBeta);\r\n\r\n this._coffs[4] += scale * (matrixB._coffs[4] + ax * by + cx * ay + ay * axBeta);\r\n this._coffs[5] += scale * (matrixB._coffs[5] + ay * by + cy * ay + ay * ayBeta);\r\n this._coffs[6] += scale * (matrixB._coffs[6] + az * by + cz * ay + ay * azBeta);\r\n this._coffs[7] += scale * (by + ayBeta);\r\n\r\n this._coffs[8] += scale * (matrixB._coffs[8] + ax * bz + cx * az + az * axBeta);\r\n this._coffs[9] += scale * (matrixB._coffs[9] + ay * bz + cy * az + az * ayBeta);\r\n this._coffs[10] += scale * (matrixB._coffs[10] + az * bz + cz * az + az * azBeta);\r\n this._coffs[11] += scale * (bz + azBeta);\r\n\r\n this._coffs[12] += scale * (cx + axBeta);\r\n this._coffs[13] += scale * (cy + ayBeta);\r\n this._coffs[14] += scale * (cz + azBeta);\r\n this._coffs[15] += scale * beta;\r\n }\r\n /**\r\n * Multiply and replace contents of ` this` matrix by `A*this*AT` where\r\n * * `A` is a pure translation with final column [x,y,z,1].\r\n * * `this` is this matrix.\r\n * * `AT` is the transpose of A.\r\n * @param ax x part of translation.\r\n * @param ay y part of translation.\r\n * @param az z part of translation.\r\n */\r\n public multiplyTranslationSandwichInPlace(ax: number, ay: number, az: number) : void {\r\n const bx = this._coffs[3];\r\n const by = this._coffs[7];\r\n const bz = this._coffs[11];\r\n // matrixB can be non-symmetric\r\n const cx = this._coffs[12];\r\n const cy = this._coffs[13];\r\n const cz = this._coffs[14];\r\n\r\n const beta = this._coffs[15];\r\n const axBeta = ax * beta;\r\n const ayBeta = ay * beta;\r\n const azBeta = az * beta;\r\n this._coffs[0] += (ax * bx + cx * ax + ax * axBeta);\r\n this._coffs[1] += (ay * bx + cy * ax + ax * ayBeta);\r\n this._coffs[2] += (az * bx + cz * ax + ax * azBeta);\r\n this._coffs[3] += axBeta;\r\n\r\n this._coffs[4] += (ax * by + cx * ay + ay * axBeta);\r\n this._coffs[5] += (ay * by + cy * ay + ay * ayBeta);\r\n this._coffs[6] += (az * by + cz * ay + ay * azBeta);\r\n this._coffs[7] += ayBeta;\r\n\r\n this._coffs[8] += (ax * bz + cx * az + az * axBeta);\r\n this._coffs[9] += (ay * bz + cy * az + az * ayBeta);\r\n this._coffs[10] += (az * bz + cz * az + az * azBeta);\r\n this._coffs[11] += azBeta;\r\n\r\n this._coffs[12] += axBeta;\r\n this._coffs[13] += ayBeta;\r\n this._coffs[14] += azBeta;\r\n // coffs[15] is unchanged\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1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,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;AAtZD,gCAsZC","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,0CAAuC;AAEvC,qDAAkD;AAClD,mEAAuE;AACvE,uDAAoD;AAEpD,yCAAsC;AACtC,uCAAoC;AAEpC;;;;;;;;;;;;;;;;GAgBG;AACH,MA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ACF;AAtZD,gCAsZC","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,uCAAoC;AAEpC;;;;;;GAMG;AACH,MAAa,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,KAAK,CAAC,MAAkC;QAC7C,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACrB,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,OAAO,IAAI,yBAAyB,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,IAAI,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AAC;IACD,sEAAsE;IAC/D,MAAM,CAAC,wBAAwB,CAAC,MAAe,EAAE,OAAgB,EAAE,OAAgB,EAAE,MAAkC;QAC5H,OAAO,yBAAyB,CAAC,0BAA0B,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;IACvP,CAAC;IACD,gEAAgE;IACzD,eAAe,CAAC,CAAS,EAAE,CAAS,EAAE,MAAgB;QAC3D,OAAO,IAAI,CAAC,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;AAzED,8DAyEC","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,uCAAoC;AAEpC;;;;;;GAMG;AACH,MAAa,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,KAAK,CAAC,MAAkC;QAC7C,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACrB,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,OAAO,IAAI,yBAAyB,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;IACxG,CAAC;IACD,wCAAwC;IACjC,OAAO,CAAC,KAAgC;QAC7C,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAClC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACpC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IACD,sEAAsE;IAC/D,aAAa,C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CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;IACvP,CAAC;IACD,gEAAgE;IACzD,eAAe,CAAC,CAAS,EAAE,CAAS,EAAE,MAAgB;QAC3D,OAAO,IAAI,CAAC,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;AAzED,8DAyEC","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"]}
|