space_ex v0.8.0 SpaceEx.SpaceCenter.CelestialBody

Represents a celestial body (such as a planet or moon).

See SpaceEx.SpaceCenter.bodies/1.

Link to this section Summary

Functions

The altitude, in meters, of the given position in the given reference frame

The angular velocity of the body in the specified reference frame

The depth of the atmosphere, in meters

The atmospheric density at the given position, in \(kg/m^3\), in the given reference frame

The height of the surface relative to mean sea level, in meters, at the given position

The position of the surface at the given latitude and longitude, in the given reference frame

The biome at the given latitude and longitude, in degrees

The biomes present on this body

Gets the air density, in \(kg/m^3\), for the specified altitude above sea level, in meters

The direction in which the north pole of the celestial body is pointing, in the specified reference frame

The equatorial radius of the body, in meters

The altitude, in meters, above which a vessel is considered to be flying “high” when doing science

true if the body has an atmosphere

true if there is oxygen in the atmosphere, required for air-breathing engines

The initial rotation angle of the body (at UT 0), in radians

The latitude of the given position, in the given reference frame

The longitude of the given position, in the given reference frame

The mass of the body, in kilograms

The position at mean sea level at the given latitude and longitude, in the given reference frame

The name of the body

The reference frame that is fixed relative to this celestial body, and orientated in a fixed direction (it does not rotate with the body)

The orbit of the body

The reference frame that is fixed relative to this celestial body, but orientated with the body’s orbital prograde/normal/radial directions

The position of the center of the body, in the specified reference frame

The position at the given latitude, longitude and altitude, in the given reference frame

Gets the air pressure, in Pascals, for the specified altitude above sea level, in meters

The reference frame that is fixed relative to the celestial body

The rotation of the body, in the specified reference frame

The current rotation angle of the body, in radians

The sidereal rotational period of the body, in seconds

The rotational speed of the body, in radians per second

A list of celestial bodies that are in orbit around this celestial body

The altitude, in meters, above which a vessel is considered to be in “high” space when doing science

The radius of the sphere of influence of the body, in meters

The acceleration due to gravity at sea level (mean altitude) on the body, in \(m/s^2\)

The height of the surface relative to mean sea level, in meters, at the given position

The position of the surface at the given latitude and longitude, in the given reference frame

The temperature on the body at the given position, in the given reference frame

The linear velocity of the body, in the specified reference frame

Link to this section Functions

Link to this function altitude_at_position(this, position, reference_frame)

The altitude, in meters, of the given position in the given reference frame.

  • position — Position as a vector.

  • reference_frame — Reference frame for the position vector.

Returns: a high precision decimal

Link to this function angular_velocity(this, reference_frame)

The angular velocity of the body in the specified reference frame.

Returns the angular velocity as a vector. The magnitude of the vector is the rotational speed of the body, in radians per second. The direction of the vector indicates the axis of rotation, using the right-hand rule.

  • reference_frame — The reference frame the returned angular velocity is in.

Returns: {double, double, double}, where double is a high precision decimal

Link to this function atmosphere_depth(this)

The depth of the atmosphere, in meters.

Returns: a low-precision decimal

Link to this function atmospheric_density_at_position(this, position, reference_frame)

The atmospheric density at the given position, in \(kg/m^3\), in the given reference frame.

  • position — The position vector at which to measure the density.

  • reference_frame — Reference frame that the position vector is in.

Returns: a high precision decimal

Link to this function bedrock_height(this, latitude, longitude)

The height of the surface relative to mean sea level, in meters, at the given position.

When over water, this is the height of the sea-bed and is therefore negative value.

  • latitude — Latitude in degrees.

  • longitude — Longitude in degrees.

Returns: a high precision decimal

Link to this function bedrock_position(this, latitude, longitude, reference_frame)

The position of the surface at the given latitude and longitude, in the given reference frame.

When over water, this is the position at the bottom of the sea-bed.

