polar2cart: Convert Polar Coordinates To Cartesian Coordinates

Description Usage Arguments Value Examples

Description

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.

Usage

1
polar2cart(x, y, dist, bearing, as.deg = TRUE, rnd = NA)

Arguments

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.

Value

This function returns a list with "x" and "y" coordinates for the polar coordinates entered.

Examples

1
2
polar2cart(1, 1, 2, 90)
polar2cart(1,1,c(2,2,2),c(90,180,270) )

ecology-rocks/disperseR documentation built on May 15, 2019, 7:58 p.m.