MomentData Class

A MomentData structure exists in several levels:

  • First level: as a carrier of sums of inertial products that determine moments.
    • 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
    • In this level,
      • the absoluteQuantity member is undefined.
      • the localToWorldMap and radiiOfGyration are created by have undefined contents.
  • Second level: after a call to inertiaProductsToPrincipalAxes, the localToWorldMap, absoluteQuantity and radiiOfGyration are filled in.

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: Readonly<WritableXYAndZ>, scaleFactor: number): void add scaled outer product of (4d, unit weight) point to this.sums  
accumulateTriangleMomentsXY(pointA: undefined | Readonly<WritableXAndY>, pointB: Readonly<WritableXAndY>, pointC: Readonly<WritableXAndY>): void compute moments of a triangle from the origin to the given line.  
accumulateTriangleToLineStringMomentsXY(sweepBase: undefined | Readonly<WritableXAndY>, 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: Readonly<WritableXAndY>, vectorU: Readonly<WritableXAndY>, vectorV: Readonly<WritableXAndY>): 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  
shiftOriginAndSumsToCentroidOfSums(): boolean revise the accumulated sums to be "around the centroid"  
shiftOriginAndSumsToNewOrigin(newOrigin: Readonly<WritableXYAndZ>): 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: undefined | MomentData, dataB: undefined | MomentData): boolean Static Test for match among selected members as they exist after inertiaProductsToPrincipalAxes  
create(origin?: Point3d, needOrigin: boolean = false): MomentData Static Create moments with optional origin.  
inertiaProductsToPrincipalAxes(origin: XYZ, inertiaProducts: Matrix4d): undefined | MomentData Static Compute principal axes from inertial products  
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[]): undefined | MomentData 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
absoluteQuantity undefined | number principal quantity (e.g.  
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: 20 June, 2023