Hi,
How can I get the angle from 2 xy coordinates?
Point 1 (2,1), Point 2 (4,5). What I want is the angle from/between point1 to point2.
Attachment 24408
Thanks.
Printable View
Hi,
How can I get the angle from 2 xy coordinates?
Point 1 (2,1), Point 2 (4,5). What I want is the angle from/between point1 to point2.
Attachment 24408
Thanks.
you mean the angle which made from the line that pass from the two points with the x-axis (cute angle, < 90 )?? if that so
tan ( angle ) = slope
slope of that line is 4/2 = 2
so the angle will be arctan(2)
Yes what Amer said is what I meat.
But atan(2) = 1.107. The answer I was looking is between 30-40degrees (pure by looking at it).
I hope it describes it better.
No its for a programming language.
Yes I can to that conclusion too of 63 degrees. But the answer doesn't look correct. The answer should be somewhere between 30-40 at the most.
So whats wrong?
If you slide the line over till it hits the y axis, it looks around 63 degrees to me.
I to am trying to create a function that can calculate degrees from a graph for the purpose of a script in Script-fu for GIMP. However, the problem is the slope of 90 degrees is y/0, which creates some difficulty when writing a function.
Any input is appreciated.
Thank you.
The angle, as shown in your picture, is clearly larger than 40 degrees. Where did you get the condition that it must be "between 30-40 at the most"?
I updated the image.
If you were to place point1 at 0,0 so in the center it definitely isn't over 45degrees.
Attachment 24410
Are you aware that, as customary in mathematics and as stated explicitly in post #3, the angles are measured between the line in question and the x-axis (the horizontal one)?
Well I was hoping to get the degrees starting at the 0 degrees.
I can do 63-90 = 27degrees. But I was hoping to get a formula which starts at 0 degrees, the upper y axis.
You can either subtract the found angle from 90 or take the arctangent of Δx / Δy instead of Δy / Δx. Here Δx is the difference of the x-coordinates and similarly for y.