Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVGArcApproximator::approximate() doesn't work properly #78

Closed
captain-igloo opened this issue Jun 19, 2020 · 1 comment
Closed

SVGArcApproximator::approximate() doesn't work properly #78

captain-igloo opened this issue Jun 19, 2020 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@captain-igloo
Copy link

I haven't delved too deeply into the maths but the results returned are sometimes incorrect. For example:

$approx = new SVGArcApproximator();
$result = $approx->approximate([10, 10], [20, 10], true, false, 10, 10, 0);

The large arc flag is true but it returns a small arc. I have compared your code with a couple of other implementations. Have a look at this line and line 155. $angleDelta should be adjusted, not $angleStart.
Also vectorAngle() returns a positive number so line 155 is never executed (?)
And is fmod() at line 146 needed ?

@captain-igloo
Copy link
Author

duplicate

@meyfa meyfa added the duplicate This issue or pull request already exists label Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants