Definition at line 3228 of file lwgeodetic.c.
References SPHEROID::a, SPHEROID::b, POINTARRAY::flags, FLAGS_GET_Z, geographic_point_init(), getPoint4d_p(), LW_FALSE, POINTARRAY::npoints, SPHEROID::radius, sphere_distance(), spheroid_distance(), POINT4D::x, POINT4D::y, and POINT4D::z.
Referenced by lwgeom_length_spheroid().
3231 double za = 0.0, zb = 0.0;
3235 double length = 0.0;
3236 double seglength = 0.0;
3239 if ( ! pa || pa->
npoints < 2 )
3252 for ( i = 1; i < pa->
npoints; i++ )
3269 seglength = sqrt( (zb-za)*(zb-za) + seglength*seglength );
3272 length += seglength;
double sphere_distance(const GEOGRAPHIC_POINT *s, const GEOGRAPHIC_POINT *e)
Given two points on a unit sphere, calculate their distance apart in radians.
Point in spherical coordinates on the world.
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
void geographic_point_init(double lon, double lat, GEOGRAPHIC_POINT *g)
Initialize a geographic point.
double spheroid_distance(const GEOGRAPHIC_POINT *a, const GEOGRAPHIC_POINT *b, const SPHEROID *spheroid)
Computes the shortest distance along the surface of the spheroid between two points.
int getPoint4d_p(const POINTARRAY *pa, int n, POINT4D *point)