Is there any easy way to draw smooth line through many points?

I know `quadraticTo`

can do this through two points, and `cubicTo`

make it for three points.

But what if I need to do that through 10 points?

Do I really need to make some complicated math? Isn’t there any function to do that easly?

# How to draw smooth line through many points

**pajczur**#1

**daniel**#2

That’s not how you use quadraticTo, here is a thread with a graphic of the parameters explained:

And here is your previous thread:

You will have to calculate the control vertices yourself out of each three consecutive points.

The tangent should be the orthogonal to the half enclosed angle.

**pajczur**#3

Thanks for reply. So the answer is “no” - there is not any ready to use method to make smooth line that goes through many points.

So really all audio analyser graphs use that complicated math to calculate the control points?

**daniel**#4

Your problem leaves too much ambiguity for a generic solution. So you will have to do a little maths on your own…

**G-Mon**#5

Use a Path and draw your graph with straight lines and then use Path::createPathWithRoundedCorners(). I’ve done that before and it looks pretty good.

**pajczur**#6

Hey G-Mon it looks great. But it doesn’t work for me. I make it like that:

`for(int i=0; i<something; i++) { myPath.lineTo(/*some code*/); } myPath.createPathWithRoundedCorners(10.0f);`

And my line is still sharped. What am I doing wrong here?

`Path::createPathWithRoundedCorners()`

returns a new path:

```
Path roundedPath = myPath.createPathWithRoundedCorners(10.0f);
g.strokePath(roundedPath, PathStrokeType(...));
```

**pajczur**#10

Just wondering about radius. I see when I set radius above some value there is no changes. For radius in range 1-30 it works as I expect, but above 30 for example 100 or 500, it looks the same as for 30.

**TonyAtHarrison**#11

Above a certain range you’ll have more points than will be noticeable on screen. When I was using this method on an earlier project I found a value of 16 was enough to get a good looking result