Definition at line 1344 of file lwgeodetic.c.
1346 int steps = 1000000;
1355 LWDEBUG(4,
"edge is zero length. returning");
1367 LWDEBUG(4,
"edge is antipodal. setting to maximum size box, and returning");
1377 dx = (end.
x - start.
x)/steps;
1378 dy = (end.
y - start.
y)/steps;
1379 dz = (end.
z - start.
z)/steps;
1384 for ( i = 0; i < steps; i++ )
int gbox_merge_point3d(const POINT3D *p, GBOX *gbox)
Update the GBOX to be large enough to include itself and the new point.
int gbox_init_point3d(const POINT3D *p, GBOX *gbox)
Initialize a GBOX using the values of the point.
void normalize(POINT3D *p)
Normalize to a unit vector.
double sphere_distance(const GEOGRAPHIC_POINT *s, const GEOGRAPHIC_POINT *e)
Given two points on a unit sphere, calculate their distance apart in radians.
void geog2cart(const GEOGRAPHIC_POINT *g, POINT3D *p)
Convert spherical coordinates to cartesian coordinates on unit sphere.
Datum distance(PG_FUNCTION_ARGS)
#define LWDEBUG(level, msg)
References distance(), GEOGRAPHIC_EDGE::end, FP_EQUALS, FP_IS_ZERO, gbox_init_point3d(), gbox_merge_point3d(), geog2cart(), LW_SUCCESS, LWDEBUG, normalize(), sphere_distance(), GEOGRAPHIC_EDGE::start, POINT3D::x, GBOX::xmax, GBOX::xmin, POINT3D::y, GBOX::ymax, GBOX::ymin, POINT3D::z, GBOX::zmax, and GBOX::zmin.