Distance calculations
PHPCoord can calculate the distance between two Points via the calculateDistance() method.
public function calculateDistance(
Point $to,
): Length
The distance between two
ProjectedPoints is calculated via Pythagoras’ theoremThe distance between two
GeographicPoints or twoGeocentricPoints is calculated via Karney’s formulaThe distance between two
VerticalPoints is calculated as simple difference
Example
$from = GeographicPoint::create(...);
$to = GeographicPoint::create(...);
$distance = $from->calculateDistance($to);