1640 if (d <= max_seg_length)
1655 mid.
x = (p1->
x + p2->
x) / 2.0;
1656 mid.
y = (p1->
y + p2->
y) / 2.0;
1657 mid.
z = (p1->
z + p2->
z) / 2.0;
1665 midv.
z = (v1->
z + v2->
z) / 2.0;
1666 midv.
m = (v1->
m + v2->
m) / 2.0;
void normalize(POINT3D *p)
Normalize to a unit vector.
void cart2geog(const POINT3D *p, GEOGRAPHIC_POINT *g)
Convert cartesion coordinates on unit sphere to spherical coordinates.
Point in spherical coordinates on the world.
int ptarray_append_point(POINTARRAY *pa, const POINT4D *pt, int allow_duplicates)
Append a point to the end of an existing POINTARRAY If allow_duplicate is LW_FALSE, then a duplicate point will not be added.
static int ptarray_segmentize_sphere_edge_recursive(const POINT3D *p1, const POINT3D *p2, const POINT4D *v1, const POINT4D *v2, double d, double max_seg_length, POINTARRAY *pa)