R/rotate.R

Defines functions .rotate

.rotate <- function(coords, degrees, pivot = c(0, 0)){
    radians <- - degrees * pi / 180  
    rotated.mat <- matrix(c(cos(radians), -sin(radians), sin(radians), cos(radians)), 
                   byrow = TRUE, ncol = 2)
    t(pivot + rotated.mat %*% (t(as.matrix(coords) ) - pivot))
}

Try the archeoViz package in your browser

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

archeoViz documentation built on June 22, 2024, 10:04 a.m.