Returns position as a vector.

  • latitude — Latitude in degrees.

  • longitude — Longitude in degrees.

  • reference_frame — Reference frame for the returned position vector.

Returns: {double, double, double}, where double is a high precision decimal

Link to this function biome_at(this, latitude, longitude)

The biome at the given latitude and longitude, in degrees.

Returns: a string

The biomes present on this body.

Returns: MapSet.new([str, ...]), where str is a string

Link to this function density_at(this, altitude)

Gets the air density, in \(kg/m^3\), for the specified altitude above sea level, in meters.

This is an approximation, because actual calculations, taking sun exposure into account to compute air temperature, require us to know the exact point on the body where the density is to be computed (knowing the altitude is not enough). However, the difference is small for high altitudes, so it makes very little difference for trajectory prediction.

Returns: a high precision decimal

Link to this function direction(this, reference_frame)

The direction in which the north pole of the celestial body is pointing, in the specified reference frame.

Returns the direction as a unit vector.

  • reference_frame — The reference frame that the returned direction is in.

Returns: {double, double, double}, where double is a high precision decimal

Link to this function equatorial_radius(this)

The equatorial radius of the body, in meters.

Returns: a low-precision decimal

Link to this function flying_high_altitude_threshold(this)

The altitude, in meters, above which a vessel is considered to be flying “high” when doing science.

Returns: a low-precision decimal

Link to this function gravitational_parameter(this)

The standard gravitational parameter of the body in \(m^3s^{-2}\).

Returns: a low-precision decimal

Link to this function has_atmosphere(this)

true if the body has an atmosphere.

Returns: true or false

Link to this function has_atmospheric_oxygen(this)

true if there is oxygen in the atmosphere, required for air-breathing engines.

Returns: true or false

Link to this function initial_rotation(this)

The initial rotation angle of the body (at UT 0), in radians.

A value between 0 and \(2\pi\)

Returns: a high precision decimal

Link to this function latitude_at_position(this, position, reference_frame)

The latitude of the given position, in the given reference frame.

  • position — Position as a vector.

  • reference_frame — Reference frame for the position vector.

Returns: a high precision decimal

Link to this function longitude_at_position(this, position, reference_frame)

The longitude of the given position, in the given reference frame.

  • position — Position as a vector.

  • reference_frame — Reference frame for the position vector.

Returns: a high precision decimal

The mass of the body, in kilograms.

Returns: a low-precision decimal

Link to this function msl_position(this, latitude, longitude, reference_frame)

The position at mean sea level at the given latitude and longitude, in the given reference frame.

Returns position as a vector.

  • latitude — Latitude in degrees.

  • longitude — Longitude in degrees.

  • reference_frame — Reference frame for the returned position vector.

Returns: {double, double, double}, where double is a high precision decimal

The name of the body.

Returns: a string

Link to this function non_rotating_reference_frame(this)

The reference frame that is fixed relative to this celestial body, and orientated in a fixed direction (it does not rotate with the body).

  • The origin is at the center of the body.

  • The axes do not rotate.

  • The x-axis points in an arbitrary direction through the equator.

  • The y-axis points from the center of the body towards the north pole.

  • The z-axis points in an arbitrary direction through the equator.

Returns: a reference to a SpaceEx.SpaceCenter.ReferenceFrame object

The orbit of the body.

Returns: a reference to a SpaceEx.SpaceCenter.Orbit object

Link to this function orbital_reference_frame(this)

The reference frame that is fixed relative to this celestial body, but orientated with the body’s orbital prograde/normal/radial directions.

  • The origin is at the center of the body.

  • The axes rotate with the orbital prograde/normal/radial directions.

  • The x-axis points in the orbital anti-radial direction.

  • The y-axis points in the orbital prograde direction.

  • The z-axis points in the orbital normal direction.

Returns: a reference to a SpaceEx.SpaceCenter.ReferenceFrame object

