CrashingDutchman
Mar 27, 2006, 05:01 AM
Let's say I have the coordinates of a location. I want to fly a circle around that location and need to calculate about 10 (maybe less, maybe more) waypoints around that location.
Anyone knows how to do that?
clolson
Mar 27, 2006, 07:36 AM
Do you need WGS-84 math or can you get by with spherical math? Clock-wise or counter clock-wise? Eurpoean or African circles?
Basically you need to be able compute a second waypoint given a first waypoint, a direction, and a distance. You can hunt around on the net and find wgs-84 or spherical formulas for that depending on the accuracy you need. You might even be able to project into a local X,Y coordinate system and be good enough. For whatever it's worth the SimGear library (www.simgear.org) has both spherical and wgs-84 code that will compute both ways ... given a starting point, direction and distance, it will compute the ending point. Or given two points, it can compute the distance and heading between them.
Then just write a little loop that will increment the angle by some increment each time and cruch the math.
There might be other ways to do it depending on your onboard computational power. You could pick a new heading to fly based on the heading and distance to the center point, and if done carefully, the aircraft would fly a circle around the way point. Or you could just try to fly to the way point, with a really tight tolerance for "did we get there" and when the aircraf misses it will try to come back and will likely fly a tight circle continuously, never quite getting to the waypoint.
Disclaimer: this answer is caffeine free, therefore you should examine any of these ideas carefully before actually trying them.
vBulletin® Copyright ©2000-2009, Jelsoft Enterprises Ltd.