AveTranslate: Create an Average Point Translation Vector

Description Usage Arguments Details Value Author(s) See Also Examples

Description

A function to calculate a translation vector for trajectory2 using the average of the two trajectories. The vector created can be used to translate the average of trajectory2's points to that of trajectory1.

Usage

1
AveTranslate(traj1, traj2)

Arguments

traj1

An m x n matrix containing trajectory1. Here m is the number of points and n is the dimension of the points.

traj2

A k x n matrix containing trajectory2. Here k is the number of points and n is the dimension of the points. The two trajectories are not required to have the same number of points.

Details

The average of each dimension of both trajectories is calculated. The required translation is then calculated from the difference between them.

Value

A vector of length n is returned containing the translation in each dimension. If there is a problem this returns a string of information instead.

Author(s)

Kevin Toohey

See Also

LCSSTranslation, StartEndTranslate

Examples

1
2
3
4
5
6
# Creating two trajectories.
path1 <- matrix(c(0, 1, 2, 3, 0, 1, 2, 3), 4)
path2 <- matrix(c(0, 1, 2, 3, 4, 5, 6, 7), 4)

# Running the translation.
AveTranslate(path1, path2)

Example output

[1]  0 -4

SimilarityMeasures documentation built on May 1, 2019, 10:06 p.m.