| GeodesicExact.hpp | | GeodesicExact.hpp | |
| | | | |
| skipping to change at line 712 | | skipping to change at line 712 | |
| * possess, i.e., which quantities can be returned in calls to | | * possess, i.e., which quantities can be returned in calls to | |
| * GeodesicLib::Position. | | * GeodesicLib::Position. | |
| * | | * | |
| * \e lat1 should be in the range [−90°, 90°]; \e lon1 an
d \e | | * \e lat1 should be in the range [−90°, 90°]; \e lon1 an
d \e | |
| * azi1 should be in the range [−540°, 540°). | | * azi1 should be in the range [−540°, 540°). | |
| * | | * | |
| * The GeodesicExact::mask values are | | * The GeodesicExact::mask values are | |
| * - \e caps |= GeodesicExact::LATITUDE for the latitude \e lat2; this
is | | * - \e caps |= GeodesicExact::LATITUDE for the latitude \e lat2; this
is | |
| * added automatically | | * added automatically | |
| * - \e caps |= GeodesicExact::LONGITUDE for the latitude \e lon2 | | * - \e caps |= GeodesicExact::LONGITUDE for the latitude \e lon2 | |
|
| * - \e caps |= GeodesicExact::AZIMUTH for the latitude \e azi2; this i
s | | * - \e caps |= GeodesicExact::AZIMUTH for the azimuth \e azi2; this is | |
| * added automatically | | * added automatically | |
| * - \e caps |= GeodesicExact::DISTANCE for the distance \e s12 | | * - \e caps |= GeodesicExact::DISTANCE for the distance \e s12 | |
| * - \e caps |= GeodesicExact::REDUCEDLENGTH for the reduced length \e
m12 | | * - \e caps |= GeodesicExact::REDUCEDLENGTH for the reduced length \e
m12 | |
| * - \e caps |= GeodesicExact::GEODESICSCALE for the geodesic scales \e
M12 | | * - \e caps |= GeodesicExact::GEODESICSCALE for the geodesic scales \e
M12 | |
| * and \e M21 | | * and \e M21 | |
| * - \e caps |= GeodesicExact::AREA for the area \e S12 | | * - \e caps |= GeodesicExact::AREA for the area \e S12 | |
| * - \e caps |= GeodesicExact::DISTANCE_IN permits the length of the | | * - \e caps |= GeodesicExact::DISTANCE_IN permits the length of the | |
| * geodesic to be given in terms of \e s12; without this capability t
he | | * geodesic to be given in terms of \e s12; without this capability t
he | |
| * length can only be specified in terms of arc length. | | * length can only be specified in terms of arc length. | |
| * . | | * . | |
| | | | |
End of changes. 1 change blocks. |
| 1 lines changed or deleted | | 1 lines changed or added | |
|
| PolygonArea.hpp | | PolygonArea.hpp | |
| | | | |
| skipping to change at line 84 | | skipping to change at line 84 | |
| * | | * | |
| * @param[in] earth the Geodesic object to use for geodesic calculation
s. | | * @param[in] earth the Geodesic object to use for geodesic calculation
s. | |
| * By default this uses the WGS84 ellipsoid. | | * By default this uses the WGS84 ellipsoid. | |
| * @param[in] polyline if true that treat the points as defining a poly
line | | * @param[in] polyline if true that treat the points as defining a poly
line | |
| * instead of a polygon (default = false). | | * instead of a polygon (default = false). | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| PolygonArea(const Geodesic& earth, bool polyline = false) throw() | | PolygonArea(const Geodesic& earth, bool polyline = false) throw() | |
| : _earth(earth) | | : _earth(earth) | |
| , _area0(_earth.EllipsoidArea()) | | , _area0(_earth.EllipsoidArea()) | |
| , _polyline(polyline) | | , _polyline(polyline) | |
|
| , _mask(Geodesic::DISTANCE | (_polyline ? 0 : Geodesic::AREA)) | | , _mask(Geodesic::LATITUDE | Geodesic::LONGITUDE | | |
| { | | Geodesic::DISTANCE | (_polyline ? 0 : Geodesic::AREA)) | |
| Clear(); | | { Clear(); } | |
| } | | | |
| | | | |
| /** | | /** | |
| * Clear PolygonArea, allowing a new polygon to be started. | | * Clear PolygonArea, allowing a new polygon to be started. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| void Clear() throw() { | | void Clear() throw() { | |
| _num = 0; | | _num = 0; | |
| _crossings = 0; | | _crossings = 0; | |
| _areasum = 0; | | _areasum = 0; | |
| _perimetersum = 0; | | _perimetersum = 0; | |
|
| _lat0 = _lon0 = _lat1 = _lon1 = 0; | | _lat0 = _lon0 = _lat1 = _lon1 = Math::NaN<real>(); | |
| } | | } | |
| | | | |
| /** | | /** | |
| * Add a point to the polygon or polyline. | | * Add a point to the polygon or polyline. | |
| * | | * | |
| * @param[in] lat the latitude of the point (degrees). | | * @param[in] lat the latitude of the point (degrees). | |
| * @param[in] lon the latitude of the point (degrees). | | * @param[in] lon the latitude of the point (degrees). | |
| * | | * | |
| * \e lat should be in the range [−90°, 90°] and \e | | * \e lat should be in the range [−90°, 90°] and \e | |
| * lon should be in the range [−540°, 540°). | | * lon should be in the range [−540°, 540°). | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| void AddPoint(real lat, real lon) throw(); | | void AddPoint(real lat, real lon) throw(); | |
| | | | |
| /** | | /** | |
|
| | | * Add an edge to the polygon or polyline. | |
| | | * | |
| | | * @param[in] azi azimuth at current point (degrees). | |
| | | * @param[in] s distance from current point to next point (meters). | |
| | | * | |
| | | * \e azi should be in the range [−540°, 540°). This doe | |
| | | s | |
| | | * nothing if no points have been added yet. Use PolygonArea::CurrentP | |
| | | oint | |
| | | * to determine the position of the new vertex. | |
| | | ********************************************************************** | |
| | | / | |
| | | void AddEdge(real azi, real s) throw(); | |
| | | | |
| | | /** | |
| * Return the results so far. | | * Return the results so far. | |
| * | | * | |
| * @param[in] reverse if true then clockwise (instead of counter-clockw
ise) | | * @param[in] reverse if true then clockwise (instead of counter-clockw
ise) | |
| * traversal counts as a positive area. | | * traversal counts as a positive area. | |
| * @param[in] sign if true then return a signed result for the area if | | * @param[in] sign if true then return a signed result for the area if | |
| * the polygon is traversed in the "wrong" direction instead of retur
ning | | * the polygon is traversed in the "wrong" direction instead of retur
ning | |
| * the area for the rest of the earth. | | * the area for the rest of the earth. | |
| * @param[out] perimeter the perimeter of the polygon or length of the | | * @param[out] perimeter the perimeter of the polygon or length of the | |
| * polyline (meters). | | * polyline (meters). | |
| * @param[out] area the area of the polygon (meters<sup>2</sup>); only
set | | * @param[out] area the area of the polygon (meters<sup>2</sup>); only
set | |
| | | | |
| skipping to change at line 153 | | skipping to change at line 164 | |
| * @param[out] perimeter the approximate perimeter of the polygon or le
ngth | | * @param[out] perimeter the approximate perimeter of the polygon or le
ngth | |
| * of the polyline (meters). | | * of the polyline (meters). | |
| * @param[out] area the approximate area of the polygon | | * @param[out] area the approximate area of the polygon | |
| * (meters<sup>2</sup>); only set if polyline is false in the | | * (meters<sup>2</sup>); only set if polyline is false in the | |
| * constructor. | | * constructor. | |
| * @return the number of points. | | * @return the number of points. | |
| * | | * | |
| * \e lat should be in the range [−90°, 90°] and \e | | * \e lat should be in the range [−90°, 90°] and \e | |
| * lon should be in the range [−540°, 540°). | | * lon should be in the range [−540°, 540°). | |
| **********************************************************************
/ | | **********************************************************************
/ | |
|
| | | unsigned TestPoint(real lat, real lon, bool reverse, bool sign, | |
| | | real& perimeter, real& area) const throw(); | |
| | | | |
| | | /** | |
| | | * Return the results assuming a tentative final test point is added vi | |
| | | a an | |
| | | * azimuth and distance; however, the data for the test point is not sa | |
| | | ved. | |
| | | * This lets you report a running result for the perimeter and area as | |
| | | the | |
| | | * user moves the mouse cursor. Ordinary floating point arithmetic is | |
| | | used | |
| | | * to accumulate the data for the test point; thus the area and perimet | |
| | | er | |
| | | * returned are less accurate than if AddPoint and Compute are used. | |
| | | * | |
| | | * @param[in] azi azimuth at current point (degrees). | |
| | | * @param[in] s distance from current point to final test point (meters | |
| | | ). | |
| | | * @param[in] reverse if true then clockwise (instead of counter-clockw | |
| | | ise) | |
| | | * traversal counts as a positive area. | |
| | | * @param[in] sign if true then return a signed result for the area if | |
| | | * the polygon is traversed in the "wrong" direction instead of retur | |
| | | ning | |
| | | * the area for the rest of the earth. | |
| | | * @param[out] perimeter the approximate perimeter of the polygon or le | |
| | | ngth | |
| | | * of the polyline (meters). | |
| | | * @param[out] area the approximate area of the polygon | |
| | | * (meters<sup>2</sup>); only set if polyline is false in the | |
| | | * constructor. | |
| | | * @return the number of points. | |
| | | * | |
| | | * \e azi should be in the range [−540°, 540°). | |
| | | ********************************************************************** | |
| | | / | |
| | | unsigned TestEdge(real azi, real s, bool reverse, bool sign, | |
| | | real& perimeter, real& area) const throw(); | |
| | | | |
| | | /** | |
| | | * <b>DEPRECATED</b> | |
| | | * The old name for PolygonArea::TestPoint. | |
| | | ********************************************************************** | |
| | | / | |
| unsigned TestCompute(real lat, real lon, bool reverse, bool sign, | | unsigned TestCompute(real lat, real lon, bool reverse, bool sign, | |
| real& perimeter, real& area) const throw(); | | real& perimeter, real& area) const throw(); | |
| | | | |
| /** \name Inspector functions | | /** \name Inspector functions | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| ///@{ | | ///@{ | |
| /** | | /** | |
| * @return \e a the equatorial radius of the ellipsoid (meters). This
is | | * @return \e a the equatorial radius of the ellipsoid (meters). This
is | |
| * the value inherited from the Geodesic object used in the construct
or. | | * the value inherited from the Geodesic object used in the construct
or. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| | | | |
| Math::real MajorRadius() const throw() { return _earth.MajorRadius(); } | | Math::real MajorRadius() const throw() { return _earth.MajorRadius(); } | |
| | | | |
| /** | | /** | |
| * @return \e f the flattening of the ellipsoid. This is the value | | * @return \e f the flattening of the ellipsoid. This is the value | |
| * inherited from the Geodesic object used in the constructor. | | * inherited from the Geodesic object used in the constructor. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real Flattening() const throw() { return _earth.Flattening(); } | | Math::real Flattening() const throw() { return _earth.Flattening(); } | |
|
| | | | |
| | | /** | |
| | | * Report the previous vertex added to the polygon or polyline. | |
| | | * | |
| | | * @param[out] lat the latitude of the point (degrees). | |
| | | * @param[out] lon the latitude of the point (degrees). | |
| | | * | |
| | | * If no points have been added, then NaNs are returned. Otherwise, \e | |
| | | lon | |
| | | * will be in the range [−180°, 180°). | |
| | | ********************************************************************** | |
| | | / | |
| | | void CurrentPoint(real& lat, real& lon) const throw() | |
| | | { lat = _lat1; lon = _lon1; } | |
| ///@} | | ///@} | |
| }; | | }; | |
| | | | |
| } // namespace GeographicLib | | } // namespace GeographicLib | |
| | | | |
| #endif // GEOGRAPHICLIB_POLYGONAREA_HPP | | #endif // GEOGRAPHICLIB_POLYGONAREA_HPP | |
| | | | |
End of changes. 5 change blocks. |
| 5 lines changed or deleted | | 78 lines changed or added | |
|