### Getting a GPS point based off of current location and a given distance.

#### Replies

• yeah, this took me a while to figure out, too.

The ardupilot code has some routines that provide inspiration, I've attached my own (crappy but functional) code that runs on an Ardupilot. It's also got a routine that works out direction and distance.

The hardest thing I found was visualizing the coordinate system. X coordinates work differently at various latitudes and you have to scale degrees by the Cosine of the Lat. Also, when you work with angles, things like Cos and Tan work from a "zero" that is 90 degrees out from regular North/South bearings. Urgh.

Anyway, I hope this helps.

cartest_03.zip

• 3D Robotics
All the math you need is here.
Calculate distance and bearing between two Latitude/Longitude points using haversine formula in Jav…

### Activity

RT @chr1sa: Donkeycar 4.4 released with tons of new features, including path learning (useful with GPS outdoors), better Web and Lidar supp…
Sunday
RT @NXP: We are already biting our nails in anticipation of the #NXPCupEMEA challenge! 😉 Did you know there are great cash prizes to be won…
Nov 24
RT @gclue_akira: レースまであと3日。今回のコースは激ムズかも。あと一歩 #jetracer https://t.co/GKcEjImQ3t
Nov 24
UC Berkeley's DIY robocar program https://roar.berkeley.edu/
Nov 24
RT @chr1sa: The next @DIYRobocars autonomous car race at @circuitlaunch will be on Sat, Dec 10. Thrills, spills and a Brazilian BBQ. Fun…
Nov 24
RT @arthiak_tc: Donkey car platform ... Still training uses behavioral cloning #TCXpo #diyrobocar @OttawaAVGroup https://t.co/PHBYwlFlnE
Nov 20
RT @emurmur77: Points for style. @donkeycar racing in @diyrobocars at @UCSDJacobs thanks @chr1sa for taking the video. https://t.co/Y2hMyj1…
Nov 20
RT @SmallpixelCar: Going to @diyrobocars race at @UCSDJacobs https://t.co/Rrf9vDJ8TJ
Nov 8
RT @SmallpixelCar: Race @diyrobocars at @UCSDJacobs thanks @chr1sa for taking the video. https://t.co/kK686Hb9Ej
Nov 8