Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
add triangle shape #350
add triangle shape #350
Changes from all commits
7f1a2d1
2d0d6f9
20dc309
7181e4f
a7f3a75
b2eaa7a
0be14de
276076d
7358faa
0532dc9
1126a0f
8f0e1a8
e1cce3d
0542c60
2124dcc
ff39cee
7e07c00
6b10318
913f0f4
3670f6e
84b0609
1f4e1ad
c5dc9fb
452b296
bebbb78
99d9c91
ca336fc
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the different types of 'center' are useful and IIRC not currently implemented in
kurbo
. I think we should add them to other shapes, and possibly also general paths. Not needed for this PR though.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is quite a loose bound for
f64
. I'd use something closer to machine epsilon e.g.1e-13
. Out of scope for this PR, but we really need to standardize this (I likefloat_cmp
because it allows big epsilons as long as the expected and actually are <n representable numbers apart in f64).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied the bound from "rect.rs" i understood that it was loose but knew that it was only a temporary solution.
i could change it to be more strict but even with
1e-13
,Triangle::area()
tests are already failing from precision. i still could arbitrarily restrict the bound or could just wait for it to be standardized as you said, which would you prefer?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just leave it as-is for now - what you have is fine.