cart2polar: cart2polar

View source: R/A016_polarConversions2.R

cart2polarR Documentation

cart2polar

Description

Converts polar co-ordinates into cartesian co-ordinates.

Usage

cart2polar(
  x = 0,
  y = 0,
  x0 = NULL,
  y0 = NULL,
  x1 = NULL,
  y1 = NULL,
  lineSegments = FALSE,
  forcePositive = FALSE
)

Arguments

x, y, x0, y0, x1, y1

numerical. See details.

lineSegments

logical. See details.

forcePositive

defaults to FALSE. Setting this to true ensures the bearings are between 0 and 2*pi instead of from -pi to pi.

Details

If none of the below apply (the default), the input vector is (x,y). i.e. from the origin to x,y.

x and y are ignored if all of x0,y0,x1,y1 are provided and the input vectors are (x1-x0,y1-y0). i.e. from (x0,y0) to (x1,y1). x1 and y1 are ignored otherwise.

if all of x0,y0,x1,y1 are NULL, only x and y are used. If lineSegments is FALSE, the default behaviour applies. If TRUE, the vectors are along the line given by x and y, from the first point to the second and so on.

Value

Returns a list with r and bearing co-ordinates.

See Also

Other polarConversion: makePolar(), polar2cart()

Examples

print(1+1)

R-graphic-design/RGD documentation built on Jan. 2, 2023, 10:30 p.m.