Find Point on a line w/ specified distance

gade

New member
Joined
Mar 1, 2009
Messages
3
I have a line drawn between point1 and point2 at the specified coordinates:
Point 1 (306, 146)
Point 2(366, 180)

The line has a slope of .56667.

I now want to extend that line to point3 by a specified distance.

Point3 should extend the line by a distance of 75.

How do I find the x,y coordinates of Point3 knowing only the distance that it should be at on that line?

I'm sure this is something simple that I am missing but I am stuck.

Thanks for any help.
 
Find the equation of the line.

You'll get a formula for the y-coordinates in the form mx+b.

In other words, the point 75 units away has coordinates (x, mx+b).

Use the distance formula with these coordinates and the coodinates of whichever point you choose to move away from.

Solve the resulting equation for x. You'll get two solutions. Analyze these two values to determine which one makes sense as the x-coordinate of the point 75 units away in the direction you choose.

Use the equation of the line to find the value of y that corresponds to this x-coordinate.

If you need more help with this exercise, then please show whatever work you can accomplish and explain what you're thinking so that I know where to continue helping.
 
Here's an example exercise.

Two points are (1,1) and (9,10).

Find the coordinates of the point on the line through these two points that is 16 units away from the point (1,1), in the direction heading toward Quadrant III.

The equation of the line is: y = (9/8)x - 1/8.

This means that the unknown coordinates of the point we seek are (x, [9/8]x - 1/8).

The distance formula gives us the following equation.

(1 - x)^2 + (1 - [9/8]x + 1/8)^2 = 16^2

Solving this quadratic yields two candidates for the unknown x-coordinate: 11.6298 and -9.6298.

Clearly, if we're looking for the point that is on the line extended into Quadrant III, then the x-coordinate cannot be greater than 1.

Therefore, the x-coordinate we seek is -9.6298.

Using the equation of the line as a formula for finding y-coordinates, we find that the coordinates of the point on this line in Quadrant III which is 16 units away from the point (1,1) are (-9.6298, -10.9585).


 
thanks for the reply.

the second example helped.

I need to implement this in a program. Is there any possible way to do this with vector addition ?

The coding for this is going to get a little ugly.
 
No need for slopes, equations....
General case:

Point 1 (a,b) : given
Point 2 (c,d) : given
e = extension length : given

Point 3 (j,k)

u = c - a
v = d - b
w = sqrt(u^2 + v^2)

x = eu / w
y = ev / w

j = a + u + x
k = b + v + y

Using Mark's example, this'll give you the point at the other end: (19.6298, 21.9585)

Using your example: (431.2517, 216.9759) ; 75 from (366, 180)

I'll let you figure out the "adjustment" required to get the point from the other end...
 
gade said:
I have a line drawn between point1 and point2 at the specified coordinates:
Point 1 (306, 146)
Point 2 (366, 180)
Just a remark, gade: if you're trying to "understand" how this works, why choose such points?
Much easier to "see" if you'd set up something like:
Point 1 (4,3), Point 2 (10,11), distance 5.
USE graph paper: you then easily "see" an initial 6-8-10 right triangle;
and you easily "see" that extending the line (hypotenuse) by 5 from (10,11) ends up at point (13,15).
You can then use this simple example to work out a general case formula...kapish?
 
Thanks so much Denis

It worked great and there was so much less code!
 
Top