sims <- runif_on_triangle(30, c(0,0), c(1,0), c(0,1))
plot(sims, xlim = c(0,1), ylim = c(0,1), pch = 19)
sims <- runif_in_triangle(100, c(0,0), c(1,0), c(0,1))
plot(sims, xlim = c(0,1), ylim = c(0,1), pch = 19)
Run the code above in your browser using DataLab