Last data update: 2014.03.03
|
R: Project unity-summed triples (a, b, c) to unit-square doubles...
Project unity-summed triples (a, b, c) to unit-square doubles (x, y)
Description
Given a matrix of ternary values, this function will compute their x , y coordinates.
Usage
abc2xy(abc)
Arguments
abc |
A 3-column matrix containing unity-summed triples
|
Details
The x , y coordinates are scaled such that the altitude of the equilateral triangle defining the ternary space is equal to one.
Value
A matrix of x , y values, one per row
Author(s)
Timothy H. Keitt <tkeitt@gmail.com>
References
http://dx.doi.org/10.1016/j.ecolmodel.2012.05.020
See Also
xy2abc
Examples
# 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)
Results
|