• Remix
  • Share
  • New Entry

on 4 Oct 2021
  • 4
  • 36
  • 0
  • 0
  • 270
n=500; % Number of points
set(gcf, 'color', 'k') % Black background
clf
hold on
%% Compute modular arithmetic
% Plot the circle
a=linspace(0,2*pi,360*n); % Assign Angle Vector
xV=cos(a); % Circle ‘x’ Vector
yV=sin(a);
% Set the axis aspect ratio to 1:1
axis square off
% Indices of points locations
pI=1:360:360*n;
% Compute times table
B=round(1:n);
E=floor(mod(B*2,n))+1;
% Create colormap and transparency
lC=hsv(n);
%% Plot lines
for i=1:n
h=plot([xV(pI(B(i))),xV(pI(E(i)))],[yV(pI(B(i))),yV(pI(E(i)))],'Color',lC(i,:));
h.Color(4)=0.5; % Modify line opacity
h.LineWidth=1.5;
end
Remix Tree