zoukankan      html  css  js  c++  java
  • Mandelbrot图像

     

    图片

     图片

     using System;
    using System.Collections.Generic;
    using System.Text;

    namespace ConsoleApplication3
    {
        class Program
        {
            static void Main(string[] args)
            {
                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 = (imagtemp * imagtemp) + (realtemp * realtemp);
                            iterations += 1;
                        }
                        switch (iterations % 4)
                        {
                            case 0:
                                Console.Write(".");
                                break;
                            case 1:
                                Console.Write("o");
                                break;
                            case 2:
                                Console.Write("O");
                                break;
                            case 3:
                                Console.Write("@");
                                break;
                        }
                    }
                    Console.Write(" ");
                }
                Console.ReadKey();

             }
        }
    }

  • 相关阅读:
    mailto发送邮件
    使用css实现一个持续的动画效果
    documentFragment添加节点
    删除数组的第一个元素,不要直接修改数组,结果返回新的数组
    js数组去重
    css定位position(侧边栏导航)
    mongoexport导出mongodb数据库中的数据
    textarea头部不顶行问题和textarea禁止拉伸
    HTML meta标签
    textarea
  • 原文地址:https://www.cnblogs.com/zzkgis/p/3742586.html
Copyright © 2011-2022 走看看