Android Question GPS library DistanceTo seems wrong

shb777

Active Member
Licensed User
Longtime User
I added this code to my dji app so I could display distance 0n my app:

B4X:
Sub CaculateDistance
   
    L1.Latitude=HomeLocationLatitudeMavic
    L1.Longitude=HomeLocationLongitudeMavic
    L2.Latitude=LatitudeMavic
    L2.Longitude=LongitudeMavic
    DistanceBetweenMavicAndHome =    L1.DistanceTo(L2)
   
End Sub

It seems to be way off. The remote control is showing a distance around 4 times greater, and I think the remote control is right.
 
D

Deleted member 103

Guest
The distance measurement is always in 2D, if you need it in 3D then you have to calculate differently.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0
Top