R/rotation.R

rotation <- function (form,center,angle) 
{
npoints<-length(form[,1])
for (i in 1:npoints)
	{
	 form[i,]<-form[i,]-center
	}
matrot<-matrix(c(cos(angle),sin(angle),-sin(angle),cos(angle)),2,2)
rotated<-matrot %*% t(form) + cbind(center,center)
rotated<-data.matrix(t(rotated))
row.names(rotated)<-NULL
rotated
}

Try the sequence package in your browser

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

sequence documentation built on March 26, 2020, 7:30 p.m.