How to draw a smooth curve through given points (2D) within a certain deviation?

313 Views Asked by At

There are algorithms to draw smooth curve through given points but I want the curve between any two points to always be within a certain distance (i.e. the deviation I mentioned in the title) from the straight line connecting those two points. So far I have used curves of type $$ax^2+by^2+cx+dy+gxy+h=0$$for each consecutive pair of points and equated second derivatives (i.e. derivative of gradients) on both side of a point. Still I have found no guarantee of maintaining that deviation. Can anyone please help? Here is an image for explaining the thing but the drawing is a bit rough.