cen_galaxy: Centering the galaxy.

View source: R/RcppExports.R

cen_galaxyR Documentation

Centering the galaxy.

Description

The purpose of this function is to centre the galaxy such that the origin of the system lies at (0,0,0).

Usage

cen_galaxy(part_data)

Arguments

part_data

A data.frame describing the particles ID, positions, velocities and masses.

Value

A list containing the input data.frame with positions and velocities centered, as well as the median coordiantes and velocities of the original distribution

Examples

  galaxy_data = data.frame("ID"=1:100, "x"=stats::rnorm(100),
                           "y"=stats::rnorm(100), "z"=stats::rnorm(100),
                           "vx"=stats::rnorm(100), "vy"=stats::rnorm(100),
                           "vz"=stats::rnorm(100), "Mass"=rep(1,100))
  centered_galaxy = cen_galaxy(galaxy_data)

kateharborne/SimSpin documentation built on June 11, 2025, 7:16 p.m.