Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding coordinates of a point between two points?

Doing some 3D stuff in wpf- want to use a simpler test to see if everything is working (before moving to curves).

The basic question is given two points x1,y1,z1 and x2,y2,z2 I have calculated the distance between the points. But how to find the coordinates of another point (x3,y3,z3) that lies on that line at some distance?

I.e. if my line is 100 long between -50,0,0 and 50,0,0 what are the coordinates of the point at 100 * 0.1 along the line?

I think this is a simple formula but I haven't found it yet....

like image 822
Nicros Avatar asked May 21 '10 22:05

Nicros


People also ask

How do you find the unknown coordinates of a point?

Substitute the value of the slope given and the given coordinate values of point A and point B. Use a slope of "1" and the coordinates of point A as (0, 0) for the point (X2, Y2) and the coordinates of point B as (1, Y1) for the other point (X1, Y1), where Y1 is the unknown coordinate that you must solve for.

What is the formula for coordinates?

Question 1: State the formula of coordinate geometry? Answer: One of the important formula of coordinate geometry is the equation of the straight line which is y = mx + c. Here m is the slope and c is the y-intercept (tan θ = m, here θ is the angle that the line makes with the positive x-axis).


2 Answers

For each p between 0 and 1 then this will give you a point on the line segment:

(x1, y1, z1) + p * ((x2, y2, z2) - (x1, y1, z1))
like image 158
Mark Byers Avatar answered Oct 25 '22 15:10

Mark Byers


This has to do with math, but ok. Let P and Q be the two given points and X the point you're looking for.

P + r(Q - P) = X

r indicates a factor.

if 0 < r < 1: the point x will be on the line between the two points.

That's it!

EDIT:

To find a point at a given distance d from P(p1/p2/p3):

d² / euclidian_square_distance(P,Q) = r

Insert r in the equation mentioned above and you'll have your point! :)

P.S: Btw: P-Q = (Px - Qx, Py - Qy, Pz - Qz)... i bet you alread knew it :)

like image 31
Simon Avatar answered Oct 25 '22 16:10

Simon