public function distance(LatLng $to)
	{
		// radius in km, assuming a spherical Earth
		$er = 6366.707;

		$latFrom = deg2rad($this->lat);
		$latTo	 = deg2rad($to->lat);
		$lngFrom = deg2rad($this->lng);
		$lngTo	 = deg2rad($to->lng);

		$x1 = $er * cos($lngFrom) * sin($latFrom);
		$y1 = $er * sin($lngFrom) * sin($latFrom);
		$z1 = $er * cos($latFrom);

		$x2 = $er * cos($lngTo) * sin($latTo);
		$y2 = $er * sin($lngTo) * sin($latTo);
		$z2 = $er * cos($latTo);

		$d = acos(sin($latFrom)*sin($latTo) + cos($latFrom)*cos($latTo)*cos($lngTo-$lngFrom)) * $er;

		return $d;
	}