Unit

template<typename T>
class Unit

SBody uses the Geometrized units, in which \(c=G=1\). In addition, the central black hole mass is set to 1.

Public Functions

inline Unit(T mass)

Initialize the unit system.

Parameters:

mass – mass of the central black hole, in unit of \(M_\odot\)

Returns:

status

Public Members

const T M_sun

Mass of the Sun, \(M_\odot\).

const T M_earth

Mass of Earth, \(M_\oplus\).

const T M_jup

Mass of Jupiter, \(M_\mathrm{jup}\).

const T s

Second.

const T min

Minute.

const T hr

Hour.

const T day

Day.

const T yr

Year.

const T cm

Centimeter.

const T m

Meter.

const T km

Kilometer.

const T R_sun

Radius of the Sun, \(R_\odot\).

const T AU

The astronomical unit.

const T mpc

Milliparsec.

const T pc

Parsec.

const T kpc

Kiloparsec.

const T Mpc

Megaparsec.

const T Gpc

Gigaparsec.

const T erg

Erg.

const T J

Joules.