1
$\begingroup$

I want to know if there is a function with which we can smooth out line joining two( or more )points . I've read we can do it with Quad and cubic splines or something but I am not clear with them. i want a simple function which can be computed efficiently with a mobile device , so can someone explain Quad spline .Help appreciated

This picture shows my requirement.

  • 0
    because they don't let you get points out of a path and then tweak with that points before drawing . I am developing an android drawing app and using a path does smooths my line but then i can just draw solid along that line , i wish to draw bitmaps along that smoothed path but android canvas has canvas.drawpath(path,paint) alone .2012-06-03

1 Answers 1

2

The computationally simplest solution would probably be so-called Catmull-Rom splines. You can look them up on the web. There's a simple formula that gives you the tangent vector at each point. So, then, for each two consecutive points, you know their locations and tangent vectors, and this is enough information to construct a Bezier cubic curve between them. A lot of PC drawing programs use these curves. They are not very smooth, but they're easy to implement.