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

cross_prod method added to Point #189

Merged
merged 4 commits into from
Mar 12, 2018
Merged

cross_prod method added to Point #189

merged 4 commits into from
Mar 12, 2018

Conversation

Jay9596
Copy link
Contributor

@Jay9596 Jay9596 commented Mar 11, 2018

Solves #133

Point struct now implements a cross product fuction cross_prod that use previously used inline in 2 different parts of the codebase.

  • algorithm/extremes.rs
  • algorithm/convexhull.rs

It uses the same implementation the other inline function were using.

Copy link
Member

@frewsxcv frewsxcv left a comment

Choose a reason for hiding this comment

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

looks great, thanks for the contribution! just one small documentation suggestion

src/types.rs Outdated
@@ -254,6 +254,25 @@ where
self.x() * point.x() + self.y() * point.y()
}

/// Returns the cross product of 3 points
Copy link
Member

Choose a reason for hiding this comment

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

can you add another sentence here saying something like:

A positive value implies selfpoint_bpoint_c is counter-clockwise, negative implies clockwise.

@frewsxcv
Copy link
Member

thanks for the pull request @Jay9596! ✨

i added one small commit fbfbac2 adjusting the formatting

bors r+

bors bot added a commit that referenced this pull request Mar 12, 2018
189: cross_prod method added to Point r=frewsxcv a=Jay9596

Solves #133 

`Point` struct  now implements a cross product fuction `cross_prod` that use previously used inline in 2 different parts of the codebase.
- algorithm/extremes.rs
- algorithm/convexhull.rs

It uses the same implementation the other inline function were using.
@bors
Copy link
Contributor

bors bot commented Mar 12, 2018

Build succeeded

@bors bors bot merged commit fbfbac2 into georust:master Mar 12, 2018
@Jay9596 Jay9596 deleted the point_cross branch April 15, 2018 11:40
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