# perpendicular from vertex to line, to plane?

Hello
Who can help -
I have three vertexes. How can find perpendicular from one vertex to line of two other?
If I have for vertexes. How find perpendicular from vertex to plane of three other vertexes?

Thank You

## Comment viewing options ### .

```(
p01 = point pos:[0,0,0]
p02 = point pos:[100,100,100]
p03 = point pos:[50,70,90]

function PointLineProjection pA pB pC =
(
local vAB = pB - pA
local vAC = pC - pA
local d = dot (normalize vAB) (normalize vAC)
(pA + ( vAB * ( d * ( length vAC / length vAB) ) ) )
)

pos = PointLineProjection p01.pos p02.pos p03.pos
point pos:pos
)```
```(
p01 = point pos:[0,0,0]
p02 = point pos:[100,0,0]
p03 = point pos:[0,100,0]
p04 = point pos:[50,70,90]

fn pointPlaneProj pA pB pC pD =
(
/*******************************************************************************
<DOC> Find the projection of a point onto a plane.
Arguments:
<point3> pA:				Point on the plane.
<point3> pB:				Point on the plane.
<point3> pC:				Point on the plane.
<point3> pD:				Point to project on the plane.
Return:
<point3>	Projected point.
*******************************************************************************/
local nABC = normalize (cross (pB - pA) (pC - pA))
pD + ((dot (pA - pD) nABC) * nABC)
)

pos = pointPlaneProj p01.pos p02.pos p03.pos p04.pos
point pos:pos
)``` Thank You!

Perfect