Calculates the distance between two Coordinate objects
public distanceFrom ( |
||
$coordinate | ||
$unit | ValueObjects\Geography\DistanceUnit | |
$formula | ValueObjects\Geography\DistanceFormula | |
리턴 | ValueObjects\Number\Real |
public function testDistanceFrom() { $newYork = new Coordinate(new Latitude(41.145556), new Longitude(-73.995)); $distance = $this->coordinate->distanceFrom($newYork); $this->assertSame(7609068.4225575, $distance->toNative()); }