astro/
inertiatens.pro
top source inertiatens
Astro
result = inertiatens(pos, masses=masses, r2weight=r2weight)
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.
Return value
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].
Parameters
- pos in
An Nx3 array specifying the 3d positions of the N particles that make up the mass distribution.
Keywords
- masses in
An N-element vector of the mass of each point. If not specified, all masses are assumed to be unity.
- r2weight in
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.
Examples
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]])
Author information
- History:
Written by: Jeremy Bailin 10 June 2008 Public release in JBIU 22 July 2011 Bug fix for /R2WEIGHT to actually do something useful
File attributes
| Modification date: | Fri Jul 22 11:40:27 2011 |
| Lines: | 69 |
![[attach.png]](../idldoc-resources/attach.png)