# Orbit¶

public class Orbit

Describes an orbit. For example, the orbit of a vessel, obtained by calling Vessel.getOrbit(), or a celestial body, obtained by calling CelestialBody.getOrbit().

CelestialBody getBody()

The celestial body (e.g. planet or moon) around which the object is orbiting.

Game Scenes: All
double getApoapsis()

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

Game Scenes: All

Note

For the apoapsis altitude reported on the in-game map view, use Orbit.getApoapsisAltitude().

double getPeriapsis()

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

Game Scenes: All

Note

For the periapsis altitude reported on the in-game map view, use Orbit.getPeriapsisAltitude().

double getApoapsisAltitude()

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

Game Scenes: All

Note

This is equal to Orbit.getApoapsis() minus the equatorial radius of the body.

double getPeriapsisAltitude()

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

Game Scenes: All

Note

This is equal to Orbit.getPeriapsis() minus the equatorial radius of the body.

double getSemiMajorAxis()

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

Game Scenes: All
double getSemiMinorAxis()

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

Game Scenes: All
double getRadius()

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.

Game Scenes: All

Note

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

double radiusAt(double ut)

The orbital radius at the given time, in meters.

Parameters: ut (double) – The universal time to measure the radius at. All
org.javatuples.Triplet<Double, Double, Double> positionAt(double ut, ReferenceFrame referenceFrame)

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

Parameters: ut (double) – The universal time to measure the position at. referenceFrame (ReferenceFrame) – The reference frame that the returned position vector is in. The position as a vector. All
double getSpeed()

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

Game Scenes: All

Note

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

double getPeriod()

The orbital period, in seconds.

Game Scenes: All
double getTimeToApoapsis()

The time until the object reaches apoapsis, in seconds.

Game Scenes: All
double getTimeToPeriapsis()

The time until the object reaches periapsis, in seconds.

Game Scenes: All
double getEccentricity()

The eccentricity of the orbit.

Game Scenes: All
double getInclination()

The inclination of the orbit, in radians.

Game Scenes: All
double getLongitudeOfAscendingNode()

The longitude of the ascending node, in radians.

Game Scenes: All
double getArgumentOfPeriapsis()

The argument of periapsis, in radians.

Game Scenes: All
double getMeanAnomalyAtEpoch()
Game Scenes: All
double getEpoch()

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

Game Scenes: All
double getMeanAnomaly()

The mean anomaly.

Game Scenes: All
double meanAnomalyAtUT(double ut)

The mean anomaly at the given time.

Parameters: ut (double) – The universal time in seconds. All
double getEccentricAnomaly()
Game Scenes: All
double eccentricAnomalyAtUT(double ut)

The eccentric anomaly at the given universal time.

Parameters: ut (double) – The universal time, in seconds. All
double getTrueAnomaly()

The true anomaly.

Game Scenes: All
double trueAnomalyAtUT(double ut)

The true anomaly at the given time.

Parameters: ut (double) – The universal time in seconds. All
double trueAnomalyAtRadius(double radius)

The true anomaly at the given orbital radius.

double uTAtTrueAnomaly(double trueAnomaly)

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

Parameters: trueAnomaly (double) – True anomaly. All
double radiusAtTrueAnomaly(double trueAnomaly)

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

Parameters: trueAnomaly (double) – The true anomaly. All
double trueAnomalyAtAN(Orbit target)

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

Parameters: target (Orbit) – Target orbit. All
double trueAnomalyAtDN(Orbit target)

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

Parameters: target (Orbit) – Target orbit. All
double getOrbitalSpeed()

The current orbital speed in meters per second.

Game Scenes: All
double orbitalSpeedAt(double time)

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

Parameters: time (double) – Time from now, in seconds. All
static org.javatuples.Triplet<Double, Double, Double> referencePlaneNormal(Connection connection, ReferenceFrame referenceFrame)

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.

Parameters: referenceFrame (ReferenceFrame) – The reference frame that the returned direction is in. The direction as a unit vector. All
static org.javatuples.Triplet<Double, Double, Double> referencePlaneDirection(Connection connection, ReferenceFrame referenceFrame)

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

Parameters: referenceFrame (ReferenceFrame) – The reference frame that the returned direction is in. The direction as a unit vector. All
double relativeInclination(Orbit target)

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

Parameters: target (Orbit) – Target orbit. All
double getTimeToSOIChange()

The time until the object changes sphere of influence, in seconds. Returns NaN if the object is not going to change sphere of influence.

Game Scenes: All
Orbit getNextOrbit()

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

Game Scenes: All
double timeOfClosestApproach(Orbit target)

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

Parameters: target (Orbit) – Target orbit. The universal time at closest approach, in seconds. All
double distanceAtClosestApproach(Orbit target)

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

Parameters: target (Orbit) – Target orbit. All
java.util.List<java.util.List<Double>> listClosestApproaches(Orbit target, int orbits)

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

Parameters: target (Orbit) – Target orbit. orbits (int) – The number of future orbits to search. 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. All