10 #if !defined(GEOGRAPHICLIB_POLYGONAREA_HPP) 11 #define GEOGRAPHICLIB_POLYGONAREA_HPP 1 68 template <
class GeodType = Geodesic>
79 real _lat0, _lon0, _lat1, _lon1;
80 static int transit(real lon1, real lon2) {
90 lon1 <= 0 && lon2 > 0 && lon12 > 0 ? 1 :
91 (lon2 <= 0 && lon1 > 0 && lon12 < 0 ? -1 : 0);
96 static int transitdirect(real lon1, real lon2) {
101 return ( (lon2 <= 0 && lon2 > -360 ? 1 : 0) -
102 (lon1 <= 0 && lon1 > -360 ? 1 : 0) );
106 template <
typename T>
107 void AreaReduce(T& area,
int crossings,
bool reverse,
bool sign)
const;
119 , _area0(_earth.EllipsoidArea())
120 , _polyline(polyline)
121 , _mask(GeodType::LATITUDE | GeodType::LONGITUDE | GeodType::DISTANCE |
122 (_polyline ? GeodType::NONE :
123 GeodType::AREA | GeodType::LONG_UNROLL))
134 _lat0 = _lon0 = _lat1 = _lon1 =
Math::NaN();
174 unsigned Compute(
bool reverse,
bool sign,
257 { lat = _lat1; lon = _lon1; }
293 #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
Math::real EquatorialRadius() const
GeographicLib::Math::real real
PolygonAreaT< Rhumb > PolygonAreaRhumb
Accumulator & remainder(T y)
static T AngDiff(T x, T y, T &e)
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
void AddPoint(real lat, real lon)
void CurrentPoint(real &lat, real &lon) const
Header for GeographicLib::GeodesicExact class.
PolygonAreaT< Geodesic > PolygonArea
static T remainder(T x, T y)