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

Improving the Arcto function #21

Open
q2apro opened this issue Dec 6, 2017 · 1 comment
Open

Improving the Arcto function #21

q2apro opened this issue Dec 6, 2017 · 1 comment

Comments

@q2apro
Copy link

q2apro commented Dec 6, 2017

I am trying the svg.path.js plugin and want to draw an arc using it, since svgjs does not provide this feature out of the box, as it seems.

Result should look like this:

image

However, the Arcto function is for ellipses and I obviously have problems in "reducing" the parameters to a simple arc on a circle. A(rx, ry, xAxisRotate, outerinner, clockwise, endpoint)

The hardest part is the endpoint with x and y coordinate...

I would love to see another implementation, that I know from easeljs:

draw.arc(x, y, circle_radius, angle_start, angle_end, anticlockwise);

Or, if this implementation is not possible or planned, then: How to get the endpoint. I tried to use Math.sin() and Math.cos() to calculate it, but it was just messed up :/

PS: Just found this https://stackoverflow.com/q/5736398/1066234 but seems not that easy.

@kylekyle
Copy link

This would be super-handy. I've always longed for the Canvas API's arc method in SVG.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants