Learn R Programming

spatstat.geom (version 2.1-0)

rotate.owin: Rotate a Window

Description

Rotates a window

Usage

# S3 method for owin
rotate(X, angle=pi/2, …, rescue=TRUE, centre=NULL)

Arguments

X

A window (object of class "owin").

angle

Angle of rotation.

rescue

Logical. If TRUE, the rotated window will be processed by rescue.rectangle.

Optional arguments passed to as.mask controlling the resolution of the rotated window, if X is a binary pixel mask. Ignored if X is not a binary mask.

centre

Centre of rotation. Either a vector of length 2, or a character string (partially matched to "centroid", "midpoint" or "bottomleft"). The default is the coordinate origin c(0,0).

Value

Another object of class "owin" representing the rotated window.

Details

Rotates the window by the specified angle. Angles are measured in radians, anticlockwise. The default is to rotate the window 90 degrees anticlockwise. The centre of rotation is the origin, by default, unless centre is specified.

See Also

owin.object

Examples

Run this code
# NOT RUN {
  w <- owin(c(0,1),c(0,1))
  v <- rotate(w, pi/3)
  e <- rotate(w, pi/2, centre="midpoint")
  # plot(v)
  w <- as.mask(letterR)
  v <- rotate(w, pi/5)
# }

Run the code above in your browser using DataLab