# Cycling Breakaway Calculator

Cycling races wouldn't be half as exciting without all the breakaways that we get to see and cheer for at every race. Riders get into breakaways for plenty of reasons - to widen the gap between them and their main rivals on the mountain stages, to grab particular jerseys and win classifications and most usually to win stages and races. And often the biggest question that millions behind TVs ask is - will they make it or not?

And this is when mathematics comes handy. Professor Hendrik Van Maldeghem of the Ghent University in Belgium came up with the equation which pretty accurately can predict whether cyclists will make it or not. He tested it during plenty of races and very often results turned out to be very precise. The equation and as a result our calculator lets you calculate how much distance the peloton needs to catch the group of riders ahead of them. Calculator takes into consideration the following values:

- number of riders in the breakaway
- time gap between the breakaway and the peloton
- speed of peloton
- and speed of breakaway

Different equations are used depending on the number of riders. If there are 10 or more cyclists in the breakaway equation assumes they get tired at the same pace as the peloton riding at the same speed (this relation has also been tested). The lower the number of riders, the more important role fatigue would play and the lower distance peloton would need to catch them. The equation doesn't take into consideration factors such as wind or road's profile and will be most accurate on flat stages.

Prof. Van Maldeghem's formula is as follows:

`distance_needed = time_gap * peloton_speed * (6 * peloton_speed / (3 * (peloton_speed - sprinters_speed) + sqrt(6 * peloton_speed * time_gap * (10 - number_of_sprinters) + 9 * pow((peloton_speed - sprinters_speed), 2))) - 1)`

Time gap is expressed in hours, speed in kilometers per hour.