10 #if !defined(GEOGRAPHICLIB_POLYGONAREA_HPP) 11 #define GEOGRAPHICLIB_POLYGONAREA_HPP 1 64 template <
class GeodType = Geodesic>
75 real _lat0, _lon0, _lat1, _lon1;
76 static inline int transit(real lon1, real lon2) {
84 lon1 < 0 && lon2 >= 0 && lon12 > 0 ? 1 :
85 (lon2 < 0 && lon1 >= 0 && lon12 < 0 ? -1 : 0);
90 static inline int transitdirect(real lon1, real lon2) {
97 #if GEOGRAPHICLIB_CXX11_MATH && GEOGRAPHICLIB_PRECISION != 4 99 lon1 = remainder(lon1, real(720)); lon2 = remainder(lon2, real(720));
100 return ( (lon2 >= 0 && lon2 < 360 ? 0 : 1) -
101 (lon1 >= 0 && lon1 < 360 ? 0 : 1) );
104 lon1 = fmod(lon1, real(720)); lon2 = fmod(lon2, real(720));
105 return ( ((lon2 >= 0 && lon2 < 360) || lon2 < -360 ? 0 : 1) -
106 ((lon1 >= 0 && lon1 < 360) || lon1 < -360 ? 0 : 1) );
120 , _area0(_earth.EllipsoidArea())
121 , _polyline(polyline)
122 , _mask(GeodType::LATITUDE | GeodType::LONGITUDE | GeodType::DISTANCE |
123 (_polyline ? GeodType::NONE :
124 GeodType::AREA | GeodType::LONG_UNROLL))
135 _lat0 = _lon0 = _lat1 = _lon1 =
Math::NaN();
157 void AddEdge(real azi, real s);
175 unsigned Compute(
bool reverse,
bool sign,
176 real& perimeter, real& area)
const;
203 unsigned TestPoint(real lat, real lon,
bool reverse,
bool sign,
204 real& perimeter, real& area)
const;
229 unsigned TestEdge(real azi, real s,
bool reverse,
bool sign,
230 real& perimeter, real& area)
const;
258 { lat = _lat1; lon = _lon1; }
288 #endif // GEOGRAPHICLIB_POLYGONAREA_HPP static T AngNormalize(T x)
void CurrentPoint(real &lat, real &lon) const
unsigned TestEdge(real azi, real s, bool reverse, bool sign, real &perimeter, real &area) const
unsigned TestPoint(real lat, real lon, bool reverse, bool sign, real &perimeter, real &area) const
PolygonAreaT< Rhumb > PolygonAreaRhumb
static T AngDiff(T x, T y, T &e)
Header for GeographicLib::Rhumb and GeographicLib::RhumbLine classes.
void AddEdge(real azi, real s)
Math::real Flattening() const
PolygonAreaT(const GeodType &earth, bool polyline=false)
Header for GeographicLib::Geodesic class.
PolygonAreaT< GeodesicExact > PolygonAreaExact
Header for GeographicLib::Accumulator class.
unsigned Compute(bool reverse, bool sign, real &perimeter, real &area) const
Namespace for GeographicLib.
void AddPoint(real lat, real lon)
Header for GeographicLib::GeodesicExact class.
Math::real MajorRadius() const
PolygonAreaT< Geodesic > PolygonArea