Trajectories#

Provides functionality to interact with the Trajectories mod. Tested with Trajectories 2.4.5.5.

Example#

The following example prints the predicted impact position of the active vessel, in the reference frame of the body it orbits:

import { connect } from "@krpc-org/krpc";

const conn = await connect({ name: "Trajectories Example" });
const vessel = await conn.spaceCenter.getActiveVessel();
const body = await (await vessel.getOrbit()).getBody();
console.log(
  await conn.trajectories.impactPosition(await body.getReferenceFrame()),
);