Learn R Programming

trifield (version 1.1)

xy2abc: Ternary projection of x, y coordinates

Description

Projects x, y coordinates on the unit square to a, b, c ternary ordinates

Usage

xy2abc(xy)

Arguments

xy
A matrix of coordinates, one per row, on the unit square

Value

A matrix of a, b, c triples

References

http://dx.doi.org/10.1016/j.ecolmodel.2012.05.020

See Also

abc2xy

Examples

Run this code
# See demo(trifield)
## Not run: 
# grid.size = 128
# par(mar = rep(2, 4), oma = rep(0, 4))
# tg = ternary.grid(grid.size)
# f = function(x)
#         sin(2 * pi * x[1]) +
#         sin(3 * pi * x[2]) +
#         sin(4 * pi * x[3])
# z = ternary.apply(tg, f)
# tf = ternary.field(tg, z)
# plot(tf)
# ternary.legend()
# ## End(Not run)

Run the code above in your browser using DataLab