Function Repository Resource:

HessianPlane

Source Notebook

Get the Hessian normal form of a plane passing through three given points in space

Contributed by: Ed Pegg Jr

ResourceFunction["HessianPlane"][pts]

returns the Hessian plane for pts.

Details

Let and be the normal vector {a,b,c}, such that a2+b2+c2=1. The Hessian normal form of a plane is , with d the distance from the origin.
The Hessian plane equation a x+b y+c z-d=0 can also be written as {a,b,c,d}.{x,y,z,-1}=0.

Examples

Basic Examples (3) 

Find the Hessian plane through three points:

In[1]:=
pts = {{-1, 0, 0}, {0, 0, -2}, {0, -1, 0}};
hp = ResourceFunction["HessianPlane"][pts]
Out[1]=

The first three components form a unit vector:

In[2]:=
Norm[Most[hp]]
Out[2]=

Show the plane, points and normal vector:

In[3]:=
Graphics3D[{Sphere[pts, Scaled[0.02]],
  {Directive[Black, Arrowheads[Medium]], Arrow[Tube[{Mean[pts], Mean[pts] - 1.5 Most[hp]}]]},
  {Directive[Opacity[0.5], ColorData[97, 2]], Hyperplane[Most[hp], -Last[hp]]}}, {ImageSize -> Small, PlotRange -> {{-2, 1}, {-2, 1}, {-2, 1}}, PlotRangePadding -> Scaled[0.05]}]
Out[3]=

Possible Issues (2) 

Timing can be faster than RegionDistance in some cases (though usually it is not):

In[4]:=
triangles = Select[RandomInteger[{-6, 6}, {1000, 3, 3}], Volume[Tetrahedron[Append[#, {7, 7, 7}]]] > 0 &];
In[5]:=
Timing[ distr = RegionDistance[InfinitePlane[#], {Sqrt[2], 1, Sqrt[5]}] & /@ triangles;]
Out[5]=
In[6]:=
Timing[ disth = ResourceFunction["HessianPlane"][#] . {Sqrt[2], 1, Sqrt[5], 1} & /@
     triangles;]
Out[6]=
In[7]:=
Chop[Total[Abs[N[distr]] - Abs[N[disth]]]]
Out[7]=

HessianPlane fails if the given points do not determine a plane:

In[8]:=
ResourceFunction["HessianPlane"][{{0, 0, 0}, {0, 0, 1}, {0, 0, 2}}]
Out[8]=

Neat Examples (4) 

Points of a random tetrahedron centered at the origin:

In[9]:=
v = Standardize[RandomInteger[{-3, 3}, {4, 3}], Mean, 1 &]
Out[9]=

Face planes of the tetrahedron:

In[10]:=
fp = ResourceFunction["HessianPlane"] /@ Subsets[v, {3}]
Out[10]=

Incenters of each face, using the resource function Incircle3D:

In[11]:=
in = RootReduce[ResourceFunction["Incircle3D"][#, "Center"]] & /@ Subsets[v, {3}];

Perpendiculars to the incenters do not not intersect, therefore this tetrahedron does not have a midsphere tangent to all edges:

In[12]:=
Graphics3D[{{EdgeForm[Gray], Opacity[0.5], Tetrahedron[v]},
  {Black, Composition[Tube[#, Scaled[0.002]] &, ResourceFunction["Incircle3D"]] /@ Subsets[v, {3}]},
  Table[Tube[{in[[k]], in[[k]] + Most[fp[[k]]]}, 0.06], {k, 4}]}]
Out[12]=

Version History

  • 1.0.0 – 31 May 2022

Related Resources

Author Notes

Not sure if this already exists, but I recreate something like this constantly. If it does exist, then this might be a good function just for pointing at other functions.

License Information