Skip to content

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