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:
parent
da61d31f44
commit
01039b50ca
|
@ -76,7 +76,7 @@ int CircleToEndSegmentDeltaRadius( int aRadius, int aSegCount )
|
||||||
|
|
||||||
// aRadius is the radius of the circle tangent to the middle of each segment
|
// 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
|
// 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;
|
return delta;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue