Generate some points on the plane restricted by 3 points (triangle)
Show older comments
Assume that
are the vertices of a triangle in space. How can i generate some points on this triangle?
Accepted Answer
More Answers (1)
Bruno Luong
on 26 Oct 2020
Edited: Bruno Luong
on 26 Oct 2020
Another method:
n = 1000; % number of random points
p1 = [1 1 2];
p2 = [5 7 3];
p3 = [8 2 1];
w = -log(rand(3,n));
xyz = [p1; p2; p3].' * (w./sum(w));
plot3(xyz(1,:),xyz(2,:),xyz(3,:),'.')
Categories
Find more on Scatter Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!