• New Entry

Art with random digits

KSSV on 20 Oct 2021
  • 47
  • 101
  • 1
  • 0
  • 265
% Functions
L=@linspace;
M=@movmean; % use smooth for more beauty
% Intervals
n=1000;
m=10;
% Random digit generation
r=randi(m,n,1);
T=L(0,2*pi,m+1);
% Get connections
%x=zeros(n-1,1);
%y=x;
for i=1:m
j=r==i;
t=L(T(i),T(i+1),nnz(j));
x(j)=cos(t);
y(j)=sin(t);
end
% Draw connections/lines using curves
d=.05;
W=[1:-d:0;0:d:1];
w=[1:-d:.55 .5:d:1];
figure('color','k')
hold
Current plot held
for i=1:n-1
l=x(i:i+1)*W.*w;
m=y(i:i+1)*W.*w;
plot(M(l,15),M(m,15));
end
axis equal off
Remix Tree