0
$\begingroup$

say i have two points (x,y) (10,10) and (100,100) how would i be able to calculate the width, height, startAngle and arcAngle (parameters for java.awt.graphics#drawArc), to draw an arc between those two points?

$\endgroup$
0
$\begingroup$

You cannot. There is an infinite number of circles that pass through two points. You need more information, such as the radius (you will get two solutions), or the center of the circle (1 or 0 solutions) or another point on the arc

$\endgroup$
2
  • $\begingroup$ so if 3 points are known, how would it be done then? $\endgroup$ – FrankK Sep 27 '17 at 11:54
  • $\begingroup$ Yes. If the three points are not colinear, they will form a triangle. You can look up circumscribed circle (it's unique) en.wikipedia.org/wiki/Circumscribed_circle#Triangles $\endgroup$ – Andrei Sep 27 '17 at 12:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.