Skip to content

LCSSCalc

Stewart Thomson edited this page Jun 27, 2018 · 2 revisions

int LCSSCalc(Matrix<double> trajectory1, Matrix<double> trajectory2, int pointSpacing = -1, double pointDistance = 20, Vector<double> translations = null)

Calculates the LCSS of two trajectories using a set translation

Parameters

Matrix<double> trajectory1 | The first trajectory

Matrix<double> trajectory2 | The second trajectory

The two trajectories must have the same dimensions, but can have a different number of points

int pointSpacing | Integer value of the max index difference between the two trajectories allowed. Negative values set the spacing to unlimited

int pointDistance | A number representing the max distance in each dimension allowed for points to be equivalent

Vector<double> translations | A vector containing the translations in each dimension to be applied to trajectory2

Example

double[,] arr1 = {{0,1,2,3},{0,1,2,3}};
path1 = Matrix.Build.DenseOfColumns(arr1);
double[,] arr2 = {{0,1,2,3},{4,5,6,7}};
path2 = Matrix.Build.DenseOfColumns(arr2);
int lcss = LCSSCalc(path1, path2, 2, 2);