Computes the coordinate position of a point after rotation about an origin.

point.ang.orig(p, o, theta)

Arguments

p

numeric vector of length 2, the x and y coordinates of the point that will rotate

o

numeric vector of length 2, the x and y coordinates of the origin

theta

numeric, the angle of rotation

Value

A vector of length 2 containing the resulting x,y coordinates

Examples

p <- c(2,2)
o <- c(0,0)

plot(c(-4,4),col=NULL)
points(p[1],p[2],col="red")
points(o[1],o[2])

new.p <- point.ang.orig(p,o,pi/2*-1)
points(new.p[1],new.p[2],col="blue")