API Reference / visibility · function
Function: visibility()
function visibility(
engine,
target,
jdUt,
latDeg,
lonDeg,
opts?): Visibility;
Whether a planet or catalog star can be seen with the naked eye at one instant from one place: the sky's brightness where it stands, the limiting magnitude there after extinction, and the margin the body has over it.
Parameters
| Parameter | Type | Description |
|---|---|---|
engine | Engine | The engine used to evaluate positions. |
target | string | A planet id ("mercury" to "pluto") or a catalog star name. |
jdUt | number | Julian Day (UT). |
latDeg | number | Observer latitude in degrees, north positive. |
lonDeg | number | Observer longitude in degrees, east positive. |
opts | { altM?: number; extinction?: number; } | extinction (V-band magnitudes per air mass, default 0.25) and altM (observer altitude in metres). |
opts.altM? | number | - |
opts.extinction? | number | - |
Returns
Example
// Is Sirius visible from Cairo 40 minutes before sunrise on 5 August 2025?
visibility(engine, "Sirius", julianDay(2025, 8, 5, 2, 35), 30.05, 31.25).visible;