cart2polar {AIUQ} | R Documentation |
Transform Cartesian coordinates to polar coordinates
Description
Transform ordered pair (x,y), where x and y denotes the directed distance between the point and each of two perpendicular lines, the x-axis and the y-axis, to polar coordinate. Input x and y must have the same length.
Usage
cart2polar(x, y)
Arguments
x |
a vector of x-coordinates |
y |
a vector of y-coordinates |
Value
A data frame with 2 variables, where r is the directed distance from a point designed as the pole, and theta represents the angle, in radians, between the pole and the point.
Author(s)
Yue He [aut], Xubo Liu [aut], Mengyang Gu [aut, cre]
Examples
library(AIUQ)
# Input in Cartesian coordinates
(x <- rep(1:3,each = 3))
(y <- rep(1:3,3))
# Data frame with polar coordinates
(polar <- cart2polar(x, y))
[Package AIUQ version 0.5.3 Index]