diff options
| author | Bdale Garbee <bdale@gag.com> | 2010-08-27 03:08:53 -0600 | 
|---|---|---|
| committer | Bdale Garbee <bdale@gag.com> | 2010-08-27 03:08:53 -0600 | 
| commit | c443f43f8dee6e0fcbcecf9d09e948fd928b7af4 (patch) | |
| tree | 653fe6ba91e165aaf8a6b4eef17602c5f1bd62a9 /ao-tools/altosui/AltosGreatCircle.java | |
| parent | 295043112ccde35092945c286596f9045ee6fa05 (diff) | |
| parent | 2923cf5057f9cef110dd547d8677ea5b60e00796 (diff) | |
Merge branch 'new-packet-format' of ssh://git.gag.com/scm/git/fw/altos into new-package-format
Diffstat (limited to 'ao-tools/altosui/AltosGreatCircle.java')
| -rw-r--r-- | ao-tools/altosui/AltosGreatCircle.java | 15 | 
1 files changed, 13 insertions, 2 deletions
diff --git a/ao-tools/altosui/AltosGreatCircle.java b/ao-tools/altosui/AltosGreatCircle.java index 878da03e..07c02c16 100644 --- a/ao-tools/altosui/AltosGreatCircle.java +++ b/ao-tools/altosui/AltosGreatCircle.java @@ -17,6 +17,8 @@  package altosui; +import altosui.AltosGPS; +  import java.lang.Math;  public class AltosGreatCircle { @@ -28,8 +30,8 @@ public class AltosGreatCircle {  	static final double rad = Math.PI / 180;  	static final double earth_radius = 6371.2 * 1000;	/* in meters */ -	AltosGreatCircle (double start_lat, double start_lon, -			  double end_lat, double end_lon) +	public AltosGreatCircle (double start_lat, double start_lon, +				 double end_lat, double end_lon)  	{  		double lat1 = rad * start_lat;  		double lon1 = rad * -start_lon; @@ -63,4 +65,13 @@ public class AltosGreatCircle {  		distance = d * earth_radius;  		bearing = course * 180/Math.PI;  	} + +	public AltosGreatCircle(AltosGPS start, AltosGPS end) { +		this(start.lat, start.lon, end.lat, end.lon); +	} + +	public AltosGreatCircle() { +		distance = 0; +		bearing = 0; +	}  }  | 
