AveTranslate:
Create an Average Point Translation Vector
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
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.
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.
Details
The average of each dimension of both trajectories is calculated. The required translation is then calculated from the difference between them.