deviation_metrics function

Metrics of trajectory deviation with respect to a reference trajectory