12 namespace GeographicLib {
23 _earth.GenInverse(_lat1, _lon1, lat, lon, _mask, s12, t, t, t, t, t, S12);
27 _crossings += transit(_lon1, lon);
29 _lat1 = lat; _lon1 = lon;
36 real lat, lon, S12, t;
37 _earth.GenDirect(_lat1, _lon1, azi,
false, s, _mask,
38 lat, lon, t, t, t, t, t, S12);
42 _crossings += transit(_lon1, lon);
44 _lat1 = lat; _lon1 = lon;
50 real& perimeter, real& area)
const throw() {
59 perimeter = _perimetersum();
62 _earth.GenInverse(_lat1, _lon1, _lat0, _lon0, _mask,
63 s12, t, t, t, t, t, S12);
64 perimeter = _perimetersum(s12);
67 int crossings = _crossings + transit(_lon1, _lon0);
69 tempsum += (tempsum < 0 ? 1 : -1) * _area0/2;
76 if (tempsum > _area0/2)
78 else if (tempsum <= -_area0/2)
81 if (tempsum >= _area0)
91 real& perimeter, real& area)
const throw() {
98 perimeter = _perimetersum();
99 real tempsum = _polyline ? 0 : _areasum();
100 int crossings = _crossings;
101 unsigned num = _num + 1;
102 for (
int i = 0; i < (_polyline ? 1 : 2); ++i) {
104 _earth.GenInverse(i == 0 ? _lat1 : lat, i == 0 ? _lon1 : lon,
105 i != 0 ? _lat0 : lat, i != 0 ? _lon0 : lon,
106 _mask, s12, t, t, t, t, t, S12);
110 crossings += transit(i == 0 ? _lon1 : lon,
111 i != 0 ? _lon0 : lon);
119 tempsum += (tempsum < 0 ? 1 : -1) * _area0/2;
126 if (tempsum > _area0/2)
128 else if (tempsum <= -_area0/2)
131 if (tempsum >= _area0)
133 else if (tempsum < 0)
141 real& perimeter, real& area)
const throw() {
143 perimeter = Math::NaN<real>();
145 area = Math::NaN<real>();
148 unsigned num = _num + 1;
149 perimeter = _perimetersum() + s;
153 real tempsum = _areasum();
154 int crossings = _crossings;
156 real lat, lon, s12, S12, t;
157 _earth.GenDirect(_lat1, _lon1, azi,
false, s, _mask,
158 lat, lon, t, t, t, t, t, S12);
160 crossings += transit(_lon1, lon);
161 _earth.GenInverse(lat, lon, _lat0, _lon0, _mask, s12, t, t, t, t, t, S12);
164 crossings += transit(lon, _lon0);
168 tempsum += (tempsum < 0 ? 1 : -1) * _area0/2;
175 if (tempsum > _area0/2)
177 else if (tempsum <= -_area0/2)
180 if (tempsum >= _area0)
182 else if (tempsum < 0)
static T AngNormalize(T x)
void AddEdge(real azi, real s)
unsigned TestPoint(real lat, real lon, bool reverse, bool sign, real &perimeter, real &area) const
unsigned TestEdge(real azi, real s, bool reverse, bool sign, real &perimeter, real &area) const
Header for GeographicLib::PolygonArea class.
unsigned Compute(bool reverse, bool sign, real &perimeter, real &area) const
void AddPoint(real lat, real lon)