
Set the per-trajectory reference and re-derive the relative frame
Source:R/coords.R
set_reference.RdUpdates each trajectory's reference direction and re-derives its relative columns (`rel_theta`/`rel_x`/`rel_y`) from the unit-circle position via [derive_coords()], so the relative frame stays consistent. The step is recorded in [transform_history()]. This is the drift-safe way to change the reference frame – prefer it over a manual [apply_transform()].
Arguments
- x
A [`Tracks`] with position roles (`cols$x`/`cols$y`) and relative roles (`cols$angle`/`cols$rel_x`/`cols$rel_y`) registered.
- value
Reference direction(s) in unit-circle radians: a scalar applied to all trajectories, or a named numeric vector / two-column (`id`,`ref_theta`) data frame setting them per trajectory.