Page 1 of 2 12 LastLast
Results 1 to 15 of 16
Like Tree2Thanks

Math Help - Get angle from 2 points

  1. #1
    Newbie
    Joined
    Jul 2012
    From
    Location
    Posts
    11

    Get angle from 2 points

    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.

    Get angle from 2 points-points.png

    Thanks.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor

    Joined
    Aug 2006
    Posts
    18,922
    Thanks
    1762
    Awards
    1

    Re: Get angle from 2 points

    Quote Originally Posted by mplus View Post
    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.

    Click image for larger version. 

Name:	points.PNG 
Views:	25 
Size:	5.2 KB 
ID:	24408
    There is no angle between two points.
    An angle is the union of two rays with common endpoints.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    MHF Contributor Amer's Avatar
    Joined
    May 2009
    From
    Jordan
    Posts
    1,093

    Re: Get angle from 2 points

    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)
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Newbie
    Joined
    Jul 2012
    From
    Location
    Posts
    11

    Re: Get angle from 2 points

    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.
    Follow Math Help Forum on Facebook and Google+

  5. #5
    MHF Contributor
    skeeter's Avatar
    Joined
    Jun 2008
    From
    North Texas
    Posts
    12,059
    Thanks
    894

    Re: Get angle from 2 points

    Quote Originally Posted by mplus View Post
    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.
    atan(2) = 1.107 radians .. check the mode of your calculator and change it to degrees if you want degrees
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Newbie
    Joined
    Jul 2012
    From
    Location
    Posts
    11

    Re: Get angle from 2 points

    No its for a programming language.
    Follow Math Help Forum on Facebook and Google+

  7. #7
    MHF Contributor

    Joined
    Aug 2006
    Posts
    18,922
    Thanks
    1762
    Awards
    1

    Re: Get angle from 2 points

    Quote Originally Posted by mplus View Post
    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).
    Well there are still mathematical dinosaurs who still use degrees.
    For those left behind you want \frac{\arctan(2)\cdot 180^o}{\pi}=63.435^o.
    Thanks from skeeter and Amer
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Newbie
    Joined
    Jul 2012
    From
    Location
    Posts
    11

    Re: Get angle from 2 points

    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?
    Follow Math Help Forum on Facebook and Google+

  9. #9
    Newbie
    Joined
    Aug 2012
    From
    Canada
    Posts
    13

    Re: Get angle from 2 points

    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.
    Last edited by Phoenix999; August 2nd 2012 at 11:51 PM.
    Follow Math Help Forum on Facebook and Google+

  10. #10
    MHF Contributor
    Joined
    Oct 2009
    Posts
    5,559
    Thanks
    785

    Re: Get angle from 2 points

    Quote Originally Posted by mplus View Post
    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.
    Please explain why you think so.
    Follow Math Help Forum on Facebook and Google+

  11. #11
    MHF Contributor

    Joined
    Apr 2005
    Posts
    16,234
    Thanks
    1795

    Re: Get angle from 2 points

    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"?
    Follow Math Help Forum on Facebook and Google+

  12. #12
    Newbie
    Joined
    Jul 2012
    From
    Location
    Posts
    11

    Re: Get angle from 2 points

    I updated the image.

    If you were to place point1 at 0,0 so in the center it definitely isn't over 45degrees.

    Get angle from 2 points-points.png
    Follow Math Help Forum on Facebook and Google+

  13. #13
    MHF Contributor
    Joined
    Oct 2009
    Posts
    5,559
    Thanks
    785

    Re: Get angle from 2 points

    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)?
    Follow Math Help Forum on Facebook and Google+

  14. #14
    Newbie
    Joined
    Jul 2012
    From
    Location
    Posts
    11

    Re: Get angle from 2 points

    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.
    Follow Math Help Forum on Facebook and Google+

  15. #15
    MHF Contributor
    Joined
    Oct 2009
    Posts
    5,559
    Thanks
    785

    Re: Get angle from 2 points

    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.
    Follow Math Help Forum on Facebook and Google+

Page 1 of 2 12 LastLast

Similar Math Help Forum Discussions

  1. Angle between two points in all four quadrants?
    Posted in the Trigonometry Forum
    Replies: 0
    Last Post: February 29th 2012, 09:22 PM
  2. Angle between two points on a circle
    Posted in the Trigonometry Forum
    Replies: 6
    Last Post: December 1st 2009, 06:11 AM
  3. Vector-points-angle problem
    Posted in the Geometry Forum
    Replies: 5
    Last Post: October 10th 2009, 07:00 AM
  4. Replies: 2
    Last Post: September 4th 2009, 11:19 PM
  5. determine angle of 3 points
    Posted in the Geometry Forum
    Replies: 1
    Last Post: May 22nd 2009, 10:48 PM

Search Tags


/mathhelpforum @mathhelpforum