10 #if !defined(GEOGRAPHICLIB_POLYGONAREA_HPP)
11 #define GEOGRAPHICLIB_POLYGONAREA_HPP 1
96 template <
class GeodType = Geodesic>
107 real _lat0, _lon0, _lat1, _lon1;
108 static int transit(real lon1, real lon2) {
118 lon1 <= 0 && lon2 > 0 && lon12 > 0 ? 1 :
119 (lon2 <= 0 && lon1 > 0 && lon12 < 0 ? -1 : 0);
124 static int transitdirect(real lon1, real lon2) {
127 using std::remainder;
128 lon1 = remainder(lon1, real(720));
129 lon2 = remainder(lon2, real(720));
130 return ( (lon2 <= 0 && lon2 > -360 ? 1 : 0) -
131 (lon1 <= 0 && lon1 > -360 ? 1 : 0) );
134 void Remainder(real& a)
const {
135 using std::remainder;
136 a = remainder(a, _area0);
138 template <
typename T>
139 void AreaReduce(T& area,
int crossings,
bool reverse,
bool sign)
const;
151 , _area0(_earth.EllipsoidArea())
152 , _polyline(polyline)
153 , _mask(GeodType::LATITUDE | GeodType::LONGITUDE | GeodType::DISTANCE |
154 (_polyline ? GeodType::NONE :
155 GeodType::AREA | GeodType::LONG_UNROLL))
166 _lat0 = _lon0 = _lat1 = _lon1 =
Math::NaN();
206 unsigned Compute(
bool reverse,
bool sign,
289 { lat = _lat1; lon = _lon1; }
Header for GeographicLib::Accumulator class.
#define GEOGRAPHICLIB_DEPRECATED(msg)
GeographicLib::Math::real real
Header for GeographicLib::GeodesicExact class.
Header for GeographicLib::Geodesic class.
Header for GeographicLib::Rhumb and GeographicLib::RhumbLine classes.
Accumulator & remainder(T y)
Mathematical functions needed by GeographicLib.
static T AngNormalize(T x)
static T AngDiff(T x, T y, T &e)
PolygonAreaT(const GeodType &earth, bool polyline=false)
void AddPoint(real lat, real lon)
unsigned Compute(bool reverse, bool sign, real &perimeter, real &area) const
PolygonAreaT< Rhumb > PolygonAreaRhumb
void CurrentPoint(real &lat, real &lon) const
Math::real Flattening() const
Math::real EquatorialRadius() const
PolygonAreaT< Geodesic > PolygonArea
unsigned TestPoint(real lat, real lon, bool reverse, bool sign, real &perimeter, real &area) const
void AddEdge(real azi, real s)
Math::real MajorRadius() const
PolygonAreaT< GeodesicExact > PolygonAreaExact
unsigned TestEdge(real azi, real s, bool reverse, bool sign, real &perimeter, real &area) const
Namespace for GeographicLib.