Learn R Programming

spatstat.geom (version 3.2-8)

reflect: Reflect In Origin

Description

Reflects a geometrical object through the origin.

Usage

reflect(X)

# S3 method for im reflect(X)

# S3 method for default reflect(X)

Value

Another object of the same type, representing the result of reflection.

Arguments

X

Any suitable dataset representing a two-dimensional object, such as a point pattern (object of class "ppp"), or a window (object of class "owin").

Author

Adrian Baddeley Adrian.Baddeley@curtin.edu.au

and Rolf Turner rolfturner@posteo.net

Details

The object X is reflected through the origin. That is, each point in X with coordinates \((x,y)\) is mapped to the position \((-x, -y)\).

This is equivalent to applying the affine transformation with matrix diag(c(-1,-1)). It is also equivalent to rotation about the origin by 180 degrees.

The command reflect is generic, with a method for pixel images and a default method.

See Also

affine, flipxy

Examples

Run this code
  plot(reflect(as.im(letterR)))
  plot(reflect(letterR), add=TRUE)

Run the code above in your browser using DataLab