Ejemplo n.º 1
0
        public static double ZoneHeading(Vessel vessel)
        {
            double LZVectorY = Starship.ImpactPoint().Item1 - Starship.InitPos.Item1;
            double LZVectorX = Starship.ImpactPoint().Item2 - Starship.InitPos.Item2;

            double LZAngle = 90;

            if (LZVectorX == 0)
            {
            }
            else
            {
                LZAngle = Math.Atan(LZVectorY / LZVectorX);
            }

            LZAngle = RadToDeg(LZAngle);

            double LZHeading = 0;

            if (LZVectorY >= 0 && LZVectorX < 0)
            {
                LZHeading = 90 - LZAngle;
            }
            else if (LZVectorY < 0 && LZVectorX < 0)
            {
                LZHeading = 90 - LZAngle;
            }
            else if (LZVectorX >= 0 && LZVectorY >= 0)

            {
                LZHeading = 270 - LZAngle;
            }
            else

            {
                LZHeading = 270 - LZAngle;
            }

            return(LZHeading);
        }
Ejemplo n.º 2
0
 public static void GuidanceByLatitude()
 {
     if (useLatitude == true)
     {
         Console.WriteLine("Oui 1");
         if (Starship.ImpactPoint().Item2 > Starship.InitPos.Item1 && superior == true)
         {
             if (Starship.ImpactPoint().Item1 > Starship.InitPos.Item2)
             {
                 Console.WriteLine("Non 1");
                 teta = -2;
             }
             else
             {
                 Console.WriteLine("Non 2");
                 teta = 2;
             }
         }
         else if (Starship.ImpactPoint().Item2 < Starship.InitPos.Item1 && superior == true)
         {
             if (Starship.ImpactPoint().Item1 > Starship.InitPos.Item2)
             {
                 Console.WriteLine("Non 3");
                 teta = -1;
             }
             else
             {
                 Console.WriteLine("Non 4");
                 teta = 1;
             }
         }
         else if (Starship.ImpactPoint().Item2 > Starship.InitPos.Item1 && superior == false)
         {
             if (Starship.ImpactPoint().Item1 > Starship.InitPos.Item2)
             {
                 Console.WriteLine("Non 5");
                 teta = 1;
             }
             else
             {
                 Console.WriteLine("Non 6");
                 teta = 2;
             }
         }
         else if (Starship.ImpactPoint().Item2 < Starship.InitPos.Item1 && superior == false)
         {
             if (Starship.ImpactPoint().Item1 > Starship.InitPos.Item2)
             {
                 Console.WriteLine("Non 7");
                 teta = 2;
             }
             else
             {
                 Console.WriteLine("Non 8");
                 teta = -2;
             }
         }
     }
     else
     {
         Console.WriteLine("Oui 2");
         if (Starship.ImpactPoint().Item2 > Starship.InitPos.Item2 && superior == true)
         {
             if (Starship.ImpactPoint().Item1 > Starship.InitPos.Item1)
             {
                 Console.WriteLine("Non 1");
                 teta = -2;
             }
             else
             {
                 Console.WriteLine("Non 2");
                 teta = 2;
             }
         }
         else if (Starship.ImpactPoint().Item2 < Starship.InitPos.Item2 && superior == true)
         {
             if (Starship.ImpactPoint().Item1 > Starship.InitPos.Item1)
             {
                 Console.WriteLine("Non 3");
                 teta = -1;
             }
             else
             {
                 Console.WriteLine("Non 4");
                 teta = 1;
             }
         }
         else if (Starship.ImpactPoint().Item2 > Starship.InitPos.Item2 && superior == false)
         {
             if (Starship.ImpactPoint().Item1 > Starship.InitPos.Item1)
             {
                 Console.WriteLine("Non 5");
                 teta = -2;
             }
             else
             {
                 Console.WriteLine("Non 6");
                 teta = 2;
             }
         }
         else if (Starship.ImpactPoint().Item2 < Starship.InitPos.Item2 && superior == false)
         {
             if (Starship.ImpactPoint().Item1 > Starship.InitPos.Item1)
             {
                 Console.WriteLine("Non 7");
                 teta = 1;
             }
             else
             {
                 Console.WriteLine("Non 8");
                 teta = -1;
             }
         }
     }
 }