set_mass_props_and_unc: Set mass properties and uncertainties for a row in a data...

View source: R/massprops.R

set_mass_props_and_uncR Documentation

Set mass properties and uncertainties for a row in a data frame

Description

set_mass_props_and_unc() is a convenience wrapper that combines the results of set_mass_props() and set_mass_props_unc().

Usage

set_mass_props_and_unc(df, id, mpu)

Arguments

df

A data frame with an id column.

id

The id value of the desired row.

mpu

A list containing the following named elements:

  • mass Numeric mass.

  • center_mass Numeric 3-vector center of mass.

  • point Logical indicating point mass. The inertia of point masses is excluded from calculations.

  • poi_conv Enumeration c("+", "-") indicating sign convention for products of inertia.

  • inertia Numeric 3x3 matrix inertia tensor. The signs of the products of inertia are determined by POIconv. For example, Ixy is the xy element of the inertia tensor if POIconv is "-"; it is the additive inverse of that value if POIconv is "+".

  • sigma_mass Numeric mass uncertainty.

  • sigma_center_mass Numeric 3-vector center of mass uncertainties.

  • sigma_inertia Numeric 3x3 matrix inertia tensor uncertainties.

Value

The updated data frame.

Examples

mpu <- c(get_mass_props_and_unc(sawe_table, "Widget"), poi_conv = "+")
set_mass_props_and_unc(sawe_table, "Combined", mpu)


massProps documentation built on April 4, 2025, 1:45 a.m.