diff options
| author | Gerald Barker <geraldbarker@gmail.com> | 2011-09-03 11:49:25 +0100 |
|---|---|---|
| committer | Gerald Barker <geraldbarker@gmail.com> | 2011-09-03 11:49:25 +0100 |
| commit | 22940d838d710537e8e5c83b1d22015747fbc4e4 (patch) | |
| tree | 216ea388625a7f7ed3505e5854b025fc475f5a14 /src/cgeo/geocaching/geopoint/Geopoint.java | |
| parent | 560ce54b9727e4fb5e514716b33b70352f3a0ff1 (diff) | |
| parent | 8d040c24bfbb2a12788dede9911f14333df5098d (diff) | |
| download | cgeo-22940d838d710537e8e5c83b1d22015747fbc4e4.zip cgeo-22940d838d710537e8e5c83b1d22015747fbc4e4.tar.gz cgeo-22940d838d710537e8e5c83b1d22015747fbc4e4.tar.bz2 | |
Update locaal branch to revision 8d040c24bfbb2a12788d
Diffstat (limited to 'src/cgeo/geocaching/geopoint/Geopoint.java')
| -rw-r--r-- | src/cgeo/geocaching/geopoint/Geopoint.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/cgeo/geocaching/geopoint/Geopoint.java b/src/cgeo/geocaching/geopoint/Geopoint.java index 533854b..85149be 100644 --- a/src/cgeo/geocaching/geopoint/Geopoint.java +++ b/src/cgeo/geocaching/geopoint/Geopoint.java @@ -9,7 +9,7 @@ public class Geopoint public static final double deg2rad = Math.PI / 180; public static final double rad2deg = 180 / Math.PI; public static final float erad = 6371.0f; - + private double latitude; private double longitude; @@ -76,7 +76,7 @@ public class Geopoint return this; } - + /** * Set latitude in microdegree. * @@ -113,7 +113,7 @@ public class Geopoint { return latitude; } - + /** * Get latitude in microdegree. * @@ -144,7 +144,7 @@ public class Geopoint return this; } - + /** * Set longitude in microdegree. * @@ -181,7 +181,7 @@ public class Geopoint { return longitude; } - + /** * Get longitude in microdegree. * @@ -268,7 +268,7 @@ public class Geopoint double c = Math.acos(Math.sin(lat2) * Math.sin(lat1) + Math.cos(lat2) * Math.cos(lat1) * Math.cos(lon2 - lon1)); double A = Math.asin(Math.cos(lat2) * Math.sin(lon2 - lon1) / Math.sin(c)); double result = A * rad2deg; - + if (ilat2 > ilat1 && ilon2 > ilon1) { // result don't need change @@ -285,7 +285,7 @@ public class Geopoint { result += 360f; } - + return result; } } @@ -318,7 +318,7 @@ public class Geopoint */ public boolean isEqualTo(Geopoint gp) { - return (null != gp && gp.getLatitude() == latitude && gp.getLongitude() == longitude); + return null != gp && gp.getLatitude() == latitude && gp.getLongitude() == longitude; } /** @@ -330,7 +330,7 @@ public class Geopoint */ public boolean isEqualTo(Geopoint gp, double tolerance) { - return (null != gp && distanceTo(gp) <= tolerance); + return null != gp && distanceTo(gp) <= tolerance; } /** |
