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 000ec33af2
commit 0e903dba5b
56 changed files with 236 additions and 273 deletions
+1 -2
View File
@@ -389,8 +389,7 @@ void PLOTTER::segmentAsOval( const wxPoint& start, const wxPoint& end, int width
else
orient = -(int) ( RAD2DEG( atan2( (double)size.y, (double)size.x ) ) * 10.0 );
size.x = (int) sqrt( ( (double) size.x * size.x )
+ ( (double) size.y * size.y ) ) + width;
size.x = KiROUND( hypot( size.x, size.y ) ) + width;
size.y = width;
FlashPadOval( center, size, orient, tracemode );