getDistance() 공개 메소드

public getDistance ( Coordinate $point1, Coordinate $point2 ) : float
$point1 Location\Coordinate
$point2 Location\Coordinate
리턴 float distance between the two coordinates in meters
예제 #1
0
 /**
  * Calculates the length of the line (distance between the two
  * coordinates).
  *
  * @param DistanceInterface $calculator instance of distance calculation class
  *
  * @return float
  */
 public function getLength(DistanceInterface $calculator)
 {
     return $calculator->getDistance($this->point1, $this->point2);
 }
예제 #2
0
 /**
  * Calculates the distance between the given coordinate
  * and this coordinate.
  *
  * @param Coordinate        $coordinate
  * @param DistanceInterface $calculator instance of distance calculation class
  *
  * @return float
  */
 public function getDistance(Coordinate $coordinate, DistanceInterface $calculator)
 {
     return $calculator->getDistance($this, $coordinate);
 }