Calculates a destination point for the given point, bearing angle,
and distance.
public calculateDestination ( |
||
$point | ||
$bearing | float | the bearing angle between 0 and 360 degrees |
$distance | float | the distance to the destination point in meters |
Результат |
public function testIfCalculateDestinationSouthernWorksAsExpected() { $bearingCalculator = new BearingSpherical(); $point = new Coordinate(0, 0); $destination = $bearingCalculator->calculateDestination($point, 180, 111195.0837); // 1 degree in longitude at the equator: // 2πr/360 = 40030230.1407 meters/360 = 111195.0837 meters $this->assertEquals(-1.0, $destination->getLat(), '', 0.0001); $this->assertEquals(0.0, $destination->getLng(), '', 0.0001); }