pathLength: Measure the length of a path.

View source: R/geom_pathLength.R

pathLengthR Documentation

Measure the length of a path.

Description

A simple function that adds the distances of individual segments that form the given input path

Usage

pathLength(coords)

Arguments

coords

An Nx2 or Nx3 matrix-like object containing ordered 2D or 3D coordinates.

Value

The total length of the path in mesh units

TODO

Write unit tests. Easy (document bad cases too)

Author(s)

Cornel M. Pop

Examples

# A 2D example:
coords = data.frame(x=c(1,1,10), y=c(10,1,1))
pathLength(coords)

cornelmpop/Lithics3D documentation built on Feb. 10, 2024, 11:54 p.m.