Spiral
Daisy Spiral
t=0:sqrt(pi)/pi^2:5*pi;
r=sqrt(t);
lent=length(t);
x=zeros(lent,8);
y=zeros(lent,8);
x2=zeros(lent,8);
y2=zeros(lent,8);
pd=-0.75:0.25:1;
for n=1:8
x(:,n)=r.*cos(t+pd(n)*pi);
y(:,n)=r.*sin(t+pd(n)*pi);
x2(:,n)=-r.*cos(t+pd(n)*pi);
y2(:,n)=r.*sin(t+pd(n)*pi);
end
h_s=scatter(x(:)',y(:)',50+10*((x(:)').^2+(y(:)').^2),...
((x(:)').^2+(y(:)').^2),'filled');
colormap( fliplr(hsv) );
Spiral Mandala
Euler Spiral
Cornu spiral (Euler spiral) and some of its variants
(MATLAB code for cornu spiral is here)
Slinky
Spherical Helix
Fermat spiral
%MATLAB Code for Fermat spiral
t1=linspace(-15*pi,0.1,2000);
r1=sqrt(t1);
x1=-r1.*cos(t1);
y1=r1.*sin(t1);
t2=linspace(0,15*pi,2000);
r2=sqrt(t2);
x2=r2.*cos(t2);
y2=r2.*sin(t2);
line(imag(x1),imag(y1),'linewidth',2,'color',[0.2 0.3 0.4])
line(x2,y2,'linewidth',2,'color',[0.2 0.3 0.4])
axis square
Lituus
t=linspace(0.1,14*pi,500);
r=0.2./sqrt(t);
x=r.*cos(t);
y=r.*sin(t);
plot(x,y);
Baravelle Spiral Square
%% Baravelle Spiral Square
% This spiral is made from four square.On each step
% all squares are rotated at pi/4 and scaled down
% by 1/sqrt(2).
%% Four Squares
% Length is taken as 1.All the vertices and faces of the squares,
% are kept together.Coordinates are rotated in polar coordinates
% and drawn in cartesian.This makes the rotation easier.
l = 1;
vertices = [0 0;l 0;l l;0 l;-l l;-l 0;-l -l;0 -l;l -l];
faces = [1 2 3 4;
1 4 5 6;
1 6 7 8;
1 8 9 2];
vert = vertices;
[theta,r] = cart2pol(vertices(:,1),vertices(:,2));
%% Draw the Spiral
% On each step ,all the squares are rotated by pi/4
for k = 0:pi/4:4*pi
[vert(:,1),vert(:,2)] = pol2cart(theta-k,r);
patch('Vertices',vert,'Faces',faces,...
'facecolor','flat','edgecolor','none',...
'FaceVertexCData',[1 2 3 4]');
r = r/sqrt(2);
end
axis equal off
Baravelle Spiral Triangle
%% Baravelle Spiral triangle
% This spiral is made from three triangle.On each step
% all triangles are rotated at an angle pi/3 and scaled down
% by 1/2.
%% Three equilateral Traingles
% Length is taken as 1.Vertices represent an equilateral triangle.
% Vertices consist of 7 points. O is the centre of the triangle,
% A,B,C are the vertex and D,E,F are the centre of edges.
% D,E,F are connected to the O.Coordinates are rotated in polar
% coordinates and converted to cartesian before they are drawn.
l = 1;
vertices = [0 0; %O
0 l/(2*sin(pi/3)); %A
-l/2 -l/2*tan(pi/6); %B
l/2 -l/2*tan(pi/6); %C
-l/2*cos(pi/3) l/(2*sin(pi/3))*cos(pi/3)^2; %D
0 -l/2*tan(pi/6); %E
l/2*cos(pi/3) l/(2*sin(pi/3))*cos(pi/3)^2];%F
faces = [1 5 2 7;1 6 3 5;1 6 4 7];
vert = vertices;
[theta,r] = cart2pol(vertices(:,1),vertices(:,2));
%% Draw the Spiral
% On each step , rotate each triangle by pi/3
for k = 0:pi/3:3*pi
[vert(:,1),vert(:,2)] = pol2cart(theta-k,r);
patch('Vertices',vert,'Faces',faces,...
'facecolor','flat','edgecolor','none',...
'FaceVertexCData',[1 2 3]');
r = r/2;
end
axis equal off
Circle Spiral
%% Circle Spiral
% Create a Spiral of Circles.The spiral is made of many
% cicles with increasing radius and placed at some angular offset.
%% Make the first circle
% Make a cicle in polar coordinates and convert
% to cartesian.Place the circle on y-axis at some offset
t = linspace(0,2*pi,200);
r = 1;
[x,y] = pol2cart(t,r);
y = y-min(y); %place the cicle on +ve side of y-axis
[t,r] = cart2pol(x,y);
%% Draw the spiral
% Draw many cicles starting from the first one and gradually
% increase the radius.Also add a small angle to rotate circle
% about the origin.
for k = 1:1/(4*pi):2*pi
r = 1.025*r; %increase the radius of circle
[x,y] = pol2cart(t+k,r);
patch(x,y,'r','facecolor','none','edgecolor',[1/k 1-1/k 1-1/k]);
end
axis equal
box on