Skip to the content

Hoshi Stars星

The stars you can see without a telescope, with names, colours and distances; the 88 constellations with their lines and boundaries; the Messier objects; and seven map projections to draw them on.

Hoshi is the Japanese word 星 for a star. About the name

Contents

Reference · Your sky: altitude and azimuth for a place and a moment

isAboveHorizonfunction

Whether a position is above the horizon of a place at a moment (altitude greater than 0). With refraction: true it counts the bending of the light, so a star can be seen a little below the geometric horizon.

Import it

import { isAboveHorizon } from "@johnmorrisdotca/hoshi-stars/sky";

Definition

function isAboveHorizon(position: SkyPoint, observer: Observer, when: When, options?: HorizontalOptions): boolean

Parameters

NameTypeDescription
positionSkyPoint

A right ascension and declination in degrees, J2000 or (with equinox: "date") of the date.

observerObserver

Latitude north and longitude east in degrees.

whenWhen

The moment, a Date or milliseconds since 1970.

options (optional)HorizontalOptions

The same as horizontal.

Returns

boolean

True when it is up.

Examples

import { starByName, starPosition } from "@johnmorrisdotca/hoshi-stars";
import { isAboveHorizon } from "@johnmorrisdotca/hoshi-stars/sky";

// Polaris never sets for anyone in the northern hemisphere
const polaris = starPosition(starByName("Polaris")!);
console.log(isAboveHorizon(polaris, { latitude: 49.28, longitude: -123.12 }, Date.now()));
true

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/hoshi-stars 0.7.0.