Jump to content
The simFlight Network Forums

# flying from point a to point b

## Recommended Posts

What is the best way to check that waypoints lat/long are being flown towards

I though it could be something like this :

take the difference of lat/long between the 2 waypoints

'draw' a triangle like the on the diagram

'track' we are on the hyp of the triangle by measuring the angle ie in this case it would be 45deg

'redraw' the triangle and check that the angle of 45deg has not varied more than a couple of degrees

My concern with this is Im not sure I am going about it the correct way. For the plane to be heading towards the new waypoint both sides of the triangle opp and adj must decrease in size at the same time and the angle of the hyp must stay the same otherwise we are not on track.

Has anyone looked at this problem before and got a better solution?

thanks

Graham

##### Share on other sites

Actually the simplest way is to make use of the FSUIPC GPS offsets. There you can see the properties of the previous and next waypoints. In this case the waypoint you are flying to would be the Next waypoint offset.

This would work in the majority of circumstances except when:

1. There is no GPS on the aircraft

##### Share on other sites

You can keep calculating the distance between you and another point to see if it's getting nearer. The following does it in kilometers but the units don't matter - if the number's shrinking you're flying towards it.

Distance=6371*ACOS(COS(RADIANS(90-Lat1))*COS(RADIANS(90-Lat2))+SIN(RADIANS(90-Lat1))*SIN(RADIANS(90-Lat2))*COS(RADIANS(Long1-Long2)))

You can chop off the first word (Distance), drop this into Excel and change the Lat1/Lat2/Long1/Long2 to cell addresses to check it out.

Long and Lat should be decimal and positive for North/West , negative for South/East co-ordinates.

Have fun!

Ian

##### Share on other sites

thanks, that works fine

I have modified it for vb.net and also convert to nm

'get distance to next waypoint in nm

newdistance = 0.539612 * (6371 * Math.Acos(Math.Cos(deg2rad(90 - latitude)) * Math.Cos(deg2rad(90 - waypointlat)) + Math.Sin(deg2rad(90 - latitude)) * Math.Sin(deg2rad(90 - waypointlat)) * Math.Cos(deg2rad(longitude - waypointlong))))

replace variables latitude and longitude with current aircraft lat/long and replace waypointlat and waypointlong with lat/long of next waypoint

regards

Gray

##### Share on other sites

Hi,

Just measuring the distance to determine if an aircraft is on track is not enough. In your drawing for example, if the aircraft flies along the Y-axis the distance to A decreases (untill a certain point) but the aircraft is off track.

You have to calculate the track between the 2 points and compare if the aircraft is off-track.

I always use this very helpfull and informative website:

http://williams.best.vwh.net/avform.htm

## Create an account or sign in to comment

You need to be a member in order to leave a comment

## Create an account

Sign up for a new account in our community. It's easy!

Register a new account

## Sign in

Already have an account? Sign in here.

Sign In Now
×

• #### Activity

• Leaderboard
×
• Create New...

## Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.