CelestialBody

class CelestialBody

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

String Name { get; }

The name of the body.

Game Scenes:

All

IList<CelestialBody> Satellites { get; }

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

Game Scenes:

All

Orbit Orbit { get; }

The orbit of the body.

Game Scenes:

All

Double Mass { get; }

The mass of the body, in kilograms.

Game Scenes:

All

Double GravitationalParameter { get; }

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

Game Scenes:

All

Double SurfaceGravity { get; }

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

Game Scenes:

All

Double RotationalPeriod { get; }

The sidereal rotational period of the body, in seconds.

Game Scenes:

All

Double RotationalSpeed { get; }

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

Game Scenes:

All

Double RotationAngle { get; }

The current rotation angle of the body, in radians. A value between 0 and \(2\pi\)

Game Scenes:

All

Double InitialRotation { get; }

The initial rotation angle of the body (at UT 0), in radians. A value between 0 and \(2\pi\)

Game Scenes:

All

Double EquatorialRadius { get; }

The equatorial radius of the body, in meters.

Game Scenes:

All

Double SurfaceHeight (Double latitude, Double 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.

Parameters:
  • latitude – Latitude in degrees.

  • longitude – Longitude in degrees.

Game Scenes:

All

Double BedrockHeight (Double latitude, Double 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.

Parameters:
  • latitude – Latitude in degrees.

  • longitude – Longitude in degrees.

Game Scenes:

All

Tuple<Double, Double, Double> MSLPosition (Double latitude, Double longitude, ReferenceFrame referenceFrame)

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

Parameters:
  • latitude – Latitude in degrees.

  • longitude – Longitude in degrees.

  • referenceFrame – Reference frame for the returned position vector.

Returns:

Position as a vector.

Game Scenes:

All

Tuple<Double, Double, Double> SurfacePosition (Double latitude, Double longitude, ReferenceFrame referenceFrame)

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.

Parameters:
  • latitude – Latitude in degrees.

  • longitude – Longitude in degrees.

  • referenceFrame – Reference frame for the returned position vector.

Returns:

Position as a vector.

Game Scenes:

All

Tuple<Double, Double, Double> BedrockPosition (Double latitude, Double longitude, ReferenceFrame referenceFrame)

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.

Parameters:
  • latitude – Latitude in degrees.

  • longitude – Longitude in degrees.

  • referenceFrame – Reference frame for the returned position vector.

Returns:

Position as a vector.

Game Scenes:

All

Tuple<Double, Double, Double> PositionAtAltitude (Double latitude, Double longitude, Double altitude, ReferenceFrame referenceFrame)

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

Parameters:
  • latitude – Latitude in degrees.

  • longitude – Longitude in degrees.

  • altitude – Altitude in meters above sea level.

  • referenceFrame – Reference frame for the returned position vector.

Returns:

Position as a vector.

Game Scenes:

All

Double AltitudeAtPosition (Tuple<Double, Double, Double> position, ReferenceFrame referenceFrame)

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

Parameters:
  • position – Position as a vector.

  • referenceFrame – Reference frame for the position vector.

Game Scenes:

All

Double LatitudeAtPosition (Tuple<Double, Double, Double> position, ReferenceFrame referenceFrame)

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

Parameters:
  • position – Position as a vector.

  • referenceFrame – Reference frame for the position vector.

Game Scenes:

All

Double LongitudeAtPosition (Tuple<Double, Double, Double> position, ReferenceFrame referenceFrame)

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

Parameters:
  • position – Position as a vector.

  • referenceFrame – Reference frame for the position vector.

Game Scenes:

All

Double SphereOfInfluence { get; }

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

Game Scenes:

All

Boolean IsStar { get; }

Whether or not the body is a star.

Game Scenes:

All

Boolean HasSolidSurface { get; }

Whether or not the body has a solid surface.

Game Scenes:

All

Boolean HasAtmosphere { get; }

true if the body has an atmosphere.

Game Scenes:

All

Double AtmosphereDepth { get; }

The depth of the atmosphere, in meters.

Game Scenes:

All

Double AtmosphericDensityAtPosition (Tuple<Double, Double, Double> position, ReferenceFrame referenceFrame)

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

Parameters:
  • position – The position vector at which to measure the density.

  • referenceFrame – Reference frame that the position vector is in.

Game Scenes:

All

Boolean HasAtmosphericOxygen { get; }

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

Game Scenes:

All

Double TemperatureAt (Tuple<Double, Double, Double> position, ReferenceFrame referenceFrame)

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

Parameters:
  • position – Position as a vector.

  • referenceFrame – The reference frame that the position is in.

Game Scenes:

All

Note

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.

Double DensityAt (Double altitude)

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

Parameters:

Game Scenes:

All

Note

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.

Double PressureAt (Double altitude)

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

Parameters:

Game Scenes:

All

ISet<String> Biomes { get; }

The biomes present on this body.

Game Scenes:

All

String BiomeAt (Double latitude, Double longitude)

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

Parameters:

Game Scenes:

All

Single FlyingHighAltitudeThreshold { get; }

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

Game Scenes:

All

Single SpaceHighAltitudeThreshold { get; }

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

Game Scenes:

All

ReferenceFrame ReferenceFrame { get; }

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.

Game Scenes:

All

../../../_images/celestial-body.png

Celestial body reference frame origin and axes. The equator is shown in blue, and the prime meridian in red.

ReferenceFrame NonRotatingReferenceFrame { get; }

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.

Game Scenes:

All

ReferenceFrame OrbitalReferenceFrame { get; }

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.

Game Scenes:

All

Tuple<Double, Double, Double> Position (ReferenceFrame referenceFrame)

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

Parameters:
  • referenceFrame – The reference frame that the returned position vector is in.

Returns:

The position as a vector.

Game Scenes:

All

Tuple<Double, Double, Double> Velocity (ReferenceFrame referenceFrame)

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

Parameters:
  • referenceFrame – The reference frame that the returned velocity vector is in.

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.

Game Scenes:

All

Tuple<Double, Double, Double, Double> Rotation (ReferenceFrame referenceFrame)

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

Parameters:
  • referenceFrame – The reference frame that the returned rotation is in.

Returns:

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

Game Scenes:

All

Tuple<Double, Double, Double> Direction (ReferenceFrame referenceFrame)

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

Parameters:
  • referenceFrame – The reference frame that the returned direction is in.

Returns:

The direction as a unit vector.

Game Scenes:

All

Tuple<Double, Double, Double> AngularVelocity (ReferenceFrame referenceFrame)

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

Parameters:
  • referenceFrame – The reference frame the returned angular velocity is in.

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.

Game Scenes:

All