Added document and unit tests for GeoUtility class.

- three methods in GeoUtility have been tested and passed.

#story[828]
This commit is contained in:
Haoming Yin
2017-04-28 14:34:24 +12:00
parent 8c8f253233
commit 705a0a2eaf
3 changed files with 83 additions and 4 deletions
@@ -33,8 +33,14 @@ public class GeoUtility {
*
* @param p1 the first geographical position, start point
* @param p2 the second geographical position, end point
* @return the bearing in degree from p1 to p2, value range (0 ~ 360 deg.).
* @return the initial bearing in degree from p1 to p2, value range (0 ~ 360 deg.).
* vertical up is 0 deg. horizontal right is 90 deg.
*
* NOTE:
* The final bearing will differ from the initial bearing by varying degrees
* according to distance and latitude (if you were to go from say 35°N,45°E
* (≈ Baghdad) to 35°N,135°E (≈ Osaka), you would start on a heading of 60°
* and end up on a heading of 120°
*/
public static Double getBearing(Position p1, Position p2) {