MomentData Class

A MomentData structure carries data used in calculation of moments of inertia.

  • origin = local origin used as moments are summed.
  • sums = array of summed moments.
    • The [i,j] entry of the sums is a summed or integrated moment for product of axis i and j.
      • axes 0,1,2 are x,y,z
        • e.g. entry [0,1] is summed product xy
      • axis 3 is "w", which is 1 in sums.
        • e.g. entry 03 is summed x

Methods

Name Description
accumulateLineMomentsXYZ(pointA: Point3d, pointB: Point3d): void Accumulate wire moment integral from pointA to pointB  
accumulatePointMomentsFromOrigin(points: Point3d[]): void Accumulate products-of-components for given points.  
accumulateProducts(other: MomentData, scale: number): void Accumulate sums from other moments.  
accumulateProductsFromOrigin(origin: Point3d, products: Matrix4d, scale: number): void Accumulate sums from Matrix4d and origin.  
accumulateScaledOuterProduct(point: XYAndZ, scaleFactor: number): void add scaled outer product of (4d, unit weight) point to this.sums  
accumulateTriangleMomentsXY(pointA: XAndY | undefined, pointB: XAndY, pointC: XAndY): void compute moments of a triangle from the origin to the given line.  
accumulateTriangleToLineStringMomentsXY(sweepBase: XAndY | undefined, points: GrowableXYZArray): void compute moments of triangles from a base point to the given linestring.  
accumulateXYProductsInCentroidalFrame(productXX: number, productXY: number, productYY: number, area: number, origin: XAndY, vectorU: XAndY, vectorV: XAndY): void * Assemble XX, YY, XY products into a full matrix form [xx,xy,0,0; xy,yy,0,0;0,0,0,0;0,0,0,1].  
clearSums(origin?: Point3d): void Clear the MomentData sums to zero, and establish a new origin.  
setOriginFromGrowableXYZArrayIfNeeded(points: GrowableXYZArray): void If this.needOrigin flag is set, copy origin to this.origin and clear the flag.  
setOriginIfNeeded(origin: Point3d): void If this.needOrigin flag is set, copy origin to this.origin and clear the flag.  
setOriginXYZIfNeeded(x: number, y: number, z: number): void If this.needOrigin flag is set, copy origin to this.origin and clear the flag.  
shiftOriginAndSumsByXYZ(ax: number, ay: number, az: number): void revise the accumulated sums
* add ax,ay,ax to the origin coordinates.
 
shiftOriginAndSumsToCentroidOfSums(): boolean revise the accumulated sums to be "around the centroid"  
shiftOriginAndSumsToNewOrigin(newOrigin: XYAndZ): void revise the accumulated sums so they are based at a specified origin.  
signFactor(targetSign: number): number Return a scale factor to make these sums match the target orientation sign.  
toJSON(): any Convert to a json data object with:  
areEquivalentPrincipalAxes(dataA: MomentData | undefined, dataB: MomentData | undefined): boolean Static Test for match among selected members as they exist after inertiaProductsToPrincipalAxes
The members considered are
origin of local to world map (i.e.
 
create(origin?: Point3d, needOrigin: boolean = false): MomentData Static Create moments with optional origin.  
inertiaProductsToPrincipalAxes(origin: XYZ, inertiaProducts: Matrix4d): MomentData | undefined Static Compute principal axes from inertial products
The radii of gyration are sorted smallest to largest
Hence x axis is long direction
* Hence planar data generates large moment as Z
 
momentTensorFromInertiaProducts(products: Matrix3d): Matrix3d Static Return the formal tensor of integrated values [yy+zz,xy,xz][yx,xx+zz,yz][zx,xy,xx+yy]  
pointsToPrincipalAxes(points: Point3d[]): MomentData | undefined Static Return the principal moment data for an array of points.  
sortColumnsForIncreasingMoments(axes: Matrix3d, moments: Vector3d): void Static Sort the columns of the matrix for increasing moments.  

Properties

Name Type Description
localToWorldMap Transform the mapping between principal and world system.  
needOrigin boolean flag to request deferred origin setup.  
origin Point3d Origin used for sums.  
quantitySum Accessor ReadOnly number Return the lower-right (3,3) entry in the sums.  
radiusOfGyration Vector3d radii of gyration (square roots of principal second moments)  
sums Matrix4d Moment sums.  

Defined in

Last Updated: 08 January, 2020