Flight#
- class SpaceCenter.Flight#
Used to get flight telemetry for a vessel, by calling
SpaceCenter.Vessel.flight(). All of the information returned by this class is given in the reference frame passed to that method. Obtained by callingSpaceCenter.Vessel.flight().Note
To get orbital information, such as the apoapsis or inclination, see
SpaceCenter.Orbit.- g_force: number#
The current G force acting on the vessel in \(g\).
- Attribute:
Read-only, cannot be set
- Return type:
number
- mean_altitude: number#
The altitude above sea level, in meters. Measured from the center of mass of the vessel.
- Attribute:
Read-only, cannot be set
- Return type:
number
- surface_altitude: number#
The altitude above the surface of the body or sea level, whichever is closer, in meters. Measured from the center of mass of the vessel.
- Attribute:
Read-only, cannot be set
- Return type:
number
- bedrock_altitude: number#
The altitude above the surface of the body, in meters. When over water, this is the altitude above the sea floor. Measured from the center of mass of the vessel.
- Attribute:
Read-only, cannot be set
- Return type:
number
- elevation: number#
The elevation of the terrain under the vessel, in meters. This is the height of the terrain above sea level, and is negative when the vessel is over the sea.
- Attribute:
Read-only, cannot be set
- Return type:
number
- latitude: number#
The latitude of the vessel for the body being orbited, in degrees.
- Attribute:
Read-only, cannot be set
- Return type:
number
- longitude: number#
The longitude of the vessel for the body being orbited, in degrees.
- Attribute:
Read-only, cannot be set
- Return type:
number
- velocity: Tuple#
The velocity of the vessel, in the reference frame
SpaceCenter.ReferenceFrame.- Attribute:
Read-only, cannot be set
- Returns:
The velocity as a vector. The vector points in the direction of travel, and its magnitude is the speed of the vessel in meters per second.
- Return type:
Tuple
- speed: number#
The speed of the vessel in meters per second, in the reference frame
SpaceCenter.ReferenceFrame.- Attribute:
Read-only, cannot be set
- Return type:
number
- horizontal_speed: number#
The horizontal speed of the vessel in meters per second, in the reference frame
SpaceCenter.ReferenceFrame.- Attribute:
Read-only, cannot be set
- Return type:
number
- vertical_speed: number#
The vertical speed of the vessel in meters per second, in the reference frame
SpaceCenter.ReferenceFrame.- Attribute:
Read-only, cannot be set
- Return type:
number
- acceleration: Tuple#
The acceleration of the vessel, in the reference frame
SpaceCenter.ReferenceFrame. This is the total acceleration, including the acceleration due to gravity, and is the time derivative ofSpaceCenter.Flight.velocity.- Attribute:
Read-only, cannot be set
- Returns:
The acceleration as a vector. The vector points in the direction of the acceleration, and its magnitude is the acceleration of the vessel in \(m/s^2\).
- Return type:
Tuple
- center_of_mass: Tuple#
The position of the center of mass of the vessel, in the reference frame
SpaceCenter.ReferenceFrame- Attribute:
Read-only, cannot be set
- Returns:
The position as a vector.
- Return type:
Tuple
- rotation: Tuple#
The rotation of the vessel, in the reference frame
SpaceCenter.ReferenceFrame- Attribute:
Read-only, cannot be set
- Returns:
The rotation as a quaternion of the form \((x, y, z, w)\).
- Return type:
Tuple
- direction: Tuple#
The direction that the vessel is pointing in, in the reference frame
SpaceCenter.ReferenceFrame.- Attribute:
Read-only, cannot be set
- Returns:
The direction as a unit vector.
- Return type:
Tuple
- pitch: number#
The pitch of the vessel relative to the horizon, in degrees. A value between -90° and +90°.
- Attribute:
Read-only, cannot be set
- Return type:
number
Note
An absolute Euler angle, ill-conditioned when the vessel points near vertical (pitch → ±90°), where heading and roll become ambiguous. For an always-defined attitude use
SpaceCenter.Flight.rotationorSpaceCenter.Flight.direction.
- heading: number#
The heading of the vessel (its angle relative to north), in degrees. A value between 0° and 360°.
- Attribute:
Read-only, cannot be set
- Return type:
number
Note
An absolute Euler angle, undefined when the vessel points near vertical (pitch → ±90°). For an always-defined attitude use
SpaceCenter.Flight.rotationorSpaceCenter.Flight.direction.
- roll: number#
The roll of the vessel relative to the horizon, in degrees. A value between -180° and +180°.
- Attribute:
Read-only, cannot be set
- Return type:
number
Note
An absolute Euler angle, ill-conditioned when the vessel points near vertical (pitch → ±90°), where the vertical-plane reference vanishes. For an always-defined attitude use
SpaceCenter.Flight.rotation; for a well-defined roll use the auto-pilot’sTargetRoll/RollErroragainst a chosen up reference.
- prograde: Tuple#
The prograde direction of the vessels orbit, in the reference frame
SpaceCenter.ReferenceFrame.- Attribute:
Read-only, cannot be set
- Returns:
The direction as a unit vector.
- Return type:
Tuple
- retrograde: Tuple#
The retrograde direction of the vessels orbit, in the reference frame
SpaceCenter.ReferenceFrame.- Attribute:
Read-only, cannot be set
- Returns:
The direction as a unit vector.
- Return type:
Tuple
- surface_prograde: Tuple#
The direction of the vessels surface velocity, in the reference frame
SpaceCenter.ReferenceFrame. This is the prograde direction as shown on the navball when in surface mode.- Attribute:
Read-only, cannot be set
- Returns:
The direction as a unit vector.
- Return type:
Tuple
Note
Singular when surface speed is approximately zero.
- surface_retrograde: Tuple#
The direction opposite to the vessels surface velocity, in the reference frame
SpaceCenter.ReferenceFrame. This is the retrograde direction as shown on the navball when in surface mode.- Attribute:
Read-only, cannot be set
- Returns:
The direction as a unit vector.
- Return type:
Tuple
Note
Singular when surface speed is approximately zero.
- normal: Tuple#
The direction normal to the vessels orbit, in the reference frame
SpaceCenter.ReferenceFrame.- Attribute:
Read-only, cannot be set
- Returns:
The direction as a unit vector.
- Return type:
Tuple
- anti_normal: Tuple#
The direction opposite to the normal of the vessels orbit, in the reference frame
SpaceCenter.ReferenceFrame.- Attribute:
Read-only, cannot be set
- Returns:
The direction as a unit vector.
- Return type:
Tuple
- radial: Tuple#
The radial direction of the vessels orbit, in the reference frame
SpaceCenter.ReferenceFrame.- Attribute:
Read-only, cannot be set
- Returns:
The direction as a unit vector.
- Return type:
Tuple
- anti_radial: Tuple#
The direction opposite to the radial direction of the vessels orbit, in the reference frame
SpaceCenter.ReferenceFrame.- Attribute:
Read-only, cannot be set
- Returns:
The direction as a unit vector.
- Return type:
Tuple
- atmosphere_density: number#
The current density of the atmosphere around the vessel, in \(kg/m^3\).
- Attribute:
Read-only, cannot be set
- Return type:
number
- dynamic_pressure: number#
The dynamic pressure acting on the vessel, in Pascals. This is a measure of the strength of the aerodynamic forces. It is equal to ½ · air density · velocity². It is commonly denoted \(Q\).
- Attribute:
Read-only, cannot be set
- Return type:
number
- static_pressure: number#
The static atmospheric pressure acting on the vessel, in Pascals.
- Attribute:
Read-only, cannot be set
- Return type:
number
- static_pressure_at_msl: number#
The static atmospheric pressure at mean sea level, in Pascals.
- Attribute:
Read-only, cannot be set
- Return type:
number
- aerodynamic_force: Tuple#
The total aerodynamic forces acting on the vessel, in reference frame
SpaceCenter.ReferenceFrame.- Attribute:
Read-only, cannot be set
- Returns:
A vector pointing in the direction that the force acts, with its magnitude equal to the strength of the force in Newtons.
- Return type:
Tuple
- aerodynamic_torque: Tuple#
The net aerodynamic torque currently acting on the vessel about its center of mass, in reference frame
SpaceCenter.ReferenceFrame. The magnitude is in newton-meters.- Attribute:
Read-only, cannot be set
- Returns:
A vector pointing along the axis of the torque, with its magnitude equal to the strength of the torque in newton-meters.
- Return type:
Tuple
Note
This is the live counterpart to
SpaceCenter.Flight.aerodynamic_force: it reconstructs the per-part aerodynamic forces and application points that the game applied on the current physics frame and levers them about the center of mass, rather than re-simulating them for hypothetical conditions the waySpaceCenter.Flight.simulate_aerodynamic_torque_at()does. It is intended for validating the simulator against the live game state. Not available when Ferram Aerospace Research is installed, as FAR does not expose a live per-frame torque.
- simulate_aerodynamic_force_at(body, position, velocity, rotation)#
Simulate and return the total aerodynamic forces acting on the vessel, if it were traveling with the given velocity, at the given position and orientation, in the atmosphere of the given celestial body.
- Parameters:
body (
SpaceCenter.CelestialBody) – The celestial body whose atmosphere the forces are simulated in.position (
Tuple) – The position of the vessel, in reference frameSpaceCenter.ReferenceFrame.velocity (
Tuple) – The velocity of the vessel, in reference frameSpaceCenter.ReferenceFrame.rotation (
Tuple) – The orientation of the vessel, in reference frameSpaceCenter.ReferenceFrame, in the same form asSpaceCenter.Vessel.rotation(). The angle of attack and sideslip follow from this orientation relative to the velocity; the roll component sets the direction of any aerodynamic lift. Pass the vessel’s current rotation to evaluate the force at its current orientation.
- Returns:
A vector pointing in the direction that the force acts, with its magnitude equal to the strength of the force in Newtons, in reference frame
SpaceCenter.ReferenceFrame.- Return type:
Tuple
Note
The position, velocity and rotation arguments, and the returned force, are all expressed in reference frame
SpaceCenter.ReferenceFrame. The result is the force the vessel would experience if it were placed at that position and orientation with the air flowing past it at that velocity; it is the force at the requested orientation, not the force in the vessel’s current orientation. Atmospheric temperature and density are evaluated at the current universal time.
- simulate_aerodynamic_torque_at(body, position, velocity, rotation, angular_velocity)#
Simulate and return the total aerodynamic torque acting on the vessel about its center of mass, if it were traveling with the given velocity, at the given position, orientation and angular velocity, in the atmosphere of the given celestial body.
- Parameters:
body (
SpaceCenter.CelestialBody) – The celestial body whose atmosphere the torque is simulated in.position (
Tuple) – The position of the vessel, in reference frameSpaceCenter.ReferenceFrame.velocity (
Tuple) – The velocity of the vessel, in reference frameSpaceCenter.ReferenceFrame.rotation (
Tuple) – The orientation of the vessel, in reference frameSpaceCenter.ReferenceFrame, in the same form asSpaceCenter.Vessel.rotation(). Pass the vessel’s current rotation to evaluate the torque at its current orientation.angular_velocity (
Tuple) – The angular velocity of the vessel, in reference frameSpaceCenter.ReferenceFrame. This adds the solid-body rotation term to each part’s local airflow and the per-part rigid-body angular drag the game applies, together giving the aerodynamic damping torque. Pass a zero vector to evaluate the static torque.
- Returns:
A vector pointing along the axis of the torque, with its magnitude equal to the strength of the torque in newton-meters, in reference frame
SpaceCenter.ReferenceFrame.- Return type:
Tuple
Note
The position, velocity, rotation and angular velocity arguments, and the returned torque, are all expressed in reference frame
SpaceCenter.ReferenceFrame. When Ferram Aerospace Research is installed the angular velocity argument is ignored. Atmospheric temperature and density are evaluated at the current universal time.This is the ideal rigid-body aerodynamic torque, summed from the per-part forces about the center of mass. A vessel may not visibly rotate by the full amount when a large aerodynamic force acts on a small part far from the center of mass, because the game applies each part’s force to that part and propagates it through the joints rather than to the vessel as a rigid body.
- simulate_aerodynamic_wrench_at(body, position, velocity, rotation, angular_velocity, ut)#
Simulate and return the total aerodynamic force and torque acting on the vessel, if its center of mass were traveling with the given velocity, at the given position, orientation and angular velocity, in the atmosphere of the given celestial body.
- Parameters:
body (
SpaceCenter.CelestialBody) – The celestial body whose atmosphere the wrench is simulated in.position (
Tuple) – The position of the vessel’s center of mass, in reference frameSpaceCenter.ReferenceFrame.velocity (
Tuple) – The velocity of the vessel’s center of mass, in reference frameSpaceCenter.ReferenceFrame.rotation (
Tuple) – The orientation of the vessel, in reference frameSpaceCenter.ReferenceFrame, in the same form asSpaceCenter.Vessel.rotation(). Pass the vessel’s current rotation to evaluate the wrench at its current orientation.angular_velocity (
Tuple) – The angular velocity of the vessel, in reference frameSpaceCenter.ReferenceFrame. This adds the solid-body rotation term to each part’s local airflow and the per-part rigid-body angular drag the game applies, together giving the aerodynamic damping force and torque. Pass a zero vector to evaluate the static wrench relative to the reference frame.ut (
number) – The universal time used for the atmospheric ephemeris. It selects the body/Sun geometry used for temperature and density, but does not change or propagateSpaceCenter.ReferenceFrameor any of the state arguments.
- Returns:
A pair containing the aerodynamic force in newtons followed by the aerodynamic torque in newton-meters about the vessel’s center of mass. Both are vectors in reference frame
SpaceCenter.ReferenceFrame.- Return type:
Tuple
Note
The position and velocity describe the hypothetical center-of-mass state. The position, velocity, rotation and angular velocity arguments, and both returned vectors, are expressed in reference frame
SpaceCenter.ReferenceFrame. For future-state prediction,SpaceCenter.CelestialBody.non_rotating_reference_frameis recommended so that the spatial state has unambiguous inertial semantics.This is an instantaneous rigid-body result based on the vessel’s current parts, drag cubes and control-surface state. When Ferram Aerospace Research is installed the angular velocity and ut arguments are ignored.
- lift: Tuple#
The aerodynamic lift currently acting on the vessel.
- Attribute:
Read-only, cannot be set
- Returns:
A vector pointing in the direction that the force acts, with its magnitude equal to the strength of the force in Newtons.
- Return type:
Tuple
- drag: Tuple#
The aerodynamic drag currently acting on the vessel.
- Attribute:
Read-only, cannot be set
- Returns:
A vector pointing in the direction of the force, with its magnitude equal to the strength of the force in Newtons.
- Return type:
Tuple
- aerodynamic_acceleration: Tuple#
The acceleration of the vessel due to the total aerodynamic forces acting on it (
SpaceCenter.Flight.aerodynamic_forcedivided by the vessel’s mass), in reference frameSpaceCenter.ReferenceFrame.- Attribute:
Read-only, cannot be set
- Returns:
A vector pointing in the direction that the vessel is accelerated, with its magnitude equal to the acceleration in \(m/s^2\).
- Return type:
Tuple
- lift_acceleration: Tuple#
The acceleration of the vessel due to
SpaceCenter.Flight.lift(the aerodynamic lift divided by the vessel’s mass), in reference frameSpaceCenter.ReferenceFrame.- Attribute:
Read-only, cannot be set
- Returns:
A vector pointing in the direction that the vessel is accelerated, with its magnitude equal to the acceleration in \(m/s^2\).
- Return type:
Tuple
- drag_acceleration: Tuple#
The acceleration of the vessel due to
SpaceCenter.Flight.drag(the aerodynamic drag divided by the vessel’s mass), in reference frameSpaceCenter.ReferenceFrame.- Attribute:
Read-only, cannot be set
- Returns:
A vector pointing in the direction that the vessel is accelerated, with its magnitude equal to the acceleration in \(m/s^2\).
- Return type:
Tuple
- speed_of_sound: number#
The speed of sound, in the atmosphere around the vessel, in \(m/s\).
- Attribute:
Read-only, cannot be set
- Return type:
number
- mach: number#
The speed of the vessel, in multiples of the speed of sound.
- Attribute:
Read-only, cannot be set
- Return type:
number
- reynolds_number: number#
The vessels Reynolds number.
- Attribute:
Read-only, cannot be set
- Return type:
number
Note
Requires Ferram Aerospace Research.
- true_air_speed: number#
The true air speed of the vessel, in meters per second.
- Attribute:
Read-only, cannot be set
- Return type:
number
- equivalent_air_speed: number#
The equivalent air speed of the vessel, in meters per second.
- Attribute:
Read-only, cannot be set
- Return type:
number
- terminal_velocity: number#
An estimate of the current terminal velocity of the vessel, in meters per second. This is the speed at which the drag forces cancel out the force of gravity.
- Attribute:
Read-only, cannot be set
- Return type:
number
- angle_of_attack: number#
The pitch angle between the orientation of the vessel and its velocity vector, in degrees.
- Attribute:
Read-only, cannot be set
- Return type:
number
- sideslip_angle: number#
The yaw angle between the orientation of the vessel and its velocity vector, in degrees.
- Attribute:
Read-only, cannot be set
- Return type:
number
- total_air_temperature: number#
The total air temperature of the atmosphere around the vessel, in Kelvin. This includes the
SpaceCenter.Flight.static_air_temperatureand the vessel’s kinetic energy.- Attribute:
Read-only, cannot be set
- Return type:
number
- static_air_temperature: number#
The static (ambient) temperature of the atmosphere around the vessel, in Kelvin.
- Attribute:
Read-only, cannot be set
- Return type:
number
- stall_fraction: number#
The current amount of stall, between 0 and 1. A value greater than 0.005 indicates a minor stall and a value greater than 0.5 indicates a large-scale stall.
- Attribute:
Read-only, cannot be set
- Return type:
number
Note
Requires Ferram Aerospace Research.
- drag_coefficient: number#
The coefficient of drag. This is the amount of drag produced by the vessel. It depends on air speed, air density and wing area.
- Attribute:
Read-only, cannot be set
- Return type:
number
Note
Requires Ferram Aerospace Research.
- lift_coefficient: number#
The coefficient of lift. This is the amount of lift produced by the vessel, and depends on air speed, air density and wing area.
- Attribute:
Read-only, cannot be set
- Return type:
number
Note
Requires Ferram Aerospace Research.
- ballistic_coefficient: number#
-
- Attribute:
Read-only, cannot be set
- Return type:
number
Note
Requires Ferram Aerospace Research.
- thrust_specific_fuel_consumption: number#
The thrust specific fuel consumption for the jet engines on the vessel. This is a measure of the efficiency of the engines, with a lower value indicating a more efficient vessel. This value is the number of Newtons of fuel that are burned, per hour, to produce one newton of thrust.
- Attribute:
Read-only, cannot be set
- Return type:
number
Note
Requires Ferram Aerospace Research.