# Thread: Finding the Y coordinate with the X coordinate

1. ## Finding the Y coordinate with the X coordinate

OK so this is a bit confusing to explain for me, so I drew a little diagram:

Say we have someone walking up a hill, but only know:

-Their X coordinate
-The X/Y of the bottom of the hill
-The X/Y of the top of the hill

Could someone give me a little equation to find their Y coordinate?

Sorry if this is painfully obvious, but I do not have a very good math background. Also, sorry if this is in the wrong forum.

2. Originally Posted by logank9
OK so this is a bit confusing to explain for me, so I drew a little diagram:

Say we have someone walking up a hill, but only know:

-Their X coordinate
-The X/Y of the bottom of the hill
-The X/Y of the top of the hill

Could someone give me a little equation to find their Y coordinate?

Sorry if this is painfully obvious, but I do not have a very good math background. Also, sorry if this is in the wrong forum.
Basically, you want to find the equation of this line. From that equation, you can plug in the X value, to get the Y value. From the data given, you can create this equation using the point-slope formula of a line, which looks like

$\displaystyle y - y_1 = m (x - x_1)$

where m is the slope of the line, and y_1 and x_1 are the y and x coordinates of any point on the line. You have two known points, A and B, so you can use either of these for the x_1, y_1 values.

Since you have two points, you can calculate the slope. The slope of a line is the difference in Y coordinates of two points divided by the difference in X coordinates of two points. Lets call point 1 A and point 2 B, the slope equation is

$\displaystyle m = \frac{y_b - y_a}{x_b - x_a}$

3. Referring to your diagram, if the co-ordinates of A and B are $\displaystyle (x_A, y_B) \mbox{ and } (x_B, y_B)$ respectively,
then the gradient of the hill, ( the line AB ) will be
$\displaystyle \frac{y_B - y_A}{x_B - x_A}$
If now the point C (with co-ordinates $\displaystyle (x_C , y_C) )$ lies on AB, the gradient of AC must be the same as the gradient of AB.
So, write down an expression (similar to the one above) for the gradient of AC, put the two gradients equal to each
other, substitute the known co-ordinates for A and B and the known x co-ordinate for C and solve for $\displaystyle y_C$.

4. OH!

Thanks so much I get it now