bary2cart | R Documentation |
Given the barycentric coordinates of one or more points with respect to a simplex, compute the Cartesian coordinates of these points.
bary2cart(X, Beta)
X |
Reference simplex in |
Beta |
|
M
-by-N
matrix in which each row is the
Cartesian coordinates of corresponding row of Beta
David Sterratt
cart2bary
## Define simplex in 2D (i.e. a triangle)
X <- rbind(c(0, 0),
c(0, 1),
c(1, 0))
## Cartesian cooridinates of points
beta <- rbind(c(0, 0.5, 0.5),
c(0.1, 0.8, 0.1))
## Plot triangle and points
trimesh(rbind(1:3), X)
text(X[,1], X[,2], 1:3) # Label vertices
P <- bary2cart(X, beta)
points(P)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.