altosui: Add a few simple unit conversions
authorKeith Packard <keithp@keithp.com>
Tue, 23 Aug 2011 01:21:35 +0000 (18:21 -0700)
committerKeith Packard <keithp@keithp.com>
Tue, 23 Aug 2011 01:21:35 +0000 (18:21 -0700)
Signed-off-by: Keith Packard <keithp@keithp.com>
altosui/AltosConvert.java

index 207470a..db7039e 100644 (file)
@@ -234,6 +234,18 @@ public class AltosConvert {
                return array;
        }
 
+       static double meters_to_feet(double meters) {
+               return meters * (100 / (2.54 * 12));
+       }
+
+       static double meters_to_mach(double meters) {
+               return meters / 343;            /* something close to mach at usual rocket sites */
+       }
+
+       static double meters_to_g(double meters) {
+               return meters / 9.80665;
+       }
+
        static int checksum(int[] data, int start, int length) {
                int     csum = 0x5a;
                for (int i = 0; i < length; i++)