栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

分型艺术——哥德尔,埃舍尔,巴赫(2)

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

分型艺术——哥德尔,埃舍尔,巴赫(2)

Godel Escher Bach Fractal Background

I am reading Godel, Escher, Bach, and recursion is one of the main topics the book discussed. Recursion is a pattern and never ends, or goes to infinite. ( EX. Bach’s Fugue, Escher’s stairs, Godel incompleteness theorem).

I remember there was a Fractal Artbook in my home, i used to flip through when i didnt want to study. I think Fractal Art is one of the most interesting recursion topics!

Fractal Art is a never-ending self -similar pattern across different scales, like the snowflakes (Koch Snowflake).

Today we will be using GGPLOT2 to draw a fractal!

Fractal Basic

we use complex plain to express fractals.

Z=(a+b∗i),i=sqrt(−1) Z=(a+b*i), i= sqrt(-1) Z=(a+b∗i),i=sqrt(−1)

General Recursive formula algorithm

the initial value is C, then we repeating the calculations!
ZN=Zn−12+C,C=a+b∗i Z_{N}=Z_{n-1}^{2} +C, C=a+b*i ZN​=Zn−12​+C,C=a+b∗i

R Code

library(ggplot2)

max_iter=25
cl=colours()
step=seq(-2,0.8,by=0.005)
points=array(0,dim=c(length(step)^2,3))
t=0

for(a in step)
{
  for(b in step+0.6)
  {
    x=0;y=0;n=0;dist=0
    while(n
Summary

Besides fun to look at the fractal artwork, it has practical applications. Such as fractal dimensions provide a solution to measuring the coastline (coastline Paradox).

Reference:

http://www.r-chart.com/2010/08/fractals-in-r.html

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/220502.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号