PHP Class Location\Bearing\BearingSpherical

Author: Marcus Jaschen ([email protected])
Inheritance: implements Location\Bearing\BearingInterface
Show file Open project: mjaschen/phpgeo Class Usage Examples

Public Methods

Method Description
calculateBearing ( Coordinate $point1, Coordinate $point2 ) : float This method calculates the initial bearing between the two points.
calculateDestination ( Coordinate $point, float $bearing, float $distance ) : Coordinate Calculates a destination point for the given point, bearing angle, and distance.
calculateFinalBearing ( Coordinate $point1, Coordinate $point2 ) : float Calculates the final bearing between the two points.

Method Details

calculateBearing() public method

This method calculates the initial bearing between the two points.
public calculateBearing ( Coordinate $point1, Coordinate $point2 ) : float
$point1 Location\Coordinate
$point2 Location\Coordinate
return float Bearing Angle

calculateDestination() public method

Calculates a destination point for the given point, bearing angle, and distance.
public calculateDestination ( Coordinate $point, float $bearing, float $distance ) : Coordinate
$point Location\Coordinate
$bearing float the bearing angle between 0 and 360 degrees
$distance float the distance to the destination point in meters
return Location\Coordinate

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