TernaryDistance {tricolore} | R Documentation |
Distance Between Points in Ternary Coordinates
Description
The distances between ternary coordinate p and a set of ternary coordinates C.
Usage
TernaryDistance(p, C)
Arguments
p |
A vector of ternary coordinates [p1, p2, p3]. |
C |
n by 3 matrix of ternary coordinates [p1, p2, p3](i) for i=1,...,n. |
Value
A numeric vector of distances between coordinate p and all coordinates in C.
References
https://en.wikipedia.org/wiki/Barycentric_coordinate_system#Distance_between_points
Examples
# NOTE: only intended for internal use and not part of the API
p <- c(0.5, 0.2, 0.3)
C <- prop.table(matrix(runif(3*10), ncol = 3), 1)
tricolore:::TernaryDistance(p, C)
[Package tricolore version 1.2.4 Index]