Hi rebin,
If you want the arc to be circular, you could think of the three points that you know as a triangle. You could then find the circumcircle of the triangle. There is an example of such code at OpenProcessing here.
The center of the circumcircle would not necessarily be the point you label as ‘center’, or even be within the triangle formed by your three points. Nor would the radius of the arc be what you had planned it to be.
Consider the following code, where the distance between the start and center points may not equal the distance between the end and center points.
float startx, starty, endx, endy, centerx, centery,
diststart, distend;
void setup() {
size(200, 200);
ellipseMode(RADIUS);
startx = random(0, width);
starty = random(0, height);
endx = random(0, width);
endy = random(0, height);
centerx = random(width * 0.25, width * 0.75);
centery = random(height * 0.25, height * 0.75);
diststart = dist(startx, starty, centerx, centery);
distend = dist(endx, endy, centerx, centery);
}
void draw() {
background(255.0);
stroke(0.0);
strokeWeight(1.0);
line(centerx, centery, startx, starty);
line(centerx, centery, endx, endy);
noFill();
ellipse(centerx, centery, diststart, diststart);
ellipse(centerx, centery, distend, distend);
}
Instead of drawing the full circumcircle, you could then use arc
after you’ve calculated the shortest angular distance. I usually do this when smoothing travel across a circumference over a step in time, so maybe that logic would be helpful.
Best,