Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Dividing up a line continued

Name: Anonymous 2006-04-10 7:02


If there is a line from (x1 , y1 ) to (x2, y2)

If i want to find a Point on the line a fraction of the way through it , Eg. 1/5 through the line how do i do it ?
 answer : The point at some fraction r of the way through is:
( r(x2-x1)+x1 , r(y2-y1)+y1 )

Now if i want say the point 2 "fractions" down the line, eg if R = 3 I can get 1/3rd down the line, how do i get 2/3's ?

Name: Anonymous 2006-04-10 7:43

>answer : The point at some fraction r of the way through is:
( r(x2-x1)+x1 , r(y2-y1)+y1 )

Isn't that wrong though? if you do that, the distance will be r*sqrt(2) away from the point instead of r, because you are going r both vertically and horizontally. i gave another solution in the original thread.

Name: Anonymous 2006-04-10 7:44

^bleh, ignore that, I might have got it wrong.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List