Angle and distances cleanup (preparing for angles in doubles)

- Removed spurious int casts (these are truncated anyway and will break
  doubles)

- Applied the Distance, GetLineLength, EuclideanNorm, DEG2RAD, RAD2DEG
  ArcTangente and NORMALIZE* functions where possible

- ArcTangente now returns double and handles the 0,0 case like atan2, so
  it's no longer necessary to check for it before calling

- Small functions in trigo moved as inline
This commit is contained in:
Lorenzo Marcantonio
2013-05-01 19:32:36 +02:00
parent 28f9d7f28f
commit c36ab1c6ed
56 changed files with 236 additions and 273 deletions
+2 -2
View File
@@ -1047,8 +1047,8 @@ void CPolyLine::AppendArc( int xi, int yi, int xf, int yf, int xc, int yc, int n
// generate arc
for( int ic = 0; ic < num; ic++ )
{
int x = KiROUND( xc + radius * cos( theta ) );
int y = KiROUND( yc + radius * sin( theta ) );
int x = xc + KiROUND( radius * cos( theta ) );
int y = yc + KiROUND( radius * sin( theta ) );
AppendCorner( x, y );
theta += th_d;
}