Skip to contents

Rotates the coordinates by a 'theta' angle (in radians) in the trigonometric direction (anti-clockwise). If not provided, assumed to be the centroid size. It involves three steps: centering from current position, dividing coordinates by 'scale', translating to the original position.

Usage

coo_rotate(coo, theta = 0)

Arguments

coo

either a matrix of (x; y) coordinates, or any Coo object.

theta

numericthe angle (in radians) to rotate shapes.

Value

a matrix of (x; y) coordinates, or a Coo object.

Examples

coo_plot(bot[1])

coo_plot(coo_rotate(bot[1], pi/2))


# on Coo
b <- bot %>% slice(1:5) # for speed sake
stack(b)

stack(coo_rotate(b, pi/2))