-
February 28th, 2013, 02:36 PM
#1
Converting grid ref to heading/bearing
Hi, I'm new, I hope this is the right forum for this!
I am trying to re-create a model I wrote years ago, (lost the source code), One requirement is an algorythm that will calculate the angle, between two points on a plane, from the x,y coordinates of the start and finish; I will be writing in Pascal or Object pascal, but I am NOT asking for code, just the algorythm. However, if you do NOT have the design but do have code, I will be happy to look at that
Thanks,
Jim
-
February 28th, 2013, 03:24 PM
#2
Re: Converting grid ref to heading/bearing
I think you have to provide some additional information. Two points make a single line or at least can do so.
-
February 28th, 2013, 05:08 PM
#3
Re: Converting grid ref to heading/bearing
Thanks s_m_a ??
You're right! The bearing I am calculating is between the line specified by the two points and the X axis West to East. That axis being zero degrees.
This is dictated by the progarming language that I favour where the 0 / (nought) axis is horizontal, not vertical like we use in normal navigation.
I hope that is clear. Sorry for the obvious omission.
I fear I need a spell checker on this interface!
Thanks and best wishes, Jim
-
February 28th, 2013, 10:01 PM
#4
Re: Converting grid ref to heading/bearing
Sounds like the good ol' conversion from cartesian to polar coordinates (which is independent from any programming language anyway).
HTH
I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.
This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.
-
March 1st, 2013, 03:53 AM
#5
Re: Converting grid ref to heading/bearing
Thanks eri523,
I had not come across te cartesian to polor convertion thing but it is allmost exactly what I am doing now with one great difference.
I am NOT calculating the angle as if the start point is at 0.0. If I do that and simple translate the start x,y, it makes my method far neater. Thanks for that.
I think there is another problem with the code which I have not discovered the cause of, I'll be back!
feralipod
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|