mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user