Skip to content
Prev 333332 / 398506 Next

Rotation of parallel lines

See my answer at Stack Overflow -- repeated here for anyone else who wants a
trivial function.
# coordinate transform: cartesian plane rotation
xyrot<-function(pairs,ang){
	# pairs must be Nx2 matrix w/ x in first column and y in second
	xrot <- pairs[,1]*cos(ang) - pairs[,2]*sin(ang)
	yrot <- pairs[,1]*sin(ang) + pairs[,2]*cos(ang)
	return(invisible(cbind(xrot,yrot)))
}


tonio wrote

            

            
--
View this message in context: http://r.789695.n4.nabble.com/Rotation-of-parallel-lines-tp4680676p4680695.html
Sent from the R help mailing list archive at Nabble.com.