It is often useful to know in which constellation an object appears, since it is more intuitive to find something in the sky when you know which constellation you are looking for the object in.
Finding the constellation for objects which travel along near the ecliptic this is very easy. The ecliptic is the path along which the Moon, Sun and planets move, so this is particularly applicable to these objects.
The twelve constellations on the ecliptic form the zodiac, and to find the constellation which the object is in, all you need is the ecliptic longitude of the object, since the boundaries of the constellations are fixed. By passing the right ascension and declination of the object, and then using the conversion to ecliptic coordinates, we just need to check which constellation is within the ecliptic longitude value.
public static string GetCurrentConst(double fOblique, double fRA, double fDecl) { double fELong = 0; double fELat = 0; string sConst; ConvEquToEcl(fOblique, fRA, fDecl, ref fELong, ref fELat); if (fELong < 33.18) { sConst = "Pisces"; } else if (fELong < 51.16) { sConst = "Aries"; } else if (fELong < 93.44) { sConst = "Taurus"; } else if (fELong < 119.48) { sConst = "Gemini"; } else if (fELong < 135.30) { sConst = "Cancer"; } else if (fELong < 173.34) { sConst = "Leo"; } else if (fELong < 224.17) { sConst = "Virgo"; } else if (fELong < 242.57) { sConst = "Libra"; } else if (fELong < 271.26) { sConst = "Scorpius"; } else if (fELong < 302.49) { sConst = "Sagittarius"; } else if (fELong < 311.72) { sConst = "Capricorn"; } else if (fELong < 348.58) { sConst = "Aquarius"; } else { sConst = "Pisces"; } return sConst; }
Comments