Created Mercator projection to convert between Geo location and planar projection point.

- MapGeo and MapPoint encapsulate geo location and planar projection point into classes.

#story[928]
This commit is contained in:
Haoming Yin
2017-05-15 12:24:36 +12:00
parent 189ba93e64
commit 5cc865f0af
6 changed files with 119 additions and 13 deletions
@@ -0,0 +1,44 @@
package seng302.models.map;
/**
* The Boundary class represents a square territorial bound on a map. It contains
* four extremity double values(N, E, S, W). N and S are represented as latitudes
* in radians. E and W are represented as longitudes in radians.
*
* Created by Haoming on 10/5/17
*/
public class Boundary {
private double north, east, south, west;
public Boundary(double north, double east, double south, double west) {
this.north = north;
this.east = east;
this.south = south;
this.west = west;
}
public double getCentreLat() {
return (north + south) / 2;
}
public double getCentreLng() {
return (east + west) / 2;
}
public double getNorth() {
return north;
}
public double getEast() {
return east;
}
public double getSouth() {
return south;
}
public double getWest() {
return west;
}
}