curvature_tangle: Calculate total curvature by taking the derivative of the...

View source: R/curvature_tangle.R

curvature_tangleR Documentation

Calculate total curvature by taking the derivative of the Zahn and Roskies tangent angle function

Description

Calculate total curvature by taking the derivative of the Zahn and Roskies tangent angle function

Usage

curvature_tangle(landmark_matrix, iterations)

Arguments

landmark_matrix

is a matrix object with [,1] containing the x landmark coordinates and [,2] containing the y landmark coordinates.

iterations

is the number of times to run the spline interpolation procedure. The more times this is run, the more the specimen will be sampled. Every 1-2 iterations adds an order of magnitude of interpolated landmarks.

Value

a numeric vector length 1 indicating the total curvature in radians.

Examples


# a landmark matrix describing a 1/8 unit circle
x1 <- seq(0, sqrt(2)/2, length.out=9)
y1 <- sqrt(1-x1^2)
mdat1 <- matrix(c(x1, y1), nrow = length(x1), ncol = 2)

# total curvature should be approximately pi/4
abs(curvature_tangle(mdat1, 10))


mannfred/curvr documentation built on Nov. 6, 2024, 7:10 p.m.