StarryNight is all you need for curiosity towards stars and constellations.
- Database of 15000+ stars within 7th magnitude.
- Star Catalogs including HR, HD, HIP, Gould and Bayer-Flamsteed designations.
- Celestial coordinate and proper motion.
- Visual and absolute magnitude, luminance, spectral type, binary star info, and other physical properties.
- Extended Constellation support.
- Position query and inverse position query.
- Constellation line and constellation border.
- Abbreviation, genitive and etymology.
github "DJBen/StarryNight" ~> 0.3.0
- All stars brighter than...
Star.magitudeLessThan(7)
- Star with specific designation.
Star.hr(9077)
Star.hd(224750)
Star.hip(25)
- Star closest to specific celestial coordinate.
This is very useful to locate the closest star to user input.
let coord = Vector3.init(equatorialCoordinate: EquatorialCoordinate.init(rightAscension: radians(hours: 5, minutes: 20), declination: radians(degrees: 10), distance: 1)).normalized()
Star.closest(to: coord, maximumMagnitude: 2.5)
// Bellatrix
- Constellation with name or IAU symbol.
Constellation.iau("Tau")
Constellation.named("Orion")
- Constellation that contains specific celestial coordinate.
This is very useful to locate the constellation that contains the region of user input.
It is implemented as a category on EquatorialCoordinate
. See SpaceTime repo for implementation and usage of coordinate classes.
let coord = EquatorialCoordinate.init(rightAscension: 1.547, declination: 0.129, distance: 1)
coord.constellation
// Orion
- Neighboring constellations and centers.
// Get a set of neighboring constellations
Constellation.iau("Ori").neighbors
// Get the coordinate of center(s) of current constellation
Constellation.iau("Ori").displayCenters
Note: displayCenters
returns an array of one element for all constellations except Serpens, which will include two elements - one center for Serpens Caput and the other for Serpens Cauda.
Data extracted from HYG database and processed into SQLite. The star catalog has been trimmed to 7th magnitude to reduce file size. Feel free to download the full catalog and import into SQLite whenever you see fit.