StarryNight is all you need for curiosity towards stars and constellations.
github "DJBen/StarryNight" ~> 0.3.0
Star.magitudeLessThan(7)
Star.hr(9077)
Star.hd(224750)
Star.hip(25)
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.iau("Tau")
Constellation.named("Orion")
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
// 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.