|
|
|
|
@ -9,14 +9,14 @@ public class RaceMap {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Contructor Method.
|
|
|
|
|
* @param x1 Latitude of the top left point.
|
|
|
|
|
* @param y1 Longitude of the top left point.
|
|
|
|
|
* @param x2 Latitude of the top right point.
|
|
|
|
|
* @param y2 Longitude of the top right point.
|
|
|
|
|
* @param x1 Longitude of the top left point.
|
|
|
|
|
* @param y1 Latitude of the top left point.
|
|
|
|
|
* @param x2 Longitude of the top right point.
|
|
|
|
|
* @param y2 Latitude of the top right point.
|
|
|
|
|
* @param width width that the Canvas the race is to be drawn on is.
|
|
|
|
|
* @param height height that the Canvas the race is to be drawn on is.
|
|
|
|
|
*/
|
|
|
|
|
public RaceMap(double x1, double y1, double x2, double y2, int width, int height) {
|
|
|
|
|
public RaceMap(double y1, double x1, double y2, double x2, int height, int width) {
|
|
|
|
|
this.x1 = x1; this.x2 = x2; this.y1 = y1; this.y2 = y2; this.width = width; this.height = height;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -28,7 +28,8 @@ public class RaceMap {
|
|
|
|
|
* @see GraphCoordinate
|
|
|
|
|
*/
|
|
|
|
|
public GraphCoordinate convertGPS(double lat, double lon) {
|
|
|
|
|
return new GraphCoordinate((int) ((height * (lon - y1) / (y2 - y1))),(int) (width * (lat - x1) / (x2 - x1)));
|
|
|
|
|
|
|
|
|
|
return new GraphCoordinate((int) (width * (lon - x1) / (x2 - x1)), (int) (height - (height * (lat - y1) / (y2 - y1))));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|