NavigationMathUtils class

Constructors

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

Operators

operator ==(Object other) → bool
The equality operator.
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 (Google Maps standard) Midpoint of 9.0m ensures standard lane variations (0-6m) remain snapped (>80%), while lateral deviations towards parallel frontage roads (>10m) release snapping so the vehicle marker accurately follows the actual frontage road.
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.
responsiveIconScale() → double
Computes a responsive scale factor based on the device's shortest screen dimension. Reference device: ~390pt width (iPhone 14 / standard phone) → factor 1.0.
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

Constants

earthRadiusKm → const double