Maths is smART |
Maths is smart, maths is art.
|
I hope you like this picture, this picture was wholey created using matlab! Maybe not the most productive thing to use matlab for but it was fun and I like the end result:

If you would like to see more pictures like this just give me a scene or scenario and I will have a go. Thanks! If any of you wanted the code here it is:
%sky
clf
x = [-3:0.1:13];
hold on
for i=1:0.2:13
set(gca, ‘ColorOrder’, [rand*50 rand*55+200 rand*100]./255);
set(gca, ‘ColorOrder’, [rand*50 rand*100 rand*55+200]./255);
plot(x,i);
end
%sun
nopoints = 20;
x = linspace(-1.88,1.88,nopoints);
dt = 0.05;
n = 1/dt;
theta = 2*pi*dt;
A = [cos(theta) -sin(theta); sin(theta) cos(theta)];
y = cos(x);
for i=1:n
for j=1:nopoints
v = [x(j);y(j)];
vnew = A*v;
x(j) = vnew(1);
y(j) = vnew(2);
end
set(gca, ‘ColorOrder’, [rand*50+205 rand*50+205 rand*50]./255);
plot(x+10,y+10)
end
%tree trunk
x1 = [-1:0.01:-0.2];
x2 = [0.2:0.01:1];
set(gca, ‘ColorOrder’, [139 69 19]./255);
for i=0:0.1:0.4
plot(x1+i,0.2./(x1.^2))
end
for i=0:0.1:0.4
plot(x2-i,0.2./(x2.^2))
end
%tree top
t = linspace(0,16*pi,1000);
for i = 0.5:0.1:2
x = (2*cos(t)+i*cos(8*t))./2;
y = (sin(t)+i*sin(8*t))./2+5;
set(gca, ‘ColorOrder’, [rand*100 rand*50+205 rand*50]./255);
plot(x,y)
end
%grass
x = [-3:0.1:13];
for i=-4:0.05:1
set(gca, ‘ColorOrder’, [rand*50 rand*55+200 rand*100]./255);
plot(x,i);
end
%rainbow
n = 140;
ColourMatrix = zeros(n+2,3);
for i=1:n/7
ColourMatrix(i,:) = [255 153*7*i/n 0]./255;
ColourMatrix(i+n/7,:) = [255 (255-153)*7*i/n+153 0]./255;
ColourMatrix(i+2*n/7,:) = [-255*7*i/n+255 255 0]./255;
ColourMatrix(i+3*n/7,:) = [-255*7*i/n+255 -255*7*i/n+255 255*7*i/n]./255;
ColourMatrix(i+4*n/7,:) = [0 65*7*i/n (106-255)*7*i/n+255]./255;
ColourMatrix(i+5*n/7,:) = [143*7*i/n -65*7*i/n+65 (255-106)*7*i/n+106]./255;
ColourMatrix(i+6*n/7,:) = [(255-143)*7*i/n+143 255*i/n 255]./255;
end
t = linspace(0,pi,n);
for r=linspace(5,6,n)
x = (11-r)/2*cos(t)+9;
y = (11-r)/2*sin(t)+0.8;
set(gca, ‘ColorOrder’,ColourMatrix(floor((r-5)*n+1),:));
plot(x,y)
end
hold off