isClosed: Check if the first and last points of a "trajectory" object...

View source: R/isClosed.R

isClosedR Documentation

Check if the first and last points of a "trajectory" object are within a given tolerance

Description

This function checks if the distance between the first and last points in an object of class 'trajectory' is smaller than a specified tolerance 'tol'. The distance is calculated using the Euclidean distance between the two points.

Usage

isClosed(obj, tol = 1e-06)

Arguments

obj

An object of class 'trajectory' that contains a component 'points'.

tol

A numeric value specifying the tolerance. If the distance between the first and last points is smaller than this value, the function returns 'TRUE'. Default is '1e-6'.

Value

A logical value ('TRUE' or 'FALSE'), indicating whether the distance between the first and last points is smaller than 'tol'.


BioTrajectory documentation built on Nov. 26, 2025, 5:07 p.m.