getBearing() публичный Метод

public getBearing ( Location\Bearing\BearingInterface $bearingCalculator ) : float
$bearingCalculator Location\Bearing\BearingInterface
Результат float
Пример #1
0
 /**
  * Calculates the bearing between 2 geometries.
  *
  * @param Geometry $point_a The first point.
  * @param Geometry $point_b The second point.
  * @return float Bearing in degrees.
  */
 public static function bearing($point_a, $point_b)
 {
     return self::apply($point_a, $point_b, function ($coor_a, $coor_b) {
         $line = new Line($coor_a, $coor_b);
         return $line->getBearing(new BearingEllipsoidal());
     });
 }
Пример #2
0
 public function testIfGetBearingReversedWorksAsExpected()
 {
     $point1 = new Coordinate(0, 0);
     $point2 = new Coordinate(0, 10);
     $line = new Line($point2, $point1);
     $bearingCalculator = new BearingEllipsoidal();
     $this->assertEquals(270.0, $line->getBearing($bearingCalculator));
 }