6
$\begingroup$

This is my code to find the coordinate of projection of the point pA = {2, 3, 5} on the plane -284 + 14 x + 2 y + 5 z == 0.

Clear["Global`*"]
pA = {2, 3, 5};
myP = -284 + 14 x + 2 y + 5 z;
{x, y, z} /. 
 Solve[{x == pA[[1]] + Coefficient[myP, x] t, 
   y == pA[[2]] + Coefficient[myP, y] t, 
   z == pA[[3]] + Coefficient[myP, z] t, myP == 0}, {x, y, z, t}, Reals]

{{16, 5, 10}}

What is simpler way to find the projection of a point on a plane?

$\endgroup$

2 Answers 2

9
$\begingroup$
RegionNearest[ImplicitRegion[myP == 0, {x, y, z}]]@pA

{16, 5, 10}

$\endgroup$
6
$\begingroup$
Clear["Global`*"]
pA = {2, 3, 5};
myP = -284 + 14 x + 2 y + 5 z;

The normal vector to the plane is:

Coefficient[myP, {x, y, z}]

{14, 2, 5}

The line that passes through the point pA and is parallel to the normal vector is given by:

line = Coefficient[myP, {x, y, z}] t + pA

{2 + 14 t, 3 + 2 t, 5 + 5 t}


For Mathematica processing, convert to rules:

pline = Thread[{x, y, z} -> line]

{x -> 2 + 14 t, y -> 3 + 2 t, z -> 5 + 5 t}


To find where the parametric line intersects the plane (i.e., closest point), solve for t:

sol = First@(myP == 0 /. pline // Solve[#, t] &)

{t -> 1}

res = line /. sol

{16, 5, 10}

$\endgroup$
1
  • $\begingroup$ Thank you very much for your explanation. My way is similar to your way. $\endgroup$ Mar 11 at 14:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.