-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Explain how to find out whether a point is in a circle #2770
Conversation
Add instructions explaining how to find out whether a point is in a circle. This would be helpful so that the student may focus on what's important (programming the solution), and not worry about the mathematical formulas. I spent a lot of time trying to figure out how I could see if the point passed is in the circle, until I came across this (SO post)[https://stackoverflow.com/questions/481144/equation-for-testing-if-a-point-is-inside-a-circle]. I've intentionally only mentioned how to see if the point is _in_ the circle, and not on the circumference (which is part of what the tests check). This is so that the student understands how to change the given formula to solve the problem, instead of direct copy-pasting. Please feel free to make changes as needed.
If you consider that this is helpful for all tracks, not just Python, When making a pull request it is often helpful to open an issue first to The work here is appreciated, and may almost be directly applied in a |
@@ -14,4 +14,6 @@ In our particular instance of the game, the target rewards with 4 different amou | |||
|
|||
The outer circle has a radius of 10 units (This is equivalent to the total radius for the entire target), the middle circle a radius of 5 units, and the inner circle a radius of 1. Of course, they are all centered to the same point (That is, the circles are [concentric](http://mathworld.wolfram.com/ConcentricCircles.html)) defined by the coordinates (0, 0). | |||
|
|||
To know whether a point is inside a circle (not _on_ the circumference), you can check whether `(x - center_x) ** 2 + (y - center_y) ** 2 < radius ** 2`, where `x` and `y` are the passed coordinates, `center_x` and `center_y` are the coordinates of the center of the circle, and `radius` is the radius of the circle. |
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 may be written as a more standard formula. This formula appears as though it may be Python code. Not unhelpful, for sure, but if this goes to all the tracks that use this exercise, it might be something to consider.
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.
Good point!
OK, I'll create an issue and post it soon hopefully. Could you close this PR, or should I delete it or something? |
I will leave this open for a while, if it is determined that this is the If it turns out that it is managed on problem-specifications, then it |
This PR has been open 27 days -- @safwan-samsudeen -- are you still interested in opening an issue/PR in problem-specifications for these changes? I think they should apply to more tracks than Python, and so am closing this PR for the Python track. Thanks! |
@BethanyG my apologies, I left Exercism temporarily due to school examinations! Is it fine if I open a PR on |
@safwansamsudeen - I think this exercise has already been revised at the problem-specifications level, but maybe open a topic on the forum, to see if there is anything else to be done? |
No, the suggested change - of adding a formula for calculation of whether a point is in the circle - hasn't been implemented. Other than that, the exercise looks pretty good to me (for a forum post). |
@safwansamsudeen - I think the directions along with the Python Hints are more than enough here, and adding a formula isn't really necessary, Additionally, this was merged, providing links to a formula. However, if you want to propose further modifications, as @kotp mentions, it would be in problem specifications and or the forum - not here. If and when the problem specs PR is merged, the change would then be pulled into this track. |
Add instructions explaining how to find out whether a point is in a circle. This would be helpful so that the student may focus on what's important (programming the solution), and not worry about the mathematical formulas. I spent a lot of time trying to figure out how I could see if the point passed is in the circle, until I came across this SO post.
I've intentionally only mentioned how to see if the point is in the circle, and not on the circumference (which is part of what the tests check). This is so that the student understands how to change the given formula to solve the problem, instead of direct copy-pasting. Please feel free to make changes as needed.