FrancoisBlavoet / Draw

A Draw app for Android designed by Marie Schweiz & developed by François Blavoet
18 stars 11 forks source link

Brush size handling #14

Closed LarsWerkman closed 10 years ago

LarsWerkman commented 11 years ago

Here is my piece of code how to handle the different brush sizes

FrancoisBlavoet commented 10 years ago

Hi Lars,

I reviewed your pull request and there are a couple of things that I thought could be improved, so I made my own variation. The most important change is that I used Lagrange Polynomial interpolation instead, feel free to have a look if you are curious. Thanks for the PR though :)

LarsWerkman commented 10 years ago

Hi François,

Okay cool! I must admit that i have no idea what Langrange Polynomial interpolation is, other than that is sound really difficult ;), I would love to check it out!

FrancoisBlavoet commented 10 years ago

It is a neat little trick : Marie gave me a series of of x,y coordinates as guides to make the slider. To fill the gap between these points, a Lagrange Polynomial is pretty good : it allows you to construct a function that passes in all these points. The formula looks pretty bad but is not really complicated.. I have even been extra lazy and used Apache commons maths instead of reimplementing it myself.