altosuilib, altoslib: Add azimuth and compass to reports
[fw/altos] / altosuilib / AltosInfoTable.java
index 6bfe0cf51b20d59c787fab8aebec58c83a7c7742..72d4fb56275e423b1bb16a23c8ddf7b5f6840c3a 100644 (file)
@@ -280,9 +280,10 @@ public class AltosInfoTable extends JTable implements AltosFlightDisplay, Hierar
                        info_add_row(3, "Gyro yaw", "%8.1f °/s", state.gyro_yaw());
                        if (state.mag_along() != AltosLib.MISSING) {
                                /* Report mag in nanoteslas (1 G = 100000 nT (or γ)) */
-                               info_add_row(3, "Mag along", "%8.1f γ", state.mag_along() * 100000.0);
-                               info_add_row(3, "Mag across", "%8.1f γ", state.mag_across() * 100000.0);
-                               info_add_row(3, "Mag Through", "%8.1f γ", state.mag_through() * 100000.0);
+                               info_add_row(3, "Mag along", "%8.1f µT", state.mag_along() * 100.0);
+                               info_add_row(3, "Mag across", "%8.1f µT", state.mag_across() * 100.0);
+                               info_add_row(3, "Mag Through", "%8.1f µT", state.mag_through() * 100.0);
+                               info_add_row(3, "Mag Bearing", "%8.1f°", Math.atan2(state.mag_across(), state.mag_through()) * 180/Math.PI);
                        }
                }