10 #if !defined(GEOGRAPHICLIB_POLYGONAREA_HPP) 11 #define GEOGRAPHICLIB_POLYGONAREA_HPP 1 63 template <
class GeodType = Geodesic>
74 real _lat0, _lon0, _lat1, _lon1;
75 static inline int transit(real lon1, real lon2) {
83 lon1 < 0 && lon2 >= 0 && lon12 > 0 ? 1 :
84 (lon2 < 0 && lon1 >= 0 && lon12 < 0 ? -1 : 0);
89 static inline int transitdirect(real lon1, real lon2) {
95 lon1 = fmod(lon1, real(720)); lon2 = fmod(lon2, real(720));
96 return ( ((lon2 >= 0 && lon2 < 360) || lon2 < -360 ? 0 : 1) -
97 ((lon1 >= 0 && lon1 < 360) || lon1 < -360 ? 0 : 1) );
110 , _area0(_earth.EllipsoidArea())
111 , _polyline(polyline)
112 , _mask(GeodType::LATITUDE | GeodType::LONGITUDE | GeodType::DISTANCE |
113 (_polyline ? GeodType::NONE :
114 GeodType::AREA | GeodType::LONG_UNROLL))
125 _lat0 = _lon0 = _lat1 = _lon1 =
Math::NaN();
149 void AddEdge(real azi, real s);
165 unsigned Compute(
bool reverse,
bool sign,
166 real& perimeter, real& area)
const;
194 unsigned TestPoint(real lat, real lon,
bool reverse,
bool sign,
195 real& perimeter, real& area)
const;
222 unsigned TestEdge(real azi, real s,
bool reverse,
bool sign,
223 real& perimeter, real& area)
const;
230 unsigned TestCompute(real lat, real lon,
bool reverse,
bool sign,
231 real& perimeter, real& area)
const {
232 return TestPoint(lat, lon, reverse, sign, perimeter, area);
262 { lat = _lat1; lon = _lon1; }
292 #endif // GEOGRAPHICLIB_POLYGONAREA_HPP static T AngNormalize(T x)
Math::real Flattening() const
unsigned TestEdge(real azi, real s, bool reverse, bool sign, real &perimeter, real &area) const
PolygonAreaT< Rhumb > PolygonAreaRhumb
Header for GeographicLib::Rhumb and GeographicLib::RhumbLine classes.
void AddEdge(real azi, real s)
PolygonAreaT(const GeodType &earth, bool polyline=false)
Header for GeographicLib::Geodesic class.
PolygonAreaT< GeodesicExact > PolygonAreaExact
Math::real MajorRadius() const
Header for GeographicLib::Accumulator class.
Namespace for GeographicLib.
unsigned TestPoint(real lat, real lon, bool reverse, bool sign, real &perimeter, real &area) const
unsigned Compute(bool reverse, bool sign, real &perimeter, real &area) const
static T AngDiff(T x, T y)
void AddPoint(real lat, real lon)
void CurrentPoint(real &lat, real &lon) const
Header for GeographicLib::GeodesicExact class.
PolygonAreaT< Geodesic > PolygonArea