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 192 of file lwgeodetic_tree.c.
193{
196 double proportion = offset/
distance;
197
198 LWDEBUG(4,
"calculating cartesian center");
199
202
203
204 p1p2.
x = p2.
x - p1.
x;
205 p1p2.
y = p2.
y - p1.
y;
206 p1p2.
z = p2.
z - p1.
z;
207
208
209 p1p2.
x *= proportion;
210 p1p2.
y *= proportion;
211 p1p2.
z *= proportion;
212
213
214 pc.
x = p1.
x + p1p2.
x;
215 pc.
y = p1.
y + p1p2.
y;
216 pc.
z = p1.
z + p1p2.
z;
218
219
221
223}
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().