コード例 #1
0
ファイル: LatLongTest.php プロジェクト: markbaker/phpgeodetic
 public function testGetInitialBearing()
 {
     $latLongObject = new LatLong($this->_xyz);
     $destinationObject = new LatLong($this->_zyx);
     $bearing = $latLongObject->getInitialBearing($destinationObject);
     $this->assertTrue(is_object($bearing));
     $this->assertTrue(is_a($bearing, 'Geodetic\\Angle'));
 }
コード例 #2
0
ファイル: LatLong.php プロジェクト: markbaker/phpgeodetic
 /**
  * Get the final bearing for a great circle route between two Latitude/Longitude objects
  *
  * @param     LatLong    $endPoint    The destination point
  * @return    Angle      The final bearing when $endPoint is reached
  * @throws    Exception
  */
 public function getFinalBearing(LatLong $endPoint)
 {
     $initialBearing = $endPoint->getInitialBearing($this);
     $finalBearing = $initialBearing->getValue() + 180 % 360;
     return new Angle($finalBearing);
 }