offset method
Returns a destination point based on the given distance and bearing
Given a from
(start) point, initial bearing
, and distance,
this will calculate the destination point and
final bearing travelling along a (shortest distance) great circle arc.
final Distance distance = const Distance();
final num distanceInMeter = (earthRadius * math.PI / 4).round();
final p1 = new LatLng(0.0, 0.0);
final p2 = distance.offset(p1, distanceInMeter, 180);
Bearing: Left - 270°, right - 90°, up - 0°, down - 180°
Implementation
@override
LatLng offset(
final LatLng from, final num distanceInMeter, final num bearing) =>
_calculator.offset(from, distanceInMeter.toDouble(), bearing.toDouble());