Fix UAT track calculation when one velocity component = 0

pull/566/head
Keith Tschohl 2017-02-10 03:55:26 +00:00
rodzic 239c473c9a
commit 4201bb1ec3
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -549,7 +549,7 @@ func parseDownlinkReport(s string, signalLevel int) {
}
}
if ns_vel_valid && ew_vel_valid {
if ns_vel != 0 && ew_vel != 0 {
if ns_vel != 0 || ew_vel != 0 {
//TODO: Track type
track = uint16((360 + 90 - (int16(math.Atan2(float64(ns_vel), float64(ew_vel)) * 180 / math.Pi))) % 360)
}