R/xy2abc.R

Defines functions xy2abc

Documented in xy2abc

xy2abc <-
function(xy)
{
	tmat = c(sqrt(3) / 2, -0.5, 0, 1)
	dim(tmat) = rep(2, 2)
	res = as.matrix(xy) %*% tmat
	res = cbind(res[,2], 1 - rowSums(res), res[,1])
	colnames(res) = c("a", "b", "c")
	res
}

Try the trifield package in your browser

Any scripts or data that you put into this service are public.

trifield documentation built on May 29, 2017, 11:44 p.m.