Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DELIMITER //
- DROP FUNCTION IF EXISTS GetDistance;
- CREATE FUNCTION GetDistance(currentLatitude FLOAT, currentLongitude FLOAT, latitude FLOAT, longitude FLOAT)
- RETURNS FLOAT
- DETERMINISTIC
- BEGIN
- RETURN ((ACOS(SIN(currentLatitude * PI() / 180) * SIN(latitude * PI() / 180)
- + COS(currentLatitude * PI() / 180) * COS(latitude * PI() / 180) *
- COS((currentLongitude-longitude) * PI() / 180)) * 180 / PI()) * 60 * 1.1515);
- RETURN distance;
- END //
- DELIMITER ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement