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

add_orientation2target2(
  ref_movement,
  target_movement,
  join_by = "time",
  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_movement

Movement of point of interest (e.g threat movement)

join_by

= "time" Column by which to join the two data frames (character)

relative_to_first

= FALSE

Value

`ref_movement` with columns `time`, `target_diff` (raw angle relative to target) and `target_ratio` (cosine of angle) added