Documentation / @interstellar-tools/maps / isStableLanding
Function: isStableLanding()
ts
function isStableLanding(
slope: Radians,
dynamicTilt: Radians,
rFootprint: number,
hCoM: number
): boolean;Defined in: landing/is-stable-landing.ts:54
Check whether a lander stays upright on a slope: whether its total tilt stays below its tip-over angle.
Where:
is the slope of the ground under the lander (rad) is the extra tilt from the touchdown itself, the rock-up as the legs take the load (rad) - the right-hand side is tipOverAngle
Units
- Inputs:
slopeanddynamicTiltin radians,rFootprintandhCoMin m. - Output:
trueif it stays up,falseif it tips at or past the limit.
Notes
- A static check, the first screen for a landing site: real landers also depend on touchdown speed, leg compression, friction and footpads digging in or sliding.
- Pass the slope in the direction the lander is most likely to tip, and the footprint distance in that direction too.
- For a whole elevation grid, safeLandingGrid combines it with each cell's slope and roughness.
Parameters
| Parameter | Type | Description |
|---|---|---|
slope | Radians | Ground slope |
dynamicTilt | Radians | Extra tilt from touchdown |
rFootprint | number | Distance from the centre of mass to the tipping edge, horizontally, in m (finite, > 0). |
hCoM | number | Height of the centre of mass above the ground in m (finite, > 0). |
Returns
boolean
true if the total tilt stays below the tip-over angle.
Throws
- If any input is not a finite number.
- If
slopeordynamicTiltis negative, orrFootprintorhCoMis<= 0.
Example
ts
import type { Radians } from '@interstellar-tools/types';
const toRad = (deg: number) => ((deg * Math.PI) / 180) as Radians;
// Tips at 45°: fine on a 30° slope with 10° of rock-up, not on 40° with 10°
isStableLanding(toRad(30), toRad(10), 2, 2); // true
isStableLanding(toRad(40), toRad(10), 2, 2); // false