Reference
Facts, line drawings and positions
import { … } from "@johnmorrisdotca/wakusei-planets";
Exports
| Name | Kind | What it is |
|---|---|---|
addBody | function | Add a body to a scene (once), in its place in the order of the sky for an automatic layout, or at the front and to the right of the others for a manual one. |
apparent | function | How a body looks from the Earth at a time, from its real pole, rotation and the Sun's direction. |
Apparent | type | What the sky shows of a body at a time: its pose, the latitude the viewer sees it from (how open its rings are), the longitude at the middle of the disc, the phase and the size. |
BODIES | constant | Every body's facts, by name: sizes, flattening, axial tilt, poles and rotation from the IAU and NASA. |
BODY_IDS | constant | Every body's name: the Sun, the planets outward, the dwarf planets, then the moons of each. |
BodyFacts | type | The facts of one body: its radius, flattening, axial tilt, pole, prime meridian, rotation, colour, rings and the features a line drawing shows. |
BodyId | type | The name of a body: sun, a planet, a dwarf planet or a moon. |
decodeScene | function | The scene from its text. |
defaultPortrait | function | An empty scene with the usual settings: an automatic row, readable sizes, the stars behind, the Sun upper left. |
drawnTilt | function | The tilt a drawing shows for a body: its obliquity, turned past 120 degrees to the other side (Venus is nearly upside down, so it is drawn nearly upright). |
DWARF_IDS | constant | The dwarf planets besides Pluto, nearest the Sun first (by the size of their orbits). |
DwarfId | type | The name of a dwarf planet besides Pluto: ceres, eris, haumea... |
EMBED_KINDS | constant | The ways embedCode writes a body into a page. |
embedCode | function | The text that puts a body in a page, for one way of making the page. |
embedCredit | function | The credits that travel with a picture of a body: the line and illustrated looks are drawn from numbers, and realistic and painted use the surface maps. |
EmbedKind | type | One of the ways in EMBED_KINDS. |
EmbedOptions | type | What the reader chose: the body, how it is drawn, and whether it is a portrait or the sky at a date. |
EmbedSettings | type | Where the embed code points: the package's version on jsDelivr, and the published demo, where embed.html is. |
encodeScene | function | The scene as one short piece of text that is safe in an address: fields joined by ~, each name:value, then one body_x_y_r_spin_tilt_pitch_turn for each body, back to front. |
Feature | type | A thing a line drawing shows on a body's surface, placed by longitude and latitude in degrees (angular sizes in degrees): a circle, an oval, a band of latitude or a line. |
heliocentric | function | A planet's or dwarf planet's position in the Sun's frame (J2000 ecliptic, astronomical units) at a time: Mercury to Neptune from the VSOP87B series, and Pluto and the other dwarf planets from tables fitted to Horizons (each within a few arc-seconds or better, see the accuracy guide; outside a table's years a dwarf planet falls back to the osculating elements of one epoch from JPL's Small-Body Database). |
heliocentricModel | function | The theory that heliocentric(planet, ms) answers with, given the tables loaded now: VSOP87B for Mercury to Neptune, a fitted Chebyshev table where one covers the moment, else osculating elements (a dwarf planet) or JPL's approximate elements (Pluto outside its table). |
HostId | type | A body a moon can go round: a planet, Pluto or another dwarf planet. |
JOURNEY_STOPS | constant | Every body, in the same order as BODY_IDS: the Sun, the planets, the dwarf planets, then the moons. |
journeyStop | function | One body's row. |
JourneyStop | type | One body, with what a trip needs. |
layoutPortrait | function | Where every body is and how big, and the camera that holds them. |
LineOptions | type | Options for lineSvg: the size, a pose (tilt, pitch, phase, spin, a time or a pose), moons, range, fill, the language and the colours. |
lineSvg | function | A body as a line drawing, as an SVG string: the outline (squeezed by its flattening and leaning at its axial tilt), bands and features, rings with their gaps, and the dark side dashed off. |
Look | type | How a body is drawn: line (an outline drawing), realistic and painted (a real surface map; painted is the same maps), or illustrated (shaded from the numbers, not a default). |
meanSunAu | function | Mean distance from the Sun, in astronomical units: a planet's semi-major axis at J2000, or a dwarf planet's semi-major axis at the epoch of its elements. |
mix | function | Mix two #rrggbb colours: t is how much of b (0 to 1). |
moonGeocentric | function | The Moon's position from the Earth's centre (J2000 mean ecliptic and equinox, kilometres), from the lunar solution ELP2000-82B (Chapront-Touze and Chapront, IMCCE) cut to its 540 largest terms and run in terrestrial time: within a few arc-seconds of Horizons from 1800 to 2200. |
MoonId | type | The name of a moon the package draws, such as moon, io or titan. |
MoonPlace | type | One moon, placed in a planet's system: in planet radii, x to the right, y up, z toward the viewer, with its distance from the planet and its phase angle. |
MOONS_OF | constant | The moons the package draws, by planet or dwarf planet. |
orbitPath | function | The path one moon follows round its planet over one trip, as the Earth sees it at time: x, y, z in planet radii, in the viewer's frame at that moment. |
PlacedItem | type | A body of a scene as the layout puts it: its place and size now (stored, or worked out by an automatic layout), and how far its picture reaches past the disc. |
PLANET_IDS | constant | The planets and the dwarf planet Pluto, nearest the Sun first. |
PlanetId | type | The name of a planet or of Pluto: mercury to pluto. |
portrait | function | A pose from a tilt, a pitch, a phase and a spin: the body as a portrait, with the Sun a little above the left. |
Portrait | type | A portrait scene: the bodies, back to front, and how they are arranged, sized, lit and drawn. |
PORTRAIT_PRESETS | constant | Ready-made scenes to start from: a family photo of the Sun and the planets, the gas giants to scale, Jupiter and the Galileans, the Earth and the Moon to scale (size and distance), Mars and its moons at their true distance, and the inner planets round the Sun. |
portraitCode | function | The text that puts a portrait scene in a page, for each way a page is made, as embedCode does for a single body. |
PortraitEmbed | type | A scene of the portrait builder to put in a page: the scene as the builder writes it in its address, how wide the picture is, and the look to draw it in if not the scene's own. |
PortraitItem | type | One body in the scene: which body, where it is and how big, how it is turned and how fast it turns by itself. |
PortraitLayout | type | What a layout works out for a scene: every body placed, and the camera that holds them (its centre and half-height, in the scene's units). |
PortraitOptions | type | Options for a pose when no date is given. |
PortraitPreset | type | A ready-made scene with its name in English and Japanese. |
Pose | type | The way a body is turned toward the viewer, in the viewer's frame (x to the right, y up, z toward the viewer), as unit vectors: its north pole, the direction of longitude 0 and the Sun's direction. |
RingBand | type | One band of a ring system, in kilometres from the planet's centre: how much light it stops (alpha, 0 to 1) and how bright it is (tone, 0 dark, 1 bright). |
ringReach | function | The ring system's outer edge in body radii, or 1 for a body with no rings. |
ringStrip | function | The strip of a body's rings, made from its ring bands: where each band is it stops light and has its tone, with fine ringlets in it and soft edges. |
RingStrip | type | The strip of a body's rings: RGBA bytes width pixels across, and the inner and outer radii in body radii. |
stopPlaceAu | function | Where a body is in the Sun's frame at an instant, in astronomical units. |
system | function | A planet and its moons as the Earth sees them at a time: each moon's place in planet radii, in the viewer's frame (x right, y up, z toward the viewer). |
System | type | A planet's own pose and its moons as the Earth sees them at a time, nearest first. |