point.ang.orig | R Documentation |
Computes the coordinate position of a point after rotation about an origin.
point.ang.orig(p, o, theta)
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 |
A vector of length 2 containing the resulting x,y coordinates
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.