-
Notifications
You must be signed in to change notification settings - Fork 205
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
Impl Polygon convexity function on the type #195
Conversation
The convexity function was previously only available within the Extremes module, but it's generally useful and will be required by other algorithms. This moves the function and implements it directly on the type.
src/types.rs
Outdated
false | ||
} else { | ||
true | ||
} |
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.
these last five lines can just be convex != ListSign::Mixed
src/types.rs
Outdated
// The polygon is convex if the z-components of the cross products are either | ||
// all positive or all negative. Otherwise, the polygon is non-convex. | ||
// see: http://stackoverflow.com/a/1881201/416626 | ||
pub fn convex(&self) -> bool { |
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.
most things that return bool
usually start with is_
or has_
. what do you think about calling this is_convex
?
Addressed! |
bors r+ |
195: Impl Polygon convexity function on the type r=frewsxcv a=urschrei The convexity function was previously only available within the Extremes module, but it's generally useful and will be required by other algorithms. This moves the function and implements it directly on the type.
Build succeeded |
The convexity function was previously only available within the
Extremes module, but it's generally useful and will be required by
other algorithms. This moves the function and implements it directly
on the type.