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

Catch edge case and fix example #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dostran4
Copy link
Contributor

Ensure that function won't return negative numbers if the desired point is inside the circle already
Fix documentation example because it didn't match up with the intended result

Ensures that function won't return negative numbers if the desired point is inside the circle already.
Fixed documentation example because it didn't match up with the intended result.
@@ -96,7 +96,13 @@ const Circle = stampit(Point, {
},
methods: { // that goes to the prototype
distance(point) {
return Point(point).distance(this) - this.radius;
// Shouldn't this only return a value if the point is located outside of the circle?
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the tips mate.
This function returns positive value if the point is outside the circle. But returns negative value if the point is inside.

@koresar
Copy link
Member

koresar commented May 25, 2019

Thank you for the pr.

The intention of this example is to show the reader how stamps can be composed. Math is secondary.

Are those examples clear enough to understand the stamps?

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