Traj3DSpeed | R Documentation |
Speed is calculated as the magnitude of velocity. The returned speed will contain leading and/or trailing 'NA' values, depending on the type of differences used to calculate velocity.
Traj3DSpeed(vel)
vel |
Velocity of a 3-dimensional trajectory, as returned by
|
If the trajectory has constant time steps, then the average speed of the
trajectory is 'mean(Traj3DSpeed(Traj3DVelocity(trj)), na.rm = TRUE)'. A
trajectory can be resampled by Traj3DResampleTime
so that it
has constant time steps.
This function is implemented to simply interpret each row of a matrix as a 3D
vector, and return their lengths. Accordingly, this function can also be used
to calculate the magnitude of acceleration as returned by
Traj3DAcceleration
.
Numeric vector with speed at each point along the trajectory.
Traj3DVelocity
to calculate the 3D velocity,
Traj3DAcceleration
to calculate the 3D acceleration,
Traj3DLength
, TrajDuration
,
Traj3DResampleTime
## Not run:
# Get the velocity along the trajectory
speed <- Traj3DSpeed(Traj3DVelocity(trj3d))
# Alternative method to calculate mean speed of a portion of a trajectory
si <- 10
ei <- 400
# Mean speed is displacement divided by time
speedMean <- Traj3DLength(trj3d, startIndex = si, endIndex = ei) /
TrajDuration(trj3d, startIndex = si, endIndex = ei)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.