@itwin/core-geometry 5.8.0-dev.14 → 5.8.0-dev.16
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 +6 -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.js.map +1 -1
- package/lib/cjs/curve/ConstrainedCurve2d.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.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/PointToCurveTangentHandler.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/internalContexts/geometry2d/ConstrainedImplicitCurve2d.js.map +1 -1
- package/lib/cjs/curve/internalContexts/geometry2d/ConstraintSet.js.map +1 -1
- package/lib/cjs/curve/internalContexts/geometry2d/ImplicitCurve2d.js.map +1 -1
- package/lib/cjs/curve/internalContexts/geometry2d/ImplicitCurve2dConverter.js.map +1 -1
- package/lib/cjs/curve/internalContexts/geometry2d/UnboundedCircle2d.js.map +1 -1
- package/lib/cjs/curve/internalContexts/geometry2d/UnboundedEllipse2d.js.map +1 -1
- package/lib/cjs/curve/internalContexts/geometry2d/UnboundedHyperbola2d.js.map +1 -1
- package/lib/cjs/curve/internalContexts/geometry2d/UnboundedLine2d.js.map +1 -1
- package/lib/cjs/curve/internalContexts/geometry2d/UnboundedParabola2d.js.map +1 -1
- package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
- package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
- package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
- package/lib/cjs/geometry3d/Angle.js.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.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.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedCollectionInterval.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.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.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/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.js.map +1 -1
- package/lib/esm/curve/ConstrainedCurve2d.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.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/PointToCurveTangentHandler.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/internalContexts/geometry2d/ConstrainedImplicitCurve2d.js.map +1 -1
- package/lib/esm/curve/internalContexts/geometry2d/ConstraintSet.js.map +1 -1
- package/lib/esm/curve/internalContexts/geometry2d/ImplicitCurve2d.js.map +1 -1
- package/lib/esm/curve/internalContexts/geometry2d/ImplicitCurve2dConverter.js.map +1 -1
- package/lib/esm/curve/internalContexts/geometry2d/UnboundedCircle2d.js.map +1 -1
- package/lib/esm/curve/internalContexts/geometry2d/UnboundedEllipse2d.js.map +1 -1
- package/lib/esm/curve/internalContexts/geometry2d/UnboundedHyperbola2d.js.map +1 -1
- package/lib/esm/curve/internalContexts/geometry2d/UnboundedLine2d.js.map +1 -1
- package/lib/esm/curve/internalContexts/geometry2d/UnboundedParabola2d.js.map +1 -1
- package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
- package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
- package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
- package/lib/esm/geometry3d/Angle.js.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.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.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/esm/geometry3d/IndexedCollectionInterval.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.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.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/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":"UnboundedCircle2d.js","sourceRoot":"","sources":["../../../../../src/curve/internalContexts/geometry2d/UnboundedCircle2d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAExE,OAAO,EAAE,sBAAsB,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AAC,CAAC,CAAC,CAAC;YACjD,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\n\r\nimport { Geometry } from \"../../../Geometry\";\r\nimport { Point2d, Vector2d } from \"../../../geometry3d/Point2dVector2d\";\r\nimport { XAndY } from \"../../../geometry3d/XYZProps\";\r\nimport { Degree2PowerPolynomial } from \"../../../numerics/Polynomials\";\r\nimport { ImplicitCurve2d } from \"./ImplicitCurve2d\";\r\nimport { UnboundedLine2dByPointAndNormal } from \"./UnboundedLine2d\";\r\n\r\n/**\r\n * Internal class for a complete circle in the xy plane, with center and radius stored.\r\n * @internal\r\n */\r\nexport class UnboundedCircle2dByCenterAndRadius extends ImplicitCurve2d {\r\n /** The circle's center. */\r\n public center: Point2d;\r\n /** The circle radius. */\r\n public radius: number;\r\n /* Constructor - CAPTURE given center and normal */\r\n private constructor(center: Point2d, radius: number) {\r\n super();\r\n this.center = center;\r\n this.radius = radius;\r\n }\r\n /** Return a clone of this circle. */\r\n public clone(): UnboundedCircle2dByCenterAndRadius {\r\n // the create method clones the inputs\r\n return UnboundedCircle2dByCenterAndRadius.createPointRadius(this.center, this.radius);\r\n }\r\n /** Return a clone of this circle, with radius negated. */\r\n public cloneNegateRadius(): UnboundedCircle2dByCenterAndRadius {\r\n // the create method clones the inputs\r\n return UnboundedCircle2dByCenterAndRadius.createPointRadius(this.center, -this.radius);\r\n }\r\n /**\r\n * Create an ImplicitCircle2d from XY parts of its center and its radius.\r\n * @param centerX x coordinate of center\r\n * @param centerY y coordinate of center\r\n * @param radius circle radius\r\n * @returns newly created circle object\r\n */\r\n public static createXYRadius(centerX: number, centerY: number, radius: number): UnboundedCircle2dByCenterAndRadius {\r\n return new UnboundedCircle2dByCenterAndRadius(Point2d.create(centerX, centerY), radius);\r\n }\r\n /**\r\n * Create an ImplicitCircle2d from an xy object and a radius.\r\n * * Zero radius is valid.\r\n * * The input coordinates are copied -- the center is NOT captured.\r\n * @param center xy coordinates of center\r\n * @param radius circle radius\r\n * @returns newly created circle object\r\n */\r\n public static createPointRadius(center: XAndY, radius: number): UnboundedCircle2dByCenterAndRadius {\r\n return new UnboundedCircle2dByCenterAndRadius(Point2d.create(center.x, center.y), radius);\r\n }\r\n /**\r\n * Returns gradient of the implicit function.\r\n * @param xy space point\r\n * @returns squared distance to center minus squared radius.\r\n */\r\n public override functionValue(xy: XAndY): number {\r\n return Geometry.distanceSquaredXYXY(xy.x, xy.y, this.center.x, this.center.y) - this.radius * this.radius;\r\n }\r\n /**\r\n * Returns gradient of the implicit function.\r\n * @param xy space point\r\n */\r\n public override gradient(xy: XAndY): Vector2d {\r\n return Vector2d.create(2 * (xy.x - this.center.x), 2 * (xy.y - this.center.y));\r\n }\r\n /**\r\n * Emit circle points for which a vector to the space point is perpendicular to the circle.\r\n * * For a non-zero radius circle, there are two perpendiculars. The one on the side of the space point is emitted first.\r\n * * For a zero radius circle, the vector from center to the space point is the only perpendicular.\r\n * @param spacePoint the space point.\r\n * @handler the handler to receive all the points on the curve and radians where perpendicular happens.\r\n */\r\n public override emitPerpendiculars(\r\n spacePoint: Point2d, handler: (curvePoint: Point2d, radians: number | undefined) => any,\r\n ) {\r\n // Make a vector from center to space point, scaled so length equals radius.\r\n // Add and subtract it to/from center to get to circumference point.\r\n const radialVector = Vector2d.createStartEnd(this.center, spacePoint).scaleToLength(this.radius);\r\n if (radialVector !== undefined) {\r\n handler(this.center.plus(radialVector), undefined);\r\n handler(this.center.minus(radialVector), undefined);\r\n }\r\n }\r\n /**\r\n * Returns true if the circle radius is near zero.\r\n */\r\n // eslint-disable-next-line @itwin/prefer-get\r\n public override isDegenerate(): boolean {\r\n return Geometry.isSameCoordinate(this.radius, 0);\r\n }\r\n /**\r\n * Test if the centers and radii of two circles are close.\r\n * @param other second circle\r\n * @returns true if identical to tolerance.\r\n */\r\n public isSameCircle(other: UnboundedCircle2dByCenterAndRadius, negatedRadiiAreEqual: boolean): boolean {\r\n if (negatedRadiiAreEqual)\r\n return Geometry.isSameCoordinate(Math.abs(this.radius), Math.abs(other.radius))\r\n && Geometry.isSamePoint2d(this.center, other.center);\r\n return Geometry.isSameCoordinate(this.radius, other.radius)\r\n && Geometry.isSamePoint2d(this.center, other.center);\r\n }\r\n /**\r\n * Compute intersections with another circle.\r\n * @param other second circle\r\n * @return array of 0, 1, or 2 points of intersection\r\n */\r\n public intersectCircle(other: UnboundedCircle2dByCenterAndRadius): Point2d[] {\r\n const vectorAB = Vector2d.createStartEnd(this.center, other.center);\r\n const unitAB = vectorAB.normalize();\r\n if (unitAB === undefined)\r\n return [];\r\n const d = vectorAB.magnitude();\r\n const rA2 = Geometry.square(this.radius);\r\n const rB2 = Geometry.square(other.radius);\r\n // if intersection points are called i1 and i2 and the mid point of the line connecting i1 and i2 is called m\r\n // then we can form 2 triangles: <this.center, m, i1> and <other.center, m, i2>\r\n // now if a is distance from this.center to m and h is distance from m to i1, we get rA2 = a^2 + h^2\r\n // similarly we get rB2 = (d-a)^2 + h^2 and from those 2 equations we can solve for a and h\r\n const a = Geometry.conditionalDivideCoordinate(rA2 - rB2 + d * d, 2 * d);\r\n const points = [];\r\n if (a !== undefined) {\r\n const h2 = rA2 - a * a;\r\n if (Math.abs(h2) < Geometry.smallMetricDistanceSquared)\r\n points.push(this.center.plusScaled(unitAB, a));\r\n else if (h2 > 0) {\r\n const h = Math.sqrt(h2);\r\n points.push(this.center.addForwardLeft(a, h, unitAB));\r\n points.push(this.center.addForwardLeft(a, -h, unitAB));\r\n }\r\n }\r\n return points;\r\n }\r\n /**\r\n * Compute intersections with a line\r\n * @param line the line.\r\n * @return array of 0, 1, or 2 points of intersection\r\n */\r\n public intersectLine(line: UnboundedLine2dByPointAndNormal): Point2d[] {\r\n // a point on line is X = P + frac*U where P is line.point and U is the vector along line\r\n // vector from X to center is X-C = (P-C) + frac*U\r\n // now defined P-C = V to get X-C = V + frac*U\r\n // when distance squared from X to center is equal to this.radius squared, we have intersection:\r\n // (V + frac*U) dot (V + frac*U) = r^2\r\n // (U.U)*frac^2 + (2U.V)*frac + (V.V-r^2) = 0\r\n // now solve for frac\r\n const vectorU = line.vectorAlongLine();\r\n const vectorV = Vector2d.createStartEnd(this.center, line.point);\r\n const uDotV = vectorU.dotProduct(vectorV);\r\n const vDotV = vectorV.dotProduct(vectorV);\r\n const uDotU = vectorU.dotProduct(vectorU);\r\n const fractions = Degree2PowerPolynomial.solveQuadratic(uDotU, 2 * uDotV, vDotV - this.radius * this.radius);\r\n const points = [];\r\n if (fractions !== undefined)\r\n for (const f of fractions) {\r\n points.push(line.point.plusScaled(vectorU, f));\r\n }\r\n return points;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"UnboundedCircle2d.js","sourceRoot":"","sources":["../../../../../src/curve/internalContexts/geometry2d/UnboundedCircle2d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAExE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD;;;GAGG;AACH,MAAM,OAAO,kCAAmC,SAAQ,eAAe;IACrE,2BAA2B;IACpB,MAAM,CAAU;IACvB,yBAAyB;IAClB,MAAM,CAAS;IACtB,mDAAmD;IACnD,YAAoB,MAAe,EAAE,MAAc;QACjD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IACD,qCAAqC;IAC9B,KAA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;;;OAIG;IACI,aAAa,CAAC,IAAqC;QACxD,yFAAyF;QACzF,kDAAkD;QAClD,8CAA8C;QAC9C,gGAAgG;QAChG,sCAAsC;QACtC,6CAA6C;QAC7C,qBAAqB;QACrB,MAAM,OAAO,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QACvC,MAAM,OAAO,GAAG,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QACjE,MAAM,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAC1C,MAAM,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAC1C,MAAM,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAC1C,MAAM,SAAS,GAAG,sBAAsB,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC,GAAG,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;QAC7G,MAAM,MAAM,GAAG,EAAE,CAAC;QAClB,IAAI,SAAS,KAAK,SAAS;YACzB,KAAK,MAAM,CAAC,IAAI,SAAS,EAAE,CAAC;gBAC1B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;YACjD,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module CartesianGeometry\n */\n\nimport { Geometry } from \"../../../Geometry\";\nimport { Point2d, Vector2d } from \"../../../geometry3d/Point2dVector2d\";\nimport { XAndY } from \"../../../geometry3d/XYZProps\";\nimport { Degree2PowerPolynomial } from \"../../../numerics/Polynomials\";\nimport { ImplicitCurve2d } from \"./ImplicitCurve2d\";\nimport { UnboundedLine2dByPointAndNormal } from \"./UnboundedLine2d\";\n\n/**\n * Internal class for a complete circle in the xy plane, with center and radius stored.\n * @internal\n */\nexport class UnboundedCircle2dByCenterAndRadius extends ImplicitCurve2d {\n /** The circle's center. */\n public center: Point2d;\n /** The circle radius. */\n public radius: number;\n /* Constructor - CAPTURE given center and normal */\n private constructor(center: Point2d, radius: number) {\n super();\n this.center = center;\n this.radius = radius;\n }\n /** Return a clone of this circle. */\n public clone(): UnboundedCircle2dByCenterAndRadius {\n // the create method clones the inputs\n return UnboundedCircle2dByCenterAndRadius.createPointRadius(this.center, this.radius);\n }\n /** Return a clone of this circle, with radius negated. */\n public cloneNegateRadius(): UnboundedCircle2dByCenterAndRadius {\n // the create method clones the inputs\n return UnboundedCircle2dByCenterAndRadius.createPointRadius(this.center, -this.radius);\n }\n /**\n * Create an ImplicitCircle2d from XY parts of its center and its radius.\n * @param centerX x coordinate of center\n * @param centerY y coordinate of center\n * @param radius circle radius\n * @returns newly created circle object\n */\n public static createXYRadius(centerX: number, centerY: number, radius: number): UnboundedCircle2dByCenterAndRadius {\n return new UnboundedCircle2dByCenterAndRadius(Point2d.create(centerX, centerY), radius);\n }\n /**\n * Create an ImplicitCircle2d from an xy object and a radius.\n * * Zero radius is valid.\n * * The input coordinates are copied -- the center is NOT captured.\n * @param center xy coordinates of center\n * @param radius circle radius\n * @returns newly created circle object\n */\n public static createPointRadius(center: XAndY, radius: number): UnboundedCircle2dByCenterAndRadius {\n return new UnboundedCircle2dByCenterAndRadius(Point2d.create(center.x, center.y), radius);\n }\n /**\n * Returns gradient of the implicit function.\n * @param xy space point\n * @returns squared distance to center minus squared radius.\n */\n public override functionValue(xy: XAndY): number {\n return Geometry.distanceSquaredXYXY(xy.x, xy.y, this.center.x, this.center.y) - this.radius * this.radius;\n }\n /**\n * Returns gradient of the implicit function.\n * @param xy space point\n */\n public override gradient(xy: XAndY): Vector2d {\n return Vector2d.create(2 * (xy.x - this.center.x), 2 * (xy.y - this.center.y));\n }\n /**\n * Emit circle points for which a vector to the space point is perpendicular to the circle.\n * * For a non-zero radius circle, there are two perpendiculars. The one on the side of the space point is emitted first.\n * * For a zero radius circle, the vector from center to the space point is the only perpendicular.\n * @param spacePoint the space point.\n * @handler the handler to receive all the points on the curve and radians where perpendicular happens.\n */\n public override emitPerpendiculars(\n spacePoint: Point2d, handler: (curvePoint: Point2d, radians: number | undefined) => any,\n ) {\n // Make a vector from center to space point, scaled so length equals radius.\n // Add and subtract it to/from center to get to circumference point.\n const radialVector = Vector2d.createStartEnd(this.center, spacePoint).scaleToLength(this.radius);\n if (radialVector !== undefined) {\n handler(this.center.plus(radialVector), undefined);\n handler(this.center.minus(radialVector), undefined);\n }\n }\n /**\n * Returns true if the circle radius is near zero.\n */\n // eslint-disable-next-line @itwin/prefer-get\n public override isDegenerate(): boolean {\n return Geometry.isSameCoordinate(this.radius, 0);\n }\n /**\n * Test if the centers and radii of two circles are close.\n * @param other second circle\n * @returns true if identical to tolerance.\n */\n public isSameCircle(other: UnboundedCircle2dByCenterAndRadius, negatedRadiiAreEqual: boolean): boolean {\n if (negatedRadiiAreEqual)\n return Geometry.isSameCoordinate(Math.abs(this.radius), Math.abs(other.radius))\n && Geometry.isSamePoint2d(this.center, other.center);\n return Geometry.isSameCoordinate(this.radius, other.radius)\n && Geometry.isSamePoint2d(this.center, other.center);\n }\n /**\n * Compute intersections with another circle.\n * @param other second circle\n * @return array of 0, 1, or 2 points of intersection\n */\n public intersectCircle(other: UnboundedCircle2dByCenterAndRadius): Point2d[] {\n const vectorAB = Vector2d.createStartEnd(this.center, other.center);\n const unitAB = vectorAB.normalize();\n if (unitAB === undefined)\n return [];\n const d = vectorAB.magnitude();\n const rA2 = Geometry.square(this.radius);\n const rB2 = Geometry.square(other.radius);\n // if intersection points are called i1 and i2 and the mid point of the line connecting i1 and i2 is called m\n // then we can form 2 triangles: <this.center, m, i1> and <other.center, m, i2>\n // now if a is distance from this.center to m and h is distance from m to i1, we get rA2 = a^2 + h^2\n // similarly we get rB2 = (d-a)^2 + h^2 and from those 2 equations we can solve for a and h\n const a = Geometry.conditionalDivideCoordinate(rA2 - rB2 + d * d, 2 * d);\n const points = [];\n if (a !== undefined) {\n const h2 = rA2 - a * a;\n if (Math.abs(h2) < Geometry.smallMetricDistanceSquared)\n points.push(this.center.plusScaled(unitAB, a));\n else if (h2 > 0) {\n const h = Math.sqrt(h2);\n points.push(this.center.addForwardLeft(a, h, unitAB));\n points.push(this.center.addForwardLeft(a, -h, unitAB));\n }\n }\n return points;\n }\n /**\n * Compute intersections with a line\n * @param line the line.\n * @return array of 0, 1, or 2 points of intersection\n */\n public intersectLine(line: UnboundedLine2dByPointAndNormal): Point2d[] {\n // a point on line is X = P + frac*U where P is line.point and U is the vector along line\n // vector from X to center is X-C = (P-C) + frac*U\n // now defined P-C = V to get X-C = V + frac*U\n // when distance squared from X to center is equal to this.radius squared, we have intersection:\n // (V + frac*U) dot (V + frac*U) = r^2\n // (U.U)*frac^2 + (2U.V)*frac + (V.V-r^2) = 0\n // now solve for frac\n const vectorU = line.vectorAlongLine();\n const vectorV = Vector2d.createStartEnd(this.center, line.point);\n const uDotV = vectorU.dotProduct(vectorV);\n const vDotV = vectorV.dotProduct(vectorV);\n const uDotU = vectorU.dotProduct(vectorU);\n const fractions = Degree2PowerPolynomial.solveQuadratic(uDotU, 2 * uDotV, vDotV - this.radius * this.radius);\n const points = [];\n if (fractions !== undefined)\n for (const f of fractions) {\n points.push(line.point.plusScaled(vectorU, f));\n }\n return points;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnboundedEllipse2d.js","sourceRoot":"","sources":["../../../../../src/curve/internalContexts/geometry2d/UnboundedEllipse2d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE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C,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;gBACtG,OAAO,CAAC,CAAC,CAAC;YACZ,OAAO,CAAC,CAAC;QACX,CAAC,CAAA;QACD,IAAI,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;YACtD,IAAI,CAAC,+BAA+B;gBAClC,OAAO,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAC5G,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YACjE,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YACjE,IAAI,MAAM,KAAK,CAAC,IAAI,MAAM,KAAK,CAAC;gBAC9B,OAAO,IAAI,CAAA;YACb,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YACjE,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YACjE,IAAI,MAAM,KAAK,CAAC,IAAI,MAAM,KAAK,CAAC;gBAC9B,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\n\r\nimport { SmallSystem } from \"../../../numerics/SmallSystem\";\r\nimport { Geometry } from \"../../../Geometry\";\r\nimport { Point2d, Vector2d } from \"../../../geometry3d/Point2dVector2d\";\r\nimport { XAndY } from \"../../../geometry3d/XYZProps\";\r\nimport { TrigPolynomial } from \"../../../numerics/Polynomials\";\r\nimport { ImplicitCurve2d } from \"./ImplicitCurve2d\";\r\n\r\n/**\r\n * Class for an ellipse in the xy plane.The ellipse equation in angular parameterization is\r\n * * X = A + U * cos(theta) + V * sin(theta)\r\n * which means that in the (skewed and scaled) coordinate system with origin at A and local u and v as\r\n * multiples of U and V the implicit equation is u^2 + v^2 = 1\r\n * * Note that the U and V vectors DO NOT need to be perpendicular or have any particular length relationship.\r\n * * If U and V ARE perpendicular, their lengths are commonly called the major and minor axis lengths,\r\n * and the major and minor axis points are in the U and V directions.\r\n * * If U and V are NOT perpendicular, the major and minor axis points are at other directions.\r\n * @internal\r\n */\r\nexport class UnboundedEllipse2d extends ImplicitCurve2d {\r\n /** The Cartesian coordinates of any center on the line. */\r\n public center: Point2d;\r\n /** The local u axis direction. */\r\n public vectorU: Vector2d;\r\n /** The local v axis direction. */\r\n public vectorV: Vector2d;\r\n /* Constructor - CAPTURE given center and axis vectors */\r\n private constructor(center: Point2d, vectorU: Vector2d, vectorV: Vector2d) {\r\n super();\r\n this.center = center;\r\n this.vectorU = vectorU;\r\n this.vectorV = vectorV;\r\n }\r\n /** Return a clone of this circle. */\r\n public clone(): UnboundedEllipse2d {\r\n // the create method clones the inputs\r\n return UnboundedEllipse2d.createCenterAndAxisVectors(this.center, this.vectorU, this.vectorV);\r\n }\r\n /**\r\n * Create an axis-aligned UnboundedEllipse2d with axis lengths.\r\n * * The implicit equation is (x/scaleU)^2 + (y/scaleV)^2 = 1\r\n * @param centerX x coordinate of center\r\n * @param centerY y coordinate of center\r\n * @param scaleX x axis radius\r\n * @param scaleY y axis radius\r\n */\r\n public static createFromCenterAndScales(centerX: number, centerY: number, scaleX: number, scaleY: number): UnboundedEllipse2d {\r\n return new UnboundedEllipse2d(Point2d.create(centerX, centerY),\r\n Vector2d.create(scaleX, 0), Vector2d.create(0, scaleY));\r\n }\r\n /**\r\n * Create an UnboundedEllipse2d from xy coordinates and axis vectors.\r\n * @param center xy coordinates of center\r\n * @param vectorU vector from center to to theta=0 point\r\n * @param vectorV vector from center to the theta=90 point\r\n */\r\n public static createCenterAndAxisVectors(center: XAndY, vectorU: XAndY, vectorV: XAndY): UnboundedEllipse2d {\r\n return new UnboundedEllipse2d(\r\n Point2d.create(center.x, center.y),\r\n Vector2d.create(vectorU.x, vectorU.y),\r\n Vector2d.create(vectorV.x, vectorV.y),\r\n );\r\n }\r\n /**\r\n * Convert the coordinates of spacePoint to local coordinates relative to the ellipse vectors.\r\n * @param spacePoint point for coordinate conversion\r\n */\r\n public globalToLocal(spacePoint: XAndY): Vector2d | undefined {\r\n const result = Vector2d.create();\r\n if (SmallSystem.linearSystem2d(\r\n this.vectorU.x, this.vectorV.x,\r\n this.vectorU.y, this.vectorV.y,\r\n spacePoint.x - this.center.x, spacePoint.y - this.center.y,\r\n result))\r\n return result;\r\n return undefined;\r\n }\r\n /**\r\n * Return the implicit function value at xy.\r\n * @param xy space point\r\n * @returns squared local (uv) coordinates minus 1\r\n */\r\n public override functionValue(xy: XAndY): number {\r\n const vectorUV = this.globalToLocal(xy);\r\n if (vectorUV === undefined)\r\n return 0;\r\n return vectorUV.x * vectorUV.x + vectorUV.y * vectorUV.y - 1.0;\r\n }\r\n /**\r\n * Returns gradient of the implicit function.\r\n * @param xy space point\r\n */\r\n public override gradient(xy: XAndY): Vector2d {\r\n const vectorUV = this.globalToLocal(xy);\r\n if (vectorUV === undefined)\r\n return Vector2d.create(0, 0);\r\n return ImplicitCurve2d.gradientLocalToGlobal(2 * vectorUV.x, 2 * vectorUV.y, this.vectorU, this.vectorV);\r\n }\r\n /**\r\n * Find points that are on the ellipse at foot of perpendiculars to the space point.\r\n * Pass each point to the handler.\r\n * * 0 to 4 handler calls are possible.\r\n * @param spacePoint the space point.\r\n * @handler the handler to receive all the points on the curve and radians where perpendicular happens.\r\n */\r\n public override emitPerpendiculars(\r\n spacePoint: Point2d, handler: (curvePoint: Point2d, radians: number | undefined) => void,\r\n ): void {\r\n const vectorW = Vector2d.createStartEnd(spacePoint, this.center);\r\n // vector from space point to point on ellipse is\r\n // R = center + U*c + V * s - spacePoint\r\n // = W + Uc * Vs where W = center - spacePOInt\r\n // curve tangent is X' = (-U*s + V * c)\r\n // dot product R and X' is\r\n // 0 = (W + Uc + Vs ) dot (-Us + Vc)\r\n // coefficients of c and s and combinations are:\r\n const coffC = vectorW.dotProduct(this.vectorV);\r\n const coffS = -vectorW.dotProduct(this.vectorU);\r\n const coff1 = 0;\r\n const dotUV = this.vectorU.dotProduct(this.vectorV);\r\n const coffCC = dotUV;\r\n const coffSC = this.vectorV.dotProduct(this.vectorV) - this.vectorU.dotProduct(this.vectorU);\r\n const coffSS = -dotUV;\r\n const radiansSolutions: number[] = [];\r\n TrigPolynomial.solveUnitCircleImplicitQuadricIntersection(coffCC, coffSC, coffSS, coffC, coffS, coff1, radiansSolutions);\r\n for (const radians of radiansSolutions) {\r\n const curvePoint = this.radiansToPoint2d(radians);\r\n if (curvePoint !== undefined)\r\n handler(curvePoint, radians);\r\n }\r\n }\r\n /**\r\n * Evaluate the curve point at parametric angle given in radians.\r\n * * Note that the radians is as it appears in sin(radians) and cos( radians),\r\n * and this is NOT a geometric angle in the xy plane.\r\n * * The radians value is only geometric if the U and V are perpendicular and of equal length,\r\n * i.e., the ellipse is a circle.\r\n * @param radians angular coordinate in the ellipse.\r\n */\r\n public override radiansToPoint2d(radians: number): Point2d | undefined {\r\n return this.center.plus2Scaled(this.vectorU, Math.cos(radians), this.vectorV, Math.sin(radians));\r\n }\r\n /**\r\n * Returns the tangent at given radians value.\r\n * @param radians parametric angle on the ellipse\r\n */\r\n public override radiansToTangentVector2d(radians: number): Vector2d | undefined {\r\n const c = Math.cos(radians);\r\n const s = Math.sin(radians);\r\n return Vector2d.createAdd2Scaled(this.vectorU, -s, this.vectorV, c);\r\n }\r\n /** Returns true if the ellipse is collapsed to a point or line.*/\r\n // eslint-disable-next-line @itwin/prefer-get\r\n public override isDegenerate(): boolean {\r\n return undefined === this.globalToLocal(Point2d.create(0, 0));\r\n }\r\n /**\r\n * Test if the centers and axes of the vectors are close\r\n * @param other second hyperbola\r\n * @param negatedAndExchangedAxesAreEqual\r\n * * if false, a strong equality test requiring both U and V vectors to match.\r\n * * This strong test is a test for identical parameterization.\r\n * * if true, a weak equality test that allows U and V to be negated and or exchanged.\r\n * * The weak test is a test for the same implicit set.\r\n * @returns true if identical to tolerance.\r\n */\r\n public isSameEllipse(other: UnboundedEllipse2d, negatedAndExchangedAxesAreEqual: boolean = false): boolean {\r\n const almostEqualOrNegated = (vectorU: Vector2d, vectorV: Vector2d): -1 | 0 | 1 => {\r\n if (Geometry.isSameCoordinate(vectorU.x, vectorV.x) && Geometry.isSameCoordinate(vectorU.y, vectorV.y))\r\n return 1;\r\n if (Geometry.isSameCoordinate(vectorU.x, -vectorV.x) && Geometry.isSameCoordinate(vectorU.y, -vectorV.y))\r\n return -1;\r\n return 0;\r\n }\r\n if (Geometry.isSamePoint2d(this.center, other.center)) {\r\n if (!negatedAndExchangedAxesAreEqual)\r\n return this.vectorU.isAlmostEqualMetric(other.vectorU) && this.vectorV.isAlmostEqualMetric(other.vectorV);\r\n const uuCode = almostEqualOrNegated(this.vectorU, other.vectorU);\r\n const vvCode = almostEqualOrNegated(this.vectorV, other.vectorV);\r\n if (uuCode !== 0 && vvCode !== 0)\r\n return true\r\n const uvCode = almostEqualOrNegated(this.vectorU, other.vectorV);\r\n const vuCode = almostEqualOrNegated(this.vectorV, other.vectorU);\r\n if (uvCode !== 0 && vuCode !== 0)\r\n return true;\r\n }\r\n return false;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"UnboundedEllipse2d.js","sourceRoot":"","sources":["../../../../../src/curve/internalContexts/geometry2d/UnboundedEllipse2d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,W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IAAI,QAAQ,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;gBACtG,OAAO,CAAC,CAAC,CAAC;YACZ,OAAO,CAAC,CAAC;QACX,CAAC,CAAA;QACD,IAAI,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;YACtD,IAAI,CAAC,+BAA+B;gBAClC,OAAO,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAC5G,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YACjE,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YACjE,IAAI,MAAM,KAAK,CAAC,IAAI,MAAM,KAAK,CAAC;gBAC9B,OAAO,IAAI,CAAA;YACb,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YACjE,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YACjE,IAAI,MAAM,KAAK,CAAC,IAAI,MAAM,KAAK,CAAC;gBAC9B,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module CartesianGeometry\n */\n\nimport { SmallSystem } from \"../../../numerics/SmallSystem\";\nimport { Geometry } from \"../../../Geometry\";\nimport { Point2d, Vector2d } from \"../../../geometry3d/Point2dVector2d\";\nimport { XAndY } from \"../../../geometry3d/XYZProps\";\nimport { TrigPolynomial } from \"../../../numerics/Polynomials\";\nimport { ImplicitCurve2d } from \"./ImplicitCurve2d\";\n\n/**\n * Class for an ellipse in the xy plane.The ellipse equation in angular parameterization is\n * * X = A + U * cos(theta) + V * sin(theta)\n * which means that in the (skewed and scaled) coordinate system with origin at A and local u and v as\n * multiples of U and V the implicit equation is u^2 + v^2 = 1\n * * Note that the U and V vectors DO NOT need to be perpendicular or have any particular length relationship.\n * * If U and V ARE perpendicular, their lengths are commonly called the major and minor axis lengths,\n * and the major and minor axis points are in the U and V directions.\n * * If U and V are NOT perpendicular, the major and minor axis points are at other directions.\n * @internal\n */\nexport class UnboundedEllipse2d extends ImplicitCurve2d {\n /** The Cartesian coordinates of any center on the line. */\n public center: Point2d;\n /** The local u axis direction. */\n public vectorU: Vector2d;\n /** The local v axis direction. */\n public vectorV: Vector2d;\n /* Constructor - CAPTURE given center and axis vectors */\n private constructor(center: Point2d, vectorU: Vector2d, vectorV: Vector2d) {\n super();\n this.center = center;\n this.vectorU = vectorU;\n this.vectorV = vectorV;\n }\n /** Return a clone of this circle. */\n public clone(): UnboundedEllipse2d {\n // the create method clones the inputs\n return UnboundedEllipse2d.createCenterAndAxisVectors(this.center, this.vectorU, this.vectorV);\n }\n /**\n * Create an axis-aligned UnboundedEllipse2d with axis lengths.\n * * The implicit equation is (x/scaleU)^2 + (y/scaleV)^2 = 1\n * @param centerX x coordinate of center\n * @param centerY y coordinate of center\n * @param scaleX x axis radius\n * @param scaleY y axis radius\n */\n public static createFromCenterAndScales(centerX: number, centerY: number, scaleX: number, scaleY: number): UnboundedEllipse2d {\n return new UnboundedEllipse2d(Point2d.create(centerX, centerY),\n Vector2d.create(scaleX, 0), Vector2d.create(0, scaleY));\n }\n /**\n * Create an UnboundedEllipse2d from xy coordinates and axis vectors.\n * @param center xy coordinates of center\n * @param vectorU vector from center to to theta=0 point\n * @param vectorV vector from center to the theta=90 point\n */\n public static createCenterAndAxisVectors(center: XAndY, vectorU: XAndY, vectorV: XAndY): UnboundedEllipse2d {\n return new UnboundedEllipse2d(\n Point2d.create(center.x, center.y),\n Vector2d.create(vectorU.x, vectorU.y),\n Vector2d.create(vectorV.x, vectorV.y),\n );\n }\n /**\n * Convert the coordinates of spacePoint to local coordinates relative to the ellipse vectors.\n * @param spacePoint point for coordinate conversion\n */\n public globalToLocal(spacePoint: XAndY): Vector2d | undefined {\n const result = Vector2d.create();\n if (SmallSystem.linearSystem2d(\n this.vectorU.x, this.vectorV.x,\n this.vectorU.y, this.vectorV.y,\n spacePoint.x - this.center.x, spacePoint.y - this.center.y,\n result))\n return result;\n return undefined;\n }\n /**\n * Return the implicit function value at xy.\n * @param xy space point\n * @returns squared local (uv) coordinates minus 1\n */\n public override functionValue(xy: XAndY): number {\n const vectorUV = this.globalToLocal(xy);\n if (vectorUV === undefined)\n return 0;\n return vectorUV.x * vectorUV.x + vectorUV.y * vectorUV.y - 1.0;\n }\n /**\n * Returns gradient of the implicit function.\n * @param xy space point\n */\n public override gradient(xy: XAndY): Vector2d {\n const vectorUV = this.globalToLocal(xy);\n if (vectorUV === undefined)\n return Vector2d.create(0, 0);\n return ImplicitCurve2d.gradientLocalToGlobal(2 * vectorUV.x, 2 * vectorUV.y, this.vectorU, this.vectorV);\n }\n /**\n * Find points that are on the ellipse at foot of perpendiculars to the space point.\n * Pass each point to the handler.\n * * 0 to 4 handler calls are possible.\n * @param spacePoint the space point.\n * @handler the handler to receive all the points on the curve and radians where perpendicular happens.\n */\n public override emitPerpendiculars(\n spacePoint: Point2d, handler: (curvePoint: Point2d, radians: number | undefined) => void,\n ): void {\n const vectorW = Vector2d.createStartEnd(spacePoint, this.center);\n // vector from space point to point on ellipse is\n // R = center + U*c + V * s - spacePoint\n // = W + Uc * Vs where W = center - spacePOInt\n // curve tangent is X' = (-U*s + V * c)\n // dot product R and X' is\n // 0 = (W + Uc + Vs ) dot (-Us + Vc)\n // coefficients of c and s and combinations are:\n const coffC = vectorW.dotProduct(this.vectorV);\n const coffS = -vectorW.dotProduct(this.vectorU);\n const coff1 = 0;\n const dotUV = this.vectorU.dotProduct(this.vectorV);\n const coffCC = dotUV;\n const coffSC = this.vectorV.dotProduct(this.vectorV) - this.vectorU.dotProduct(this.vectorU);\n const coffSS = -dotUV;\n const radiansSolutions: number[] = [];\n TrigPolynomial.solveUnitCircleImplicitQuadricIntersection(coffCC, coffSC, coffSS, coffC, coffS, coff1, radiansSolutions);\n for (const radians of radiansSolutions) {\n const curvePoint = this.radiansToPoint2d(radians);\n if (curvePoint !== undefined)\n handler(curvePoint, radians);\n }\n }\n /**\n * Evaluate the curve point at parametric angle given in radians.\n * * Note that the radians is as it appears in sin(radians) and cos( radians),\n * and this is NOT a geometric angle in the xy plane.\n * * The radians value is only geometric if the U and V are perpendicular and of equal length,\n * i.e., the ellipse is a circle.\n * @param radians angular coordinate in the ellipse.\n */\n public override radiansToPoint2d(radians: number): Point2d | undefined {\n return this.center.plus2Scaled(this.vectorU, Math.cos(radians), this.vectorV, Math.sin(radians));\n }\n /**\n * Returns the tangent at given radians value.\n * @param radians parametric angle on the ellipse\n */\n public override radiansToTangentVector2d(radians: number): Vector2d | undefined {\n const c = Math.cos(radians);\n const s = Math.sin(radians);\n return Vector2d.createAdd2Scaled(this.vectorU, -s, this.vectorV, c);\n }\n /** Returns true if the ellipse is collapsed to a point or line.*/\n // eslint-disable-next-line @itwin/prefer-get\n public override isDegenerate(): boolean {\n return undefined === this.globalToLocal(Point2d.create(0, 0));\n }\n /**\n * Test if the centers and axes of the vectors are close\n * @param other second hyperbola\n * @param negatedAndExchangedAxesAreEqual\n * * if false, a strong equality test requiring both U and V vectors to match.\n * * This strong test is a test for identical parameterization.\n * * if true, a weak equality test that allows U and V to be negated and or exchanged.\n * * The weak test is a test for the same implicit set.\n * @returns true if identical to tolerance.\n */\n public isSameEllipse(other: UnboundedEllipse2d, negatedAndExchangedAxesAreEqual: boolean = false): boolean {\n const almostEqualOrNegated = (vectorU: Vector2d, vectorV: Vector2d): -1 | 0 | 1 => {\n if (Geometry.isSameCoordinate(vectorU.x, vectorV.x) && Geometry.isSameCoordinate(vectorU.y, vectorV.y))\n return 1;\n if (Geometry.isSameCoordinate(vectorU.x, -vectorV.x) && Geometry.isSameCoordinate(vectorU.y, -vectorV.y))\n return -1;\n return 0;\n }\n if (Geometry.isSamePoint2d(this.center, other.center)) {\n if (!negatedAndExchangedAxesAreEqual)\n return this.vectorU.isAlmostEqualMetric(other.vectorU) && this.vectorV.isAlmostEqualMetric(other.vectorV);\n const uuCode = almostEqualOrNegated(this.vectorU, other.vectorU);\n const vvCode = almostEqualOrNegated(this.vectorV, other.vectorV);\n if (uuCode !== 0 && vvCode !== 0)\n return true\n const uvCode = almostEqualOrNegated(this.vectorU, other.vectorV);\n const vuCode = almostEqualOrNegated(this.vectorV, other.vectorU);\n if (uvCode !== 0 && vuCode !== 0)\n return true;\n }\n return false;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnboundedHyperbola2d.js","sourceRoot":"","sources":["../../../../../src/curve/internalContexts/geometry2d/UnboundedHyperbola2d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAExE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;;GAQG;AACH,MAAM,OAAO,oBAAqB,SAAQ,eAAe;IACvD,2DAA2D;IACpD,MAAM,CAAU;IACvB,kCAAkC;IAC3B,OAAO,CAAW;IACzB,kCAAkC;IAC3B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ACb,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YACjE,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YACjE,IAAI,MAAM,KAAK,CAAC,IAAI,MAAM,KAAK,CAAC;gBAC9B,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\n\r\nimport { SmallSystem } from \"../../../numerics/SmallSystem\";\r\nimport { Geometry } from \"../../../Geometry\";\r\nimport { Point2d, Vector2d } from \"../../../geometry3d/Point2dVector2d\";\r\nimport { XAndY } from \"../../../geometry3d/XYZProps\";\r\nimport { TrigPolynomial } from \"../../../numerics/Polynomials\";\r\nimport { ImplicitCurve2d } from \"./ImplicitCurve2d\";\r\n\r\n/**\r\n * Internal class for hyperbola in the xy plane. The hyperbola equation in angular parameterization is\r\n * * X = A + U * sec(theta) + V * tan(theta)\r\n * which means that in the (skewed and scaled) coordinate system with origin at A and local u and v as\r\n * multiples of U and V the implicit equation is u^2 - v^2 = 1\r\n * which means the hyperbola opens along the positive and negative U axis with asymptotes at 45 degrees,\r\n * i.e., along the directions (U+V) and (U-V)\r\n * @internal\r\n */\r\nexport class UnboundedHyperbola2d extends ImplicitCurve2d {\r\n /** The Cartesian coordinates of any center on the line. */\r\n public center: Point2d;\r\n /** The local u axis direction. */\r\n public vectorU: Vector2d;\r\n /** The local v axis direction. */\r\n public vectorV: Vector2d;\r\n /* Constructor - CAPTURE given center and axis vectors */\r\n private constructor(center: Point2d, vectorU: Vector2d, vectorV: Vector2d) {\r\n super();\r\n this.center = center;\r\n this.vectorU = vectorU;\r\n this.vectorV = vectorV;\r\n }\r\n /** Return a clone of this hyperbola. */\r\n public clone(): UnboundedHyperbola2d {\r\n // the create method clones the inputs\r\n return UnboundedHyperbola2d.createCenterAndAxisVectors(this.center, this.vectorU, this.vectorV);\r\n }\r\n /**\r\n * Create UnboundedHyperbola2d with scale factors.\r\n * * The implicit equation is (x/a)^2 - (y/b)^2 = 1\r\n * @param centerX x coordinate of center\r\n * @param centerY y coordinate of center\r\n * @param scaleU scale factor along the U axis\r\n * @param scaleV scale factor along the V axis\r\n * @returns newly created hyperbola object\r\n */\r\n public static createFromCenterAndScales(centerX: number, centerY: number, scaleU: number, scaleV: number): UnboundedHyperbola2d {\r\n return new UnboundedHyperbola2d(\r\n Point2d.create(centerX, centerY), Vector2d.create(scaleU, 0), Vector2d.create(0, scaleV),\r\n );\r\n }\r\n /**\r\n * Create an UnboundedHyperbola2d from an xy object and a radius.\r\n * @param center xy coordinates of center\r\n * @param vectorU vector from center to to theta=0 vertex, i.e. along axis on the \"inside\" of the curve\r\n * @param vectorV vector from center to the transverse direction\r\n */\r\n public static createCenterAndAxisVectors(center: XAndY, vectorU: XAndY, vectorV: XAndY): UnboundedHyperbola2d {\r\n return new UnboundedHyperbola2d(Point2d.create(center.x, center.y),\r\n Vector2d.create(vectorU.x, vectorU.y),\r\n Vector2d.create(vectorV.x, vectorV.y),\r\n );\r\n }\r\n /**\r\n * Return the local (uv) coordinate of a global point.\r\n * @param spacePoint point for coordinate conversion\r\n */\r\n public globalToLocal(spacePoint: XAndY): Vector2d | undefined {\r\n const result = Vector2d.create();\r\n if (SmallSystem.linearSystem2d(\r\n this.vectorU.x, this.vectorV.x,\r\n this.vectorU.y, this.vectorV.y,\r\n spacePoint.x - this.center.x, spacePoint.y - this.center.y,\r\n result))\r\n return result;\r\n return undefined;\r\n }\r\n /**\r\n * Returns xy coordinate on the hyperbola.\r\n * @param radians parametric angle on the hyperbola\r\n */\r\n public override radiansToPoint2d(radians: number): Point2d | undefined {\r\n const c = Math.cos(radians);\r\n const s = Math.sin(radians);\r\n if (Geometry.isSmallMetricDistance(Math.abs(c)))\r\n return undefined;\r\n return this.center.plus2Scaled(this.vectorU, 1.0 / c, this.vectorV, s / c);\r\n }\r\n /**\r\n * Returns the tangent at given radians value.\r\n * @param radians parametric angle on the hyperbola\r\n */\r\n public override radiansToTangentVector2d(radians: number): Vector2d | undefined {\r\n // The curve is parameterized as X = A + U * sec(theta) + V * tan(theta)\r\n // Its tangent vector (derivative) is X' = U * sec(theta) * tan(theta + V * tan^2(theta))\r\n const c = Math.cos(radians);\r\n const s = Math.sin(radians);\r\n const cc = c * c;\r\n const sec2 = Geometry.conditionalDivideCoordinate(1.0, cc);\r\n const secTan = Geometry.conditionalDivideCoordinate(s, cc);\r\n if (sec2 === undefined || secTan === undefined)\r\n return undefined;\r\n return Vector2d.createAdd2Scaled(this.vectorU, secTan, this.vectorV, sec2);\r\n }\r\n /**\r\n * Return the implicit function value at xy.\r\n * @param xy space point\r\n * @returns squared local (uv) coordinates minus 1.\r\n */\r\n public override functionValue(xy: XAndY): number {\r\n const vectorUV = this.globalToLocal(xy);\r\n if (vectorUV === undefined)\r\n return 0;\r\n return vectorUV.x * vectorUV.x - vectorUV.y * vectorUV.y - 1.0;\r\n }\r\n /**\r\n * Evaluate the gradient (steepest descent) of the implicit function.\r\n * @param xy space point\r\n * @returns gradient vector for the implicit function\r\n */\r\n public override gradient(xy: XAndY): Vector2d {\r\n const vectorUV = this.globalToLocal(xy);\r\n const result = Vector2d.create();\r\n // use INVERSE of TRANSPOSE of [UV] matrix to map gradient terms\r\n if (vectorUV !== undefined && SmallSystem.linearSystem2d(\r\n this.vectorU.x, this.vectorU.y,\r\n this.vectorV.x, this.vectorV.y,\r\n 2 * vectorUV.x, -2 * vectorUV.y,\r\n result))\r\n return result;\r\n return Vector2d.create(0, 0);\r\n }\r\n /**\r\n * Solve for parametric radians at hyperbola points which are perpendicular projections of spacePoint.\r\n * * Up to 4 solutions are possible.\r\n * @param spacePoint the space point.\r\n * @handler the handler to receive all the points on the curve and radians where perpendicular happens.\r\n */\r\n public override emitPerpendiculars(\r\n spacePoint: Point2d, handler: (curvePoint: Point2d, radians: number | undefined) => any,\r\n ): any {\r\n const centerToSpacePoint = Vector2d.createStartEnd(spacePoint, this.center);\r\n // coefficients of C and S where C and S are the unit circle points parameterized by theta.\r\n // Hyperbola point at theta is X = A + U sec + V tan\r\n // tangent is T = U sec tan + V sec^2\r\n // vector W = spacePOint - this.center\r\n // perpendicular condition for vector V from space point is\r\n // 0 = T dot (spacePoint - X) = T dot (W - U sec - V tan)\r\n // multiply through by cos^4 and there are various appearances of sine and cosine\r\n // in the numerator. There are constant term, terms with one trig, and terms with product\r\n // of 2 trigs. This fits the call list for solving \"intersection\" of a quadric with unit circle.\r\n //\r\n const coffSC = centerToSpacePoint.dotProduct(this.vectorU);\r\n const coffC = centerToSpacePoint.dotProduct(this.vectorV);\r\n const coffS = this.vectorU.dotProduct(this.vectorU) + this.vectorV.dotProduct(this.vectorV);\r\n const coff1 = this.vectorU.dotProduct(this.vectorV);\r\n const coffSS = this.vectorV.dotProduct(this.vectorU);\r\n const radiansSolutions: number[] = [];\r\n TrigPolynomial.solveUnitCircleImplicitQuadricIntersection(0, coffSC, coffSS, coffC, coffS, coff1, radiansSolutions);\r\n for (const radians of radiansSolutions) {\r\n const s = Math.sin(radians);\r\n const c = Math.cos(radians);\r\n const curvePoint = this.center.plus2Scaled(this.vectorU, 1.0 / c, this.vectorV, s / c);\r\n handler(curvePoint, radians);\r\n }\r\n }\r\n /** Returns true if the circle radius is near zero. */\r\n // eslint-disable-next-line @itwin/prefer-get\r\n public override isDegenerate(): boolean {\r\n return undefined === this.globalToLocal(Point2d.create(0, 0));\r\n }\r\n /**\r\n * Test if the centers and axes of the vectors are close\r\n * @param other second hyperbola\r\n * @param negatedAndExchangedAxesAreEqual\r\n * * if false, a strong equality test requiring both U and V vectors to match\r\n * * This strong test is a test for identical parameterization\r\n * * if true, a weak equality test that allows U and V to be negated and or exchanged.\r\n * * The weak test is a test for the same implicit set\r\n * @returns true if identical to tolerance.\r\n */\r\n public isSameHyperbola(other: UnboundedHyperbola2d, negatedAndExchangedAxesAreEqual: boolean = false): boolean {\r\n const almostEqualOrNegated = (vectorU: Vector2d, vectorV: Vector2d): -1 | 0 | 1 => {\r\n if (Geometry.isSameCoordinate(vectorU.x, vectorV.x) && Geometry.isSameCoordinate(vectorU.y, vectorV.y))\r\n return 1;\r\n if (Geometry.isSameCoordinate(vectorU.x, -vectorV.x) && Geometry.isSameCoordinate(vectorU.y, -vectorV.y))\r\n return -1;\r\n return 0;\r\n }\r\n if (Geometry.isSamePoint2d(this.center, other.center)) {\r\n if (!negatedAndExchangedAxesAreEqual)\r\n return this.vectorU.isAlmostEqualMetric(other.vectorU) && this.vectorV.isAlmostEqualMetric(other.vectorV);\r\n const uuCode = almostEqualOrNegated(this.vectorU, other.vectorU);\r\n const vvCode = almostEqualOrNegated(this.vectorV, other.vectorV);\r\n if (uuCode !== 0 && vvCode !== 0)\r\n return true\r\n const uvCode = almostEqualOrNegated(this.vectorU, other.vectorV);\r\n const vuCode = almostEqualOrNegated(this.vectorV, other.vectorU);\r\n if (uvCode !== 0 && vuCode !== 0)\r\n return true;\r\n }\r\n return false;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"UnboundedHyperbola2d.js","sourceRoot":"","sources":["../../../../../src/curve/internalContexts/geometry2d/UnboundedHyperbola2d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAExE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAA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,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YACjE,IAAI,MAAM,KAAK,CAAC,IAAI,MAAM,KAAK,CAAC;gBAC9B,OAAO,IAAI,CAAA;YACb,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YACjE,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YACjE,IAAI,MAAM,KAAK,CAAC,IAAI,MAAM,KAAK,CAAC;gBAC9B,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module CartesianGeometry\n */\n\nimport { SmallSystem } from \"../../../numerics/SmallSystem\";\nimport { Geometry } from \"../../../Geometry\";\nimport { Point2d, Vector2d } from \"../../../geometry3d/Point2dVector2d\";\nimport { XAndY } from \"../../../geometry3d/XYZProps\";\nimport { TrigPolynomial } from \"../../../numerics/Polynomials\";\nimport { ImplicitCurve2d } from \"./ImplicitCurve2d\";\n\n/**\n * Internal class for hyperbola in the xy plane. The hyperbola equation in angular parameterization is\n * * X = A + U * sec(theta) + V * tan(theta)\n * which means that in the (skewed and scaled) coordinate system with origin at A and local u and v as\n * multiples of U and V the implicit equation is u^2 - v^2 = 1\n * which means the hyperbola opens along the positive and negative U axis with asymptotes at 45 degrees,\n * i.e., along the directions (U+V) and (U-V)\n * @internal\n */\nexport class UnboundedHyperbola2d extends ImplicitCurve2d {\n /** The Cartesian coordinates of any center on the line. */\n public center: Point2d;\n /** The local u axis direction. */\n public vectorU: Vector2d;\n /** The local v axis direction. */\n public vectorV: Vector2d;\n /* Constructor - CAPTURE given center and axis vectors */\n private constructor(center: Point2d, vectorU: Vector2d, vectorV: Vector2d) {\n super();\n this.center = center;\n this.vectorU = vectorU;\n this.vectorV = vectorV;\n }\n /** Return a clone of this hyperbola. */\n public clone(): UnboundedHyperbola2d {\n // the create method clones the inputs\n return UnboundedHyperbola2d.createCenterAndAxisVectors(this.center, this.vectorU, this.vectorV);\n }\n /**\n * Create UnboundedHyperbola2d with scale factors.\n * * The implicit equation is (x/a)^2 - (y/b)^2 = 1\n * @param centerX x coordinate of center\n * @param centerY y coordinate of center\n * @param scaleU scale factor along the U axis\n * @param scaleV scale factor along the V axis\n * @returns newly created hyperbola object\n */\n public static createFromCenterAndScales(centerX: number, centerY: number, scaleU: number, scaleV: number): UnboundedHyperbola2d {\n return new UnboundedHyperbola2d(\n Point2d.create(centerX, centerY), Vector2d.create(scaleU, 0), Vector2d.create(0, scaleV),\n );\n }\n /**\n * Create an UnboundedHyperbola2d from an xy object and a radius.\n * @param center xy coordinates of center\n * @param vectorU vector from center to to theta=0 vertex, i.e. along axis on the \"inside\" of the curve\n * @param vectorV vector from center to the transverse direction\n */\n public static createCenterAndAxisVectors(center: XAndY, vectorU: XAndY, vectorV: XAndY): UnboundedHyperbola2d {\n return new UnboundedHyperbola2d(Point2d.create(center.x, center.y),\n Vector2d.create(vectorU.x, vectorU.y),\n Vector2d.create(vectorV.x, vectorV.y),\n );\n }\n /**\n * Return the local (uv) coordinate of a global point.\n * @param spacePoint point for coordinate conversion\n */\n public globalToLocal(spacePoint: XAndY): Vector2d | undefined {\n const result = Vector2d.create();\n if (SmallSystem.linearSystem2d(\n this.vectorU.x, this.vectorV.x,\n this.vectorU.y, this.vectorV.y,\n spacePoint.x - this.center.x, spacePoint.y - this.center.y,\n result))\n return result;\n return undefined;\n }\n /**\n * Returns xy coordinate on the hyperbola.\n * @param radians parametric angle on the hyperbola\n */\n public override radiansToPoint2d(radians: number): Point2d | undefined {\n const c = Math.cos(radians);\n const s = Math.sin(radians);\n if (Geometry.isSmallMetricDistance(Math.abs(c)))\n return undefined;\n return this.center.plus2Scaled(this.vectorU, 1.0 / c, this.vectorV, s / c);\n }\n /**\n * Returns the tangent at given radians value.\n * @param radians parametric angle on the hyperbola\n */\n public override radiansToTangentVector2d(radians: number): Vector2d | undefined {\n // The curve is parameterized as X = A + U * sec(theta) + V * tan(theta)\n // Its tangent vector (derivative) is X' = U * sec(theta) * tan(theta + V * tan^2(theta))\n const c = Math.cos(radians);\n const s = Math.sin(radians);\n const cc = c * c;\n const sec2 = Geometry.conditionalDivideCoordinate(1.0, cc);\n const secTan = Geometry.conditionalDivideCoordinate(s, cc);\n if (sec2 === undefined || secTan === undefined)\n return undefined;\n return Vector2d.createAdd2Scaled(this.vectorU, secTan, this.vectorV, sec2);\n }\n /**\n * Return the implicit function value at xy.\n * @param xy space point\n * @returns squared local (uv) coordinates minus 1.\n */\n public override functionValue(xy: XAndY): number {\n const vectorUV = this.globalToLocal(xy);\n if (vectorUV === undefined)\n return 0;\n return vectorUV.x * vectorUV.x - vectorUV.y * vectorUV.y - 1.0;\n }\n /**\n * Evaluate the gradient (steepest descent) of the implicit function.\n * @param xy space point\n * @returns gradient vector for the implicit function\n */\n public override gradient(xy: XAndY): Vector2d {\n const vectorUV = this.globalToLocal(xy);\n const result = Vector2d.create();\n // use INVERSE of TRANSPOSE of [UV] matrix to map gradient terms\n if (vectorUV !== undefined && SmallSystem.linearSystem2d(\n this.vectorU.x, this.vectorU.y,\n this.vectorV.x, this.vectorV.y,\n 2 * vectorUV.x, -2 * vectorUV.y,\n result))\n return result;\n return Vector2d.create(0, 0);\n }\n /**\n * Solve for parametric radians at hyperbola points which are perpendicular projections of spacePoint.\n * * Up to 4 solutions are possible.\n * @param spacePoint the space point.\n * @handler the handler to receive all the points on the curve and radians where perpendicular happens.\n */\n public override emitPerpendiculars(\n spacePoint: Point2d, handler: (curvePoint: Point2d, radians: number | undefined) => any,\n ): any {\n const centerToSpacePoint = Vector2d.createStartEnd(spacePoint, this.center);\n // coefficients of C and S where C and S are the unit circle points parameterized by theta.\n // Hyperbola point at theta is X = A + U sec + V tan\n // tangent is T = U sec tan + V sec^2\n // vector W = spacePOint - this.center\n // perpendicular condition for vector V from space point is\n // 0 = T dot (spacePoint - X) = T dot (W - U sec - V tan)\n // multiply through by cos^4 and there are various appearances of sine and cosine\n // in the numerator. There are constant term, terms with one trig, and terms with product\n // of 2 trigs. This fits the call list for solving \"intersection\" of a quadric with unit circle.\n //\n const coffSC = centerToSpacePoint.dotProduct(this.vectorU);\n const coffC = centerToSpacePoint.dotProduct(this.vectorV);\n const coffS = this.vectorU.dotProduct(this.vectorU) + this.vectorV.dotProduct(this.vectorV);\n const coff1 = this.vectorU.dotProduct(this.vectorV);\n const coffSS = this.vectorV.dotProduct(this.vectorU);\n const radiansSolutions: number[] = [];\n TrigPolynomial.solveUnitCircleImplicitQuadricIntersection(0, coffSC, coffSS, coffC, coffS, coff1, radiansSolutions);\n for (const radians of radiansSolutions) {\n const s = Math.sin(radians);\n const c = Math.cos(radians);\n const curvePoint = this.center.plus2Scaled(this.vectorU, 1.0 / c, this.vectorV, s / c);\n handler(curvePoint, radians);\n }\n }\n /** Returns true if the circle radius is near zero. */\n // eslint-disable-next-line @itwin/prefer-get\n public override isDegenerate(): boolean {\n return undefined === this.globalToLocal(Point2d.create(0, 0));\n }\n /**\n * Test if the centers and axes of the vectors are close\n * @param other second hyperbola\n * @param negatedAndExchangedAxesAreEqual\n * * if false, a strong equality test requiring both U and V vectors to match\n * * This strong test is a test for identical parameterization\n * * if true, a weak equality test that allows U and V to be negated and or exchanged.\n * * The weak test is a test for the same implicit set\n * @returns true if identical to tolerance.\n */\n public isSameHyperbola(other: UnboundedHyperbola2d, negatedAndExchangedAxesAreEqual: boolean = false): boolean {\n const almostEqualOrNegated = (vectorU: Vector2d, vectorV: Vector2d): -1 | 0 | 1 => {\n if (Geometry.isSameCoordinate(vectorU.x, vectorV.x) && Geometry.isSameCoordinate(vectorU.y, vectorV.y))\n return 1;\n if (Geometry.isSameCoordinate(vectorU.x, -vectorV.x) && Geometry.isSameCoordinate(vectorU.y, -vectorV.y))\n return -1;\n return 0;\n }\n if (Geometry.isSamePoint2d(this.center, other.center)) {\n if (!negatedAndExchangedAxesAreEqual)\n return this.vectorU.isAlmostEqualMetric(other.vectorU) && this.vectorV.isAlmostEqualMetric(other.vectorV);\n const uuCode = almostEqualOrNegated(this.vectorU, other.vectorU);\n const vvCode = almostEqualOrNegated(this.vectorV, other.vectorV);\n if (uuCode !== 0 && vvCode !== 0)\n return true\n const uvCode = almostEqualOrNegated(this.vectorU, other.vectorV);\n const vuCode = almostEqualOrNegated(this.vectorV, other.vectorU);\n if (uvCode !== 0 && vuCode !== 0)\n return true;\n }\n return false;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnboundedLine2d.js","sourceRoot":"","sources":["../../../../../src/curve/internalContexts/geometry2d/UnboundedLine2d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,OAAO,+BAAgC,SAAQ,eAAe;IAClE,0DAA0D;IACnD,KAAK,CAAU;IACtB,2CAA2C;IACpC,MAAM,CAAW;IACxB,kDAAkD;IAClD,YAAoB,KAAc,EAAE,MAAgB;QAClD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IACD,mCAAmC;IAC5B,KAAK;QACV,sCAAsC;QACtC,OAAO,+BAA+B,CAAC,iBAAiB,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A+B,CACxC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CACtF,CAAC;IACJ,CAAC;IACD;;;;;MAKE;IACK,YAAY,CAAC,WAAmB;QACrC,OAAO,+BAA+B,CAAC,iBAAiB,CACtD,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,EAC/C,IAAI,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC;IACD;;;;;;;;;OASG;IACI,mDAAmD,CACxD,KAAsC,EAAE,aAAqB,CAAC,EAAE,cAAsB,CAAC;QAEvF,kFAAkF;QAClF,2FAA2F;QAC3F,aAAa;QACb,+DAA+D;QAC/D,+DAA+D;QAC/D,MAAM,EAAE,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC;QAC7B,IAAI,WAAW,CAAC,cAAc,CAC5B,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,EAC5B,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,EAC9B,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,EACnG,EAAE,CAAC,EAAE,CAAC;YACN,OAAO,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QACpC,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\n\r\nimport { Geometry } from \"../../../Geometry\";\r\nimport { Point2d, Vector2d } from \"../../../geometry3d/Point2dVector2d\";\r\nimport { ImplicitCurve2d } from \"./ImplicitCurve2d\";\r\nimport { XAndY } from \"../../../geometry3d/XYZProps\";\r\nimport { SmallSystem } from \"../../../numerics/SmallSystem\";\r\n\r\n/**\r\n * An UnboundedLine2dByPointAndNormal represents an infinite line by a single point on the line and a normal vector.\r\n * * The normal vector is NOT required to be a unit (normalized) vector.\r\n * * Use method `cloneNormalizedFromOrigin` to create a line with unit normal.\r\n * @internal\r\n */\r\nexport class UnboundedLine2dByPointAndNormal extends ImplicitCurve2d {\r\n /** The Cartesian coordinates of any point on the line. */\r\n public point: Point2d;\r\n /** The vector perpendicular to the line */\r\n public normal: Vector2d;\r\n /* Constructor - CAPTURE given point and normal */\r\n private constructor(point: Point2d, normal: Vector2d) {\r\n super();\r\n this.point = point;\r\n this.normal = normal;\r\n }\r\n /** Return a clone of this line. */\r\n public clone(): UnboundedLine2dByPointAndNormal {\r\n // the create method clones the inputs\r\n return UnboundedLine2dByPointAndNormal.createPointNormal(this.point, this.normal);\r\n }\r\n /**\r\n * Create an UnboundedLine2dByPointAndNormal from XY parts of a point on the line and the normal vector.\r\n * @param pointX x coordinate of a reference point on the line\r\n * @param pointY y coordinate of the reference point\r\n * @param normalX x component of normal vector\r\n * @param normalY y component of normal vector\r\n * @returns new line object.\r\n */\r\n public static createPointXYNormalXY(pointX: number, pointY: number, normalX: number, normalY: number): UnboundedLine2dByPointAndNormal | undefined {\r\n const unitVector = Vector2d.create(normalX, normalY).normalize();\r\n if (unitVector === undefined)\r\n return undefined;\r\n return new UnboundedLine2dByPointAndNormal(Point2d.create(pointX, pointY), unitVector);\r\n }\r\n /**\r\n * Create an UnboundedLine2dByPointAndNormal from a point on the line and a normal vector.\r\n * * The xy data from the inputs is copied to the line.\r\n * * i.e. the inputs are NOT captured.\r\n * @param point any point on the line\r\n * @param normal the normal vector\r\n * @returns new line object.\r\n */\r\n public static createPointNormal(point: Point2d, normal: Vector2d): UnboundedLine2dByPointAndNormal {\r\n return new UnboundedLine2dByPointAndNormal(Point2d.create(point.x, point.y), Vector2d.create(normal.x, normal.y));\r\n }\r\n /**\r\n * Create an UnboundedLine2dByPointAndNormal from XY parts of a point on the line and a vector along the line\r\n * @param pointX x coordinate of a reference point on the line\r\n * @param pointY y coordinate of the reference point\r\n * @param directionX x component of the vector along the line\r\n * @param directionY y component of the vector along the line\r\n * @returns new line object or undefined.\r\n */\r\n public static createPointXYDirectionXY(\r\n pointX: number, pointY: number, directionX: number, directionY: number\r\n ): UnboundedLine2dByPointAndNormal | undefined {\r\n const unitVector = Vector2d.create(directionY, -directionX).normalize();\r\n if (unitVector === undefined)\r\n return undefined;\r\n return new UnboundedLine2dByPointAndNormal(Point2d.create(pointX, pointY), unitVector);\r\n }\r\n /**\r\n * Create an UnboundedLine2dByPointAndNormal from XY parts of two points on the line.\r\n * * The nominal origin is at pointA.\r\n * * The line direction is from pointA to pointB, converted to a normal by createPointXYDirectionXY.\r\n * @param pointAX x coordinate of first point on the line\r\n * @param pointAY y coordinate of first point on the line\r\n * @param pointBX x coordinate of second point on the line\r\n * @param pointBY y component of second point on the line\r\n * @returns new line object or undefined.\r\n */\r\n public static createPointXYPointXY(\r\n pointAX: number, pointAY: number, pointBX: number, pointBY: number\r\n ): UnboundedLine2dByPointAndNormal | undefined {\r\n return this.createPointXYDirectionXY(pointAX, pointAY, pointBX - pointAX, pointBY - pointAY);\r\n }\r\n /**\r\n * Create an UnboundedLine2dByPointAndNormal from two points on the line.\r\n * @param pointA first point on the line\r\n * @param pointB second point on the line\r\n * @returns new line object or undefined.\r\n */\r\n public static createPointPoint(pointA: XAndY, pointB: XAndY): UnboundedLine2dByPointAndNormal | undefined {\r\n return this.createPointXYDirectionXY(pointA.x, pointA.y, pointB.x - pointA.x, pointB.y - pointA.y);\r\n }\r\n /** Return true if the normal vector has zero length. */\r\n // eslint-disable-next-line @itwin/prefer-get\r\n public override isDegenerate(): boolean {\r\n return this.normal.isAlmostZero;\r\n }\r\n /**\r\n * Return the implicit function value at xy.\r\n * @param xy space point for evaluation\r\n * @returns dot product of the line normal with the vector from the line's point to the space point.\r\n */\r\n public override functionValue(xy: XAndY): number {\r\n return this.normal.dotProductStartEnd(this.point, xy);\r\n }\r\n /**\r\n * Returns gradient of the implicit function.\r\n * @param xy space point\r\n * @returns unit normal of the line.\r\n */\r\n public override gradient(_xy: XAndY): Vector2d {\r\n const unit = this.normal.normalize();\r\n if (unit !== undefined)\r\n return unit;\r\n return Vector2d.create(0, 0);\r\n }\r\n /** Returns a vector along the line, i.e., rotated 90 degrees from the normal vector, with normal to the left. */\r\n public vectorAlongLine(): Vector2d {\r\n return this.normal.rotate90CWXY();\r\n }\r\n /**\r\n * Rotate the line normal by 90 degrees counterclockwise and normalize it\r\n * @returns the unit vector, or undefined if the normal is zero length.\r\n */\r\n public unitVectorAlongLine(): Vector2d | undefined {\r\n return this.normal.rotate90CCWXY().normalize();\r\n }\r\n /**\r\n * Return unit vector for the line normal.\r\n * @returns the unit vector, or undefined if the normal is zero length.\r\n */\r\n public unitNormal(): Vector2d | undefined {\r\n return this.normal.normalize();\r\n }\r\n /**\r\n * Drop a perpendicular from spacePoint to the line. Emit that point to the handler.\r\n * @param spacePoint the space point to be projected.\r\n * @handler the handler to receive the projection point.\r\n */\r\n public override emitPerpendiculars(\r\n spacePoint: Point2d,\r\n handler: (curvePoint: Point2d, radians: number | undefined) => any,\r\n ): any {\r\n const fraction = Geometry.fractionOfProjectionToVectorXYXY(\r\n spacePoint.x - this.point.x, spacePoint.y - this.point.y, this.normal.x, this.normal.y,\r\n );\r\n handler(spacePoint.plusScaled(this.normal, -fraction), undefined);\r\n }\r\n /**\r\n * Return a new implicit line with its reference point given relative to newOrigin, and its perpendicular vector normalized.\r\n * @return undefined if perpendicular vector has zero length.\r\n * @param newOrigin origin coordinates to subtract from existing origin.\r\n */\r\n public cloneNormalizedFromOrigin(newOrigin?: Point2d): UnboundedLine2dByPointAndNormal | undefined {\r\n const unitNormal = this.normal.normalize();\r\n if (unitNormal === undefined)\r\n return undefined;\r\n if (newOrigin === undefined)\r\n return new UnboundedLine2dByPointAndNormal(this.point.clone(), Vector2d.create(unitNormal.x, unitNormal.y));\r\n return new UnboundedLine2dByPointAndNormal(\r\n Point2d.create(this.point.x - newOrigin.x, this.point.y - newOrigin.y),\r\n Vector2d.create(unitNormal.x, unitNormal.y));\r\n }\r\n /**\r\n * Return a new implicit line with given origin and unit normal based on this.\r\n * * WARNING: Beware of confusing related function cloneNormalizedFromOrigin, which has different origin logic.\r\n * @return undefined if perpendicular vector has zero length.\r\n */\r\n public cloneNormalizedWithOrigin(newOrigin?: Point2d): UnboundedLine2dByPointAndNormal | undefined {\r\n const unitNormal = this.normal.normalize();\r\n if (unitNormal === undefined)\r\n return undefined;\r\n if (newOrigin === undefined)\r\n return new UnboundedLine2dByPointAndNormal(this.point, unitNormal);\r\n return new UnboundedLine2dByPointAndNormal(\r\n Point2d.create(newOrigin.x, newOrigin.y), Vector2d.create(unitNormal.x, unitNormal.y),\r\n );\r\n }\r\n /**\r\n * Return a new implicit line with its reference point shifted by given multiple of its normal vector.\r\n * * The shift is applied to the point, and the normal copied unchanged-- no normalization or test for zero.\r\n * @param shiftFactor multiplier for normal.\r\n * @return shifted line\r\n */\r\n public cloneShifted(shiftFactor: number): UnboundedLine2dByPointAndNormal | undefined {\r\n return UnboundedLine2dByPointAndNormal.createPointNormal(\r\n this.point.plusScaled(this.normal, shiftFactor),\r\n this.normal);\r\n }\r\n /**\r\n * Compute the intersection of two lines.\r\n * * Each can be offset.\r\n * * Offsets are in units of the dot products with normal vectors.\r\n * * If normal vectors are unit vectors, the offsets are simple distance.\r\n * * Otherwise the offset scaling is scaled --- use carefully.\r\n * @param other the other line.\r\n * @param thisOffset target function value for dot products with this line\r\n * @param otherOffset target function value for dot products with other line\r\n */\r\n public intersectUnboundedLine2dByPointAndNormalWithOffsets(\r\n other: UnboundedLine2dByPointAndNormal, thisOffset: number = 0, otherOffset: number = 0,\r\n ): Point2d | undefined {\r\n // points p = (x,y) on the line satisfies equation \"normal dot (p−point) = 0\" and\r\n // points p = (x,y) on the offset line satisfies equation \"normal dot (p−point) = offset\"\r\n // therefore:\r\n // normal.x (x−point.x) + normal.y (y−point.y) = thisOffset\r\n // normal.x x + normal.y y = thisOffset + normal dot point.x\r\n const xy = Vector2d.create();\r\n if (SmallSystem.linearSystem2d(\r\n this.normal.x, this.normal.y,\r\n other.normal.x, other.normal.y,\r\n thisOffset + this.normal.dotProduct(this.point), otherOffset + other.normal.dotProduct(other.point),\r\n xy)) {\r\n return Point2d.create(xy.x, xy.y);\r\n }\r\n return undefined;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"UnboundedLine2d.js","sourceRoot":"","sources":["../../../../../src/curve/internalContexts/geometry2d/UnboundedLine2d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,OAAO,+BAAgC,SAAQ,eAAe;IAClE,0DAA0D;IACnD,KAAK,CAAU;IACtB,2CAA2C;IACpC,MAAM,CAAW;IACxB,kDAAkD;IAClD,YAAoB,KAAc,EAAE,MAAgB;QAClD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IACD,mCAAmC;IAC5B,KAAK;QACV,sCAAsC;QACtC,OAAO,+BAA+B,CAAC,iBAA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+BAA+B,CACxC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CACtF,CAAC;IACJ,CAAC;IACD;;;;;MAKE;IACK,YAAY,CAAC,WAAmB;QACrC,OAAO,+BAA+B,CAAC,iBAAiB,CACtD,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,EAC/C,IAAI,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC;IACD;;;;;;;;;OASG;IACI,mDAAmD,CACxD,KAAsC,EAAE,aAAqB,CAAC,EAAE,cAAsB,CAAC;QAEvF,kFAAkF;QAClF,2FAA2F;QAC3F,aAAa;QACb,+DAA+D;QAC/D,+DAA+D;QAC/D,MAAM,EAAE,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC;QAC7B,IAAI,WAAW,CAAC,cAAc,CAC5B,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,EAC5B,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,EAC9B,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,EACnG,EAAE,CAAC,EAAE,CAAC;YACN,OAAO,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QACpC,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module CartesianGeometry\n */\n\nimport { Geometry } from \"../../../Geometry\";\nimport { Point2d, Vector2d } from \"../../../geometry3d/Point2dVector2d\";\nimport { ImplicitCurve2d } from \"./ImplicitCurve2d\";\nimport { XAndY } from \"../../../geometry3d/XYZProps\";\nimport { SmallSystem } from \"../../../numerics/SmallSystem\";\n\n/**\n * An UnboundedLine2dByPointAndNormal represents an infinite line by a single point on the line and a normal vector.\n * * The normal vector is NOT required to be a unit (normalized) vector.\n * * Use method `cloneNormalizedFromOrigin` to create a line with unit normal.\n * @internal\n */\nexport class UnboundedLine2dByPointAndNormal extends ImplicitCurve2d {\n /** The Cartesian coordinates of any point on the line. */\n public point: Point2d;\n /** The vector perpendicular to the line */\n public normal: Vector2d;\n /* Constructor - CAPTURE given point and normal */\n private constructor(point: Point2d, normal: Vector2d) {\n super();\n this.point = point;\n this.normal = normal;\n }\n /** Return a clone of this line. */\n public clone(): UnboundedLine2dByPointAndNormal {\n // the create method clones the inputs\n return UnboundedLine2dByPointAndNormal.createPointNormal(this.point, this.normal);\n }\n /**\n * Create an UnboundedLine2dByPointAndNormal from XY parts of a point on the line and the normal vector.\n * @param pointX x coordinate of a reference point on the line\n * @param pointY y coordinate of the reference point\n * @param normalX x component of normal vector\n * @param normalY y component of normal vector\n * @returns new line object.\n */\n public static createPointXYNormalXY(pointX: number, pointY: number, normalX: number, normalY: number): UnboundedLine2dByPointAndNormal | undefined {\n const unitVector = Vector2d.create(normalX, normalY).normalize();\n if (unitVector === undefined)\n return undefined;\n return new UnboundedLine2dByPointAndNormal(Point2d.create(pointX, pointY), unitVector);\n }\n /**\n * Create an UnboundedLine2dByPointAndNormal from a point on the line and a normal vector.\n * * The xy data from the inputs is copied to the line.\n * * i.e. the inputs are NOT captured.\n * @param point any point on the line\n * @param normal the normal vector\n * @returns new line object.\n */\n public static createPointNormal(point: Point2d, normal: Vector2d): UnboundedLine2dByPointAndNormal {\n return new UnboundedLine2dByPointAndNormal(Point2d.create(point.x, point.y), Vector2d.create(normal.x, normal.y));\n }\n /**\n * Create an UnboundedLine2dByPointAndNormal from XY parts of a point on the line and a vector along the line\n * @param pointX x coordinate of a reference point on the line\n * @param pointY y coordinate of the reference point\n * @param directionX x component of the vector along the line\n * @param directionY y component of the vector along the line\n * @returns new line object or undefined.\n */\n public static createPointXYDirectionXY(\n pointX: number, pointY: number, directionX: number, directionY: number\n ): UnboundedLine2dByPointAndNormal | undefined {\n const unitVector = Vector2d.create(directionY, -directionX).normalize();\n if (unitVector === undefined)\n return undefined;\n return new UnboundedLine2dByPointAndNormal(Point2d.create(pointX, pointY), unitVector);\n }\n /**\n * Create an UnboundedLine2dByPointAndNormal from XY parts of two points on the line.\n * * The nominal origin is at pointA.\n * * The line direction is from pointA to pointB, converted to a normal by createPointXYDirectionXY.\n * @param pointAX x coordinate of first point on the line\n * @param pointAY y coordinate of first point on the line\n * @param pointBX x coordinate of second point on the line\n * @param pointBY y component of second point on the line\n * @returns new line object or undefined.\n */\n public static createPointXYPointXY(\n pointAX: number, pointAY: number, pointBX: number, pointBY: number\n ): UnboundedLine2dByPointAndNormal | undefined {\n return this.createPointXYDirectionXY(pointAX, pointAY, pointBX - pointAX, pointBY - pointAY);\n }\n /**\n * Create an UnboundedLine2dByPointAndNormal from two points on the line.\n * @param pointA first point on the line\n * @param pointB second point on the line\n * @returns new line object or undefined.\n */\n public static createPointPoint(pointA: XAndY, pointB: XAndY): UnboundedLine2dByPointAndNormal | undefined {\n return this.createPointXYDirectionXY(pointA.x, pointA.y, pointB.x - pointA.x, pointB.y - pointA.y);\n }\n /** Return true if the normal vector has zero length. */\n // eslint-disable-next-line @itwin/prefer-get\n public override isDegenerate(): boolean {\n return this.normal.isAlmostZero;\n }\n /**\n * Return the implicit function value at xy.\n * @param xy space point for evaluation\n * @returns dot product of the line normal with the vector from the line's point to the space point.\n */\n public override functionValue(xy: XAndY): number {\n return this.normal.dotProductStartEnd(this.point, xy);\n }\n /**\n * Returns gradient of the implicit function.\n * @param xy space point\n * @returns unit normal of the line.\n */\n public override gradient(_xy: XAndY): Vector2d {\n const unit = this.normal.normalize();\n if (unit !== undefined)\n return unit;\n return Vector2d.create(0, 0);\n }\n /** Returns a vector along the line, i.e., rotated 90 degrees from the normal vector, with normal to the left. */\n public vectorAlongLine(): Vector2d {\n return this.normal.rotate90CWXY();\n }\n /**\n * Rotate the line normal by 90 degrees counterclockwise and normalize it\n * @returns the unit vector, or undefined if the normal is zero length.\n */\n public unitVectorAlongLine(): Vector2d | undefined {\n return this.normal.rotate90CCWXY().normalize();\n }\n /**\n * Return unit vector for the line normal.\n * @returns the unit vector, or undefined if the normal is zero length.\n */\n public unitNormal(): Vector2d | undefined {\n return this.normal.normalize();\n }\n /**\n * Drop a perpendicular from spacePoint to the line. Emit that point to the handler.\n * @param spacePoint the space point to be projected.\n * @handler the handler to receive the projection point.\n */\n public override emitPerpendiculars(\n spacePoint: Point2d,\n handler: (curvePoint: Point2d, radians: number | undefined) => any,\n ): any {\n const fraction = Geometry.fractionOfProjectionToVectorXYXY(\n spacePoint.x - this.point.x, spacePoint.y - this.point.y, this.normal.x, this.normal.y,\n );\n handler(spacePoint.plusScaled(this.normal, -fraction), undefined);\n }\n /**\n * Return a new implicit line with its reference point given relative to newOrigin, and its perpendicular vector normalized.\n * @return undefined if perpendicular vector has zero length.\n * @param newOrigin origin coordinates to subtract from existing origin.\n */\n public cloneNormalizedFromOrigin(newOrigin?: Point2d): UnboundedLine2dByPointAndNormal | undefined {\n const unitNormal = this.normal.normalize();\n if (unitNormal === undefined)\n return undefined;\n if (newOrigin === undefined)\n return new UnboundedLine2dByPointAndNormal(this.point.clone(), Vector2d.create(unitNormal.x, unitNormal.y));\n return new UnboundedLine2dByPointAndNormal(\n Point2d.create(this.point.x - newOrigin.x, this.point.y - newOrigin.y),\n Vector2d.create(unitNormal.x, unitNormal.y));\n }\n /**\n * Return a new implicit line with given origin and unit normal based on this.\n * * WARNING: Beware of confusing related function cloneNormalizedFromOrigin, which has different origin logic.\n * @return undefined if perpendicular vector has zero length.\n */\n public cloneNormalizedWithOrigin(newOrigin?: Point2d): UnboundedLine2dByPointAndNormal | undefined {\n const unitNormal = this.normal.normalize();\n if (unitNormal === undefined)\n return undefined;\n if (newOrigin === undefined)\n return new UnboundedLine2dByPointAndNormal(this.point, unitNormal);\n return new UnboundedLine2dByPointAndNormal(\n Point2d.create(newOrigin.x, newOrigin.y), Vector2d.create(unitNormal.x, unitNormal.y),\n );\n }\n /**\n * Return a new implicit line with its reference point shifted by given multiple of its normal vector.\n * * The shift is applied to the point, and the normal copied unchanged-- no normalization or test for zero.\n * @param shiftFactor multiplier for normal.\n * @return shifted line\n */\n public cloneShifted(shiftFactor: number): UnboundedLine2dByPointAndNormal | undefined {\n return UnboundedLine2dByPointAndNormal.createPointNormal(\n this.point.plusScaled(this.normal, shiftFactor),\n this.normal);\n }\n /**\n * Compute the intersection of two lines.\n * * Each can be offset.\n * * Offsets are in units of the dot products with normal vectors.\n * * If normal vectors are unit vectors, the offsets are simple distance.\n * * Otherwise the offset scaling is scaled --- use carefully.\n * @param other the other line.\n * @param thisOffset target function value for dot products with this line\n * @param otherOffset target function value for dot products with other line\n */\n public intersectUnboundedLine2dByPointAndNormalWithOffsets(\n other: UnboundedLine2dByPointAndNormal, thisOffset: number = 0, otherOffset: number = 0,\n ): Point2d | undefined {\n // points p = (x,y) on the line satisfies equation \"normal dot (p−point) = 0\" and\n // points p = (x,y) on the offset line satisfies equation \"normal dot (p−point) = offset\"\n // therefore:\n // normal.x (x−point.x) + normal.y (y−point.y) = thisOffset\n // normal.x x + normal.y y = thisOffset + normal dot point.x\n const xy = Vector2d.create();\n if (SmallSystem.linearSystem2d(\n this.normal.x, this.normal.y,\n other.normal.x, other.normal.y,\n thisOffset + this.normal.dotProduct(this.point), otherOffset + other.normal.dotProduct(other.point),\n xy)) {\n return Point2d.create(xy.x, xy.y);\n }\n return undefined;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnboundedParabola2d.js","sourceRoot":"","sources":["../../../../../src/curve/internalContexts/geometry2d/UnboundedParabola2d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAExE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,mBAAoB,SAAQ,eAAe;IACtD,2DAA2D;IACpD,MAAM,CAAU;IACvB,kCAAkC;IAC3B,OAAO,CAAW;IACzB,kCAAkC;IAC3B,OAAO,CAAW;IACzB,yDAAyD;IACzD,YAAoB,MAAe,EAAE,OAAiB,EAAE,OAAiB;QACvE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IACD,uCAAuC;IAChC,KAAK;QACV,sCAAsC;QACtC,OAAO,mBAAmB,CAAC,0BAA0B,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACjG,CAAC;IACD;;;;;OAKG;IACI,MAAM,CAAC,0BAA0B,CAAC,MAAa,EAAE,OAAc,EAAE,OAAc;QACpF,OAAO,IAAI,mBAAmB,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAC/D,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,EACrC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AC5G,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YACjE,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YACjE,IAAI,MAAM,KAAK,CAAC,IAAI,MAAM,KAAK,CAAC;gBAC9B,OAAO,IAAI,CAAA;YACb,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YACjE,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YACjE,IAAI,MAAM,KAAK,CAAC,IAAI,MAAM,KAAK,CAAC;gBAC9B,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\n\r\n\r\nimport { SmallSystem } from \"../../../numerics/SmallSystem\";\r\nimport { Geometry } from \"../../../Geometry\";\r\nimport { Point2d, Vector2d } from \"../../../geometry3d/Point2dVector2d\";\r\nimport { XAndY } from \"../../../geometry3d/XYZProps\";\r\nimport { TrigPolynomial } from \"../../../numerics/Polynomials\";\r\nimport { ImplicitCurve2d } from \"./ImplicitCurve2d\";\r\n\r\n/**\r\n * Internal class for parabola in the xy plane, with an angular parameterization.\r\n * * In uv local coordinates\r\n * * Let c = cos(theta) and s = sin(theta)\r\n * * The parabola is (u,v) = (s/(1+c), (1-c)/(1+c))\r\n * * The uv derivative is (u',v') = (1/(c+1), 2s/(c+1))\r\n * * Basic trig identities confirm that u^2 = v as expected for a parabola.\r\n * * This traces the parabola in a full theta range (-2PI < theta < 2PI).\r\n * * The angle theta = 2PI is the singular point.\r\n * * In XY coordinates the mapped parabola is\r\n * * x = A + Uu + Vv\r\n * * X = A + U*s/(1+c) + V*(1-2*c/(1+c))\r\n * * X' = U * (1/(c+1) + V*2s/(c+1))\r\n * @internal\r\n */\r\nexport class UnboundedParabola2d extends ImplicitCurve2d {\r\n /** The Cartesian coordinates of any center on the line. */\r\n public center: Point2d;\r\n /** The local u axis direction. */\r\n public vectorU: Vector2d;\r\n /** The local v axis direction. */\r\n public vectorV: Vector2d;\r\n /* Constructor - CAPTURE given center and axis vectors */\r\n private constructor(center: Point2d, vectorU: Vector2d, vectorV: Vector2d) {\r\n super();\r\n this.center = center;\r\n this.vectorU = vectorU;\r\n this.vectorV = vectorV;\r\n }\r\n /** Return a clone of this Parabola. */\r\n public clone(): UnboundedParabola2d {\r\n // the create method clones the inputs\r\n return UnboundedParabola2d.createCenterAndAxisVectors(this.center, this.vectorU, this.vectorV);\r\n }\r\n /**\r\n * Create an UnboundedParabola2d from an xy object and a radius.\r\n * @param center xy coordinates of center\r\n * @param vectorU vector from center to to theta=0 vertex, i.e., along axis on the \"inside\" of the curve\r\n * @param vectorV vector from center to the transverse direction.\r\n */\r\n public static createCenterAndAxisVectors(center: XAndY, vectorU: XAndY, vectorV: XAndY): UnboundedParabola2d {\r\n return new UnboundedParabola2d(Point2d.create(center.x, center.y),\r\n Vector2d.create(vectorU.x, vectorU.y),\r\n Vector2d.create(vectorV.x, vectorV.y),\r\n );\r\n }\r\n /**\r\n * Return the local (uv) coordinate of a global point.\r\n * @param spacePoint point for coordinate conversion\r\n */\r\n public globalToLocal(spacePoint: XAndY): Vector2d | undefined {\r\n const result = Vector2d.create();\r\n if (SmallSystem.linearSystem2d(\r\n this.vectorU.x, this.vectorV.x,\r\n this.vectorU.y, this.vectorV.y,\r\n spacePoint.x - this.center.x, spacePoint.y - this.center.y,\r\n result))\r\n return result;\r\n return undefined;\r\n }\r\n /**\r\n * Returns xy coordinate on the Parabola.\r\n * @param radians parametric angle on the Parabola\r\n */\r\n public override radiansToPoint2d(radians: number): Point2d | undefined {\r\n const c = Math.cos(radians);\r\n const s = Math.sin(radians);\r\n const q = 1 + c;\r\n if (Geometry.isSmallMetricDistance(Math.abs(q)))\r\n return undefined;\r\n return this.center.plus2Scaled(this.vectorU, s / q, this.vectorV, (1 - c) / q);\r\n }\r\n /**\r\n * Returns the tangent at given radians value.\r\n * @param radians parametric angle on the parabola\r\n */\r\n public override radiansToTangentVector2d(radians: number): Vector2d | undefined {\r\n const c = Math.cos(radians);\r\n const s = Math.sin(radians);\r\n const q = 1 + c;\r\n const u = Geometry.conditionalDivideCoordinate(1, q);\r\n const v = Geometry.conditionalDivideCoordinate(2 * s, q * q);\r\n if (u === undefined || v === undefined)\r\n return undefined;\r\n return Vector2d.createAdd2Scaled(this.vectorU, u, this.vectorV, v);\r\n }\r\n /**\r\n * Return the implicit function value at xy.\r\n * @param xy space point\r\n * @returns v - u*u\r\n */\r\n public override functionValue(xy: XAndY): number {\r\n const vectorUV = this.globalToLocal(xy);\r\n if (vectorUV === undefined)\r\n return 0;\r\n return vectorUV.y - vectorUV.x * vectorUV.x;\r\n }\r\n /**\r\n * Evaluate the (global coordinates) gradient (steepest descent) of the implicit function.\r\n * @param xy space point\r\n * @returns gradient vector for the implicit function\r\n */\r\n public override gradient(xy: XAndY): Vector2d {\r\n const vectorUV = this.globalToLocal(xy);\r\n const result = Vector2d.create();\r\n // use INVERSE of TRANSPOSE of [UV] matrix to map gradient terms\r\n if (vectorUV !== undefined && SmallSystem.linearSystem2d(\r\n this.vectorU.x, this.vectorU.y,\r\n this.vectorV.x, this.vectorV.y,\r\n - 2 * vectorUV.x, 1.0,\r\n result))\r\n return result;\r\n return Vector2d.create(0, 0);\r\n }\r\n /**\r\n * Solve for parametric radians at Parabola points which are perpendicular projections of spacePoint.\r\n * * Up to 4 solutions are possible.\r\n * @param spacePoint the space point.\r\n * @handler the handler to receive all the points on the curve and radians where perpendicular happens.\r\n */\r\n public override emitPerpendiculars(\r\n spacePoint: Point2d, handler: (curvePoint: Point2d, radians: number | undefined) => any,\r\n ): void {\r\n const vectorW = Vector2d.createStartEnd(spacePoint, this.center);\r\n // vectorW is from space point to curve origin.\r\n // vector to curve at an angle theta is vectorW + (s/(1=c)) U + ((1-c)/(1-s)) V\r\n // where c and s are cosine and sine of the parameterization angle.\r\n // The dot product of the curve tangent vector with the vector from spacePoint to curve\r\n // has trig terms appearing at highest degree 2, hence is solved by the function\r\n // solveUnitCircleImplicitQuadricIntersection.\r\n const dotWU = vectorW.dotProduct(this.vectorU);\r\n const dotWV = vectorW.dotProduct(this.vectorV);\r\n const dotUU = this.vectorU.dotProduct(this.vectorU);\r\n const dotVV = this.vectorV.dotProduct(this.vectorV);\r\n const dotUV = this.vectorU.dotProduct(this.vectorV);\r\n const coff1 = dotWU;\r\n const coffC = 2 * dotWU;\r\n const coffS = 2 * dotWV + dotUU + 2 * dotVV;\r\n const coffCC = dotWU;\r\n const coffSC = 2 * dotWV + dotUU - 2 * dotVV;\r\n const coffSS = 3 * dotUV;\r\n const radiansSolutions: number[] = [];\r\n TrigPolynomial.solveUnitCircleImplicitQuadricIntersection(coffCC, coffSC, coffSS, coffC, coffS, coff1, radiansSolutions);\r\n for (const radians of radiansSolutions) {\r\n const curvePoint = this.radiansToPoint2d(radians);\r\n if (curvePoint !== undefined)\r\n handler(curvePoint, radians);\r\n }\r\n }\r\n /** Returns true if the circle radius is near zero. */\r\n // eslint-disable-next-line @itwin/prefer-get\r\n public override isDegenerate(): boolean {\r\n return undefined === this.globalToLocal(Point2d.create(0, 0));\r\n }\r\n /**\r\n * Test if the centers and axes of the vectors are close\r\n * @param other second Parabola\r\n * @param negatedAndExchangedAxesAreEqual\r\n * * if false, a strong equality test requiring both U and V vectors to match\r\n * * This strong test is a test for identical parameterization\r\n * * if true, a weak equality test that allows U and V to be negated and or exchanged.\r\n * * The weak test is a test for the same implicit set\r\n * @returns true if identical to tolerance.\r\n */\r\n public isSameParabola(other: UnboundedParabola2d, negatedAndExchangedAxesAreEqual: boolean = false): boolean {\r\n const almostEqualOrNegated = (vectorU: Vector2d, vectorV: Vector2d): -1 | 0 | 1 => {\r\n if (Geometry.isSameCoordinate(vectorU.x, vectorV.x)\r\n && Geometry.isSameCoordinate(vectorU.y, vectorV.y))\r\n return 1;\r\n if (Geometry.isSameCoordinate(vectorU.x, -vectorV.x)\r\n && Geometry.isSameCoordinate(vectorU.y, -vectorV.y))\r\n return -1;\r\n return 0;\r\n }\r\n if (Geometry.isSamePoint2d(this.center, other.center)) {\r\n if (!negatedAndExchangedAxesAreEqual)\r\n return this.vectorU.isAlmostEqualMetric(other.vectorU) && this.vectorV.isAlmostEqualMetric(other.vectorV);\r\n const uuCode = almostEqualOrNegated(this.vectorU, other.vectorU);\r\n const vvCode = almostEqualOrNegated(this.vectorV, other.vectorV);\r\n if (uuCode !== 0 && vvCode !== 0)\r\n return true\r\n const uvCode = almostEqualOrNegated(this.vectorU, other.vectorV);\r\n const vuCode = almostEqualOrNegated(this.vectorV, other.vectorU);\r\n if (uvCode !== 0 && vuCode !== 0)\r\n return true;\r\n }\r\n return false;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"UnboundedParabola2d.js","sourceRoot":"","sources":["../../../../../src/curve/internalContexts/geometry2d/UnboundedParabola2d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAExE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,mBAAoB,SAAQ,eAAe;IAC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AC,IAAI,MAAM,KAAK,CAAC;gBAC9B,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module CartesianGeometry\n */\n\n\nimport { SmallSystem } from \"../../../numerics/SmallSystem\";\nimport { Geometry } from \"../../../Geometry\";\nimport { Point2d, Vector2d } from \"../../../geometry3d/Point2dVector2d\";\nimport { XAndY } from \"../../../geometry3d/XYZProps\";\nimport { TrigPolynomial } from \"../../../numerics/Polynomials\";\nimport { ImplicitCurve2d } from \"./ImplicitCurve2d\";\n\n/**\n * Internal class for parabola in the xy plane, with an angular parameterization.\n * * In uv local coordinates\n * * Let c = cos(theta) and s = sin(theta)\n * * The parabola is (u,v) = (s/(1+c), (1-c)/(1+c))\n * * The uv derivative is (u',v') = (1/(c+1), 2s/(c+1))\n * * Basic trig identities confirm that u^2 = v as expected for a parabola.\n * * This traces the parabola in a full theta range (-2PI < theta < 2PI).\n * * The angle theta = 2PI is the singular point.\n * * In XY coordinates the mapped parabola is\n * * x = A + Uu + Vv\n * * X = A + U*s/(1+c) + V*(1-2*c/(1+c))\n * * X' = U * (1/(c+1) + V*2s/(c+1))\n * @internal\n */\nexport class UnboundedParabola2d extends ImplicitCurve2d {\n /** The Cartesian coordinates of any center on the line. */\n public center: Point2d;\n /** The local u axis direction. */\n public vectorU: Vector2d;\n /** The local v axis direction. */\n public vectorV: Vector2d;\n /* Constructor - CAPTURE given center and axis vectors */\n private constructor(center: Point2d, vectorU: Vector2d, vectorV: Vector2d) {\n super();\n this.center = center;\n this.vectorU = vectorU;\n this.vectorV = vectorV;\n }\n /** Return a clone of this Parabola. */\n public clone(): UnboundedParabola2d {\n // the create method clones the inputs\n return UnboundedParabola2d.createCenterAndAxisVectors(this.center, this.vectorU, this.vectorV);\n }\n /**\n * Create an UnboundedParabola2d from an xy object and a radius.\n * @param center xy coordinates of center\n * @param vectorU vector from center to to theta=0 vertex, i.e., along axis on the \"inside\" of the curve\n * @param vectorV vector from center to the transverse direction.\n */\n public static createCenterAndAxisVectors(center: XAndY, vectorU: XAndY, vectorV: XAndY): UnboundedParabola2d {\n return new UnboundedParabola2d(Point2d.create(center.x, center.y),\n Vector2d.create(vectorU.x, vectorU.y),\n Vector2d.create(vectorV.x, vectorV.y),\n );\n }\n /**\n * Return the local (uv) coordinate of a global point.\n * @param spacePoint point for coordinate conversion\n */\n public globalToLocal(spacePoint: XAndY): Vector2d | undefined {\n const result = Vector2d.create();\n if (SmallSystem.linearSystem2d(\n this.vectorU.x, this.vectorV.x,\n this.vectorU.y, this.vectorV.y,\n spacePoint.x - this.center.x, spacePoint.y - this.center.y,\n result))\n return result;\n return undefined;\n }\n /**\n * Returns xy coordinate on the Parabola.\n * @param radians parametric angle on the Parabola\n */\n public override radiansToPoint2d(radians: number): Point2d | undefined {\n const c = Math.cos(radians);\n const s = Math.sin(radians);\n const q = 1 + c;\n if (Geometry.isSmallMetricDistance(Math.abs(q)))\n return undefined;\n return this.center.plus2Scaled(this.vectorU, s / q, this.vectorV, (1 - c) / q);\n }\n /**\n * Returns the tangent at given radians value.\n * @param radians parametric angle on the parabola\n */\n public override radiansToTangentVector2d(radians: number): Vector2d | undefined {\n const c = Math.cos(radians);\n const s = Math.sin(radians);\n const q = 1 + c;\n const u = Geometry.conditionalDivideCoordinate(1, q);\n const v = Geometry.conditionalDivideCoordinate(2 * s, q * q);\n if (u === undefined || v === undefined)\n return undefined;\n return Vector2d.createAdd2Scaled(this.vectorU, u, this.vectorV, v);\n }\n /**\n * Return the implicit function value at xy.\n * @param xy space point\n * @returns v - u*u\n */\n public override functionValue(xy: XAndY): number {\n const vectorUV = this.globalToLocal(xy);\n if (vectorUV === undefined)\n return 0;\n return vectorUV.y - vectorUV.x * vectorUV.x;\n }\n /**\n * Evaluate the (global coordinates) gradient (steepest descent) of the implicit function.\n * @param xy space point\n * @returns gradient vector for the implicit function\n */\n public override gradient(xy: XAndY): Vector2d {\n const vectorUV = this.globalToLocal(xy);\n const result = Vector2d.create();\n // use INVERSE of TRANSPOSE of [UV] matrix to map gradient terms\n if (vectorUV !== undefined && SmallSystem.linearSystem2d(\n this.vectorU.x, this.vectorU.y,\n this.vectorV.x, this.vectorV.y,\n - 2 * vectorUV.x, 1.0,\n result))\n return result;\n return Vector2d.create(0, 0);\n }\n /**\n * Solve for parametric radians at Parabola points which are perpendicular projections of spacePoint.\n * * Up to 4 solutions are possible.\n * @param spacePoint the space point.\n * @handler the handler to receive all the points on the curve and radians where perpendicular happens.\n */\n public override emitPerpendiculars(\n spacePoint: Point2d, handler: (curvePoint: Point2d, radians: number | undefined) => any,\n ): void {\n const vectorW = Vector2d.createStartEnd(spacePoint, this.center);\n // vectorW is from space point to curve origin.\n // vector to curve at an angle theta is vectorW + (s/(1=c)) U + ((1-c)/(1-s)) V\n // where c and s are cosine and sine of the parameterization angle.\n // The dot product of the curve tangent vector with the vector from spacePoint to curve\n // has trig terms appearing at highest degree 2, hence is solved by the function\n // solveUnitCircleImplicitQuadricIntersection.\n const dotWU = vectorW.dotProduct(this.vectorU);\n const dotWV = vectorW.dotProduct(this.vectorV);\n const dotUU = this.vectorU.dotProduct(this.vectorU);\n const dotVV = this.vectorV.dotProduct(this.vectorV);\n const dotUV = this.vectorU.dotProduct(this.vectorV);\n const coff1 = dotWU;\n const coffC = 2 * dotWU;\n const coffS = 2 * dotWV + dotUU + 2 * dotVV;\n const coffCC = dotWU;\n const coffSC = 2 * dotWV + dotUU - 2 * dotVV;\n const coffSS = 3 * dotUV;\n const radiansSolutions: number[] = [];\n TrigPolynomial.solveUnitCircleImplicitQuadricIntersection(coffCC, coffSC, coffSS, coffC, coffS, coff1, radiansSolutions);\n for (const radians of radiansSolutions) {\n const curvePoint = this.radiansToPoint2d(radians);\n if (curvePoint !== undefined)\n handler(curvePoint, radians);\n }\n }\n /** Returns true if the circle radius is near zero. */\n // eslint-disable-next-line @itwin/prefer-get\n public override isDegenerate(): boolean {\n return undefined === this.globalToLocal(Point2d.create(0, 0));\n }\n /**\n * Test if the centers and axes of the vectors are close\n * @param other second Parabola\n * @param negatedAndExchangedAxesAreEqual\n * * if false, a strong equality test requiring both U and V vectors to match\n * * This strong test is a test for identical parameterization\n * * if true, a weak equality test that allows U and V to be negated and or exchanged.\n * * The weak test is a test for the same implicit set\n * @returns true if identical to tolerance.\n */\n public isSameParabola(other: UnboundedParabola2d, negatedAndExchangedAxesAreEqual: boolean = false): boolean {\n const almostEqualOrNegated = (vectorU: Vector2d, vectorV: Vector2d): -1 | 0 | 1 => {\n if (Geometry.isSameCoordinate(vectorU.x, vectorV.x)\n && Geometry.isSameCoordinate(vectorU.y, vectorV.y))\n return 1;\n if (Geometry.isSameCoordinate(vectorU.x, -vectorV.x)\n && Geometry.isSameCoordinate(vectorU.y, -vectorV.y))\n return -1;\n return 0;\n }\n if (Geometry.isSamePoint2d(this.center, other.center)) {\n if (!negatedAndExchangedAxesAreEqual)\n return this.vectorU.isAlmostEqualMetric(other.vectorU) && this.vectorV.isAlmostEqualMetric(other.vectorV);\n const uuCode = almostEqualOrNegated(this.vectorU, other.vectorU);\n const vvCode = almostEqualOrNegated(this.vectorV, other.vectorV);\n if (uuCode !== 0 && vvCode !== 0)\n return true\n const uvCode = almostEqualOrNegated(this.vectorU, other.vectorV);\n const vuCode = almostEqualOrNegated(this.vectorV, other.vectorU);\n if (uvCode !== 0 && vuCode !== 0)\n return true;\n }\n return false;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AustralianRailCorpXYEvaluator.js","sourceRoot":"","sources":["../../../../src/curve/spiral/AustralianRailCorpXYEvaluator.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AA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mBAAmB,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,WAAW,CAAC;mBACjE,QAAQ,CAAC,mBAAmB,CAAC,IAAI,CAAC,eAAe,EAAE,KAAK,CAAC,eAAe,CAAC;mBACzE,QAAQ,CAAC,mBAAmB,CAAC,IAAI,CAAC,eAAe,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;QACjF,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD;;;;;;;;;;;;OAYG;IACI,2CAA2C,CAAC,CAAS;QAC1D,MAAM,EAAE,GAAG,MAAM,CAAC;QAClB,MAAM,EAAE,GAAG,MAAM,CAAC;QAClB,MAAM,EAAE,GAAG,OAAO,CAAC;QACnB,MAAM,EAAE,GAAG,QAAQ,CAAC;QACpB,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC;QACvB,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACnC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,IAAI,GAAG,CAAC,EAAE,GAAG,IAAI,GAAG,CAAC,EAAE,GAAG,IAAI,GAAG,CAAC,EAAE,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1E,OAAO,CAAC,CAAC;IACX,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\nimport { Geometry } from \"../../Geometry\";\r\nimport { Angle } from \"../../geometry3d/Angle\";\r\nimport { CubicEvaluator } from \"./CubicEvaluator\";\r\n\r\n/**\r\n * AustralianRailCorp spiral (also known as New South Wales spiral)\r\n * * The ultimate curve is a cubic `y = m * x^3`.\r\n * * `m` is a constant throughout the curve.\r\n * * Computation of m from the R and L is an complicated sequence, but is only done at construction time.\r\n * @internal\r\n */\r\nexport class AustralianRailCorpXYEvaluator extends CubicEvaluator {\r\n private _nominalLength1: number;\r\n private _nominalRadius1: number;\r\n private constructor(nominalLength1: number, nominalRadius1: number, axisLength: number, cubicM: number) {\r\n super(axisLength, cubicM);\r\n this._nominalLength1 = nominalLength1;\r\n this._nominalRadius1 = nominalRadius1;\r\n }\r\n public get nominalLength1() {\r\n return this._nominalLength1;\r\n }\r\n public get nominalRadius1() {\r\n return this._nominalRadius1;\r\n }\r\n public clone(): AustralianRailCorpXYEvaluator {\r\n return new AustralianRailCorpXYEvaluator(this._nominalLength1, this._nominalRadius1, this._axisLength, this._cubicM);\r\n }\r\n public static create(nominalLength1: number, nominalRadius1: number): AustralianRailCorpXYEvaluator | undefined {\r\n const axisLength = AustralianRailCorpXYEvaluator.radiusAndNominalLengthToAxisLength(nominalRadius1, nominalLength1);\r\n const phi = this.radiusAndAxisLengthToPhi(nominalRadius1, axisLength);\r\n const xc2 = axisLength * axisLength;\r\n const cubicM = Math.tan(phi) / (3.0 * xc2);\r\n return new AustralianRailCorpXYEvaluator(nominalLength1, nominalRadius1, axisLength, cubicM);\r\n }\r\n /** Compute the phi constant for AustralianRail spiral with given end radius and length along axis. */\r\n public static radiusAndAxisLengthToPhi(nominalRadius1: number, axisLength: number): number {\r\n const xc = axisLength;\r\n const expr1 = (2. / Math.sqrt(3.));\r\n let expr2 = (-(3. / 4.) * Math.sqrt(3.) * xc / nominalRadius1);\r\n if (expr2 < -1.0)\r\n expr2 = -1.0;\r\n if (expr2 > 1.0)\r\n expr2 = 1.0;\r\n const expr3 = Angle.degreesToRadians(240);\r\n return Math.asin(expr1 * Math.cos(Math.acos(expr2) / 3. + expr3));\r\n }\r\n public override scaleInPlace(scaleFactor: number): void {\r\n // apply the scale factor to all contents; all distances scale directly\r\n this._nominalLength1 *= scaleFactor;\r\n this._nominalRadius1 *= scaleFactor;\r\n super.scaleInPlace(scaleFactor);\r\n }\r\n /** Compute length along axis for AustralianRail spiral nominal radius and length. */\r\n public static radiusAndNominalLengthToAxisLength(\r\n nominalRadius1: number, nominalLength1: number, tolerance: number = 1.0e-5, requiredConvergenceCount: number = 2,\r\n ): number {\r\n const R = nominalRadius1;\r\n let idx = 0;\r\n let m, phi, xc2;\r\n let xc = .7 * nominalLength1;\r\n let convergenceCount = 0;\r\n // remark: This converges quickly\r\n // for L=100, R=400\r\n // ** full precision at 7th iteration.\r\n // ** classic tolerance 1.0e-5 (7 digits from L) with requiredConvergenceCount = 1 gives 11 digits after 3 iterations\r\n // ** each iteration adds about 2 digits. This is quite good for a successive replacement without derivative\r\n // ** Unanswerable question: If this is only done once and reused over all evaluations, do you want:\r\n // * run the 7 iterations to get full precision\r\n // * stop with the classic tolerance to get compatibility?\r\n for (idx = 0; idx < 100; ++idx) {\r\n phi = this.radiusAndAxisLengthToPhi(R, xc);\r\n xc2 = xc * xc;\r\n m = Math.tan(phi) / (3.0 * xc2);\r\n const m2x4 = m * m * xc2 * xc2;\r\n const correction = xc * m2x4 * ((9. / 10) + m2x4 * (-(9. / 8.) + m2x4 * (+(729. / 208.) + m2x4 * -(32805. / 2176.))));\r\n const correctedLength = xc + correction;\r\n xc = (nominalLength1 / correctedLength) * xc;\r\n if (Math.abs(nominalLength1 - correctedLength) < tolerance) {\r\n convergenceCount++;\r\n if (convergenceCount >= requiredConvergenceCount)\r\n break;\r\n } else {\r\n convergenceCount = 0;\r\n }\r\n }\r\n return xc;\r\n }\r\n public isAlmostEqual(other: any): boolean {\r\n if (other instanceof AustralianRailCorpXYEvaluator) {\r\n return Geometry.isAlmostEqualNumber(this._cubicM, other._cubicM)\r\n && Geometry.isAlmostEqualNumber(this._axisLength, other._axisLength)\r\n && Geometry.isAlmostEqualNumber(this._nominalLength1, other._nominalLength1)\r\n && Geometry.isAlmostEqualNumber(this._nominalRadius1, other._nominalRadius1);\r\n }\r\n return false;\r\n }\r\n /**\r\n * Return a (quite good approximation) of fraction along x axis for given distance along spiral.\r\n * * The AustralianRailSpiral has a supporting power series to approximately map distance along the spiral to\r\n * an x coordinate.\r\n * * The `xToFraction(x)` method quickly (with a single divide) converts this x to fraction used for\r\n * this.fractionToX(fraction), this.fractionToY(fraction) etc to get coordinates and derivatives.\r\n * * The x-to-distance relation is not as precise as the CurvePrimitive method moveSignedDistanceFromFraction.\r\n * * It is supported here for users interested in replicating the AustralianRail distance mapping rather than the\r\n * more accurate CurvePrimitive measurements.\r\n * * Round tripping distance through (a) distanceAlongSpiralToAustralianApproximateX, (b) xToFraction, and\r\n * (c) curveLengthBetweenFractions has 10 digit accuracy for L/R = 4, 12 digit accuracy for L/R = 10.\r\n * @param s distance along the axis.\r\n */\r\n public distanceAlongSpiralToAustralianApproximateX(s: number): number {\r\n const a1 = 0.9000;\r\n const a2 = 5.1750;\r\n const a3 = 43.1948;\r\n const a4 = 426.0564;\r\n const m = this._cubicM;\r\n const m2s4 = m * m * s * s * s * s;\r\n const x = s * (1.0 - m2s4 * (a1 - m2s4 * (a2 - m2s4 * (a3 - m2s4 * a4))));\r\n return x;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"AustralianRailCorpXYEvaluator.js","sourceRoot":"","sources":["../../../../src/curve/spiral/AustralianRailCorpXYEvaluator.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;;;;GAMG;AACH,MAAM,OAAO,6BAA8B,SAAQ,cAAc;IACvD,eAAe,CAAS;IACxB,eAAe,CAAS;IAChC,YAAoB,cAAsB,EAAE,cAAsB,EAAE,UAAkB,EAAE,MAAc;QACpG,KAAK,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QAC1B,IAAI,CAAC,eAAe,GAAG,c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1D,MAAM,EAAE,GAAG,MAAM,CAAC;QAClB,MAAM,EAAE,GAAG,MAAM,CAAC;QAClB,MAAM,EAAE,GAAG,OAAO,CAAC;QACnB,MAAM,EAAE,GAAG,QAAQ,CAAC;QACpB,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC;QACvB,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACnC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,IAAI,GAAG,CAAC,EAAE,GAAG,IAAI,GAAG,CAAC,EAAE,GAAG,IAAI,GAAG,CAAC,EAAE,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1E,OAAO,CAAC,CAAC;IACX,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\nimport { Geometry } from \"../../Geometry\";\nimport { Angle } from \"../../geometry3d/Angle\";\nimport { CubicEvaluator } from \"./CubicEvaluator\";\n\n/**\n * AustralianRailCorp spiral (also known as New South Wales spiral)\n * * The ultimate curve is a cubic `y = m * x^3`.\n * * `m` is a constant throughout the curve.\n * * Computation of m from the R and L is an complicated sequence, but is only done at construction time.\n * @internal\n */\nexport class AustralianRailCorpXYEvaluator extends CubicEvaluator {\n private _nominalLength1: number;\n private _nominalRadius1: number;\n private constructor(nominalLength1: number, nominalRadius1: number, axisLength: number, cubicM: number) {\n super(axisLength, cubicM);\n this._nominalLength1 = nominalLength1;\n this._nominalRadius1 = nominalRadius1;\n }\n public get nominalLength1() {\n return this._nominalLength1;\n }\n public get nominalRadius1() {\n return this._nominalRadius1;\n }\n public clone(): AustralianRailCorpXYEvaluator {\n return new AustralianRailCorpXYEvaluator(this._nominalLength1, this._nominalRadius1, this._axisLength, this._cubicM);\n }\n public static create(nominalLength1: number, nominalRadius1: number): AustralianRailCorpXYEvaluator | undefined {\n const axisLength = AustralianRailCorpXYEvaluator.radiusAndNominalLengthToAxisLength(nominalRadius1, nominalLength1);\n const phi = this.radiusAndAxisLengthToPhi(nominalRadius1, axisLength);\n const xc2 = axisLength * axisLength;\n const cubicM = Math.tan(phi) / (3.0 * xc2);\n return new AustralianRailCorpXYEvaluator(nominalLength1, nominalRadius1, axisLength, cubicM);\n }\n /** Compute the phi constant for AustralianRail spiral with given end radius and length along axis. */\n public static radiusAndAxisLengthToPhi(nominalRadius1: number, axisLength: number): number {\n const xc = axisLength;\n const expr1 = (2. / Math.sqrt(3.));\n let expr2 = (-(3. / 4.) * Math.sqrt(3.) * xc / nominalRadius1);\n if (expr2 < -1.0)\n expr2 = -1.0;\n if (expr2 > 1.0)\n expr2 = 1.0;\n const expr3 = Angle.degreesToRadians(240);\n return Math.asin(expr1 * Math.cos(Math.acos(expr2) / 3. + expr3));\n }\n public override scaleInPlace(scaleFactor: number): void {\n // apply the scale factor to all contents; all distances scale directly\n this._nominalLength1 *= scaleFactor;\n this._nominalRadius1 *= scaleFactor;\n super.scaleInPlace(scaleFactor);\n }\n /** Compute length along axis for AustralianRail spiral nominal radius and length. */\n public static radiusAndNominalLengthToAxisLength(\n nominalRadius1: number, nominalLength1: number, tolerance: number = 1.0e-5, requiredConvergenceCount: number = 2,\n ): number {\n const R = nominalRadius1;\n let idx = 0;\n let m, phi, xc2;\n let xc = .7 * nominalLength1;\n let convergenceCount = 0;\n // remark: This converges quickly\n // for L=100, R=400\n // ** full precision at 7th iteration.\n // ** classic tolerance 1.0e-5 (7 digits from L) with requiredConvergenceCount = 1 gives 11 digits after 3 iterations\n // ** each iteration adds about 2 digits. This is quite good for a successive replacement without derivative\n // ** Unanswerable question: If this is only done once and reused over all evaluations, do you want:\n // * run the 7 iterations to get full precision\n // * stop with the classic tolerance to get compatibility?\n for (idx = 0; idx < 100; ++idx) {\n phi = this.radiusAndAxisLengthToPhi(R, xc);\n xc2 = xc * xc;\n m = Math.tan(phi) / (3.0 * xc2);\n const m2x4 = m * m * xc2 * xc2;\n const correction = xc * m2x4 * ((9. / 10) + m2x4 * (-(9. / 8.) + m2x4 * (+(729. / 208.) + m2x4 * -(32805. / 2176.))));\n const correctedLength = xc + correction;\n xc = (nominalLength1 / correctedLength) * xc;\n if (Math.abs(nominalLength1 - correctedLength) < tolerance) {\n convergenceCount++;\n if (convergenceCount >= requiredConvergenceCount)\n break;\n } else {\n convergenceCount = 0;\n }\n }\n return xc;\n }\n public isAlmostEqual(other: any): boolean {\n if (other instanceof AustralianRailCorpXYEvaluator) {\n return Geometry.isAlmostEqualNumber(this._cubicM, other._cubicM)\n && Geometry.isAlmostEqualNumber(this._axisLength, other._axisLength)\n && Geometry.isAlmostEqualNumber(this._nominalLength1, other._nominalLength1)\n && Geometry.isAlmostEqualNumber(this._nominalRadius1, other._nominalRadius1);\n }\n return false;\n }\n /**\n * Return a (quite good approximation) of fraction along x axis for given distance along spiral.\n * * The AustralianRailSpiral has a supporting power series to approximately map distance along the spiral to\n * an x coordinate.\n * * The `xToFraction(x)` method quickly (with a single divide) converts this x to fraction used for\n * this.fractionToX(fraction), this.fractionToY(fraction) etc to get coordinates and derivatives.\n * * The x-to-distance relation is not as precise as the CurvePrimitive method moveSignedDistanceFromFraction.\n * * It is supported here for users interested in replicating the AustralianRail distance mapping rather than the\n * more accurate CurvePrimitive measurements.\n * * Round tripping distance through (a) distanceAlongSpiralToAustralianApproximateX, (b) xToFraction, and\n * (c) curveLengthBetweenFractions has 10 digit accuracy for L/R = 4, 12 digit accuracy for L/R = 10.\n * @param s distance along the axis.\n */\n public distanceAlongSpiralToAustralianApproximateX(s: number): number {\n const a1 = 0.9000;\n const a2 = 5.1750;\n const a3 = 43.1948;\n const a4 = 426.0564;\n const m = this._cubicM;\n const m2s4 = m * m * s * s * s * s;\n const x = s * (1.0 - m2s4 * (a1 - m2s4 * (a2 - m2s4 * (a3 - m2s4 * a4))));\n return x;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClothoidSeries.js","sourceRoot":"","sources":["../../../../src/curve/spiral/ClothoidSeries.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD;;;;;;;GAOG;AACH,MAAM,OAAO,yBAA0B,SAAQ,gBAAgB;IAC7D,iDAAiD;IAC1C,SAAS,CAAS;IACzB,iDAAiD;IAC1C,SAAS,CAAS;IACzB,yCAAyC;IAClC,cAAc,CAAS;IAC9B,gCAAgC;IACzB,cAAc,CAAS;IAC9B,YAAmB,cAAsB,EAAE,cAAsB,EAAE,YAAoB,CAAC,EAAE,YAAoB,CAAC;QAC7G,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IACD,2BAA2B;IACpB,KAAK;QACV,OAAO,IAAI,yBAAyB,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IACjH,CAAC;IACM,YAAY,CAAC,WAAmB;QACrC,IAAI,CAAC,cAAc,IAAI,WAAW,CAAC;QACnC,IAAI,CAAC,cAAc,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC,CAAC;IACrD,CAAC;IACD,gCAAgC;IACzB,aAAa,CAAC,KAAU;QAC7B,IAAI,KAAK,YAAY,yBAAyB,EAAE,CAA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AG,CAAC,CAAC;QAC7C,MAAM,OAAO,GAAG,GAAG,GAAG,IAAI,CAAC,cAAc,CAAC;QAC1C,oCAAoC;QACpC,6FAA6F;QAC7F,wEAAwE;QACxE,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAC7D,MAAM,IAAI,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC;QAC/D,OAAO,CAAC,CAAC,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;IAClG,CAAC;IACM,WAAW,CAAC,CAAS;QAC1B,MAAM,SAAS,GAAG,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC;QAC1C,MAAM,SAAS,GAAG,YAAY,CAAC,WAAW,CAAC,SAAS,EAClD,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EACxC,CAAC,CAAS,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;QACvC,IAAI,SAAS,KAAK,SAAS;YACzB,OAAO,SAAS,CAAC;QACnB,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { Geometry } from \"../../Geometry\";\r\nimport { XYCurveEvaluator } from \"./XYCurveEvaluator\";\r\nimport { SimpleNewton } from \"../../numerics/Newton\";\r\n\r\n/**\r\n * Methods to evaluate caller-specified number of terms of the x and y Taylor series for a clothoid.\r\n * Each instance has:\r\n * * number of x and y terms to use.\r\n * * constant for theta = cxx.\r\n * * This value is c = 1/2RL for curve length L measured from inflection to point with radius R.\r\n * @internal\r\n */\r\nexport class ClothoidSeriesRLEvaluator extends XYCurveEvaluator {\r\n /** Number of terms to use in x Taylor series. */\r\n public numXTerms: number;\r\n /** Number of terms to use in y Taylor series. */\r\n public numYTerms: number;\r\n /** Constant c = 1/2RL in theta = cxx. */\r\n public constantDiv2LR: number;\r\n /** The nominal curve length. */\r\n public nominalLength1: number;\r\n public constructor(nominalLength1: number, constantDiv2LR: number, numXTerms: number = 4, numYTerms: number = 4) {\r\n super();\r\n this.nominalLength1 = nominalLength1;\r\n this.constantDiv2LR = constantDiv2LR;\r\n this.numXTerms = numXTerms;\r\n this.numYTerms = numYTerms;\r\n }\r\n /** Return a deep clone. */\r\n public clone(): ClothoidSeriesRLEvaluator {\r\n return new ClothoidSeriesRLEvaluator(this.nominalLength1, this.constantDiv2LR, this.numXTerms, this.numYTerms);\r\n }\r\n public scaleInPlace(scaleFactor: number): void {\r\n this.nominalLength1 *= scaleFactor;\r\n this.constantDiv2LR /= (scaleFactor * scaleFactor);\r\n }\r\n /** Member by member matchup. */\r\n public isAlmostEqual(other: any): boolean {\r\n if (other instanceof ClothoidSeriesRLEvaluator) {\r\n return this.numXTerms === other.numXTerms\r\n && this.numYTerms === other.numYTerms\r\n && Geometry.isAlmostEqualNumber(this.constantDiv2LR, other.constantDiv2LR)\r\n && Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1);\r\n }\r\n return false;\r\n }\r\n /**\r\n * Evaluate the X series at a nominal distance along the curve.\r\n * @param fraction fractional position along the curve.\r\n */\r\n public fractionToX(fraction: number): number {\r\n return this.fractionToXGo(fraction, this.numXTerms);\r\n }\r\n /**\r\n * Evaluate the Y series at a nominal distance along the curve.\r\n * @param fraction fractional position along the curve.\r\n */\r\n public fractionToY(fraction: number): number {\r\n return this.fractionToYGo(fraction, this.numYTerms);\r\n }\r\n /**\r\n * Evaluate the derivative of the X series at a nominal distance along the curve.\r\n * @param fraction fractional position along the curve.\r\n */\r\n public fractionToDX(fraction: number): number {\r\n return this.fractionToDXGo(fraction, this.numXTerms);\r\n }\r\n /**\r\n * Evaluate the derivative of the Y series at a nominal distance along the curve.\r\n * @param fraction fractional position along the curve.\r\n */\r\n public fractionToDY(fraction: number): number {\r\n return this.fractionToDYGo(fraction, this.numYTerms);\r\n }\r\n /**\r\n * Evaluate the derivative of the X series at a nominal distance along the curve.\r\n * @param fraction fractional position along the curve.\r\n */\r\n public fractionToDDX(fraction: number): number {\r\n return this.fractionToDDXGo(fraction, this.numXTerms);\r\n }\r\n /**\r\n * Evaluate the derivative of the Y series at a nominal distance along the curve.\r\n * @param fraction fractional position along the curve.\r\n */\r\n public fractionToDDY(fraction: number): number {\r\n return this.fractionToDDYGo(fraction, this.numYTerms);\r\n }\r\n /**\r\n * Evaluate the X series at a nominal distance along the curve.\r\n * @param fraction fractional position along the curve.\r\n * @param numTerms number of terms to use.\r\n */\r\n public fractionToXGo(fraction: number, numTerms: number): number {\r\n // write the Taylor series for cos(theta):\r\n // 1 - theta^2 / 2! + theta^4 / 4! - theta^6 / 6! + ...\r\n // replace theta by s*s*c:\r\n // 1 - s^4c^2 / 2! + s^8c^4 / 4! - s^12c^6 / 6! + ...\r\n // integrate wrt s:\r\n // x = s - s^5 c^2 / 5*2! + s^9 c^4 / 9*4! - s^13 c^6 / 13*6! + ...\r\n // x = s(1 - (s^4 c^2/2) ( 1/5 - (s^4 c^2 / 3*4) (1/9 - ...) ) )\r\n const s = fraction * this.nominalLength1;\r\n let result = s;\r\n if (numTerms < 2)\r\n return result;\r\n const q1 = s * s * this.constantDiv2LR;\r\n const beta = - q1 * q1;\r\n let alpha = s;\r\n let m = 1;\r\n let n = 5;\r\n for (let i = 1; i < numTerms; i++) {\r\n alpha *= beta / (m * (m + 1));\r\n result += alpha / n;\r\n m += 2;\r\n n += 4;\r\n }\r\n return result;\r\n }\r\n public fractionToYGo(fraction: number, numTerms: number): number {\r\n // write the Taylor series for sin(theta):\r\n // theta - theta^3 / 3! + theta^5 / 5! - theta^7 / 7! + ...\r\n // replace theta by s*s*c:\r\n // s^2 c - s^6 c^3 / 3! + s^10 c^5 / 5! - s^14 c^7 / 7! + ...\r\n // integrate wrt s:\r\n // y = s^3 c / 3 - s^7 c^3 / 7*3! + s^11 c^5 / 11*5! - s^15 c^7 / 15*7! + ...\r\n // y = s^3 c ( 1/3 - s^4 c^2/ 3! ( (1/7) - (s^4 c^2 / 4*5) (1/11 - ...) ) )\r\n const s = fraction * this.nominalLength1;\r\n const q1 = s * s * this.constantDiv2LR;\r\n let result = q1 * s / 3;\r\n if (numTerms < 2)\r\n return result;\r\n const beta = - q1 * q1;\r\n let alpha = q1 * s;\r\n let m = 2;\r\n let n = 7;\r\n for (let i = 1; i < numTerms; i++) {\r\n alpha *= beta / (m * (m + 1));\r\n result += alpha / n;\r\n m += 2;\r\n n += 4;\r\n }\r\n return result;\r\n }\r\n public fractionToDXGo(fraction: number, numTerms: number): number {\r\n // yes -- this does happen during derivatives of cosines with more than 0 terms\r\n if (numTerms <= 0)\r\n return 0;\r\n // dX = 1 - s^4c^2/2 + s^8 c^4 / 4! -\r\n // new Term = old Term * beta / (m(m+1))\r\n const s = fraction * this.nominalLength1;\r\n let result = 1;\r\n if (numTerms < 2) {\r\n return result * this.nominalLength1;\r\n }\r\n const q1 = s * s * this.constantDiv2LR;\r\n const beta = - q1 * q1;\r\n let alpha = 1.0;\r\n let m = 1;\r\n for (let i = 1; i < numTerms; i++) {\r\n alpha *= beta / (m * (m + 1));\r\n result += alpha;\r\n m += 2;\r\n }\r\n return result * this.nominalLength1;\r\n }\r\n public fractionToDYGo(fraction: number, numTerms: number): number {\r\n if (numTerms <= 0)\r\n return 0;\r\n // dY = q - q^3/3!\r\n // q = s^2 c\r\n // dY = s^2 c - s^6 c^3/3! + s^10 c^5/ 5!\r\n // recurrence advancing m by 2 alpha *= -(s^4 c^2) / (m(m+1))\r\n const s = fraction * this.nominalLength1;\r\n const q1 = s * s * this.constantDiv2LR;\r\n let result = q1;\r\n if (numTerms < 2)\r\n return result * this.nominalLength1;\r\n const beta = - q1 * q1;\r\n let alpha = q1;\r\n let m = 2;\r\n for (let i = 1; i < numTerms; i++) {\r\n alpha *= beta / (m * (m + 1));\r\n result += alpha;\r\n m += 2;\r\n }\r\n return result * this.nominalLength1;\r\n }\r\n public fractionToDDXGo(fraction: number, numTerms: number): number {\r\n // DX is \"cosine\"\r\n // DDX is \"- sine\" series times chain rule dTheta/ds = 2 * s * this.constantDivLR\r\n const s = fraction * this.nominalLength1;\r\n const dTheta = 2 * this.constantDiv2LR * s;\r\n const sine = this.fractionToDYGo(fraction, numTerms - 1);\r\n const resultA = (- dTheta * sine * this.nominalLength1);\r\n return resultA;\r\n }\r\n public fractionToDDYGo(fraction: number, numTerms: number): number {\r\n // DY is \"sine\"\r\n // DDY is \"cosine\" series times chain rule dTheta/ds = 2 * s * this.constantDivLR\r\n // BUT .... derivative of the cosine series leading term is zero ... use one less term\r\n const s = fraction * this.nominalLength1;\r\n const dTheta = 2 * this.constantDiv2LR * s;\r\n const cosine = this.fractionToDXGo(fraction, numTerms);\r\n return cosine * dTheta * this.nominalLength1;\r\n }\r\n public fractionToD3X(fraction: number): number {\r\n if (this.numXTerms <= 1)\r\n return 0.0;\r\n // DX is \"cosine\"\r\n // DDX is \"- sine\" series times chain rule dTheta/ds = 2 * s * this.constantDivLR\r\n const s = fraction * this.nominalLength1;\r\n const dTheta = 2.0 * this.constantDiv2LR * s;\r\n const d2Theta = 2.0 * this.constantDiv2LR;\r\n const sine = this.fractionToDYGo(fraction, this.numXTerms - 1);\r\n const cosine = this.fractionToDXGo(fraction, this.numXTerms - 1);\r\n return (- cosine * dTheta * dTheta - sine * d2Theta) * this.nominalLength1 * this.nominalLength1;\r\n }\r\n public fractionToD3Y(fraction: number): number {\r\n // DY is \"sine\"\r\n // DDY is \"cosine\" series times chain rule dTheta/ds = 2 * s * this.constantDivLR\r\n const s = fraction * this.nominalLength1;\r\n const dTheta = 2.0 * this.constantDiv2LR * s;\r\n const d2Theta = 2.0 * this.constantDiv2LR;\r\n // dY is sine series with numYTerms.\r\n // ddY is cosine series. Leading term of sine series is non-constant, so numYTerms here also\r\n // d3Y is sine series. Derivative of preceding cosine killed first term.\r\n const cosine = this.fractionToDXGo(fraction, this.numYTerms);\r\n const sine = this.fractionToDYGo(fraction, this.numYTerms - 1);\r\n return (-sine * dTheta * dTheta + cosine * d2Theta) * this.nominalLength1 * this.nominalLength1;\r\n }\r\n public xToFraction(x: number): number | undefined {\r\n const fraction0 = x / this.nominalLength1;\r\n const fraction1 = SimpleNewton.runNewton1D(fraction0,\r\n (f: number) => (this.fractionToX(f) - x),\r\n (f: number) => this.fractionToDX(f));\r\n if (fraction1 === undefined)\r\n return undefined;\r\n return fraction1;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ClothoidSeries.js","sourceRoot":"","sources":["../../../../src/curve/spiral/ClothoidSeries.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD;;;;;;;GAOG;AACH,MAAM,OAAO,yBAA0B,SAAQ,gBAAgB;IAC7D,iDAAiD;IAC1C,SAAS,CAAS;IACzB,iDAAiD;IAC1C,SAAS,CAAS;IACzB,yCAAyC;IAClC,cAAc,CAAS;IAC9B,gCAAgC;IACzB,cAAc,CAAS;IAC9B,YAAmB,cAAsB,EAAE,cAAsB,EAAE,YAAoB,CAAC,EAAE,YAAoB,CAAC;QAC7G,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC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YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;QACvC,IAAI,SAAS,KAAK,SAAS;YACzB,OAAO,SAAS,CAAC;QACnB,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\n\nimport { Geometry } from \"../../Geometry\";\nimport { XYCurveEvaluator } from \"./XYCurveEvaluator\";\nimport { SimpleNewton } from \"../../numerics/Newton\";\n\n/**\n * Methods to evaluate caller-specified number of terms of the x and y Taylor series for a clothoid.\n * Each instance has:\n * * number of x and y terms to use.\n * * constant for theta = cxx.\n * * This value is c = 1/2RL for curve length L measured from inflection to point with radius R.\n * @internal\n */\nexport class ClothoidSeriesRLEvaluator extends XYCurveEvaluator {\n /** Number of terms to use in x Taylor series. */\n public numXTerms: number;\n /** Number of terms to use in y Taylor series. */\n public numYTerms: number;\n /** Constant c = 1/2RL in theta = cxx. */\n public constantDiv2LR: number;\n /** The nominal curve length. */\n public nominalLength1: number;\n public constructor(nominalLength1: number, constantDiv2LR: number, numXTerms: number = 4, numYTerms: number = 4) {\n super();\n this.nominalLength1 = nominalLength1;\n this.constantDiv2LR = constantDiv2LR;\n this.numXTerms = numXTerms;\n this.numYTerms = numYTerms;\n }\n /** Return a deep clone. */\n public clone(): ClothoidSeriesRLEvaluator {\n return new ClothoidSeriesRLEvaluator(this.nominalLength1, this.constantDiv2LR, this.numXTerms, this.numYTerms);\n }\n public scaleInPlace(scaleFactor: number): void {\n this.nominalLength1 *= scaleFactor;\n this.constantDiv2LR /= (scaleFactor * scaleFactor);\n }\n /** Member by member matchup. */\n public isAlmostEqual(other: any): boolean {\n if (other instanceof ClothoidSeriesRLEvaluator) {\n return this.numXTerms === other.numXTerms\n && this.numYTerms === other.numYTerms\n && Geometry.isAlmostEqualNumber(this.constantDiv2LR, other.constantDiv2LR)\n && Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1);\n }\n return false;\n }\n /**\n * Evaluate the X series at a nominal distance along the curve.\n * @param fraction fractional position along the curve.\n */\n public fractionToX(fraction: number): number {\n return this.fractionToXGo(fraction, this.numXTerms);\n }\n /**\n * Evaluate the Y series at a nominal distance along the curve.\n * @param fraction fractional position along the curve.\n */\n public fractionToY(fraction: number): number {\n return this.fractionToYGo(fraction, this.numYTerms);\n }\n /**\n * Evaluate the derivative of the X series at a nominal distance along the curve.\n * @param fraction fractional position along the curve.\n */\n public fractionToDX(fraction: number): number {\n return this.fractionToDXGo(fraction, this.numXTerms);\n }\n /**\n * Evaluate the derivative of the Y series at a nominal distance along the curve.\n * @param fraction fractional position along the curve.\n */\n public fractionToDY(fraction: number): number {\n return this.fractionToDYGo(fraction, this.numYTerms);\n }\n /**\n * Evaluate the derivative of the X series at a nominal distance along the curve.\n * @param fraction fractional position along the curve.\n */\n public fractionToDDX(fraction: number): number {\n return this.fractionToDDXGo(fraction, this.numXTerms);\n }\n /**\n * Evaluate the derivative of the Y series at a nominal distance along the curve.\n * @param fraction fractional position along the curve.\n */\n public fractionToDDY(fraction: number): number {\n return this.fractionToDDYGo(fraction, this.numYTerms);\n }\n /**\n * Evaluate the X series at a nominal distance along the curve.\n * @param fraction fractional position along the curve.\n * @param numTerms number of terms to use.\n */\n public fractionToXGo(fraction: number, numTerms: number): number {\n // write the Taylor series for cos(theta):\n // 1 - theta^2 / 2! + theta^4 / 4! - theta^6 / 6! + ...\n // replace theta by s*s*c:\n // 1 - s^4c^2 / 2! + s^8c^4 / 4! - s^12c^6 / 6! + ...\n // integrate wrt s:\n // x = s - s^5 c^2 / 5*2! + s^9 c^4 / 9*4! - s^13 c^6 / 13*6! + ...\n // x = s(1 - (s^4 c^2/2) ( 1/5 - (s^4 c^2 / 3*4) (1/9 - ...) ) )\n const s = fraction * this.nominalLength1;\n let result = s;\n if (numTerms < 2)\n return result;\n const q1 = s * s * this.constantDiv2LR;\n const beta = - q1 * q1;\n let alpha = s;\n let m = 1;\n let n = 5;\n for (let i = 1; i < numTerms; i++) {\n alpha *= beta / (m * (m + 1));\n result += alpha / n;\n m += 2;\n n += 4;\n }\n return result;\n }\n public fractionToYGo(fraction: number, numTerms: number): number {\n // write the Taylor series for sin(theta):\n // theta - theta^3 / 3! + theta^5 / 5! - theta^7 / 7! + ...\n // replace theta by s*s*c:\n // s^2 c - s^6 c^3 / 3! + s^10 c^5 / 5! - s^14 c^7 / 7! + ...\n // integrate wrt s:\n // y = s^3 c / 3 - s^7 c^3 / 7*3! + s^11 c^5 / 11*5! - s^15 c^7 / 15*7! + ...\n // y = s^3 c ( 1/3 - s^4 c^2/ 3! ( (1/7) - (s^4 c^2 / 4*5) (1/11 - ...) ) )\n const s = fraction * this.nominalLength1;\n const q1 = s * s * this.constantDiv2LR;\n let result = q1 * s / 3;\n if (numTerms < 2)\n return result;\n const beta = - q1 * q1;\n let alpha = q1 * s;\n let m = 2;\n let n = 7;\n for (let i = 1; i < numTerms; i++) {\n alpha *= beta / (m * (m + 1));\n result += alpha / n;\n m += 2;\n n += 4;\n }\n return result;\n }\n public fractionToDXGo(fraction: number, numTerms: number): number {\n // yes -- this does happen during derivatives of cosines with more than 0 terms\n if (numTerms <= 0)\n return 0;\n // dX = 1 - s^4c^2/2 + s^8 c^4 / 4! -\n // new Term = old Term * beta / (m(m+1))\n const s = fraction * this.nominalLength1;\n let result = 1;\n if (numTerms < 2) {\n return result * this.nominalLength1;\n }\n const q1 = s * s * this.constantDiv2LR;\n const beta = - q1 * q1;\n let alpha = 1.0;\n let m = 1;\n for (let i = 1; i < numTerms; i++) {\n alpha *= beta / (m * (m + 1));\n result += alpha;\n m += 2;\n }\n return result * this.nominalLength1;\n }\n public fractionToDYGo(fraction: number, numTerms: number): number {\n if (numTerms <= 0)\n return 0;\n // dY = q - q^3/3!\n // q = s^2 c\n // dY = s^2 c - s^6 c^3/3! + s^10 c^5/ 5!\n // recurrence advancing m by 2 alpha *= -(s^4 c^2) / (m(m+1))\n const s = fraction * this.nominalLength1;\n const q1 = s * s * this.constantDiv2LR;\n let result = q1;\n if (numTerms < 2)\n return result * this.nominalLength1;\n const beta = - q1 * q1;\n let alpha = q1;\n let m = 2;\n for (let i = 1; i < numTerms; i++) {\n alpha *= beta / (m * (m + 1));\n result += alpha;\n m += 2;\n }\n return result * this.nominalLength1;\n }\n public fractionToDDXGo(fraction: number, numTerms: number): number {\n // DX is \"cosine\"\n // DDX is \"- sine\" series times chain rule dTheta/ds = 2 * s * this.constantDivLR\n const s = fraction * this.nominalLength1;\n const dTheta = 2 * this.constantDiv2LR * s;\n const sine = this.fractionToDYGo(fraction, numTerms - 1);\n const resultA = (- dTheta * sine * this.nominalLength1);\n return resultA;\n }\n public fractionToDDYGo(fraction: number, numTerms: number): number {\n // DY is \"sine\"\n // DDY is \"cosine\" series times chain rule dTheta/ds = 2 * s * this.constantDivLR\n // BUT .... derivative of the cosine series leading term is zero ... use one less term\n const s = fraction * this.nominalLength1;\n const dTheta = 2 * this.constantDiv2LR * s;\n const cosine = this.fractionToDXGo(fraction, numTerms);\n return cosine * dTheta * this.nominalLength1;\n }\n public fractionToD3X(fraction: number): number {\n if (this.numXTerms <= 1)\n return 0.0;\n // DX is \"cosine\"\n // DDX is \"- sine\" series times chain rule dTheta/ds = 2 * s * this.constantDivLR\n const s = fraction * this.nominalLength1;\n const dTheta = 2.0 * this.constantDiv2LR * s;\n const d2Theta = 2.0 * this.constantDiv2LR;\n const sine = this.fractionToDYGo(fraction, this.numXTerms - 1);\n const cosine = this.fractionToDXGo(fraction, this.numXTerms - 1);\n return (- cosine * dTheta * dTheta - sine * d2Theta) * this.nominalLength1 * this.nominalLength1;\n }\n public fractionToD3Y(fraction: number): number {\n // DY is \"sine\"\n // DDY is \"cosine\" series times chain rule dTheta/ds = 2 * s * this.constantDivLR\n const s = fraction * this.nominalLength1;\n const dTheta = 2.0 * this.constantDiv2LR * s;\n const d2Theta = 2.0 * this.constantDiv2LR;\n // dY is sine series with numYTerms.\n // ddY is cosine series. Leading term of sine series is non-constant, so numYTerms here also\n // d3Y is sine series. Derivative of preceding cosine killed first term.\n const cosine = this.fractionToDXGo(fraction, this.numYTerms);\n const sine = this.fractionToDYGo(fraction, this.numYTerms - 1);\n return (-sine * dTheta * dTheta + cosine * d2Theta) * this.nominalLength1 * this.nominalLength1;\n }\n public xToFraction(x: number): number | undefined {\n const fraction0 = x / this.nominalLength1;\n const fraction1 = SimpleNewton.runNewton1D(fraction0,\n (f: number) => (this.fractionToX(f) - x),\n (f: number) => this.fractionToDX(f));\n if (fraction1 === undefined)\n return undefined;\n return fraction1;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CubicEvaluator.js","sourceRoot":"","sources":["../../../../src/curve/spiral/CubicEvaluator.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;;;;GAMG;AACH,MAAM,OAAgB,cAAe,SAAQ,gBAAgB;IACjD,OAAO,CAAS;IAChB,WAAW,CAAS;IAC9B,YAAsB,UAAkB,EAAE,MAAc;QACtD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IACD,6BAA6B;IACtB,YAAY,CAAC,UAAkB,EAAE,MAAc;QACpD,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IACD,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IACD,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACD;;;OAGG;IACI,YAAY,CAAC,WAAmB;QACrC,IAAI,CAAC,WAAW,IAAI,WAAW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IACvB,WAAW,CAAC,CAAS;QAC1B,OAAO,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC;IAC9B,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"CubicEvaluator.js","sourceRoot":"","sources":["../../../../src/curve/spiral/CubicEvaluator.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;;;;GAMG;AACH,MAAM,OAAgB,cAAe,SAAQ,gBAAgB;IACjD,OAAO,CAAS;IAChB,WAAW,CAAS;IAC9B,YAAsB,UAAkB,EAAE,MAAc;QACtD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IACD,6BAA6B;IACtB,YAAY,CAAC,UAAkB,EAAE,MAAc;QACpD,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IACD,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IACD,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACD;;;OAGG;IACI,YAAY,CAAC,WAAmB;QACrC,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC;QAChC,oGAAoG;QACpG,IAAI,CAAC,OAAO,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC,CAAC;IAC9C,CAAC;IACD,8BAA8B;IACvB,WAAW,CAAC,QAAgB;QACjC,OAAO,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC;IACrC,CAAC;IACD,yDAAyD;IAClD,YAAY,CAAC,SAAiB;QACnC,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IACD,gEAAgE;IACzD,aAAa,CAAC,SAAiB;QACpC,OAAO,GAAG,CAAC;IACb,CAAC;IACD,+DAA+D;IACxD,aAAa,CAAC,SAAiB;QACpC,OAAO,GAAG,CAAC;IACb,CAAC;IACD,8BAA8B;IACvB,WAAW,CAAC,QAAgB;QACjC,MAAM,CAAC,GAAG,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC;QACtC,OAAO,IAAI,CAAC,OAAO,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAClC,CAAC;IACD,yDAAyD;IAClD,YAAY,CAAC,QAAgB;QAClC,MAAM,CAAC,GAAG,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC;QACtC,OAAO,GAAG,GAAG,IAAI,CAAC,OAAO,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC;IACvD,CAAC;IACD,gEAAgE;IACzD,aAAa,CAAC,QAAgB;QACnC,MAAM,CAAC,GAAG,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC;QACtC,OAAO,GAAG,GAAG,IAAI,CAAC,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;IACtE,CAAC;IACD,+DAA+D;IACxD,aAAa,CAAC,SAAiB;QACpC,OAAO,GAAG,GAAG,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;IACrF,CAAC;IACD,8BAA8B;IACvB,WAAW,CAAC,CAAS;QAC1B,OAAO,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC;IAC9B,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\nimport { XYCurveEvaluator } from \"./XYCurveEvaluator\";\n\n/**\n * Intermediate class for evaluation of bare cubic spirals `y = m*x^3` with x axis from [0..xLength]\n * * This implements all the computations among fraction, x, and y.\n * * Derived classes implement specialized logic such as (a) precomputing `m` and (b) domain-specific fraction-to-distance\n * approximations.\n * @internal\n */\nexport abstract class CubicEvaluator extends XYCurveEvaluator {\n protected _cubicM: number;\n protected _axisLength: number;\n protected constructor(axisLength: number, cubicM: number) {\n super();\n this._cubicM = cubicM;\n this._axisLength = axisLength;\n }\n /** Update both constants. */\n public setConstants(axisLength: number, cubicM: number) {\n this._axisLength = axisLength;\n this._cubicM = cubicM;\n }\n public get axisLength() {\n return this._axisLength;\n }\n public get cubicM() {\n return this._cubicM;\n }\n /**\n * Apply `scaleFactor` to the xLength and cubicM.\n * * Derived classes commonly call this as `super.scaleInPlace()`, and additionally apply the scale to their members.\n */\n public scaleInPlace(scaleFactor: number) {\n this._axisLength *= scaleFactor;\n // \"x\" arriving at \"m * x^3\" will be scaled. \"m\" has to be divided by the scale to cancel 2 of the 3\n this._cubicM /= (scaleFactor * scaleFactor);\n }\n /** Evaluate X at fraction. */\n public fractionToX(fraction: number): number {\n return fraction * this._axisLength;\n }\n /** Evaluate derivative of X with respect to fraction. */\n public fractionToDX(_fraction: number): number {\n return this._axisLength;\n }\n /** Evaluate second derivative of X with respect to fraction. */\n public fractionToDDX(_fraction: number): number {\n return 0.0;\n }\n /** Evaluate third derivative of X with respect to fraction. */\n public fractionToD3X(_fraction: number): number {\n return 0.0;\n }\n /** Evaluate Y at fraction. */\n public fractionToY(fraction: number): number {\n const x = fraction * this._axisLength;\n return this._cubicM * x * x * x;\n }\n /** Evaluate derivative of Y with respect to fraction. */\n public fractionToDY(fraction: number): number {\n const x = fraction * this._axisLength;\n return 3.0 * this._cubicM * x * x * this._axisLength;\n }\n /** Evaluate second derivative of Y with respect to fraction. */\n public fractionToDDY(fraction: number): number {\n const x = fraction * this._axisLength;\n return 6.0 * this._cubicM * x * this._axisLength * this._axisLength;\n }\n /** Evaluate third derivative of Y with respect to fraction. */\n public fractionToD3Y(_fraction: number): number {\n return 6.0 * this._cubicM * this._axisLength * this._axisLength * this._axisLength;\n }\n /** Evaluate fraction at x. */\n public xToFraction(x: number): number {\n return x / this._axisLength;\n }\n}\n"]}
|