space_ex v0.8.0 SpaceEx.SpaceCenter.Orbit

Describes an orbit.

For example, the orbit of a vessel, obtained by calling SpaceEx.SpaceCenter.Vessel.orbit/1, or a celestial body, obtained by calling SpaceEx.SpaceCenter.CelestialBody.orbit/1.

Link to this section Summary

Functions

Gets the apoapsis of the orbit, in meters, from the center of mass of the body being orbited

The apoapsis of the orbit, in meters, above the sea level of the body being orbited

The celestial body (e.g

Estimates and returns the distance at closest approach to a target vessel, in meters

The eccentric anomaly at the given universal time

The eccentricity of the orbit

The time since the epoch (the point at which the mean anomaly at epoch was measured, in seconds

The inclination of the orbit, in radians

Returns the times at closest approach and corresponding distances, to a target vessel

The mean anomaly at the given time

If the object is going to change sphere of influence in the future, returns the new orbit after the change

The current orbital speed in meters per second

The orbital speed at the given time, in meters per second

The periapsis of the orbit, in meters, from the center of mass of the body being orbited

The periapsis of the orbit, in meters, above the sea level of the body being orbited

The orbital period, in seconds

The position at a given time, in the specified reference frame

The current radius of the orbit, in meters

The orbital radius at the given time, in meters

The orbital radius at the point in the orbit given by the true anomaly

The direction from which the orbits longitude of ascending node is measured, in the given reference frame

The direction that is normal to the orbits reference plane, in the given reference frame

Relative inclination of this orbit and the orbit of the given target vessel, in radians

The semi-major axis of the orbit, in meters

The semi-minor axis of the orbit, in meters

The current orbital speed of the object in meters per second

Estimates and returns the time at closest approach to a target vessel

The time until the object reaches apoapsis, in seconds

The time until the object reaches periapsis, in seconds

The time until the object changes sphere of influence, in seconds

The true anomaly of the ascending node with the given target vessel

The true anomaly of the descending node with the given target vessel

The true anomaly at the given orbital radius

The true anomaly at the given time

The universal time, in seconds, corresponding to the given true anomaly

Link to this section Functions

Gets the apoapsis of the orbit, in meters, from the center of mass of the body being orbited.

For the apoapsis altitude reported on the in-game map view, use SpaceEx.SpaceCenter.Orbit.apoapsis_altitude/1.

Returns: a high precision decimal

Link to this function apoapsis_altitude(this)

The apoapsis of the orbit, in meters, above the sea level of the body being orbited.

This is equal to SpaceEx.SpaceCenter.Orbit.apoapsis/1 minus the equatorial radius of the body.

Returns: a high precision decimal

Link to this function argument_of_periapsis(this)

The argument of periapsis, in radians.

Returns: a high precision decimal

The celestial body (e.g.

planet or moon) around which the object is orbiting.

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

Link to this function distance_at_closest_approach(this, target)

Estimates and returns the distance at closest approach to a target vessel, in meters.

  • target — Target vessel.

Returns: a high precision decimal

Link to this function eccentric_anomaly(this)

The eccentric anomaly.

Returns: a high precision decimal

Link to this function eccentric_anomaly_at_ut(this, ut)

The eccentric anomaly at the given universal time.

  • ut — The universal time, in seconds.

Returns: a high precision decimal

Link to this function eccentricity(this)

The eccentricity of the orbit.

Returns: a high precision decimal

The time since the epoch (the point at which the mean anomaly at epoch was measured, in seconds.

Returns: a high precision decimal

Link to this function inclination(this)

The inclination of the orbit, in radians.

Returns: a high precision decimal

Link to this function list_closest_approaches(this, target, orbits)

Returns the times at closest approach and corresponding distances, to a target vessel.

Returns A list of two lists. The first is a list of times at closest approach, as universal times in seconds. The second is a list of corresponding distances at closest approach, in meters.

  • target — Target vessel.

  • orbits — The number of future orbits to search.

Returns: [[double, ...], ...], where double is a high precision decimal

Link to this function longitude_of_ascending_node(this)

The longitude of the ascending node, in radians.

Returns: a high precision decimal

Link to this function mean_anomaly(this)

The mean anomaly.

Returns: a high precision decimal

Link to this function mean_anomaly_at_epoch(this)

The mean anomaly at epoch.

Returns: a high precision decimal

Link to this function mean_anomaly_at_ut(this, ut)

The mean anomaly at the given time.

  • ut — The universal time in seconds.

Returns: a high precision decimal

Link to this function next_orbit(this)

If the object is going to change sphere of influence in the future, returns the new orbit after the change.

Otherwise returns nil.

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

Link to this function orbital_speed(this)

The current orbital speed in meters per second.

Returns: a high precision decimal

Link to this function orbital_speed_at(this, time)

The orbital speed at the given time, in meters per second.

  • time — Time from now, in seconds.

Returns: a high precision decimal

Link to this function periapsis(this)

The periapsis of the orbit, in meters, from the center of mass of the body being orbited.

For the periapsis altitude reported on the in-game map view, use SpaceEx.SpaceCenter.Orbit.periapsis_altitude/1.

Returns: a high precision decimal

Link to this function periapsis_altitude(this)

The periapsis of the orbit, in meters, above the sea level of the body being orbited.

This is equal to SpaceEx.SpaceCenter.Orbit.periapsis/1 minus the equatorial radius of the body.

Returns: a high precision decimal

The orbital period, in seconds.

Returns: a high precision decimal

Link to this function position_at(this, ut, reference_frame)

The position at a given time, in the specified reference frame.

Returns the position as a vector.

  • ut — The universal time to measure the position at.

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

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

The current radius of the orbit, in meters.

This is the distance between the center of mass of the object in orbit, and the center of mass of the body around which it is orbiting.

This value will change over time if the orbit is elliptical.

Returns: a high precision decimal

Link to this function radius_at(this, ut)

The orbital radius at the given time, in meters.

  • ut — The universal time to measure the radius at.

Returns: a high precision decimal

Link to this function radius_at_true_anomaly(this, true_anomaly)

The orbital radius at the point in the orbit given by the true anomaly.

  • true_anomaly — The true anomaly.

Returns: a high precision decimal

Link to this function reference_plane_direction(conn, reference_frame)

The direction from which the orbits longitude of ascending node is measured, in the given 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 reference_plane_normal(conn, reference_frame)

The direction that is normal to the orbits reference plane, in the given reference frame.

The reference plane is the plane from which the orbits inclination is measured.

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 relative_inclination(this, target)

Relative inclination of this orbit and the orbit of the given target vessel, in radians.

  • target — Target vessel.

Returns: a high precision decimal

Link to this function semi_major_axis(this)

The semi-major axis of the orbit, in meters.

Returns: a high precision decimal

Link to this function semi_minor_axis(this)

The semi-minor axis of the orbit, in meters.

Returns: a high precision decimal

The current orbital speed of the object in meters per second.

This value will change over time if the orbit is elliptical.

Returns: a high precision decimal

Link to this function time_of_closest_approach(this, target)

Estimates and returns the time at closest approach to a target vessel.

Returns the universal time at closest approach, in seconds.

  • target — Target vessel.

Returns: a high precision decimal

Link to this function time_to_apoapsis(this)

The time until the object reaches apoapsis, in seconds.

Returns: a high precision decimal

Link to this function time_to_periapsis(this)

The time until the object reaches periapsis, in seconds.

Returns: a high precision decimal

Link to this function time_to_soi_change(this)

The time until the object changes sphere of influence, in seconds.

Returns NaN if the object is not going to change sphere of influence.

Returns: a high precision decimal

Link to this function true_anomaly(this)

The true anomaly.

Returns: a high precision decimal

Link to this function true_anomaly_at_an(this, target)

The true anomaly of the ascending node with the given target vessel.

  • target — Target vessel.

Returns: a high precision decimal

Link to this function true_anomaly_at_dn(this, target)

The true anomaly of the descending node with the given target vessel.

  • target — Target vessel.

Returns: a high precision decimal

Link to this function true_anomaly_at_radius(this, radius)

The true anomaly at the given orbital radius.

  • radius — The orbital radius in meters.

Returns: a high precision decimal

Link to this function true_anomaly_at_ut(this, ut)

The true anomaly at the given time.

  • ut — The universal time in seconds.

Returns: a high precision decimal

Link to this function ut_at_true_anomaly(this, true_anomaly)

The universal time, in seconds, corresponding to the given true anomaly.

  • true_anomaly — True anomaly.

Returns: a high precision decimal