This is basic graphics geometry and/or trig, and I feel dumb for asking it, but I can't remember how this goes. So:
- I have a line defined by two points (x1, y1) and (x2, y2).
- I have a third point (xp, yp) which lies somewhere else.
I want to compute the point (x', y') that lies somewhere along the line in #1, such that, when joined with the point from #2, creates a new perpendicular line to the first line.

Thanks.