I'm trying to draw an arc in android. In IOS, it's really easy to do it with this method
[path addArcWithCenter: radius: startAngle: endAngle: clockwise:]
In android, I have 3 points (the center of my circle, and the two points I want to draw an arc between) :
Point center = new Point(..., ...);
Point p1 = new Point(..., ...);
Point p2 = new Point(..., ...);
int radius = (int) Math.sqrt(Math.pow(p1.x - center.x, 2) + Math.pow(p1.y - center.y, 2));
But how can I use the Path.addArc method to draw an arc between p1 and p2 ? I have tried as said in (How to draw Arc between two points on the Canvas?) :
RectF oval = new RectF();
oval.set(p2.x - radius, p2.y - radius, p2.x + radius, p2.y + radius);
path.addArc(oval, startAngle, endAngle - startAngle);
// startAngle : angle between horizontal axis and p1 point
// endAngle : angle between horizontal axis and p2 point
But actually it doesn't draw the expected arc. I don't understand what is the first parameter of the addArc method ! What the RectF is supposed to be ?
Thanks,