« 神話の里 白うさぎ(道の駅)へ。 | トップページ | 「インシテミル」を読んだ。 »

2010年10月18日 (月)

マンデルブローさんがお亡くなりに。。。ご冥福をお祈り&Excel VBAでマンデルブロー集合を描いてみる。

大学生時代、本当によくフラクタルのお絵かきをした。そのマンデルブローさんがお亡くなりになった。時代を感じるなあ。もうフラクタルというのは一般用語になったんだろうなあ。

http://www.asahi.com/obituaries/update/1017/TKY201010170111.html

ご冥福をお祈りします。

そこでExcel VBAでマンデルブロー集合を描いてみた。3次元グラフだと結構きれい。

Mandel001

リストは載せるほどでもないですが、一応付けとくと、

Private Sub CommandButton1_Click()
    Dim a As Double, b As Double
    Dim i As Integer, j As Integer, k As Integer
    Dim amax As Double, amin As Double
    Dim bmax As Double, bmin As Double
    Dim x As Double, y As Double, xdummy As Double, ydummy As Double
    Dim n As Integer, kmax As Integer
   
    amax = 1.2
    amin = -2
    bmax = 1.2
    bmin = -1.2
    n = 250
    kmax = 200
   
    Application.ScreenUpdating = False
   
   
    For i = 0 To n
        For j = 0 To n
            a = amin + (amax - amin) * i / n
            b = bmin + (bmax - bmin) * j / n
            x = 0
            y = 0
            col = kmax
            For k = 1 To kmax
                xdummy = x
                ydummy = y
                x = x * x - y * y + a
                y = 2 * xdummy * ydummy + b
                If Sqr(x * x + y * y) > 2 Then
                    col = k
                    Exit For
                End If
            Next k
            Worksheets("Sheet1").Cells(j + 2, i + 2) = col
        Next j
    Next i
    Application.ScreenUpdating = True

End Sub

« 神話の里 白うさぎ(道の駅)へ。 | トップページ | 「インシテミル」を読んだ。 »

学問・資格」カテゴリの記事

コメント

Nice site, nice and easy on the eyes and great content too.

The mortgage loans suppose to be important for people, which would like to start their own organization. In fact, that's not hard to get a financial loan.

コメントを書く

(ウェブ上には掲載しません)

« 神話の里 白うさぎ(道の駅)へ。 | トップページ | 「インシテミル」を読んだ。 »

最近の記事

最近のコメント

2025年1月
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
フォト
無料ブログはココログ