I have been deconstructing Michael Schreiber’s Inertia Versus Gravity In 3D author.nb from the Demo project. The main work is done in the inertiaversusgravity3D function which I have “exploded” below.
inertiaversusgravity3D[m1_, m2_] := Module[
{tt}, {-m2 + 2 m1 + (
Plus @@ # & /@ Map[
With[
{tt = (#[[1]]^2 + #[[2]]^2 + #[[3]]^2)},
If[tt > 0., #/tt, {0., 0., 0.}]
]
&,
(1 - IdentityMatrix[Length[m1]]) Outer[Plus, -m1, m1,1], {2}]) , m1}
];
{m = N[pts RandomReal[{-1, 1}, {pts, 3}]]}
(* The first call would be *)
{m1,m2}=inertiaversusgravity3D[m, m]
My question is in the line:
(1 - IdentityMatrix[Length]) Outer[Plus, -m1, m1,1], {2}])
This looks like it is going to multiply two matricies but there is not a default multiplication operation either the dot or cross product must be specified. When I , define m1 manually and look at the results of this line I get Outer[Plus, -m1, m1,1], {2}] unchanged.
My question is should the matricies be dotted together and is the operation Matrix1 Matrix2 (Matrix1 * Matrix2) defined? If so what is the definition.
Any insight would be appreciated.
Mark

