work 2 def reversetimepoints(idx, mark_time, min_delay, eta, remaining_count): a = -((eta - mark_time) / remaining_count - min_delay) / (remaining_count - 1) b = -(a + min_delay) c = eta return (a * idx + b) * idx + c
mark_time = random.random() eta = mark_time + random.random() remaining_count = int(64 * random.random()) min_delay = random.random() * random.random() reversetimepoints(0, mark_time, min_delay, eta, remaining_count) - eta 0.0 reversetimepoints(1, mark_time, min_delay, eta, remaining_count) - (eta - min_delay) 0.0 reversetimepoints(remaining_count, mark_time, min_delay, eta, remaining_count) - mark_time 0.0
reversetimepoints[remaining_count] = mark_time reversetimepoints[1] = eta - min_delay reversetimepoints[0] = eta y(x) = ax^2 + bx + c y(0) = c = eta y(1) = a + b + c = eta - min_delay y(remaining_count) = a (remaining_count^2) + b (remaining_count) + c = mark_time c = eta a + b + c = eta - min_delay a + b = -min_delay a(remaining_count^2) + b(remaining_count) + eta = mark_time b = -a - min_delay a(remaining_count^2) - (a + min_delay)(remaining_count) + eta = mark_time a(remaining_count^2) - (a * remaining_count + min_delay * remaining_count) = mark_time - eta a(remaining_count^2) - a * remaining_count - min_delay * remaining_count = mark_time - eta a(remaining_count^2) - a * remaining_count = mark_time - eta + min_delay * remaining_count a * (remaining_count^2 - remaining_count) = mark_time - eta + min_delay * remaining_count a * (remaining_count^2 - remaining_count) = (mark_time - eta + min_delay * remaining_count) / (remaining_count^2 - remaining_count) a = (mark_time - eta + min_delay * remaining_count) / (remaining_count^2 - remaining_count) a = ((mark_time - eta) / remaining_count + min_delay) / (remaining_count - 1) a = (min_delay + (mark_time - eta) / remaining_count) / (remaining_count - 1) a = (min_delay - (eta - mark_time) / remaining_count) / (remaining_count - 1) a = -((eta - mark_time) / remaining_count - min_delay) / (remaining_count - 1)