Contents
Initialisations
clear all;
close all;
window = [0 100 0 100];
box = [0 0;100 0;100 100;0 100];
lambda = .005;
compute diagram
Np = round((window(2)-window(1))*(window(4)-window(3)) * lambda);
x = rand(Np, 1)*(window(2)-window(1)) + window(1);
y = rand(Np, 1)*(window(4)-window(3)) + window(3);
points = [x y];
angles = rand(Np, 1)*pi;
angles = mod([angles angles+2*pi/3 angles+4*pi/3], 2*pi);
edges = crackPattern2(box, points, angles);
Draw Result
figure(1); clf;
axis(window);hold on;
drawEdge(edges);
drawPoint(points, 'bo');
set(gca, 'box', 'on');
set(gca, 'xtick', []);
set(gca, 'ytick', []);