• New Entry

Colorful Delaunay Triangulation on circle

KSSV on 19 Oct 2021
  • 48
  • 82
  • 2
  • 0
  • 278
% Draw circle
t=linspace(0,2*pi,300) ;
R=.5;
xc=R+R*cos(t);
yc=R+R*sin(t);
% Generate random numbers
m=5000;
x=rand(m,1);y=rand(m,1);
% Get random points inside the circle
i=inpolygon(x,y,xc,yc);
x=x(i);y=y(i);
% Generate delaunay
d=delaunayTriangulation(x,y);
z=rand(nnz(i),3);
% plot
figure('color','k')
patch('faces',d.ConnectivityList,'vertices',d.Points,'facevertexc',z)
shading faceted
axis equal off
Remix Tree