php guru, convert function puzzle
I need this stored function converted into a regular php function, i get a bit confused on it
SET x = sin(lat1 * pi/180) * sin(lat2 * pi/180) + cos(lat1 *pi/180) * cos(lat2 * pi/180) * cos(abs((lon2 * pi/180) - (lon1 * pi/180)));
SET x = atan((sqrt(1- power(x,2))) /x);
RETURN (1.852 * 60.0 * ((x/pi)*180)) / 1.609344;
so something like function _getDistance($lat1, $lon1, $lat2, $lon2) {
..fill in here with answer please
Thanks in advance.
|