Struct bigbang::planet::Orbit
[−]
[src]
pub struct Orbit<'o> { // some fields omitted }
Orbit structure
This structure contains all the needed information to define an orbit, and as an extra, it contains the axial tilt of the rotation of the body and the rotation period of the body. It also includes a reference to the star being orbited. It also contains the orbital period, even if it can be calculated with the rest of the parameters.
Methods
impl<'o> Orbit<'o>
fn get_star(&self) -> &Star
Get Star
Gets the Star being orbited.
fn get_position(&self) -> u8
Get position
Gets the position of the orbit in the solar system. For example, for Earth would be 3.
fn get_ecc(&self) -> f64
Get eccentricity
Gets the eccentricity of the orbit. Since all planets will be in closed orbits, the eccentricity will be between 0 and 1.
fn get_sma(&self) -> f64
Get semimajor axis
Gets the semimajor axis of the orbit, in meters (m).
fn get_incl(&self) -> f64
Get inclination
Gets the inclination of the orbit, in radians (rad).
fn get_lan(&self) -> f64
Get longitude of ascending node
Gets the longitude of the ascending node of the orbit, in radians (rad).
fn get_arg_p(&self) -> f64
Get argument of periapsis
Gets the argument of the periapsis of the orbit, in radians (rad).
fn get_anomaly(&self) -> f64
Get mean anomaly
Gets the mean anomaly of the orbit at the beginning of the universe, in radians (rad).
fn get_orb_period(&self) -> f64
Get orbital period
Gets the period of the orbit, in seconds (s).
fn get_apoapsis(&self) -> f64
Get apoapsis
Gets the apoapsis of the orbit, in meters (m).
fn get_periapsis(&self) -> f64
Get periapsis
Gets the periapsis of the orbit, in meters (m).
fn get_ax_tilt(&self) -> f64
Get axial tilt
Gets the axial tilt of the rotation of the body, in radians (rad).
fn get_rot_period(&self) -> f64
Get rotation period
Gets the sidereal rotation period of the body, in seconds (s).
fn get_day(&self) -> f64
Get day
Gets the day length of the body, in seconds (s).