1. Try this, is a modified version of your code.

Perhaps contain some bugs, because I could not verify.

Code:
```function LWBulgeCalc(\$xs, \$xe, \$ys, \$ye, \$bulge)
{
\$result = array();

\$dx = (\$xe - \$xs)/2 ;
\$dy = (\$ye - \$ys)/2 ;
\$a = (1/\$bulge-\$bulge)/2 ;
\$r = abs(\$bulge+1/\$bulge)*sqrt(\$dx*\$dx + \$dy*\$dy)/2 ; //Radius circle

\$dr1x =  \$dy*\$a - \$dx ;
\$dr1y = -\$dx*\$a - \$dy ;

if(\$dr1y <  0) \$theta_s = 360 - \$theta_s ;

\$theta_e = \$theta_s + 4*rad2deg(atan(\$bulge))  ;
if(\$theta_e <  0)      \$theta_e += 360  ;
if(\$theta_e >=  360) \$theta_e -= 360  ;

\$result[0] = \$xe-\$dr1x ;
\$result[1] = \$ye-\$dr1y ;
\$result[2] = \$r        ;
\$result[3] = \$theta_s  ;
\$result[4] = \$theta_e  ;

return \$result;
}```

2. Originally Posted by fantasy2
YES! I guess this is my lucky evening!
I still don't know exactly what I changed but luck is on my side and I changed the right values. Except for closing the drawing, everything goes as planned!
Can you please post your modified code, 'cause i am stuck in the same point, the start and end angles.

I can't find the right conditions to get always the right angles.

3. Hello,

I use this in my geometry lib::

Code:
```	public static double GetAnglefromPoints(double x1, double y1, double x2, double y2)
{
double retval = 0;

retval = Math.Round(Math.Atan2((y2 - y1),
(x2 - x1)), 4);

retval = R2D(retval);

return retval;

}

public static double R2D(double iangle)
{
return iangle * (180.0 / Math.PI);
}```

And with GetAnglefromPoints, the first X,Y is center point and the second will either be start or end.

HTH,

Page 2 of 2 First 12