View source: R/angularmomentum.R
| angularmomentum | R Documentation |
Computes the total angular momentum of a set of particles about their centre of mass (or about a user-specified origin).
angularmomentum(m, x, v, x0 = NULL, v0 = NULL)
m |
n-vector or scalar of particle masses. For specific angular momentum computation, set |
x |
|
v |
|
x0 |
Optional 3-vector specifying the origin about which the
angular momentum is computed. If |
v0 |
Optional 3-vector specifying the reference velocity. If
|
A numeric vector of length three containing the Cartesian components of the total angular momentum,
\mathbf{J}=\sum_i m_i\,(\mathbf{x}_i-\mathbf{x}_0)\times
(\mathbf{v}_i-\mathbf{v}_0).
If m is NULL, a vector of zeros is returned.
m = c(1, 2)
x = rbind(c(1, 0, 0), c(0, 1, 0))
v = rbind(c(0, 1, 0), c(-1, 0, 0))
angularmomentum(m, x, v)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.