diff options
author | Keith Packard <keithp@keithp.com> | 2012-01-02 21:12:45 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-01-02 21:12:45 -0800 |
commit | 8942aa5118ad2ec735a08365726d23f393b722bf (patch) | |
tree | ef25b80f4df194db95b908ce0516bc16114f4ebc | |
parent | 5b3b202f27e2ae0eb1132b6cd1e054178569ca66 (diff) |
altosui: Move AltosGreatCircle.java to altoslib
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | altosui/Makefile.am | 1 | ||||
-rw-r--r-- | altosui/altoslib/Makefile.am | 1 | ||||
-rw-r--r-- | altosui/altoslib/src/org/altusmetrum/AltosLib/AltosGreatCircle.java (renamed from altosui/AltosGreatCircle.java) | 56 |
3 files changed, 29 insertions, 29 deletions
diff --git a/altosui/Makefile.am b/altosui/Makefile.am index 8ea84825..f5ed8ed8 100644 --- a/altosui/Makefile.am +++ b/altosui/Makefile.am @@ -51,7 +51,6 @@ altosui_JAVA = \ AltosFlightUI.java \ AltosFontListener.java \ AltosFreqList.java \ - AltosGreatCircle.java \ AltosHexfile.java \ Altos.java \ AltosIdleMonitorUI.java \ diff --git a/altosui/altoslib/Makefile.am b/altosui/altoslib/Makefile.am index 6f8c028a..e0647bd4 100644 --- a/altosui/altoslib/Makefile.am +++ b/altosui/altoslib/Makefile.am @@ -22,6 +22,7 @@ AltosLib_JAVA = \ $(SRC)/AltosFrequency.java \ $(SRC)/AltosGPS.java \ $(SRC)/AltosGPSSat.java \ + $(SRC)/AltosGreatCircle.java \ $(SRC)/AltosLine.java \ $(SRC)/AltosLink.java \ $(SRC)/AltosParse.java \ diff --git a/altosui/AltosGreatCircle.java b/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosGreatCircle.java index e4af3c18..76b71859 100644 --- a/altosui/AltosGreatCircle.java +++ b/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosGreatCircle.java @@ -15,44 +15,44 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package org.altusmetrum.AltosLib; import java.lang.Math; -import org.altusmetrum.AltosLib.*; public class AltosGreatCircle { - double distance; - double bearing; + public double distance; + public double bearing; double sqr(double a) { return a * a; } static final double rad = Math.PI / 180; static final double earth_radius = 6371.2 * 1000; /* in meters */ - static int BEARING_LONG = 0; - static int BEARING_SHORT = 1; - static int BEARING_VOICE = 2; - String bearing_words(int length) { - String [][] bearing_string = { - { - "North", "North North East", "North East", "East North East", - "East", "East South East", "South East", "South South East", - "South", "South South West", "South West", "West South West", - "West", "West North West", "North West", "North North West" - }, { - "N", "NNE", "NE", "ENE", - "E", "ESE", "SE", "SSE", - "S", "SSW", "SW", "WSW", - "W", "WNW", "NW", "NNW" - }, { - "north", "nor nor east", "north east", "east nor east", - "east", "east sow east", "south east", "sow sow east", - "south", "sow sow west", "south west", "west sow west", - "west", "west nor west", "north west", "nor nor west " - } - }; - return bearing_string[length][(int)((bearing / 90 * 8 + 1) / 2)%16]; - } + public static final int BEARING_LONG = 0; + public static final int BEARING_SHORT = 1; + public static final int BEARING_VOICE = 2; + + public String bearing_words(int length) { + String [][] bearing_string = { + { + "North", "North North East", "North East", "East North East", + "East", "East South East", "South East", "South South East", + "South", "South South West", "South West", "West South West", + "West", "West North West", "North West", "North North West" + }, { + "N", "NNE", "NE", "ENE", + "E", "ESE", "SE", "SSE", + "S", "SSW", "SW", "WSW", + "W", "WNW", "NW", "NNW" + }, { + "north", "nor nor east", "north east", "east nor east", + "east", "east sow east", "south east", "sow sow east", + "south", "sow sow west", "south west", "west sow west", + "west", "west nor west", "north west", "nor nor west " + } + }; + return bearing_string[length][(int)((bearing / 90 * 8 + 1) / 2)%16]; + } public AltosGreatCircle (double start_lat, double start_lon, double end_lat, double end_lon) |