public function flat()
{
Ellipsoid::checkCoordinatesEllipsoid($this->from, $this->to);
$latA = deg2rad($this->from->getLatitude());
$lngA = deg2rad($this->from->getLongitude());
$latB = deg2rad($this->to->getLatitude());
$lngB = deg2rad($this->to->getLongitude());
$x = ($lngB - $lngA) * cos(($latA + $latB) / 2);
$y = $latB - $latA;
$d = sqrt($x * $x + $y * $y) * $this->from->getEllipsoid()->getA();
return $this->convertToUserUnit($d);
}