1
\$\begingroup\$

If I had a vertical line (which its x is 0) and 2 vectors which connected together to form a line segment, would it be possible to "project" the line segment onto the vertical line?

Eg.

If all I had was Vector 1 and Vector 2, would it be find where Vector 3 is along the vertical line?

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

If vector1 is (x1, y1), vec2 is (x2, y2) and vec3 is (x3, y3), and the vertical line has the equation x = c, then

x3 = c
y3 = (y2 - y1) / (x2 - x1) * (c - x1) + y1
\$\endgroup\$
1
  • \$\begingroup\$ Thanks so much, it works! I've tried using slope before but looks like I did it wrong. :-) \$\endgroup\$
    – Sarah
    Oct 16, 2018 at 10:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .