destinationPoint2D method
Returns a destination point located at the given distance
from this to
the direction of bearing
calculated in a cartesian 2D plane.
The bearing is measured in degrees (0°..360°) with 0° pointing to the positive Y-axis ("north"), 90° to the positive X-axis ("east"), 180° to the negative Y-axis ("south"), and 270° to the negative X-axis ("west").
To calculate destination points along the surface of the earth, see
the spherical
extension for Geographic
positions implemented by the
package:geobase/geodesy.dart
library.
Examples:
final p1 = Position.create(x: 0.119, y: 52.205);
// destination point (x: 2.351, y: 48.857)
final pInt = p1.destinationPoint2D(bearing: 146.31, distance: 4.024);
Implementation
Position destinationPoint2D({
required double distance,
required double bearing,
}) =>
cartesianDestinationPoint2D(
this,
distance: distance,
bearing: bearing,
to: conforming.position,
);