This sub is usable in GPS programs -
(Source: http://www.meridianworlddata.com/Distance-Calculation.asp )
- create 5x TextBox - Lat1,2; Lon1,2; result and one Button - Calc
My sample is here:
B4X:
Sub Calc
result.Text = sqrt(69.1 * (Lat2.Text - Lat1.Text) * 69.1 * (Lat2.Text - Lat1.Text) + 69.1 * (Lon2.Text - Lon1.Text) * cos(lat1.Text/57.3) * 69.1 * (Lon2.Text - Lon1.Text) * cos(lat1.Text/57.3))
End Sub
- create 5x TextBox - Lat1,2; Lon1,2; result and one Button - Calc
My sample is here:
Attachments
Last edited: