1 | <?php |
||
23 | class BearingSpherical implements BearingInterface |
||
24 | { |
||
25 | /** |
||
26 | * Earth radius in meters. |
||
27 | */ |
||
28 | const EARTH_RADIUS = 6371009; |
||
29 | |||
30 | /** |
||
31 | * This method calculates the initial bearing between the |
||
32 | * two points. |
||
33 | * |
||
34 | * @param \Location\Coordinate $point1 |
||
35 | * @param \Location\Coordinate $point2 |
||
36 | * |
||
37 | * @return float Bearing Angle |
||
38 | */ |
||
39 | public function calculateBearing(Coordinate $point1, Coordinate $point2) |
||
57 | |||
58 | /** |
||
59 | * Calculates the final bearing between the two points. |
||
60 | * |
||
61 | * @param \Location\Coordinate $point1 |
||
62 | * @param \Location\Coordinate $point2 |
||
63 | * |
||
64 | * @return float |
||
65 | */ |
||
66 | public function calculateFinalBearing(Coordinate $point1, Coordinate $point2) |
||
72 | |||
73 | /** |
||
74 | * Calculates a destination point for the given point, bearing angle, |
||
75 | * and distance. |
||
76 | * |
||
77 | * @param \Location\Coordinate $point |
||
78 | * @param float $bearing the bearing angle between 0 and 360 degrees |
||
79 | * @param float $distance the distance to the destination point in meters |
||
80 | * |
||
81 | * @return Coordinate |
||
82 | */ |
||
83 | public function calculateDestination(Coordinate $point, $bearing, $distance) |
||
95 | } |
||
96 |