Constellations in Mathematica
by John from John D. Cook on (#6GWW4)
Mathematica has data on stars and constellations. Here is Mathematica code to create a list of constellations, sorted by the declination (essentially latitude on the celestial sphere) of the brightest star in the constellation.
constellations = EntityList["Constellation"]sorted = SortBy[constellations, -#["BrightStars"][[1]]["Declination"] &]
We can print the name of each constellation with
Map[#["Name"] &, sorted]
This yields
{"Ursa Minor", "Cepheus", "Cassiopeia", "Camelopardalis", ..., "Hydrus", "Octans", "Apus"}
We can print the name of the constellation along with its brightest star as follows.
Scan[Print[#["Name"], ", " #["BrightStars"][[1]]["Name"]] &, sorted]
This prints
Ursa Minor, PolarisCepheus, AlderaminCassiopeia, TsihCamelopardalis, Camelopardalis...Hydrus, HydriOctans, OctantisApus, Apodis
Mathematica can draw star charts for constellations, but when I tried
Entity["Constellation", "Orion"]["ConstellationGraphic"]
it produced extraneous text on top of the graphic.
Related postsThe post Constellations in Mathematica first appeared on John D. Cook.