# Normal of plane given three points [duplicate]

Is there a command (or a combination of commands) that takes three points of a plane and outputs the normal vector of that plane? I'm told there is a ready way of automating this, but have been unable to find it.

• Hyperplane maybe work. Commented Dec 22, 2021 at 9:21
• Welcome to the Mathematica Stack Exchange. Please include Mathematica code that you have tried out so far. Code can be copied from the cell in your notebook and pasted in the Edit window; use the { } button in the edit window for formatting code. If you are starting out with Mathematica, then the introductory book written by the inventor is a great online resource.
– Syed
Commented Dec 22, 2021 at 9:22
• Similar to this, this and perhaps this.
– Syed
Commented Dec 22, 2021 at 9:45

In 3D, "Cross" can be used to get a vector perpendicular to 2 given vectors.

Call the given vectors p1,p2,p3, then Cross[p2-p1,p3-p1] is a vector perpendicular to the plane through p1,p2,p3.

Here is an example:

SeedRandom[3];
{p1, p2, p3} = RandomReal[{-1, 1}, {3, 3}];
p4 = Cross[p2 - p1, p3 - p1];
Graphics3D[{
Arrow[{{0, 0, 0}, #}] & /@ {p1, p2, p3}, Red, Arrow[{{0, 0, 0}, p4}],
Green, Opacity[0.5], InfinitePlane[{p1, p2, p3}]
}]


• I will usually recommend Daniel's method, but the method hinted in Roman's comment can be made to work: Normal[Last[CoefficientArrays[Det[PadRight[Prepend[{p1, p2, p3}, {x, y, z}], {4, 4}, 1]], {x, y, z}]]] Commented Dec 22, 2021 at 13:18