% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tricolore.R
\name{TernaryNearest}
\alias{TernaryNearest}
\title{For Ternary Coordinates P Return the Nearest Coordinate in Set C}
\usage{
TernaryNearest(P, C)
}
\arguments{
\item{P, C}{n by 3 matrix of ternary coordinates [p1, p2, p3](i) for
i=1,...,n. n may be different for P and C.}
}
\value{
n by 3 matrix of ternary coordinates in C.
}
\description{
For Ternary Coordinates P Return the Nearest Coordinate in Set C
}
\examples{
# NOTE: only intended for internal use and not part of the API
P <- prop.table(matrix(runif(9), ncol = 3), 1)
C <- tricolore:::TernaryMeshCentroids(2)[,-1]
tricolore:::TernaryNearest(P, C)

}
\keyword{internal}
