45 std::lower_bound(begin(), end(), sl.
start_s(), LowerBoundComparator);
46 if (it_lower == end()) {
50 std::upper_bound(it_lower, end(), sl.
end_s(), UpperBoundComparator);
51 double min_dist = std::numeric_limits<double>::max();
52 auto min_it = it_upper;
53 for (
auto it = it_lower; it != it_upper; ++it) {
56 }
else if (it->l() > sl.
end_l()) {
57 double diff = it->l() - sl.
end_l();
58 if (diff < min_dist) {
63 double diff = sl.
start_l() - it->l();
64 if (diff < min_dist) {
75 auto it_lower = std::lower_bound(begin(), end(), s, LowerBoundComparator);
76 if (it_lower == begin()) {
78 }
else if (it_lower == end()) {
81 const auto& p0 = *(it_lower - 1);
82 const auto s0 = p0.s();
83 const auto& p1 = *it_lower;
84 const auto s1 = p1.s();
T lerp(const T &x0, const double t0, const T &x1, const double t1, const double t)
Linear interpolation between two points of type T.