# affine.linnet: Apply Geometrical Transformations to a Linear Network

### Description

Apply geometrical transformations to a linear network.

### Usage

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14``` ``` ## S3 method for class 'linnet' affine(X, mat=diag(c(1,1)), vec=c(0,0), ...) ## S3 method for class 'linnet' shift(X, vec=c(0,0), ..., origin=NULL) ## S3 method for class 'linnet' rotate(X, angle=pi/2, ..., centre=NULL) ## S3 method for class 'linnet' scalardilate(X, f, ...) ## S3 method for class 'linnet' rescale(X, s, unitname) ```

### Arguments

 `X` Linear network (object of class `"linnet"`). `mat` Matrix representing a linear transformation. `vec` Vector of length 2 representing a translation. `angle` Rotation angle in radians. `f` Scalar dilation factor. `s` Unit conversion factor: the new units are `s` times the old units. `...` Arguments passed to other methods. `origin` Character string determining a location that will be shifted to the origin. Options are `"centroid"`, `"midpoint"` and `"bottomleft"`. Partially matched. `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)`. `unitname` Optional. New name for the unit of length. A value acceptable to the function `unitname<-`

### Details

These functions are methods for the generic functions `affine`, `shift`, `rotate`, `rescale` and `scalardilate` applicable to objects of class `"linnet"`.

All of these functions perform geometrical transformations on the object `X`, except for `rescale`, which simply rescales the units of length.

### Value

Another linear network (of class `"linnet"`) representing the result of applying the geometrical transformation.

### Author(s)

and \rolf

`linnet` and `as.linnet`.

Generic functions `affine`, `shift`, `rotate`, `scalardilate`, `rescale`.

### Examples

 ```1 2 3 4 5``` ``` U <- rotate(simplenet, pi) stretch <- diag(c(2,3)) Y <- affine(simplenet, mat=stretch) shear <- matrix(c(1,0,0.6,1),ncol=2, nrow=2) Z <- affine(simplenet, mat=shear, vec=c(0, 1)) ```

Search within the spatstat package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.