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\$
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\$
  • \$\begingroup\$ Thanks so much, it works! I've tried using slope before but looks like I did it wrong. :-) \$\endgroup\$ – Sarah Oct 16 '18 at 10:34

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.