-
-
Notifications
You must be signed in to change notification settings - Fork 235
/
BearingInterface.php
47 lines (42 loc) · 1.18 KB
/
BearingInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
declare(strict_types=1);
namespace Location\Bearing;
use Location\Coordinate;
/**
* Interface BearingInterface
*
* @author Marcus Jaschen <mjaschen@gmail.com>
*/
interface BearingInterface
{
/**
* This method calculates the initial bearing between the
* two points.
*
* @param Coordinate $point1
* @param Coordinate $point2
*
* @return float Bearing Angle
*/
public function calculateBearing(Coordinate $point1, Coordinate $point2): float;
/**
* Calculates the final bearing between the two points.
*
* @param Coordinate $point1
* @param Coordinate $point2
*
* @return float
*/
public function calculateFinalBearing(Coordinate $point1, Coordinate $point2): float;
/**
* Calculates a destination point for the given point, bearing angle,
* and distance.
*
* @param Coordinate $point
* @param float $bearing the bearing angle between 0 and 360 degrees
* @param float $distance the distance to the destination point in meters
*
* @return Coordinate
*/
public function calculateDestination(Coordinate $point, float $bearing, float $distance): Coordinate;
}