\HeaderA{translate}{Image translation}{translate}
\begin{Description}\relax
Translates an image.
\end{Description}
\begin{Usage}
\begin{verbatim}
  translate(x, v)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] An \code{Image} object or an array.
\item[\code{v}] The translation vector or a matrix of translation vectors
if \code{x} contains several images.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Borders are repeated during translation.
\end{Details}
\begin{Value}
An \code{Image} object or an array, containing the translated version
of \code{x}.
\end{Value}
\begin{Author}\relax
Gregoire Pau, \email{gpau@ebi.ac.uk}, 2008
\end{Author}
\begin{SeeAlso}\relax
\code{resize}, \code{rotate}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
  x = readImage(system.file("images", "lena-color.png", package="EBImage"))
  y = translate(x, c(20,20))
  if (interactive()) {
    display(x, title='Lena')
    display(y, title='Translated lena')
  }

  ## gradient
  y = translate(x, c(1,1))
  if (interactive()) display(0.5+4*(y-x), title='NE gradient')
\end{ExampleCode}
\end{Examples}

