11 #define M_PI 3.14159265358979323846
68 longdiff = fabs(long1 - long2);
70 longdiff =
TWO_PI - longdiff;
72 sino = sqrt(sin(fabs(lat1 - lat2) / 2.) * sin(fabs(lat1 - lat2) / 2.) +
73 cos(lat1) * cos(lat2) * sin(longdiff / 2.) * sin(longdiff / 2.));
static double geo_distance_internal(Point *pt1, Point *pt2)
static double degtorad(double degrees)
static const double EARTH_RADIUS
static const double TWO_PI
Datum geo_distance(PG_FUNCTION_ARGS)
PG_FUNCTION_INFO_V1(geo_distance)
Datum degrees(PG_FUNCTION_ARGS)
#define PG_RETURN_FLOAT8(x)
#define PG_GETARG_POINT_P(n)