View source: R/traits_from_qsm.R
| get_center_of_mass | R Documentation |
This function calculates the center of mass/volume from a QSM by estimating the centroid of cylinder locations, each weighted by their volume. Only trunk sections are included (e.g., 'branching_order == 0'). For center of mass, assumes constant density within segments.
get_center_of_mass(qsm)
qsm |
qsm object loaded from '[load_qsm]'. |
A tibble with one row and three numeric columns:
Volume-weighted X coordinate of the trunk center of mass (m).
Volume-weighted Y coordinate of the trunk center of mass (m).
Volume-weighted Z coordinate of the trunk center of mass (m).
qsm_file = system.file("extdata", "tree_0744_qsm.txt", package='tReeTraits')
qsm = load_qsm(qsm_file)
print(get_center_of_mass(qsm))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.