Returns the same data frame with added cos(angle) and angle over time.

add_orientation2target(
  ref_movement,
  target_position,
  relative_to_first = FALSE
)

Arguments

ref_movement

A data frame with reference movement, e.g. the head or the waist movement. Movement file should have `pos_x`, `pos_y`, `pos_z`, `rot_x`, `rot_y`, `rot_z` columns.

target_position

A list containing `pos_x` `pos_y` `pos_z` target position

relative_to_first

= FALSE

Value

`rev_movement` with new columns `target_diff` (raw angle relative to target) and `target_ratio` (cosine of angle)