INERTIATENS
Name
INERTIATENS
Purpose
Calculates the 2nd moment tensor (sometimes incorrectly referred to
as the moment of inertia tensor) of a mass distribution specified by
a list of particle positions.
Category
Astro
Calling Sequence
Result = INERTIATENS(Pos)
Inputs
Pos: An Nx3 array specifying the 3d positions of the N particles
that make up the mass distribution.
Keyword Parameters
MASSES: An N-element vector of the mass of each point. If not
specified, all masses are assumed to be unity.
R2WEIGHT: If /R2WEIGHT is specified then particles are downweighted
by a factor of 1/r^2 so that all particles have equal
effect regardless of radius.
Outputs
The function returns a 3x3 symmetric array containing the 2nd moment
of the mass distribution tensor, i.e. Result[i,j] is the sum over each
particle k of MASSES[k] * Pos[k,i] * Pos[k,j].
Example
Calculate the inertia tensor of 6 equal-mass points distributed on
the vertices of a cube:
xmasspos = [-1,-1,-1,-1,1,1,1,1]
ymasspos = [-1,-1,1,1,-1,-1,1,1]
zmasspos = [-1,1,-1,1,-1,1,-1,1]
itens = INERTIATENS([[xmasspos],[ymasspos],[zmasspos]])
Modification History
Written by: Jeremy Bailin
10 June 2008 Public release in JBIU
22 July 2011 Bug fix for /R2WEIGHT to actually do something useful