Description Usage Arguments Value Examples
This function converts polar coordinates to cartesian coordinates. It needs an origin (x,y), as well as an individual number or vector of numbers for distance and bearing.
1 | polar2cart(x, y, dist, bearing, as.deg = TRUE, rnd = NA)
|
x |
The origin x-coordinate. Numeric. |
y |
The origin y-coordinate. Numeric. |
dist |
A number or vector of numbers of distances from the origin. |
bearing |
A number or vector of numbers representing the degrees away from the origin. This follows traditional polar coordinates, with 0 at "east", 90 at "north", etc. |
as.deg |
Default set to true, if false, then the program assumes that "bearing" is entered in radians instead of degrees. |
rnd |
The rounding value. Default is NA, for no rounding. Set to 0 for integers, 1 for 1 decimal point, etc. |
This function returns a list with "x" and "y" coordinates for the polar coordinates entered.
1 2 | polar2cart(1, 1, 2, 90)
polar2cart(1,1,c(2,2,2),c(90,180,270) )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.