polar2cartesian provides polar to Cartesian coordinate conversion.

polar2cartesian(r, phi = NULL)

Arguments

r

a vector of radii (a or a vector of length 2 holding \(r, phi\))

phi

a vector of angles

Value

A list of the \(x\) and \(y\) Cartesian coordinates.

See also

Examples

polar2cartesian(1, 0)
#> $x #> [1] 1 #> #> $y #> [1] 0 #>
polar2cartesian(1, pi)
#> $x #> [1] -1 #> #> $y #> [1] 1.224647e-16 #>
polar2cartesian(c(1, pi))
#> $x #> [1] -1 #> #> $y #> [1] 1.224647e-16 #>