Simplify a bit
The expression can't be negative. It's a Pythagorean sum. Change-Id: Ic07783c5291da71de6701a139227def2f1c4f77b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175989 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
parent
9e3803ae43
commit
35b3abf583
1 changed files with 1 additions and 14 deletions
|
@ -543,20 +543,7 @@ namespace basegfx::utils
|
|||
// of radicant solved for fRY,
|
||||
// with s=fRX/fRY)
|
||||
const double fRatio(fRX/fRY);
|
||||
const double fRadicant2(
|
||||
p1_prime.getY()*p1_prime.getY() +
|
||||
p1_prime.getX()*p1_prime.getX()/(fRatio*fRatio));
|
||||
if( fRadicant2 < 0.0 )
|
||||
{
|
||||
// only trivial solution, one
|
||||
// of the axes 0 -> straight
|
||||
// line segment according to
|
||||
// SVG spec
|
||||
aCurrPoly.append(B2DPoint(nX, nY));
|
||||
continue;
|
||||
}
|
||||
|
||||
fRY=sqrt(fRadicant2);
|
||||
fRY=std::hypot(p1_prime.getY(), p1_prime.getX()/fRatio);
|
||||
fRX=fRatio*fRY;
|
||||
|
||||
// keep center_prime forced to (0,0)
|
||||
|
|
Loading…
Reference in a new issue