Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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|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

1 Answer 1

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|improve this answer

Your Answer

 
discard

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.