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?


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


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
  • \$\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 agree to our terms of service, privacy policy and cookie policy

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