MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ compute_arc_length()

double MayaFlux::Kinesis::compute_arc_length ( const Eigen::MatrixXd &  points)

Compute arc length of curve using trapezoidal rule.

Parameters
pointsColumns are sequential points along curve
Returns
Estimated arc length

Definition at line 394 of file MotionCurves.cpp.

395{
396 if (points.cols() < 2) {
397 return 0.0;
398 }
399
400 double length = 0.0;
401 for (Eigen::Index i = 1; i < points.cols(); ++i) {
402 length += (points.col(i) - points.col(i - 1)).norm();
403 }
404
405 return length;
406}