This can probably be classed as more of a math question than a Three.js question however I've come across the issue whilst using Three.
Say I have two instances of Vector3 that can define a line (P1 and P2 in image below).
Now say I also have another instance of a Vector3 to represent a point (P3). I want to calculate the vector that defines the direction from P3 toward the line. The resulting vector should also be normal to the line.
I figure it is a dot/cross product problem but can't quite get it.
The equation should work even when P1 and P2 define a line which is not parallel to any of the cartesian axes.

