NavigationMathUtils class
Properties
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
toString()
→ String
-
A string representation of this object.
inherited
Static Methods
-
catmullRom(LatLng p0, LatLng p1, LatLng p2, LatLng p3, double t)
→ LatLng
-
E3: Catmull-Rom Spline
-
computeAdaptiveAccuracy(double speedMps)
→ double
-
D+4: Speed-adaptive GPS accuracy threshold.
Low speed → stricter (20m), high speed → more lenient (50m).
-
computeBearing(LatLng start, LatLng end)
→ double
-
-
computeConfidence(double offRouteDistance)
→ double
-
E5: Sigmoid Confidence
-
computeDestination(LatLng start, double bearingDeg, double distanceMeters)
→ LatLng
-
Computes a destination point given a start point, bearing (degrees), and distance (meters).
Uses the Haversine forward formula.
-
crossTrackError(LatLng point, LatLng segA, LatLng segB)
→ double
-
E2: Cross-Track Error (XTE)
-
easeInOutCubic(double t)
→ double
-
E4: Easing Functions
-
easeOutQuad(double t)
→ double
-
-
haversineDistance(LatLng pos1, LatLng pos2)
→ double
-
-
interpolatePosition(LatLng p1, LatLng p2, double fraction)
→ LatLng
-
-
nearestPointOnSegment(LatLng p, LatLng a, LatLng b)
→ LatLng
-
Calculates the nearest point on a line segment
a, b to a target point p.
(Snap-to-road logic)
-
pointToLineDistanceM(LatLng p, LatLng a, LatLng b)
→ double
-
Calculates the perpendicular distance in meters from point
p to line segment a, b.
-
segmentAwareSnap(LatLng gpsPos, List<LatLng> geometry, {double? userBearing, int startIndex = 0})
→ Map<String, dynamic>
-
D+1: Segment-aware snap that only searches forward from
startIndex
to prevent backward jumps along the route.
-
snapToRoute(LatLng gpsPos, List<LatLng> geometry, {double? userBearing})
→ Map<String, dynamic>
-
-
weightedBearing(double gpsBearing, double roadBearing, double confidence)
→ double
-
E6: Weighted Bearing