View source: R/kin.signal.curvature.R
kin.signal.curvature | R Documentation |
Computes the curvature of a 3D trajectory using velocity and acceleration components derived from position data using Savitzky-Golay filtering.
kin.signal.curvature(data, deltaTime, normalize = T)
data |
A matrix or data frame with 3 columns representing X, Y, and Z coordinates |
deltaTime |
Numeric value representing the time interval between samples |
normalize |
Logical value indicating whether to normalize the curvature values to a range of 0,1 (default: TRUE) |
The function calculates curvature using the formula: k = |x'y” - y'x”| / (x'^2 + y'^2)^(3/2) where x' and y' are velocities, and x” and y” are accelerations.
Velocities and accelerations are computed using Savitzky-Golay filtering via the kin.sgFilter function.
A numeric vector containing the calculated curvature values. If normalize=TRUE, values are scaled between 0 and 1.
## Not run:
# Create sample 3D trajectory data
t <- seq(0, 2*pi, length.out=100)
data <- cbind(sin(t), cos(t), t)
# Calculate curvature with normalized output
curv <- kin.signal.curvature(data, deltaTime=0.1, normalize=TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.