Caelus3,462 checksGitHubv0.25.0MIT
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

ParameterTypeDescription
engineEngineThe engine used to evaluate positions.
targetstringA planet id ("mercury" to "pluto") or a catalog star name.
jdUtnumberJulian Day (UT).
latDegnumberObserver latitude in degrees, north positive.
lonDegnumberObserver 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

Visibility

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;

Start building

Quickstart →