| MGRS.hpp | | MGRS.hpp | |
| | | | |
| skipping to change at line 109 | | skipping to change at line 109 | |
| static int LatitudeBand(real lat) throw() { | | static int LatitudeBand(real lat) throw() { | |
| int ilat = int(std::floor(lat)); | | int ilat = int(std::floor(lat)); | |
| return (std::max)(-10, (std::min)(9, (ilat + 80)/8 - 10)); | | return (std::max)(-10, (std::min)(9, (ilat + 80)/8 - 10)); | |
| } | | } | |
| // Return approximate latitude band number [-10, 10) for the given nort
hing | | // Return approximate latitude band number [-10, 10) for the given nort
hing | |
| // (meters). With this rule, each 100km tile would have a unique band | | // (meters). With this rule, each 100km tile would have a unique band | |
| // letter corresponding to the latitude at the center of the tile. Thi
s | | // letter corresponding to the latitude at the center of the tile. Thi
s | |
| // function isn't currently used. | | // function isn't currently used. | |
| static int ApproxLatitudeBand(real y) throw() { | | static int ApproxLatitudeBand(real y) throw() { | |
| // northing at tile center in units of tile = 100km | | // northing at tile center in units of tile = 100km | |
|
| real ya = std::floor( std::min(real(88), std::abs(y/tile_)) ) + 0.5; | | real ya = std::floor( std::min(real(88), std::abs(y/tile_)) ) + real(
0.5); | |
| // convert to lat (mult by 90/100) and then to band (divide by 8) | | // convert to lat (mult by 90/100) and then to band (divide by 8) | |
| // the +1 fine tunes the boundary between bands 3 and 4 | | // the +1 fine tunes the boundary between bands 3 and 4 | |
| int b = int(std::floor( ((ya * 9 + 1) / 10) / 8 )); | | int b = int(std::floor( ((ya * 9 + 1) / 10) / 8 )); | |
| // For the northern hemisphere we have | | // For the northern hemisphere we have | |
| // band rows num | | // band rows num | |
| // N 0 0:8 9 | | // N 0 0:8 9 | |
| // P 1 9:17 9 | | // P 1 9:17 9 | |
| // Q 2 18:26 9 | | // Q 2 18:26 9 | |
| // R 3 27:34 8 | | // R 3 27:34 8 | |
| // S 4 35:43 9 | | // S 4 35:43 9 | |
| | | | |
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 145 | | skipping to change at line 145 | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| unsigned Compute(bool reverse, bool sign, | | unsigned Compute(bool reverse, bool sign, | |
| real& perimeter, real& area) const throw(); | | real& perimeter, real& area) const throw(); | |
| | | | |
| /** | | /** | |
| * Return the results assuming a tentative final test point is added; | | * Return the results assuming a tentative final test point is added; | |
| * however, the data for the test point is not saved. This lets you re
port | | * however, the data for the test point is not saved. This lets you re
port | |
| * a running result for the perimeter and area as the user moves the mo
use | | * a running result for the perimeter and area as the user moves the mo
use | |
| * cursor. Ordinary floating point arithmetic is used to accumulate th
e | | * cursor. Ordinary floating point arithmetic is used to accumulate th
e | |
| * data for the test point; thus the area and perimeter returned are le
ss | | * data for the test point; thus the area and perimeter returned are le
ss | |
|
| * accurate than if AddPoint and Compute are used. | | * accurate than if PolygonArea::AddPoint and PolygonArea::Compute are | |
| | | * used. | |
| * | | * | |
| * @param[in] lat the latitude of the test point (degrees). | | * @param[in] lat the latitude of the test point (degrees). | |
| * @param[in] lon the longitude of the test point (degrees). | | * @param[in] lon the longitude of the test point (degrees). | |
| * @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 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). | |
| | | | |
| skipping to change at line 173 | | skipping to change at line 174 | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| unsigned TestPoint(real lat, real lon, bool reverse, bool sign, | | unsigned TestPoint(real lat, real lon, bool reverse, bool sign, | |
| real& perimeter, real& area) const throw(); | | real& perimeter, real& area) const throw(); | |
| | | | |
| /** | | /** | |
| * Return the results assuming a tentative final test point is added vi
a an | | * 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. | | * 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 | | * 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 | | * 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 | | * 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. | | * returned are less accurate than if PolygonArea::AddEdge and | |
| | | * PolygonArea::Compute are used. | |
| * | | * | |
| * @param[in] azi azimuth at current point (degrees). | | * @param[in] azi azimuth at current point (degrees). | |
| * @param[in] s distance from current point to final test point (meters
). | | * @param[in] s distance from current point to final test point (meters
). | |
| * @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 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). | |
| | | | |
End of changes. 2 change blocks. |
| 2 lines changed or deleted | | 4 lines changed or added | |
|