Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

bary2cart

Conversion of Barycentric to Cartesian coordinates


Description

Given the barycentric coordinates of one or more points with respect to a simplex, compute the Cartesian coordinates of these points.

Usage

bary2cart(X, Beta)

Arguments

X

Reference simplex in N dimensions represented by a N+1-by-N matrix

Beta

M points in barycentric coordinates with respect to the simplex X represented by a M-by-N+1 matrix

Value

M-by-N matrix in which each row is the Cartesian coordinates of corresponding row of Beta

Author(s)

David Sterratt

See Also

Examples

## 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)

geometry

Mesh Generation and Surface Tessellation

v0.4.5
GPL (>= 3)
Authors
Jean-Romain Roussel [cph, ctb] (wrote tsearch function with QuadTrees), C. B. Barber [cph], Kai Habel [cph, aut], Raoul Grasman [cph, aut], Robert B. Gramacy [cph, aut], Pavlo Mozharovskyi [cph, aut], David C. Sterratt [cph, aut, cre] (<https://orcid.org/0000-0001-9092-9099>)
Initial release
2019-12-02

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.