Search code examples
mathgraphicslinepointprojection

How to find projection of a point on a line


How can I find projection of a point p=(x, y, z) on the line l(t)= q + vt? where v is the unit norm vector, and q is a point on the line


Solution

  • enter image description here

    From this sketch, if we define define the vectors q = OQ and p = OP, then the orthogonal projection of p onto v is the component of p that follows the direction of v.

    Or more explicitly, it's the vector ((p · v)/v²) · v = (p · v) · v, since v² = 1.