Location\Bearing\BearingEllipsoidal::calculateFinalBearing PHP Method

calculateFinalBearing() public method

Calculates the final bearing between the two points.
public calculateFinalBearing ( Coordinate $point1, Coordinate $point2 ) : float
$point1 Location\Coordinate
$point2 Location\Coordinate
return float
    public function calculateFinalBearing(Coordinate $point1, Coordinate $point2)
    {
        return $this->inverseVincenty($point1, $point2)['bearing_final'];
    }

Usage Example

 public function testIfCalculateFinalBearingWesternWorksAsExpected()
 {
     $point1 = new Coordinate(0, 0);
     $point2 = new Coordinate(0, -10);
     $bearingCalculator = new BearingEllipsoidal();
     $this->assertEquals(270.0, $bearingCalculator->calculateFinalBearing($point1, $point2));
 }