Returns the angular width (longitudinal span) of the box in radians.
Definition at line 215 of file lwgeodetic.c.
References pixval::x, POINT3D::x, GBOX::xmin, pixval::y, POINT3D::y, GBOX::ymin, and POINT3D::z.
Referenced by geography_bestsrid(), and test_gbox_utils().
225 memcpy(d, &(gbox->
xmin), 6*
sizeof(
double));
228 pt[0].
x = gbox->
xmin;
229 pt[0].
y = gbox->
ymin;
230 magnitude = sqrt(pt[0].
x*pt[0].
x + pt[0].
y*pt[0].
y);
231 pt[0].
x /= magnitude;
232 pt[0].
y /= magnitude;
236 for ( j = 0; j < 2; j++ )
238 maxangle = -1 * FLT_MAX;
239 for ( i = 0; i < 4; i++ )
241 double angle, dotprod;
245 pt_n.
y = d[2 + (i % 2)];
246 magnitude = sqrt(pt_n.
x*pt_n.
x + pt_n.
y*pt_n.
y);
251 dotprod = pt_n.
x*pt[j].
x + pt_n.
y*pt[j].
y;
252 angle = acos(dotprod > 1.0 ? 1.0 : dotprod);
253 if ( angle > maxangle )