/// Compute Ra Dec public static CroodAzAlt FromRaDecToAzAlt(CroodLonLat Location, CroodRaDec RaDec, Angle LST) { Angle Ha = LST - RaDec.Ra; double Az = Math.Atan2(Math.Sin(Ha), Math.Cos(Ha) * Math.Sin(Location.Lat) - Math.Tan(RaDec.Dec) * Math.Cos(Location.Lat)); double Alt = Math.Asin(Math.Sin(Location.Lat) * Math.Sin(RaDec.Dec) + Math.Cos(Location.Lat) * Math.Cos(RaDec.Dec) * Math.Cos(Ha)); return(new CroodAzAlt(Az + Math.PI, Alt)); }
/// Compute Ra Dec public static CroodAzAlt FromRaDecToAzAlt(CroodLonLat Location, CroodRaDec RaDec, Angle LST) { Angle Ha = LST - RaDec.Ra; double Az = Math.Atan2(Math.Sin(Ha), Math.Cos(Ha) * Math.Sin(Location.Lat) - Math.Tan(RaDec.Dec) * Math.Cos(Location.Lat)); double Alt = Math.Asin(Math.Sin(Location.Lat) * Math.Sin(RaDec.Dec) + Math.Cos(Location.Lat) * Math.Cos(RaDec.Dec) * Math.Cos(Ha)); return new CroodAzAlt(Az + Math.PI, Alt); }