getLength() public method

Calculates the length of the line (distance between the two coordinates).
public getLength ( Location\Distance\DistanceInterface $calculator ) : float
$calculator Location\Distance\DistanceInterface instance of distance calculation class
return float
コード例 #1
0
ファイル: LineTest.php プロジェクト: horizon-institute/xmaps
 public function testCalculateLength()
 {
     $point1 = new Coordinate(52.5, 13.5);
     $point2 = new Coordinate(64.09999999999999, -21.9);
     $line = new Line($point1, $point2);
     $this->assertEquals(2397867.8, $line->getLength(new Vincenty()), '', 0.01);
 }