Search code examples
mathlinear-algebraalgebra

Get the point that corresponds to 1/3rd the distance from p1 to p2


So for example, if we have p1 = (x1,y1) and p2 = (x2,y2) and I want to find the point that corresponds to 1/3rd the distance from p1 and p2 that lies in the line formed by p1 and p2, then what formula would I use? Having a brainfart right now.


Solution

  • Same one as for any other position:

    p(t) = a*(1-t) + b*t 
    

    where 0 <= t <= 1 gives all points on a line between vectors "a" and "b"/

    In your case

    p = (x1, y1)* (1-1/3) + (x2,y2) * 1/3
    

    which is how some other answers look like.