10 #if !defined(GEOGRAPHICLIB_POLYGONAREA_HPP)
11 #define GEOGRAPHICLIB_POLYGONAREA_HPP 1
18 namespace GeographicLib {
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();
165 unsigned Compute(
bool reverse,
bool sign,
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)
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
GeographicLib::Math::real real
PolygonAreaT< Rhumb > PolygonAreaRhumb
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
static T AngDiff(T x, T y)
void AddPoint(real lat, real lon)
Header for GeographicLib::GeodesicExact class.
Math::real MajorRadius() const
PolygonAreaT< Geodesic > PolygonArea