redoing the original range and bearing calculator by Mike Atlin