• Remix
  • Share
  • New Entry

on 19 Oct 2021
  • 4
  • 14
  • 0
  • 0
  • 279
% Draw circle
t=linspace(0,2*pi,300) ;
R=.5;
xc=R+R*cos(t);
yc=R+R*sin(t);
% Generate random numbers
m=50;
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*80)
shading faceted
axis equal off
Image
Remix Tree