Skip to content

Movement & Attitude Commands

rot

Rotates the point to match the orientation implied by the passed in quaternion.

ParameterTypeDescription
point_namestringThe name of the point to rotate.
qarrayA quaternion [x, y, z, w] for the rotation.

Example:

js
rot("sat", [0, 0, 0, 1]);

mov

Moves a named point to a specific latitude, longitude, and altitude.

ParameterTypeDescription
point_namestringThe name of the point to move.
posarrayThe position interpreted as geographical or Cartesian coordinates. See use_geo.
use_geoboolIf true, assumes pos is provided as [lat, long, alt]; otherwise as [x, y, z]. Default is false.

Example:

js
mov("satellite1", 45.0, -93.0, 500);

mov2sat

Moves a point to the position of a satellite at a given timestamp.

ParameterTypeDescription
namestringThe name of the point to move.
cosparIdstringCOSPAR ID of the satellite.
timestampDateThe time for which the position is computed.

Example:

js
// Move the `sat` point to the current position of the object with
// NORAD catalog number 60562 
mov2sat("sat", "60562", new Date());

findBestQuaternion

Computes the optimal quaternion to align two pairs of vectors. The primary vector (defined in the body frame) will be exactly aligned with its target, while the secondary vector (also in body frame) will be aligned as closely as possible with its target while maintaining the primary alignment. Target vectors are defined in the Earth-Centered Earth-Fixed (ECEF) frame of the simulation.

ParameterTypeDescription
primaryVecArgarray|stringPrimary body vector as a 3-element array or string ("x", "y", or "z").
secondaryVecArgarray|stringSecondary body vector as a 3-element array or string ("x", "y", or "z").
primaryTargetArgarray|stringTarget vector for the primary vector. Can use "Moon" in vector definitions (e.g., "sat->Moon"). See valid input options here
secondaryTargetArgarray|stringTarget vector for the secondary vector. Can use "Moon" in vector definitions (e.g., "sat->Moon"). See valid input options here

Returns: An array [x, y, z, w] corresponding to the quaternion.

Example:

javascript
const quaternion = findBestQuaternion(
  state,
  "x",
  [0, 1, 0],
  "A->B",
  [0, 0, 1],
);