cart2pol: Transform cartesian coordinates to polar

Description Usage Arguments Author(s) Examples

View source: R/spatial.R

Description

Transform cartesian coordinates to polar

Usage

1
2
3
4
5
6
7
cart2pol(
  x,
  y,
  z = NULL,
  dist.type = c("euclidean", "manhattan"),
  radians = TRUE
)

Arguments

x

numeric vector, or numeric matrix (see y)

y

numeric vector; if missing, then x must have at least two columns: the first to represent x and the second to represent y

z

numeric vector

dist.type

character; the type of distance calculation

radians

logical; should the output angle be in radians? (FALSE returns in degrees)

Author(s)

modified from function in beadarrayMSV

Examples

1
2
3
4
5
6
7
8
9
cart2pol(1:10, 1:10)
all.equal(cart2pol(1:10, 1:10), cart2pol(cbind(1:10, 1:10)))

# Change radius computation
cart2pol(1:10, 1:10, 1:10) # assumes 'euclidean'
cart2pol(1:10, 1:10, 1:10, 'manhattan')

# use degrees
cart2pol(1:10, 1:10, radians=FALSE)

abarbour/deform documentation built on Feb. 15, 2022, 6:24 p.m.