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;
		}
  • Share/Bookmark

Related posts:

  1. Astronomical calculations in C#: Converting between equatorial and ecliptic coordinates As explained in my previous tutorial, equatorial coordinates are based...
  2. Astronomical calculations in C#: Calculating the Sun’s position To find the position of the Sun, the first thing...
  3. Astronomical calculations in C#: Converting between equatorial and galactic coordinates I have already addressed equatorial coordinates, so will now focus...
  4. Astronomical calculations in C#: Converting between equatorial and horizon coordinates We now begin with a vital part of astronomical calculations...
  5. Astronomy calculations in C#: Calculating Easter Easter is a rather tricky beast to calculate. It is...

Related posts brought to you by Yet Another Related Posts Plugin.