public function distance($latA, $lonA, $latB, $lonB)
	{
		$earthR = 6371000.;
		$x = cos($latA * $this->PI / 180.) * cos($latB * $this->PI / 180.) * cos(($lonA - $lonB) * $this->PI / 180);
		$y = sin($latA * $this->PI / 180.) * sin($latB * $this->PI / 180.);
		$s = $x + $y;
		if ($s > 1) $s = 1;
		if ($s < -1) $s = -1;
		$alpha = acos($s);
		$distance = $alpha * $earthR;
		return $distance;
		/*
		$earthRadius = 6367000; //approximate radius of earth in meters  

		$latA = ($latA * $this->PI ) / 180;  
		$lonA = ($lonA * $this->PI ) / 180;  

		$latA = ($latA * $this->PI ) / 180;  
		$lonB = ($lonB * $this->PI ) / 180;  


		$calcLongitude = $lonB - $lonA;  
		$calcLatitude = $latA - $latA;  
		$stepOne = pow(sin($calcLatitude / 2), 2) + cos($latA) * cos($latA) * pow(sin($calcLongitude / 2), 2);    
		$stepTwo = 2 * asin(min(1, sqrt($stepOne)));  
		$calculatedDistance = $earthRadius * $stepTwo;  

		return round($calculatedDistance);  
		 */
	}