get_optimal_t function

Finds optimal alignment for discrete open curves