0
点赞
收藏
分享

微信扫一扫

Dragon Curve/Fractal generated by mimicking the paper folding method

幸福的无所谓 2022-10-10 阅读 162

close all
clear all
clc
angle=0
%amount to rotate the final fractal
iter=20
%number of iterationsD=1;
for j=2:iter;
D2=flipud(~D);
%Make second half of new iteration
%by performing NOT operation and flipping
D(end+1,1)=0;
%make center point 0
D=vertcat(D,D2);
%join 2 halves of new iteration
endD=D-(~D);
%Changes values from 0,1 -> -1,1 for use with imaginary numberD=1i.^cumsum(D);
%Generates a list of new locations for each element relative to the
%previous elementD=cumsum(D);
%Cumulatively sums the elements to for final imageE=exp(1i*angle*pi/180)*D;
%rotates the final matrix plot(E)

举报
0 条评论