Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Coordinate geometry query

  1. Jan 23, 2006 #1
    Not actually homework, but just a general query...

    I'm trying to write a program that will predict the trajectory of a moving point by analysing several positions through which the point has passed.

    Part of this involves finding the coordiantes of a point B, given the coordinates of another point A, the length of AB and its gradient. Obviously there are two possible points... one to the right A and one to the left, but I'm only interested in the one to the right.

    I basically need two simple formulae in terms of the x and y coordinates of B, which I can apply in the program itself, although I wouldn't mind knowing how the formula was reached as well :smile:

    I've tried getting my head around it but I'm just getting confused. Any help would be greatly appreciated, thanks!
    Last edited: Jan 23, 2006
  2. jcsd
  3. Jan 23, 2006 #2


    User Avatar
    Homework Helper

    I'm not sure what you mean by the gradient. Is that the slope of the line connecting A to B? Are you asking how to find a point B=(x2,y2) given a point A=(x1,y1), and the length L and slope m of AB?

    If so, this can be found by pretending A is at (0,0) (you can add the coordinates of A back in at then end). Then the line containing AB has the equation y=mx, so that points along the line have coordinates like (x,mx). The distance from A to a point (x,mx) is [itex]\sqrt{x^2+m^2 x^2}=x\sqrt{1+m^2}[/itex]. Then you want to solve for x using [itex]L= x\sqrt{1+m^2}[/itex]. This x is the difference between the x values of A and B, and multiplying it by m gives the difference between the y values.
    Last edited: Jan 23, 2006
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook