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

Arc sweep vs clockwise explanation #945

Open
JimJJewett opened this issue May 8, 2024 · 1 comment
Open

Arc sweep vs clockwise explanation #945

JimJJewett opened this issue May 8, 2024 · 1 comment

Comments

@JimJJewett
Copy link

An "arc" -- and particularly its sweep parameter -- is never really defined, except as part of a path.

Unfortunately, the meaning is unclear without also looking at the details of the Ellipse Basic Shape. Note that the Ellipse implementation Notes are also not sufficient. (And because the actual meaning differs from reasonable expectations, this should be particularly explicit.)

Because of end-point parameterization, the center of the arc is unknown, and the arc subcommand instead requires large-arc-flag and sweep-flag.

Ideally, sweep-flag would be renamed clockwise-flag, but it may be too late for that.

At a minimum, please make it more explicit which direction the sweep flag indicates. The figure helped, and at least alerted me that something was wrong in my understanding, but I still couldn't make sense of it until I found """The path begins at the "3 o'clock" point on the radius and proceeds in a clock-wise direction (before any transformation)""" inside the Ellipse Basic Shape documentation.

My usual assumption is that an angle would increase in the counter-clockwise direction, as taught in introductory trigonometry.

My alternative assumption is that if an angle grows in the clockwise direction, it will start at the top (North on a compass, or 12 O' Clock).

Instead the SVG angle has zero along the x-coordinate, but increases in the clockwise direction. This is unusual enough that it should be very explicit in both the arc definition and the arc implementation notes.

This issue is at least partially inherited from SVG 1.1 https://www.w3.org/TR/SVG11/paths.html#PathDataEllipticalArcCommands vs https://www.w3.org/TR/SVG11/shapes.html#EllipseElement and https://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes

but is now at
https://www.w3.org/TR/SVG2/implnote.html#ArcImplementationNotes

as well as current
https://svgwg.org/svg-next/paths.html#PathDataEllipticalArcCommands
https://svgwg.org/svg-next/shapes.html#EllipseElement
https://svgwg.org/svg-next/implnote.html#ArcImplementationNotes

@Crissov
Copy link

Crissov commented May 8, 2024

  • SVG: x→ y↓ α↻
  • Math: x→ y↑ α↺

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