ToN.x


Hi all,

Let me see if i can make you understand what i need to do. I have two points (like latlong points), and i want to know if X is set 'north ou south, east or west' from the Y point.

Please if you know, tell me how to do that. And also please tell me if you don't understand what i mean.

Thanks

Ton





Re: Getting the Direction between 2 points.

Ruprect8696


Somebody can correct me if I'm wrong but if you just compare the lat/longs you can get this information.

If lat1 is less than lat2 then point 2 is East of point 1
If long1 is less than long2 then point 2 is North of point 2

There's probably an easier calculation...something like

(lat2 - lat1) / (long2 - long1) = slope

Then use the slope to tell you the direction but it's been 11 years since I had Geometry. I'll let someone else fill in the blanks.





Re: Getting the Direction between 2 points.

Derek Chan

You mean you want to get the bearings Theres an algorithm here for doing that given lat/longs

http://www.movable-type.co.uk/scripts/LatLong.html







Re: Getting the Direction between 2 points.

ToN.x

Good! But how could i get a result like southwest

Thank you for your reply.






Re: Getting the Direction between 2 points.

ToN.x

Yes! That's the answer.... but it's tooo complicated to me hehe

I'll try it later and let you know the results...

thanks alot