TrajTranslate | R Documentation |
Shifts an entire trajectory by the specified delta x and y.
TrajTranslate(trj, dx, dy, dt = 0)
trj |
The Trajectory to be translated. |
dx |
Delta x. |
dy |
Delta y. |
dt |
Delta time. |
A new trajectory which is a translated version of the input trajectory.
# Shift a trajectory so that its origin is (10, 15).
# Note that trajectories created by TrajGenerate always start at (0, 0)
set.seed(42)
trj <- TrajGenerate()
trj <- TrajTranslate(trj, 10, 15)
# Translate a trajectory so its origin (0, 0) and it starts at time 0
trj <- TrajTranslate(trj, -trj$x[1], -trj$y[1], -trj$time[1])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.