Skip to content

Latest commit

 

History

History
44 lines (29 loc) · 1.66 KB

orbitablevelocity.rst

File metadata and controls

44 lines (29 loc) · 1.66 KB

OrbitableVelocity

When any Orbitable object returns its VELOCITY <Orbitable:VELOCITY> suffix, it returns it as a structure containing a pair of both its orbit-frame velocity and its surface-frame velocity at the same instant of time. To obtain its velocity as a vector you must pick whether you want the oribtal or surface velocities by giving a further suffix:

OrbitableVelocity:

.. list-table:: Members
header-rows

1

widths

1 1

    • Suffix
    • Type
    • ORBIT
    • Vector
    • SURFACE
    • Vector

OrbitableVelocity:ORBIT

type

Vector

access

Get only

Returns the orbital velocity.

OrbitableVelocity:SURFACE

type

Vector

access

Get only

Returns the surface-frame velocity. Note that this is the surface velocity relative to the surface of the SOI body, not the orbiting object itself. (i.e. Mun:VELOCITY:SURFACE returns the Mun's velocity relative to the surface of its SOI body, Kerbin).

Examples:

SET VORB TO SHIP:VELOCITY:ORBIT
SET VSRF TO SHIP:VELOCITY:SURFACE
SET MUNORB TO MUN:VELOCITY:ORBIT
SET MUNSRF TO MUN:VELOCITY:SURFACE

Note

At first glance it may seem that Mun:VELOCITY:SURFACE is wrong because it creates a vector in the opposite direction from Mun:VELOCITY:ORBIT, but this is actually correct. Kerbin's surface rotates once every 6 hours, and the Mun takes a lot longer than 6 hours to orbit Kerbin. Therefore, relative to Kerbin's surface, the Mun is going backward.