enu static method

UArVector3 enu(
  1. double originLat,
  2. double originLng,
  3. double lat,
  4. double lng, {
  5. double originAltitude = 0,
  6. double altitude = 0,
})

East / north / up offset in metres of a point from an origin.

Implementation

static UArVector3 enu(double originLat, double originLng, double lat, double lng, {double originAltitude = 0, double altitude = 0}) {
  final double north = _rad(lat - originLat) * earthRadius;
  final double east = _rad(lng - originLng) * earthRadius * cos(_rad((lat + originLat) / 2));
  return UArVector3(east, altitude - originAltitude, north);
}