Computes the area on the spheroid of a box bounded by meridians and parallels.
The box is defined by two points, the South West corner and the North East corner. Formula based on Bagratuni 1967.
- Parameters
-
southWestCorner | - lower left corner of bounding box. |
northEastCorner | - upper right corner of bounding box. |
- Returns
- area in square meters.
Definition at line 442 of file lwspheroid.c.
444 double z0 = (northEastCorner->
lon - southWestCorner->
lon) *
POW2(spheroid->
b) / 2.0;
445 double e = sqrt(spheroid->
e_sq);
446 double sinPhi1 = sin(southWestCorner->
lat);
447 double sinPhi2 = sin(northEastCorner->
lat);
448 double t1p1 = sinPhi1 / (1.0 - spheroid->
e_sq * sinPhi1 * sinPhi1);
449 double t1p2 = sinPhi2 / (1.0 - spheroid->
e_sq * sinPhi2 * sinPhi2);
450 double oneOver2e = 1.0 / (2.0 * e);
451 double t2p1 = oneOver2e * log((1.0 + e * sinPhi1) / (1.0 - e * sinPhi1));
452 double t2p2 = oneOver2e * log((1.0 + e * sinPhi2) / (1.0 - e * sinPhi2));
453 return z0 * (t1p2 + t2p2) - z0 * (t1p1 + t2p1);
References SPHEROID::b, SPHEROID::e_sq, GEOGRAPHIC_POINT::lat, GEOGRAPHIC_POINT::lon, and POW2.
Referenced by spheroid_striparea().