Skip to contents

Rotate a 2-column matrix

Usage

rotate2dmatrix(x, theta, degrees = FALSE, origin = c(0, 0))

Arguments

x

a 2-column matrix

theta

angle

degrees

if TRUE, theta is in degrees instead of radians

origin

point of rotation

Value

a rotated 2-column matrix

Examples

x <- matrix(seq(10), ncol = 2)
rotate2dmatrix(x, pi)
#>      [,1] [,2]
#> [1,]   -1   -6
#> [2,]   -2   -7
#> [3,]   -3   -8
#> [4,]   -4   -9
#> [5,]   -5  -10