Rotates the coordinates by a theta angle (in radians) in the trigonometric direction (anti-clockwise).

coo_rotate(x, theta = 0, from_col = coo, to_col = coo, ...)

# S3 method for mom_tbl
coo_rotate(
  x,
  theta = 0,
  from_col = coo,
  to_col = {     {         from_col     } },
  ...
)

Arguments

x

coo_single, coo_list or mom_tbl

theta

numeric angle to rotate (in radians) and in the trigonometric direction (anti-clockwise). Default to 0.

from_col

colnames from where to get the coo_list and how to name the resulting one (only for mom_tbl method)

to_col

colnames from where to get the coo_list and how to name the resulting one (only for mom_tbl method)

...

useless here

Value

a coo_single, coo_list or mom_tbl

Methods (by class)

  • mom_tbl: mom_tbl method

See also

Examples

x <- bot %>% pick(1) gg(x)
x %>% coo_rotate(pi/2) %>% draw(col="red")
x %>% coo_rotate(degrees_to_radians(-45)) %>% draw(col="blue")
bot %>% coo_rotate(pi) %>% pile()