I have following task:
In the program we should draw lines on a bit mapped display. An array of
npairs of reals(ai,bi)defined thenlinesyi = ai*x + bi. The lines were ordered in thex-interval[0, 1]in the sense thatyi < yi+1for all values ofibetween0andn-2and for all values ofxin[0, 1]
Less formally, the lines don't touch in the vertical slab. Given a point (x,y), where 0 < x < 1, we want to determine two lines that bracket the point.
How can we solve this problem quickly?
