标签:经纬 pow roo col color fine var cti ret
CREATE DEFINER=`root`@`%` FUNCTION `latlon`(lat1 DOUBLE,lon1 DOUBLE,lat2 DOUBLE,lon2 DOUBLE) RETURNS varchar(200) CHARSET utf8mb4 begin return ROUND( 6378.138 * 2 * ASIN( SQRT( POW( SIN( ( lat1 * PI() / 180 - lat2 * PI() / 180 ) / 2 ), 2 ) + COS(lat1 * PI() / 180) * COS(lat2 * PI() / 180) * POW( SIN( ( lon1 * PI() / 180 - lon2 * PI() / 180 ) / 2 ), 2 ) ) ) * 1000 ); end
标签:经纬 pow roo col color fine var cti ret
原文地址:https://www.cnblogs.com/liuq1991/p/9798801.html