This paper defines constrained functional similarity between 2-D trajectories via minimizing the H1 semi-norm of the difference between the trajectories. An exact general solution is obtained for the case wherein the components of the trajectories are mesh- functions defined on a uniform mesh and the imposed constraints are linear. Various examples are presented, one of which features application to mechanics and two-point boundary value problems. A MATLAB code is given for the solution of one of the examples. The code could easily be adjusted to other cases.