kin.signal.curvature: Calculate the Curvature of a 3D Trajectory

View source: R/kin.signal.curvature.R

kin.signal.curvatureR Documentation

Calculate the Curvature of a 3D Trajectory

Description

Computes the curvature of a 3D trajectory using velocity and acceleration components derived from position data using Savitzky-Golay filtering.

Usage

kin.signal.curvature(data, deltaTime, normalize = T)

Arguments

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)

Details

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.

Value

A numeric vector containing the calculated curvature values. If normalize=TRUE, values are scaled between 0 and 1.

Examples

## 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)


ccamp83/kinesis documentation built on July 4, 2025, 6:19 p.m.