Calculate correct parameter for linear segments