SegmentDirection class abstract

Determines how the longitudinal delta is interpreted when computing the distance between two points on a geodesic.

Built-in instances are available as static constants. Custom directions can be created by extending this class and overriding effectiveDLng.

Resulted as part of a discussion in flutter_map.

Constructors

SegmentDirection()
const

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

effectiveDLng(LatLng p1, LatLng p2) double
Returns the effective longitudinal delta in radians that the distance formula should use.
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

normaliseEast(double radians) double
Normalises radians to [0, 2*pi), i.e. a strictly eastward range.
normaliseShort(double radians) double
Normalises radians to (−pi, pi].
normaliseWest(double radians) double
Normalises radians to (−2*pi, 0], i.e. a strictly westward range.

Constants

eastward → const _EastwardDirection
Travels eastward (increasing longitude, wrapping at 180°). Returns 0 for coincident longitudes -> distance is 0.
laziest → const _LaziestDirection
Raw p2 − p1 longitude difference. May accidentally take the long arc if the points straddle the antimeridian.
lazy → const _LazyDirection
(p2 − p1) mod (2*pi) longitude difference. May accidentally take the long arc if the points straddle the antimeridian. May also be called "Greenwich" or similar. This is the same as the 0.x default behaviour.
longestPath → const _LongestPathDirection
Always takes the longest angular path (> 180°). Complementary to shortestPath. Direction (east/west) follows whichever way shortestPath would go, but on the opposite arc.
shortestPath → const _ShortestPathDirection
Always takes the shortest angular path. May still cross the antimeridian.
strictlyEastward → const _StrictlyEastwardDirection
Like eastward, but travels a full loop when longitudes coincide.
strictlyWestward → const _StrictlyWestwardDirection
Like westward, but travels a full loop when longitudes coincide.
westward → const _WestwardDirection
Travels westward (decreasing longitude, wrapping at −180°). Returns 0 for coincident longitudes -> distance is 0.