Link to this function position(this, reference_frame)

The position of the center of the body, in the specified reference frame.

Returns the position as a vector.

  • reference_frame — The reference frame that the returned position vector is in.

Returns: {double, double, double}, where double is a high precision decimal

Link to this function position_at_altitude(this, latitude, longitude, altitude, reference_frame)

The position at the given latitude, longitude and altitude, in the given reference frame.

Returns position as a vector.

  • latitude — Latitude in degrees.

  • longitude — Longitude in degrees.

  • altitude — Altitude in meters above sea level.

  • reference_frame — Reference frame for the returned position vector.

Returns: {double, double, double}, where double is a high precision decimal

Link to this function pressure_at(this, altitude)

Gets the air pressure, in Pascals, for the specified altitude above sea level, in meters.

Returns: a high precision decimal

Link to this function reference_frame(this)

The reference frame that is fixed relative to the celestial body.

  • The origin is at the center of the body.

  • The axes rotate with the body.

  • The x-axis points from the center of the body towards the intersection of the prime meridian and equator (the position at 0° longitude, 0° latitude).

  • The y-axis points from the center of the body towards the north pole.

  • The z-axis points from the center of the body towards the equator at 90°E longitude.

Returns: a reference to a SpaceEx.SpaceCenter.ReferenceFrame object

Link to this function rotation(this, reference_frame)

The rotation of the body, in the specified reference frame.

Returns the rotation as a quaternion of the form \((x, y, z, w)\).

  • reference_frame — The reference frame that the returned rotation is in.

Returns: {double, double, double, double}, where double is a high precision decimal

Link to this function rotation_angle(this)

The current rotation angle of the body, in radians.

A value between 0 and \(2\pi\)

Returns: a high precision decimal

Link to this function rotational_period(this)

The sidereal rotational period of the body, in seconds.

Returns: a low-precision decimal

Link to this function rotational_speed(this)

The rotational speed of the body, in radians per second.

Returns: a low-precision decimal

Link to this function satellites(this)

A list of celestial bodies that are in orbit around this celestial body.

Returns: [celestial_body, ...], where celestial_body is a reference to a SpaceEx.SpaceCenter.CelestialBody object

Link to this function space_high_altitude_threshold(this)

The altitude, in meters, above which a vessel is considered to be in “high” space when doing science.

Returns: a low-precision decimal

Link to this function sphere_of_influence(this)

The radius of the sphere of influence of the body, in meters.

Returns: a low-precision decimal

Link to this function surface_gravity(this)

The acceleration due to gravity at sea level (mean altitude) on the body, in \(m/s^2\).

Returns: a low-precision decimal

Link to this function surface_height(this, latitude, longitude)

The height of the surface relative to mean sea level, in meters, at the given position.

When over water this is equal to 0.

  • latitude — Latitude in degrees.

  • longitude — Longitude in degrees.

Returns: a high precision decimal

Link to this function surface_position(this, latitude, longitude, reference_frame)

The position of the surface at the given latitude and longitude, in the given reference frame.

When over water, this is the position of the surface of the water.

Returns position as a vector.

  • latitude — Latitude in degrees.

  • longitude — Longitude in degrees.

  • reference_frame — Reference frame for the returned position vector.

Returns: {double, double, double}, where double is a high precision decimal

Link to this function temperature_at(this, position, reference_frame)

The temperature on the body at the given position, in the given reference frame.

  • position — Position as a vector.

  • reference_frame — The reference frame that the position is in.

This calculation is performed using the bodies current position, which means that the value could be wrong if you want to know the temperature in the far future.

Returns: a high precision decimal

Link to this function velocity(this, reference_frame)

The linear velocity of the body, in the specified reference frame.

Returns the velocity as a vector. The vector points in the direction of travel, and its magnitude is the speed of the body in meters per second.

  • reference_frame — The reference frame that the returned velocity vector is in.

Returns: {double, double, double}, where double is a high precision decimal