Fix error in trigo.

Fixes https://gitlab.com/kicad/code/kicad/issues/10495
This commit is contained in:
Jeff Young 2022-01-18 23:50:32 +00:00
parent 0091c76a6f
commit 2a60017ffa
1 changed files with 3 additions and 3 deletions

View File

@ -318,13 +318,13 @@ const VECTOR2I CalcArcCenter( const VECTOR2I& aStart, const VECTOR2I& aEnd,
}
int chord = ( start - end ).EuclideanNorm();
int r = ( chord / 2 ) / angle.Sin();
int r = ( chord / 2 ) / ( angle / 2 ).Sin();
VECTOR2I vec = end - start;
vec = vec.Resize( r );
vec = vec.Rotate( ( ANGLE_180 - angle ).AsRadians() );
RotatePoint( vec, -( ANGLE_180 - angle ) / 2 );
return (VECTOR2I) ( start + vec );
return VECTOR2I( start + vec );
}