rover2341
Is riding a roller coaster...Wee!
- Reaction score
- 113
Edit**
SOLVED
I have a XY Point (Start) And a XY Point (End)
I am trying to get the YAW Between them or the angle between them.
I want the THICK RED Angle. So that would be around 290 or so.
I have been using this. But It doesent always work.
REF: http://stackoverflow.com/questions/...-angle-between-a-line-and-the-horizontal-axis
//These Work But
F-B FAILS (Comes up with 115, That is a good angle, But in my project it gos Stright Right...)
G-B FAILS (Comes up with 115, That is a good angle, But in my project it gos Stright Right...)
Any thoughts?
Edit*
Looks like Mine Game is setup....
not 0-90-180-270
but 90-180-270-0
Hmm.. But something is wack maybe my axis is reverse too..
Edit**
SOLVED
this fixed it.
SOLVED
I have a XY Point (Start) And a XY Point (End)
I am trying to get the YAW Between them or the angle between them.
I want the THICK RED Angle. So that would be around 290 or so.
I have been using this. But It doesent always work.
REF: http://stackoverflow.com/questions/...-angle-between-a-line-and-the-horizontal-axis
Code:
float x = XPosition - tracks.Last().Position.X;
float y = YPosition - tracks.Last().Position.Y;
yawGoal = Math.Abs(Convert.ToSingle(Math.Atan2((double)x, (double)y) * 180 / Math.PI));
//These Work But
F-B FAILS (Comes up with 115, That is a good angle, But in my project it gos Stright Right...)
G-B FAILS (Comes up with 115, That is a good angle, But in my project it gos Stright Right...)
Any thoughts?
Edit*
Looks like Mine Game is setup....
not 0-90-180-270
but 90-180-270-0
Hmm.. But something is wack maybe my axis is reverse too..
Edit**
SOLVED
Code:
if (XPosition < tracks.Last().Position.X)
yawGoal = yawGoal + 90;
this fixed it.
Last edited: