Correct the formula for error

The radius should always be positive but simply reversing the sign of
the inner expression only works in some cases
This commit is contained in:
Seth Hillbrand 2023-02-22 13:24:23 -08:00
parent da61d31f44
commit 01039b50ca
1 changed files with 1 additions and 1 deletions

View File

@ -76,7 +76,7 @@ int CircleToEndSegmentDeltaRadius( int aRadius, int aSegCount )
// aRadius is the radius of the circle tangent to the middle of each segment
// and aRadius/cos(aplha) is the radius of the circle defined by seg ends
int delta = KiROUND( aRadius * ( 1/cos(alpha) - 1 ) );
int delta = KiROUND( std::abs( aRadius * ( 1 - 1/cos( alpha ) ) ) );
return delta;
}