reset.cm: Move center of mass to the origin

View source: R/reset.cm.R

reset.cmR Documentation

Move center of mass to the origin

Description

Routine, designed to reset the center of mass (CM) of the initial conditions (ICs) of an N-body simulation. The CM position and velocity are both shifted to (0,0,0).

Usage

reset.cm(sim)

Arguments

sim

list of m, x, v or list with a sublist "ics", made of m, x, v, where m = N-vector with the masses of the N particles. Negative masses are treated as positive masses of same magnitude, since negative masses normally represent positive background masses in the nbody package.
x = N-by-3 matrix specifying the initial position in cartesian coordinates
v = N-by-3 matrix specifying the initial velocities

Value

Returns a structure of the same format as the input argument, but with re-centered positions and velocities.

Author(s)

Danail Obreschkow


nbody documentation built on Sept. 11, 2024, 7:47 p.m.