double realCoord, imagCoord;
            
double realTemp, imagTemp, realTemp2, arg;
            
int iterations;
            
for (imagCoord = 1.2; imagCoord >= -1.2; imagCoord -= 0.05)
            {
                
for (realCoord = -0.6; realCoord <= 1.77; realCoord += 0.03)
                {
                    iterations 
= 0;
                    realTemp 
= realCoord;
                    imagTemp 
= imagCoord;
                    arg 
= (realCoord * realCoord) + (imagCoord * imagCoord);
                    
while ((arg < 4&& (iterations < 40))
                    {
                        realTemp2 
= (realTemp * realTemp) - (imagTemp * imagTemp)
                        
- realCoord;
                        imagTemp 
= (2 * realTemp * imagTemp) - imagCoord;
                        realTemp 
= realTemp2;
                        arg 
= (realTemp * realTemp) + (imagTemp * imagTemp);
                        iterations 
+= 1;
                    }
                    
switch (iterations % 4)
                    {
                        
case 0:
                            Console.Write(
".");
                            
break;
                        
case 1:
                            Console.Write(
"o");
                            
break;
                        
case 2:
                            Console.Write(
"0");
                            
break;
                        
case 3:
                            Console.Write(
"@");
                            
break;
                    }
                }
                Console.Write(
"\n");
            }
            Console.ReadKey();

相关文章:

  • 2022-12-23
  • 2021-06-13
  • 2022-02-06
  • 2021-07-21
  • 2021-04-24
  • 2021-12-23
  • 2022-01-28
猜你喜欢
  • 2022-03-07
  • 2022-01-21
  • 2022-12-23
  • 2021-08-25
  • 2021-09-10
  • 2022-12-23
  • 2022-02-26
相关资源
相似解决方案