use PointF instead of android int Point

This commit is contained in:
Hannes Janetzek
2013-03-13 02:57:37 +01:00
parent f508ddc1ff
commit efaafce08c
5 changed files with 39 additions and 9 deletions

View File

@@ -75,7 +75,7 @@ public class GeoPoint implements Parcelable, Comparable<GeoPoint> {
this(latitudeE6 / CONVERSION_FACTOR, longitudeE6 / CONVERSION_FACTOR);
}
public void project(Point2D out) {
public void project(PointD out) {
out.x = MercatorProjection.longitudeToX(this.longitudeE6 / CONVERSION_FACTOR);
out.y = MercatorProjection.latitudeToY(this.latitudeE6 / CONVERSION_FACTOR);
}

View File

@@ -0,0 +1,30 @@
/*
* Copyright 2013 Hannes Janetzek
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.oscim.core;
public class PointD {
public double x;
public double y;
public PointD() {
}
PointD(double x, double y){
this.x = x;
this.y = y;
}
@Override
public String toString(){
return x + " " + y;
}
}

View File

@@ -0,0 +1,38 @@
/*
* Copyright 2012 Hannes Janetzek
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.oscim.core;
/**
* without further ado: This class represents a 2D Point using float coordinates
*/
public class PointF {
public float x;
public float y;
public PointF() {
}
PointF(float x, float y) {
this.x = x;
this.y = y;
}
public void set(float x, float y) {
this.x = x;
this.y = y;
}
}