Moment of inertia of a (homogenous) triangle in R3

In a forgoing post

the moment of inertia of a triangle in R2 rotating around a point was calculated.

Here a method is given to do this in R3, the triangle rotating around an axis thru x4 and with direction b

(* square of distance of a point p to an axis thru x and direction b *)

Clear[dist]
dist2[p_, x_, b_] := Module[{aa, fL, vB},
  aa = p - x;
  fL = b.aa/(b.b);
  vB = p - x - b fL;
  vB.vB]

(* Moment of Inertia of a triangle given by x1, x2, x3 with respect to axis thru x4 and direction b  *)

Clear[fMI]
fMI[x1_, x2_, x3_, x4_, b_] := Module[{d2, d3, fe},
  d2 = x2 - x1;
  d3 = x3 - x1;
  fe = Cross[d2, d3]; 
  fe = Sqrt[fe.fe];  (*surface-element of Triangle*)
  Integrate[ fe  dist2[x1 + u d2 + v d3, x4, b], {v, 0, 1}, {u, 0, 1 - v}]
  ]

Check with the result of forgoing post

fMI[{4, 1, 0}, {1, 3, 0}, {2, 7, 0}, {.5, 5, 9}, {0, 0, 3}]

Hans showed very nice how to calculate the moment of inertia. If one is only interested in the result one can use the function provided by Mathematica which has a similiar interface compared to the function of Hans. Main difference is that not a list of coordinates has to be provided but rather a object in form of a region (here: triangle).

With[{pointOfRotation = {0.5, 5, 9}, direction = {0, 0, 3}}, 
 MomentOfInertia[Triangle[{{4, 1, 0}, {1, 3, 0}, {2, 7, 0}}], 
  pointOfRotation, direction]]