Where the circ_center_spherical() function fails, we need a fall-back.
The failures happen in short arcs, where the spherical distance between two points is practically the same as the straight-line distance, so our fallback will be to use the straight-line between the two to calculate the new projected center. For proportions far from 0.5 this will be increasingly more incorrect.
Definition at line 191 of file lwgeodetic_tree.c.
192{
195 double proportion = offset/
distance;
196
197 LWDEBUG(4,
"calculating cartesian center");
198
201
202
203 p1p2.
x = p2.
x - p1.
x;
204 p1p2.
y = p2.
y - p1.
y;
205 p1p2.
z = p2.
z - p1.
z;
206
207
208 p1p2.
x *= proportion;
209 p1p2.
y *= proportion;
210 p1p2.
z *= proportion;
211
212
213 pc.
x = p1.
x + p1p2.
x;
214 pc.
y = p1.
y + p1p2.
y;
215 pc.
z = p1.
z + p1p2.
z;
217
218
220
222}
void normalize(POINT3D *p)
Normalize to a unit vector.
void cart2geog(const POINT3D *p, GEOGRAPHIC_POINT *g)
Convert cartesian coordinates on unit sphere to spherical coordinates.
void geog2cart(const GEOGRAPHIC_POINT *g, POINT3D *p)
Convert spherical coordinates to cartesian coordinates on unit sphere.
#define LWDEBUG(level, msg)
static double distance(double x1, double y1, double x2, double y2)
References cart2geog(), distance(), geog2cart(), LW_SUCCESS, LWDEBUG, normalize(), POINT3D::x, POINT3D::y, and POINT3D::z.
Referenced by circ_node_internal_new().