View source: R/curvature_spline.R
curvature_spline  R Documentation 
Calculate total curvature from smoothing or interpolating splines.
curvature_spline(landmark_matrix, x_range, type = "smooth")
landmark_matrix 
is a 
x_range 
the lower and upper xvalue bounds to
calculate curvature. Concatenate the lower and upper bounds using

type 
either 'ip' for an interpolating spline or 'smooth' for a
smoothing spline. Uses 
a 'list' with two named elements. '$Ktot' is the total curvature in radians. '$Ki' is a numeric vector of local curvature values.
# a landmark matrix describing a segment of the unit circle#'
x < seq(0, 1, by = 0.01)
y < sqrt(1x^2)
mdat < matrix(c(x, y), nrow = 101, ncol = 2)
# total curvature between x=0 and x=sqrt(2)/2 should be approximately pi/4
abs(curvature_spline(mdat, c(0, sqrt(2)/2), type='smooth')$Ktot)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.