diff options
author | Keith Packard <keithp@keithp.com> | 2013-11-25 00:02:06 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2013-11-25 00:02:06 -0800 |
commit | 82b42935d047d2f7c2f7a63a3efb72a3f1d5594e (patch) | |
tree | 6290de009ca976bed1a1cd40f1fc5dc00213e5c1 /altoslib/AltosConvert.java | |
parent | 8da565bbafa2925aa889cf9249497a709a814b7f (diff) |
altosui: Handle units in pyro config.
This lets you edit the pyro configuration using imperial units if
desired.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altoslib/AltosConvert.java')
-rw-r--r-- | altoslib/AltosConvert.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/altoslib/AltosConvert.java b/altoslib/AltosConvert.java index 760d9eb9..8d0b74dd 100644 --- a/altoslib/AltosConvert.java +++ b/altoslib/AltosConvert.java @@ -290,10 +290,18 @@ public class AltosConvert { return meters_to_feet(meters) / 5280; } + public static double miles_to_meters(double miles) { + return feet_to_meters(miles * 5280); + } + public static double meters_to_mph(double mps) { return meters_to_miles(mps) * 3600; } + public static double mph_to_meters(double mps) { + return miles_to_meters(mps) / 3600; + } + public static double meters_to_mach(double meters) { return meters / 343; /* something close to mach at usual rocket sites */ } @@ -306,6 +314,10 @@ public class AltosConvert { return c * 9/5 + 32; } + public static double f_to_c(double c) { + return (c - 32) * 5/9; + } + public static boolean imperial_units = false; public static AltosDistance distance = new AltosDistance(); |