Converts a coldist
output into Cartesian coordinates that are
perceptually-corrected (i.e. Euclidean distances = JND distances)
jnd2xyz(coldistres, center = TRUE, rotate = TRUE,
rotcenter = c("mean", "achro"), ref1 = "l", ref2 = "u",
axis1 = c(1, 1, 0), axis2 = c(0, 0, 1))
(required) the output from a coldist
call.
logical indicating if the data should be centered on its centroid
(defaults to TRUE
).
logical indicating if the data should be rotated (defaults to TRUE
).
should the vectors for rotation be centered in the achromatic center ("achro") or the data centroid ("mean", the default)?
the cone to be used as a the first reference. May be NULL
(for no first rotation in the 3-dimensional case) or must match name
in the original data that was used for coldist
. Defaults to 'l'.
the cone to be used as a the second reference.May be NULL
(for no first rotation in the 3-dimensional case) or must match name
in the original data that was used for coldist
. Defaults to 'u'.
(only used if data has 3 dimensions).
A vector of length 3 composed of 0's and 1's, with
1's representing the axes (x,y,z) to rotate around. Defaults to c(1,1,0), such
that the rotation aligns with the xy plane (only used if data has 2 or 3 dimensions).
Ignored if ref1
is NULL (in 3-dimensional case only)
A vector of length 3 composed of 0's and 1's, with
1's representing the axes (x,y,z) to rotate around. Defaults to c(0,0,1), such
that the rotation aligns with the z axis (only used if data has 3 dimensions).
Ignored if ref2
is NULL (in 3-dimensional case only)
Pike, T.W. (2012). Preserving perceptual distances in chromaticity diagrams. Behavioral Ecology, 23, 723-728.
Maia, R., White, T. E., (2018) Comparing colors using visual models. Behavioral Ecology, ary017 doi: 10.1093/beheco/ary017.
# NOT RUN {
data(flowers)
vis.flowers <- vismodel(flowers)
cd.flowers <- coldist(vis.flowers)
jnd2xyz(cd.flowers)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab