Skip to contents

The Cartesian columns are read from the frame's declared axes, so they can have any name. phi is written in the frame's unit_angle, in (-pi, pi] or (-180, 180] (see cartesian_to_phi()).

Usage

map_to_polar(data)

Arguments

data

An aniframe in a Cartesian coordinate system.

Value

An aniframe with rho and phi in place of x and y.

See also

Examples

af <- anicore::example_anipoint(
  n_obs = 5, n_individuals = 1, n_keypoints = 1
)
map_to_polar(af)
#> # Individuals: 1
#> # Keypoints:   centroid
#> # Sessions:    1
#> # Trials:      1
#>   individual keypoint session trial  time   rho    phi confidence
#>        <int> <fct>      <int> <int> <int> <dbl>  <dbl>      <dbl>
#> 1          1 centroid       1     1     1 0.303  2.74       0.724
#> 2          1 centroid       1     1     2 1.94  -1.73       0.762
#> 3          1 centroid       1     1     3 1.37   0.679      0.616
#> 4          1 centroid       1     1     4 0.253 -1.29       0.705
#> 5          1 centroid       1     1     5 0.672 -2.83       0.583