It is very simple, all you have to do is find the perpendicular (abbr here |_ ) the distance from point P to the plane, and then move P back to the perpendicular distance in the plane of the plane. As a result, the translated P is in the plane.
Taking a simple example (which we can verify by checking):
Set n = (0,1,0) and P = (10, 20, -5).

The projected point should be (10,10, -5). You can see by checking that Pproj is 10 units perpendicular to the plane, and if it were in the plane, it would have y = 10.
So how do we find it analytically?
The plane equation is Ax + By + Cz + d = 0. What this equation means is that for a point (x, y, z) to be in a plane, it must satisfy Ax + By + Cz + d = 0 .
What is the equation Ax + By + Cz + d = 0 for the plane drawn above?
The plane has a normal n = (0,1,0). D can be found simply by using a test point already in the plane:
(0)x + (1)y + (0)z + d = 0
Point (0.10.0) is in the plane. Connecting above, we find d = -10. The flat equation is then 0x + 1y + 0z - 10 = 0 (if you simplify, you get y = 10).
A good interpretation of d is that we are talking about the perpendicular distance that you would need to translate the plane along its normal so that the plane passes through the origin .
In any case, as soon as we have d , we can find the distance from any point to the plane with the following equation:

There are 3 possible classes of results for | _ distance to the plane:
- 0: ON PLANE EXACTLY (almost never happens with floating point inaccuracy issues)
- +1:> 0: In the FRONT plane (on the normal side)
- -1: <0: BEHIND plane (ON OPPOSITE SIDE OF NORMAL)
Anyway,

Which you can check as correctly by looking at the diagram above