Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|cite|improve this question
I guess that every mobile device offers some API, like HTML5 canvas, that supports splines out of the box. Why not use a standard solution? – WimC Jun 3 '12 at 17:49
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 . – Rahul Verma Jun 3 '12 at 19:06

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.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.