How Do I Draw A Curve Through Tree Points In Android?
I need to connect three points by a smooth curve. I've looked at the same questions already answered on StackOverflow but they all suggest using Path.quadTo(). I do not understand
Solution 1:
True, what you need is Catmull Rom splines which are guaranted to go through each point. However, I don't know any function in the Android API to draw them. You could also "trick" the quadTo function and pass it a virtual middle point that you compute according to the current point and the next one.
Solution 2:
What about the cubicTo (or rCubicTo if you need it from a relative point) function? http://developer.android.com/reference/android/graphics/Path.html#cubicTo(float, float, float, float, float, float)
Solution 3:
Here is a very nice, illustrated howto for javascript, but all the used methods are usual and there is an analogue in Androids Path Class
Post a Comment for "How Do I Draw A Curve Through Tree Points In Android?"