Patch#

class Trajectories.Patch#

A patch of the trajectory, at its position in Trajectories.patches().

Note

Trajectories computes the trajectory again as the vessel flies, and the patch reads the latest one. Throws an exception if the trajectory has fewer patches.

position(reference_frame: SpaceCenter.ReferenceFrame): Tuple | nil#

The position of the impact, or nil without one.

Parameters:

reference_frame – The reference frame for the position.

Note

In a reference frame that rotates with Trajectories.Patch.body, the position includes the rotation of the body until the impact.

velocity(reference_frame: SpaceCenter.ReferenceFrame): Tuple | nil#

The velocity at the impact, or nil without one.

Parameters:

reference_frame – The reference frame for the velocity.

Note

In a reference frame that rotates with Trajectories.Patch.body, the velocity includes the rotation of the body until the impact.

body: SpaceCenter.CelestialBody#

The celestial body that the patch is relative to.

Attribute:

Read-only, cannot be set

start_ut: number#

The universal time at the start of the patch, in seconds.

Attribute:

Read-only, cannot be set

end_ut: number#

The universal time at the end of the patch, in seconds.

Attribute:

Read-only, cannot be set

Note

For a patch that ends in an impact, this is the time of the impact.

atmospheric: boolean#

Whether the patch is inside an atmosphere.

Attribute:

Read-only, cannot be set

atmospheric_trajectory(reference_frame: SpaceCenter.ReferenceFrame): List | nil#

The points of an atmospheric patch, or nil for a patch in space.

Parameters:

reference_frame – The reference frame for the positions.

Note

Each point is a tuple (ut, x, y, z). In a reference frame that rotates with Trajectories.Patch.body, the positions include the rotation of the body until each point.

orbital_trajectory: SpaceCenter.Orbit | nil#

The orbit of a patch in space, or nil for an atmospheric patch.

Attribute:

Read-only, cannot be set