troubleshooting Question

Finding the orientation of a line

Avatar of rojabuck
rojabuck asked on
9 Comments1 Solution449 ViewsLast Modified:
I would like a c function which i can pass the co-ordinates of a line as int's (start x,y and end x,y) and for that function to return a double containing the oreantation of that line as a degree. The returned value should be calculated as shown in the picture:

Does anyone have any idea how to go about this? I have tried using the atan and atan2 functions and generaly get garbage out, i am aware that this most likely mearly my lack of maths knowlage when it comes to trig etc.

Any help would be very much appreciated!

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 9 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros