R/rotation.R

rotation <- function (coords, radian) {
  # +++ purpose +++
  # rotate points counter clockwise
  # coords: 2-col matrix of [x,y] coordinates
  # radian: angle to conduct counterclokwise rotation (positive angles)

  x <- c(cos(radian), -sin(radian))
  y <- c(sin(radian), cos(radian))
  nlecoord = coords %*% cbind(x, y)
  return(nlecoord)
} # end function rotation

Try the SpatialGraph package in your browser

Any scripts or data that you put into this service are public.

SpatialGraph documentation built on Sept. 28, 2023, 5:08 p.m.