src/Vertex/Vertex.php
public function initialBearing()
    {
        Ellipsoid::checkCoordinatesEllipsoid($this->from, $this->to);

        $latA = deg2rad($this->from->getLatitude());
        $latB = deg2rad($this->to->getLatitude());
        $dLng = deg2rad($this->to->getLongitude() - $this->from->getLongitude());

        $y = sin($dLng) * cos($latB);
        $x = cos($latA) * sin($latB) - sin($latA) * cos($latB) * cos($dLng);

        return (float) (rad2deg(atan2($y, $x)) + 360) % 360;
    }
public function initialBearing()
    {
        Ellipsoid::checkCoordinatesEllipsoid($this->from, $this->to);

        $latA = deg2rad($this->from->getLatitude());
        $latB = deg2rad($this->to->getLatitude());
        $dLng = deg2rad($this->to->getLongitude() - $this->from->getLongitude());

        $y = sin($dLng) * cos($latB);
        $x = cos($latA) * sin($latB) - sin($latA) * cos($latB) * cos($dLng);

        return (float) (rad2deg(atan2($y, $x)) + 360) % 360;
    }
public function initialBearing ( ) { Ellipsoid :: checkCoordinatesEllipsoid ( $ this -> from , $ this -> to ) ; $ latA = deg2rad ( $ this -> from -> getLatitude ( ) ) ; $ latB = deg2rad ( $ this -> to -> getLatitude ( ) ) ; $ dLng = deg2rad ( $ this -> to -> getLongitude ( ) - $ this -> from -> getLongitude ( ) ) ; $ y = sin ( $ dLng ) * cos ( $ latB ) ; $ x = cos ( $ latA ) * sin ( $ latB ) - sin ( $ latA ) * cos ( $ latB ) * cos ( $ dLng ) ; return ( float ) ( rad2deg ( atan2 ( $ y , $ x ) ) + 360 ) % 360 ; }
Returns the initial bearing from the origin coordinate
to the destination coordinate in degrees.

@return float The initial bearing in degrees
Returns the initial bearing from the origin coordinate to the destination coordinate in degrees .