diff options
author | Keith Packard <keithp@keithp.com> | 2015-06-22 20:08:05 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2015-06-22 21:04:43 -0700 |
commit | 0f56903774d9e8bb033dfc0af6945e8ddc1d3065 (patch) | |
tree | eac0d0900286d80253670738381e4de73481b4e0 /altoslib/AltosMapTransform.java | |
parent | a959c1926048d1b96a06aa291131afd7c8e771c7 (diff) |
altosdroid: Select tracker by clicking on map
This lets you pick a tracker from the map, rather than having to use
the menu.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altoslib/AltosMapTransform.java')
-rw-r--r-- | altoslib/AltosMapTransform.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/altoslib/AltosMapTransform.java b/altoslib/AltosMapTransform.java index 30994ecb..11ed4eb9 100644 --- a/altoslib/AltosMapTransform.java +++ b/altoslib/AltosMapTransform.java @@ -51,6 +51,13 @@ public class AltosMapTransform { return new AltosPointDouble(screen.x + offset_x, screen.y + offset_y); } + public double hypot(AltosLatLon a, AltosLatLon b) { + AltosPointDouble a_pt = point(a); + AltosPointDouble b_pt = point(b); + + return Math.hypot(a_pt.x - b_pt.x, a_pt.y - b_pt.y); + } + public AltosLatLon screen_lat_lon(AltosPointInt screen) { return lat_lon(screen_point(screen)); } |