Documentation / @interstellar-tools/maps / ellipseOutline
Function: ellipseOutline()
ts
function ellipseOutline(
grid: GridInterface,
ellipse: GroundEllipseInterface,
points?: number
): GridPositionInterface[];Defined in: terrain/ellipse.ts:89
The outline of an ellipse on the ground, as places on a grid, to draw it.
Where:
and are its semi-major and semi-minor axes, and its azimuthand are how far east and north of its centre the place at is, in m, turned into rows and columns by the cell size
Notes
- The first place, at
, is the long axis's end in the direction of azimuth; the places go round from there, a quarter turn later at the short axis's end on its right. The last is the first again, to close it. - The grid is taken as flat with north up, so it suits an ellipse a few kilometres across on a map with little distortion there.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
grid | GridInterface | undefined | The grid, for its cell size. |
ellipse | GroundEllipseInterface | undefined | The ellipse. |
points? | number | 96 | How many places round it (an integer ≥ 3). Defaults to 96. |
Returns
points + 1 places, in grid coordinates.
Throws
- If a size, cell size or the ellipse's centre, axes or azimuth is not finite.
- If the grid's parts don't fit together, an axis is not > 0, or
pointsis not an integer ≥ 3.
Example
ts
// Perseverance's landing ellipse, 7.7 km × 6.6 km, long side east–west
ellipseOutline(grid, {
centre,
semiMajorAxis: 3850,
semiMinorAxis: 3300,
azimuth: toRad(90)
});