Added unit tests for Mercator projection class.

- changed its methods to static
- add some documentation for its methods

#story[928]
This commit is contained in:
Haoming Yin
2017-05-15 13:23:04 +12:00
parent 5cc865f0af
commit 8a2f0a9f45
3 changed files with 64 additions and 27 deletions
+16 -16
View File
@@ -9,36 +9,36 @@ package seng302.models.map;
*/
public class Boundary {
private double north, east, south, west;
private double northLat, eastLng, southLat, westLng;
public Boundary(double north, double east, double south, double west) {
this.north = north;
this.east = east;
this.south = south;
this.west = west;
public Boundary(double northLat, double eastLng, double southLat, double westLng) {
this.northLat = northLat;
this.eastLng = eastLng;
this.southLat = southLat;
this.westLng = westLng;
}
public double getCentreLat() {
return (north + south) / 2;
return (northLat + southLat) / 2;
}
public double getCentreLng() {
return (east + west) / 2;
return (eastLng + westLng) / 2;
}
public double getNorth() {
return north;
public double getNorthLat() {
return northLat;
}
public double getEast() {
return east;
public double getEastLng() {
return eastLng;
}
public double getSouth() {
return south;
public double getSouthLat() {
return southLat;
}
public double getWest() {
return west;
public double getWestLng() {
return westLng;
}
}