curvr | R Documentation |
Calculate point-wise curvature from landmarked specimens that have been fitted by polynomials in Momocs. Polynomials are parameterized by arc length to ensure even sampling intervals across the curve. Point-wise curvature is summed across the polynomial, outputting 'total curvature'.
The main function of curvr
is total_curvature()
- it calculates point-wise
curvature along bounded polynomials fitted to curved specimens (e.g. corolla tubes, bird bills).
Calculating point-wise curvature, K, involves parameterizing the fitted polynomial function
by arclength and computing the tangent directions along the curve. The helper function
parameterize()
converts polynomial objects from Momocs
into t-parameterized
polynomials readable by pracma::arclength()
. as_function()
computes the
y coordinates of our polynomial once the x-coordinates of the arclength-parameterized
function are known. as_expression()
converts a Momocs
polynomial to an
expression so that derivatives can be computed using stats::deriv3()
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.