runif_triangle | R Documentation |
Uniform sampling on or in a triangle (dimension 2).
runif_in_triangle(n, v1, v2, v3)
runif_on_triangle(n, v1, v2, v3)
n |
number of simulations |
v1, v2, v3 |
vertices of the triangle |
The simulations in a n
times 2
matrix.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.