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

Fixed arc and arcT so they are always CCW. #56

Merged
merged 4 commits into from
Nov 2, 2012

Conversation

fryguybob
Copy link
Member

Also added a few new functions for making arcs. I still have to fix roundedRect, but that should be fast once I have some tests. Wait to pull until then.

arcT :: Angle a => a -> a -> Trail R2
arcT start end = Trail bs (sweep >= tau)
arcT start end
| e < s = arcT s (e + 1) -- Try again closer to CCW
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't arcT s (e + ceiling (s - e)) be better in the (admittedly rare) case when s and e differ by much more than 1?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'll switch to that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming there isn't some edge case with Double where e < s and ceiling (s - e) == 0.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is, it serves people right for calling arcT with those arguments. I doubt such an arc would be visible anyway.

byorgey added a commit that referenced this pull request Nov 2, 2012
Fixed `arc` and `arcT` so they are always CCW.
@byorgey byorgey merged commit 8d79138 into diagrams:master Nov 2, 2012
@byorgey byorgey mentioned this pull request Nov 2, 2012
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

Successfully merging this pull request may close these issues.

2 participants