Results 1 to 9 of 9

Math Help - Angle between 2 points, based off north

  1. #1
    Newbie
    Joined
    Apr 2009
    Posts
    5

    Angle between 2 points, based off north

    Hi people,

    Basically I have 2 points, I know both of the point's X and Y co-ordinates.
    I am wanting to find the angle between the 2 points based off of North. (0 degrees)

    Pic: http://i44.tinypic.com/292o27d.jpg

    In the picture, the angle i'm after would be roughly midway between 270 and 360 (315)


    Sorry if i've posted this in the wrong section, i've really got no idea if this is trigonometry, geometry or what lol.

    Thanks,
    James
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Newbie
    Joined
    Apr 2009
    Posts
    21
    Do the lines you've drawn there come from the origin (0,0)?
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Apr 2009
    Posts
    21
    Gonna assume they do and answer anyway.

    Calling the blue dot "A" and the green dot "B".

    To find the angle you need to use trig. To use trig you need a right angled triangle. How can you form a right angled triangle from that diagram?

    How can you determine the side lengths of the triangle you draw? Well, given you know the co-ordinates of A and B you should consider that when you create your triangle.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Newbie
    Joined
    Apr 2009
    Posts
    5
    Sorry im not sure what you mean by the origin, but both points can be at any x and y position.
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Newbie
    Joined
    Apr 2009
    Posts
    21
    >>I know both of the point's X and Y co-ordinates.
    >>both points can be at any x and y position

    Which one?
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Newbie
    Joined
    Apr 2009
    Posts
    5
    ah sorry, i meant that i will be able to retrieve both point's X and Y position.

    When I said they can be at any pos, i meant that i will know that pos, but it will not always be the same pos (in different occuraces ofcourse.)
    Just realised that wasn't really relevant, basically I will always know both of the point's X and Y co-ordinates.
    Last edited by JamesUK3000; April 6th 2009 at 02:47 AM.
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Newbie
    Joined
    Apr 2009
    Posts
    5
    Hi again,
    managed to make a right angle triangle and figure out 2 side's lengths:
    http://i42.tinypic.com/2rnwox5.jpg

    I guess i need to find the hypotenuse length aswell? If so, would I do this using Pythagoras?

    And then how would I get the angle im after using those lengths?

    thanks
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Super Member

    Joined
    May 2006
    From
    Lexington, MA (USA)
    Posts
    11,548
    Thanks
    539
    Hello, James!

    We have two points: . P(x_1,y_1),\;Q(x_2,y_2)
    . . and we want the bearing of PQ.

    If P and Q can be any two distinct points, the formula is not simple.

    Code:
            |                 Q
            |                 o (x2,y2)
            |               * :
            |             *   :
            |           *     :
            |         *       :
            |       *         : y2-y1
            |     *           :
            |   *             :
            | *  θ            :
          P o - - - - - - - - o
        (x1,y1)    x2-x1      R
    Let \theta \,=\,\angle QPR.

    Then: . \tan\theta \:=\:\frac{QR}{PR} \:=\:\frac{y_2-y_1}{x_2-x_1}

    Hence: . \theta \;=\;\arctan\left(\frac{y_2-y_1}{x_2-x_1}\right)


    But the bearing of QR depends on the "quadrant" of Q, relative to P.

    I think I've organized it into two cases:
    . . whether Q is to the right or left of P.

    . . . . . \begin{array}{|c|c|} \hline<br />
x_2-x_1 & \text{Bearing} \\ \hline \hline<br />
+ & 90^o - \theta \\ \hline<br />
- & 270^o - \theta \\ \hline \end{array}



    But someone check my work . . . please!
    .
    Follow Math Help Forum on Facebook and Google+

  9. #9
    Newbie
    Joined
    Apr 2009
    Posts
    5
    Thanks soroban, worked perfectly!

    For any lua scripters out there:
    Code:
    function VLEGetBearingOf2Points(Point1X, Point1Y, Point2X, Point2Y)
    	local SideYLength = Point2Y - Point1Y
    	local SideXLength = Point2X - Point1X
    	
    	if SideYLength == 0 and SideXLength == 0 then return 0
    	end
    	
    	local TanValue = SideYLength / SideXLength
    	local Radians = math.atan(TanValue)
    	
    	local Angle = math.deg(Radians)
    	
    	local a = Point2X - Point1X
    	if a >= 0 then Angle = 90 - Angle
    	else Angle = 270 - Angle
    	end
    	
    	return Angle
    end
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. square based pyramid angle
    Posted in the Trigonometry Forum
    Replies: 4
    Last Post: December 10th 2010, 05:49 PM
  2. Angle between two points on a circle
    Posted in the Trigonometry Forum
    Replies: 6
    Last Post: December 1st 2009, 05:11 AM
  3. Replies: 2
    Last Post: September 4th 2009, 10:19 PM
  4. due north?
    Posted in the Algebra Forum
    Replies: 4
    Last Post: July 4th 2009, 06:30 AM
  5. EndPoint based on Length and Angle
    Posted in the Geometry Forum
    Replies: 4
    Last Post: April 30th 2009, 11:10 AM

Search Tags


/mathhelpforum @mathhelpforum