1

I have two points (x1y1 and x2y2), the centre point between the two lines (x0y0), and I am trying to draw an arc using the following Java method:

g.fillArc(x of initial point, y of initial point, width of arc, height of arc, start angle, end angle)

to get this:

enter image description here

I have found radius:

int r = (int)Math.sqrt((x1-x0)*(x1-x0) + (y1-y0)*(y1-y0));

then width and height:

int width = 2*r;
int height = 2*r;

and then start and end angles:

int startAngle1 = (int) (180/Math.PI*Math.atan2(y1-y0, x1-x0));
int endAngle1 = (int) (180/Math.PI*Math.atan2(y2-y0, x2-x0));

Instead, I get this:

enter image description here

or this:

enter image description here

Trying to figure out the proper way to draw the arc.

EDIT:

These are geographical coordinates as well as x and y coordinates on the screen based on the zoom property:

Point 1:

X1 coordinates: [25.7745, -81.4589]
X1 and Y1: 574043 : 893092
X2 coordinates: [25.82111, -81.45741]
X2 and Y2: 574052 : 892790
X0 coordinates: [25.797805001897803, -81.45815514647514]
X0 and Y0: 574047 : 892941

Point 2:

X1 coordinates: [26.85249, -80.8777]
X1 and Y1: 577429 : 886086
X2 coordinates: [26.87219, -80.8392]
X2 and Y2: 577653 : 885957
X0 coordinates: [26.862341303504717, -80.8584516762013]
X0 and Y0: 577541 : 886022
Vince
  • 20,017
  • 15
  • 45
  • 64

0 Answers0