point.ang.orig: Computes new position of a point rotating about an origin

Description Usage Arguments Value Examples

View source: R/trig.funs.R

Description

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

Usage

1
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

1
2
3
4
5
6
7
8
9
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")

ckenaley/trackter documentation built on Feb. 11, 2022, 6:43 a.m.