StartEndTranslate {SimilarityMeasures} | R Documentation |
A function to translate, rotate and scale the points of trajectory2 using trajectory1. The new trajectory will have the same start and end points as trajectory1.
StartEndTranslate(traj1, traj2)
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. |
Every point of trajectory2 is rotated, scaled and translated so that the start and end points of the two trajectories match. The new variation of trajectory2 is returned as a matrix.
An m x n matrix containing the new variation of trajectory2 is returned. Here m is the number of points and n is the dimension of the points.
Kevin Toohey
# 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.
StartEndTranslate(path1, path2)