Learn R Programming

binovisualfields (version 0.1.1)

rotate: Rotates a point (x,y) by an angle

Description

rotate calculates the coordinates for a point (x,y) after it rotates by an angle theta (radian)

Usage

rotate(xy, theta = 0)

Arguments

xy

A vector of length 2 representing the coordinates of a point in cartesian system

theta

A number rotating angle in radian

Value

Coordinates of the point after the rotation

Examples

Run this code
# NOT RUN {
rotate(c(1000, 0), theta=pi/6)
# }

Run the code above in your browser using DataLab