Skip to content

Improving the Arcto function #21

@q2apro

Description

@q2apro

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions