/** * The elevation, in degrees, above which a satellite counts as seen from the ground: the footprint is the circle from which it stands at least this high. * * @example * ```ts * import { BEAM_ELEVATION } from "@johnmorrisdotca/chikyu-earth/space"; * * console.log(BEAM_ELEVATION); * ``` */ export declare const BEAM_ELEVATION = 25; /** * The angle at the Earth's centre between the point below a satellite and the edge of its footprint, in radians: the ground circle from which the satellite is above `elevation`. * It is `acos(R cos(e) / (R + h)) - e` for the Earth's radius R, the height h and the elevation e. A satellite on or under the ground, or an elevation of 90 degrees or more, has none. * * @param heightKm - The satellite's height above the ground, in kilometres. * @param elevation - The least elevation, in degrees. 25 when left out. * @returns The angle, in radians, from 0 up to a quarter of a turn. * @example * ```ts * import { footprintAngle } from "@johnmorrisdotca/chikyu-earth/space"; * * console.log((footprintAngle(420) * 180) / Math.PI); * ``` */ export declare function footprintAngle(heightKm: number, elevation?: number): number; /** * The radius of a satellite's footprint along the ground, in kilometres: the Earth's radius times {@link footprintAngle}. * * @param heightKm - The satellite's height above the ground, in kilometres. * @param elevation - The least elevation, in degrees. 25 when left out. * @returns The radius in kilometres. * @example * ```ts * import { footprintKm } from "@johnmorrisdotca/chikyu-earth/space"; * * console.log(Math.round(footprintKm(550))); * ``` */ export declare const footprintKm: (heightKm: number, elevation?: number) => number; /** * The spot cells inside a footprint: where each one's middle is, and how large they are, in the footprint's own units (the footprint's radius is 1). * * @example * ```ts no-run * import type { BeamCells } from "@johnmorrisdotca/chikyu-earth/space"; * * const none: BeamCells = { lattice: [], pitch: 0, radius: 0 }; * console.log(none.lattice.length); * ``` */ export interface BeamCells { /** Each cell's middle on the lattice, in units of the distance between neighbours (the hexagonal pack: one at the middle, then rings of six, twelve, eighteen). */ lattice: number[][]; /** The distance between neighbouring cells as a share of the footprint's radius. */ pitch: number; /** A cell's radius as a share of the footprint's radius. */ radius: number; } /** * The spot cells of a footprint: `count` circles in a hexagonal pack (the middle one, then the nearest to it), drawn to fit inside the footprint, or at most `cellKm` in radius when that is smaller. * It is an illustration of a satellite that serves the ground in cells; it is not the pattern of any operator's beam plan. * * @param count - How many cells (0 for none; the most is 91, six rings). * @param radiusKm - The footprint's radius along the ground, in kilometres. * @param cellKm - A cell's radius in kilometres, when the page wants it smaller than the fit; 0 for the fit. * @returns The cells. * @example * ```ts * import { beamCells } from "@johnmorrisdotca/chikyu-earth/space"; * * console.log(beamCells(19, 2200, 0).lattice.length); * ``` */ export declare function beamCells(count: number, radiusKm: number, cellKm?: number): BeamCells; /** * The attributes the beam reads: `beam`, `beam-elevation`, `beam-cells`, `beam-cell-size`, `beam-color` and `beam-strength`. * * @example * ```ts * import { BEAM_ATTRIBUTES } from "@johnmorrisdotca/chikyu-earth/space"; * * console.log(BEAM_ATTRIBUTES.join(" ")); * ``` */ export declare const BEAM_ATTRIBUTES: readonly ["beam", "beam-elevation", "beam-cells", "beam-cell-size", "beam-color", "beam-strength"]; /** * What the attributes say: whether the beam is on, and its options. * * @example * ```ts no-run * import type { BeamOptions } from "@johnmorrisdotca/chikyu-earth/space"; * * const options: BeamOptions = { on: true, elevation: 25, cells: 19, cellSize: 0, colour: "#8fd1ff", strength: 0.6 }; * console.log(options.cells); * ``` */ export interface BeamOptions { on: boolean; elevation: number; cells: number; cellSize: number; colour: string; strength: number; } /** * The beam's colour when the page names none: a pale blue that reads on the day side and the night side. * * @example * ```ts * import { BEAM_COLOUR } from "@johnmorrisdotca/chikyu-earth/space"; * * console.log(BEAM_COLOUR); * ``` */ export declare const BEAM_COLOUR = "#8fd1ff"; /** * What the beam's attributes say. `beam` is off when it is missing, `off` or `false`; a bare attribute, `selected` or `on` switches it on for the chosen satellite. The strength is from 0 to 1 (0.6 when left out), * the elevation from 0 to 80 degrees (25), the cells from 0 to 91 (none) and the cell size in kilometres (0 for the fit). * * @param get - Reads an attribute by name, `null` when it is missing. * @returns The options. * @example * ```ts * import { readBeam } from "@johnmorrisdotca/chikyu-earth/space"; * * const read = readBeam((name) => ({ beam: "selected", "beam-cells": "19" })[name] ?? null); * console.log(read.on, read.cells); * ``` */ export declare function readBeam(get: (name: string) => string | null): BeamOptions;