Learn R Programming

geoR (version 1.2-5)

coords.aniso: Geometric Anisotropy Correction

Description

Transforms or back-transforms a set of coordinates according to the geometric anisotropy parameters.

Usage

coords.aniso(coords, aniso.pars, reverse = FALSE)

Arguments

coords
an $n \times 2$ matrix with the coordinates to be transformed.
aniso.pars
a vector with two elements, $\psi_A$ and $\psi_R$, the anisotropy angle and the anisotropy ratio, respectively. Notice that the parameters must be provided in this order. See section DETAILS below for mor
reverse
logical. Defaults to FALSE. If TRUE the reverse transformation is performed.

Value

  • An $n \times 2$ matrix with the transformed coordinates.

Details

Geometric anisotropy is defined by two parameters: [object Object],[object Object] If reverse = FALSE (the default) the coordinates are transformed from the anisotropic space to the isotropic space. The transformation consists in multiplying the original coordinates by a rotation matrix $R$ and a shrinking matrix $T$, as follows: $$X_m = X R T ,$$ where $X_m$ is a matrix with the modified coordinates (isotropic space) , $X$ is a matrix with original coordinates (anisotropic space), $R$ rotates coordinates according to the anisotropy angle $\psi_A$ and $T$ shrinks the coordinates according to the anisotropy ratio $\psi_R$. If reverse = TRUE, the back-transformation is performed, i.e. transforming the coordinates from the isotropic space to the anisotropic space by computing: $$X = X_m (R T)^{-1}$$

References

Further information about geoR can be found at: http://www.maths.lancs.ac.uk/~ribeiro/geoR.

Examples

Run this code
op <- par(no.readonly = TRUE)
par(mfrow=c(3,2))
par(mar=c(2.5,0,0,0))
par(mgp=c(2,.5,0))
par(pty="s")
## Defining a set of coordinates
coords <- expand.grid(seq(-1, 1, l=3), seq(-1, 1, l=5))
plot(c(-1.5, 1.5), c(-1.5, 1.5), xlab="", ylab="", type="n")
text(coords[,1], coords[,2], 1:nrow(coords))
## Transforming coordinates according to some anisotropy parameters
coordsA <- coords.aniso(coords, aniso.pars=c(0, 2))
plot(c(-1.5, 1.5), c(-1.5, 1.5), xlab="", ylab="", type="n")
text(coordsA[,1], coordsA[,2], 1:nrow(coords))
##
coordsB <- coords.aniso(coords, aniso.pars=c(pi/2, 2))
plot(c(-1.5, 1.5), c(-1.5, 1.5), xlab="", ylab="", type="n")
text(coordsB[,1], coordsB[,2], 1:nrow(coords))
##
coordsC <- coords.aniso(coords, aniso.pars=c(pi/4, 2))
plot(c(-1.5, 1.5), c(-1.5, 1.5), xlab="", ylab="", type="n")
text(coordsC[,1], coordsC[,2], 1:nrow(coords))
##
coordsD <- coords.aniso(coords, aniso.pars=c(3*pi/4, 2))
plot(c(-1.5, 1.5), c(-1.5, 1.5), xlab="", ylab="", type="n")
text(coordsD[,1], coordsD[,2], 1:nrow(coords))
##
coordsE <- coords.aniso(coords, aniso.pars=c(0, 5))
plot(c(-1.5, 1.5), c(-1.5, 1.5), xlab="", ylab="", type="n")
text(coordsE[,1], coordsE[,2], 1:nrow(coords))
##
par(op)

Run the code above in your browser using DataLab