Example #1
0
        public static GoogleSkyCs EquatorialToGoogleSky(EquatorialCs ecs)
        {
            var localLatitude  = ecs.Declination;
            var localLongitude = ecs.RightAscension * 15 - 180;

            return(new GoogleSkyCs(localLatitude, localLongitude));
        }
Example #2
0
        public static HorizontalCs EquatorialToHorizontal(EquatorialCs ecs)
        {
            var tHourAngle   = DegreeToRadians(ecs.HourAngle * 15);
            var tDeclination = DegreeToRadians(ecs.Declination);
            var tempLatitude = DegreeToRadians(Latitude);
            var fSinAlt      = (Math.Sin(tDeclination) * Math.Sin(tempLatitude)) + (Math.Cos(tDeclination) * Math.Cos(tempLatitude) * Math.Cos(tHourAngle));
            var altitude     = Math.Asin(fSinAlt);
            var fCosAzim     = ((Math.Sin(tDeclination) - (Math.Sin(tempLatitude) * Math.Sin(altitude))) / (Math.Cos(tempLatitude) * Math.Cos(altitude)));
            var azimuth      = RadiansToDegree(Math.Acos(fCosAzim));

            //if (Math.Sin(tHourAngle) > 0)
            //{
            //    azimuth = 360 - azimuth;
            //}
            altitude = RadiansToDegree(altitude);

            return(new HorizontalCs(azimuth, altitude));
        }