Convert coordinates of a point in ternary space, in the format (a, b, c), to x and y coordinates of Cartesian space, which can be sent to standard functions in the 'graphics' package.
Usage
TernaryCoords(
abc,
b_coord = NULL,
c_coord = NULL,
direction = getOption("ternDirection", 1L),
region = getOption("ternRegion", ternRegionDefault)
)
# S3 method for class 'matrix'
TernaryToXY(
abc,
b_coord = NULL,
c_coord = NULL,
direction = getOption("ternDirection", 1L),
region = getOption("ternRegion", ternRegionDefault)
)
# S3 method for class 'numeric'
TernaryToXY(
abc,
b_coord = NULL,
c_coord = NULL,
direction = getOption("ternDirection", 1L),
region = getOption("ternRegion", ternRegionDefault)
)
TernaryToXY(
abc,
b_coord = NULL,
c_coord = NULL,
direction = getOption("ternDirection", 1L),
region = getOption("ternRegion", ternRegionDefault)
)Arguments
- abc
A vector of length three giving the position on a ternary plot that points in the direction specified by
direction(1 = up, 2 = right, 3 = down, 4 = left).c(100, 0, 0)will plot in thedirection-most corner;c(0, 100, 0)will plot in the corner clockwise ofdirection;c(0, 0, 100)will plot in the corner anti-clockwise ofdirection. Alternatively, the a coordinate can be specified as the first parameter, in which case the b and c coordinates must be specified viab_coordandc_coord. Or, a matrix with three rows, representing in turn thea,bandccoordinates of points.- b_coord
The b coordinate, if
abcis a single number.- c_coord
The c coordinate, if
abcis a single number.- direction
(optional) Integer specifying the direction that the current ternary plot should point: 1, up; 2, right; 3, down; 4, left.
- region
(optional) Named list of length two specifying the the
minimum andmaximum values of each ternary axis to be drawn (e.g.list(min = c(40, 0, 0), max = c(100, 60, 60)); or a set of coordinates in a format accepted byTernaryPoints(). The plotted region will correspond to the smallest equilateral triangle that encompasses the specified ranges or coordinates.
Value
TernaryCoords() returns a vector of length two that converts
the coordinates given in abc into Cartesian (x, y) coordinates
corresponding to the plot created by the last call of TernaryPlot().
See also
Other coordinate translation functions:
ReflectedEquivalents(),
TriangleCentres(),
XYToTernary()