Results 1 to 3 of 3

Math Help - left or right in coordinate space

  1. #1
    Newbie
    Joined
    Oct 2009
    Posts
    2

    left or right in coordinate space

    Hi all.
    Im new to the forum, and came across it on the hunt for some maths brains better than mine. I'm a hobbyist programmer and have hit a barrier. Eternally grateful if you can help.

    In the diagram there are two points creating a line in a coordinate space. This is for Flash, so the origins of x and y are in the top left corner, but hopefully this shoudn't matter. When point B moves, I get a third point (C). I need a reliable method for determining whether point B has moved left or right of the original line. All I know are the coordinates for the two orginal points and the new position of A.

    I'm happy with finding distances between points, angles etc - it's the application in this context I'm finding tricky.

    If anyone has an idea of where might I start with this, I'd be grateful.

    Many thanks.
    Attached Thumbnails Attached Thumbnails left or right in coordinate space-leftrightproblem.jpg  
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor

    Joined
    Apr 2005
    Posts
    15,541
    Thanks
    1394
    You will need to know the coordinates of two points on the line separating "left" and "right". It appears that a and b are initially on that line so save those coordinates as, say (x_1, y_1) and (x_2, y_2). Then the equation of that line is y= \frac{y_2- y_1}{x_2- x_1}(x- x_1)+ y_1 or, equivalently, y- \frac{y_2- y_1}{x_2- x_1}(x- x_1)- y_1= 0. Points to the left of that line will have y- \frac{y_2- y_1}{x_2- x_1}(x- x_1)- y_1< 0, points to the right will have y- \frac{y_2- y_1}{x_2- x_1}(x- x_1)- y_1> 0.

    That is, to determine whether a point is left or right of that line, calculate y- \frac{y_2- y_1}{x_2- x_1}(x- x_1)- y_1 and see if it is positive or negative.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Oct 2009
    Posts
    2
    Wow, thank you for such a fast and detailed response. I'm going to plug this in as soon as possible.

    Cheers.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Question on null space/column space/row space of a matrix
    Posted in the Advanced Algebra Forum
    Replies: 5
    Last Post: December 1st 2011, 01:47 PM
  2. Replies: 2
    Last Post: November 18th 2010, 09:03 AM
  3. Replies: 1
    Last Post: November 2nd 2010, 09:51 AM
  4. Replies: 5
    Last Post: August 10th 2010, 11:15 PM
  5. Convert from some 3d coordinate system to euclidian space
    Posted in the Advanced Algebra Forum
    Replies: 0
    Last Post: March 6th 2010, 05:56 AM

Search Tags


/mathhelpforum @mathhelpforum