I need help randomizing the points of the traingle
1 次查看(过去 30 天)
显示 更早的评论
回答(1 个)
David Hill
2022-11-28
figure;hold on;
for k=1:10
p=polyshape(rand(3,1),rand(3,1));
plot(p)
end
2 个评论
Torsten
2022-11-28
编辑:Torsten
2022-11-28
And what does it mean: "randomize one triangle" ?
According to how a normal person would interprete it, you already did this in your code: You randomly chose 3 points in 2d space (most probably meant as the corner points of a triangle).
Or do you need random points inside a fixed triangle ?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graph and Network Algorithms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!