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: http://www.dcs.st-and.ac.uk/~arb11/angle-function.gif
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!