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

Explain how to find out whether a point is in a circle #2770

Closed
wants to merge 1 commit into from
Closed

Explain how to find out whether a point is in a circle #2770

wants to merge 1 commit into from

Conversation

safwansamsudeen
Copy link
Contributor

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.

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.
@kotp
Copy link
Member

kotp commented Nov 13, 2021

If you consider that this is helpful for all tracks, not just Python,
this is an exercise that many tracks have included, I believe. Consider
opening an issue at problem-specifications so that many more
students may benefit.

When making a pull request it is often helpful to open an issue first to
avoid work being done that may be unlikely to come in, or that can
better be served in another way.

The work here is appreciated, and may almost be directly applied in a
document higher up in the stack!

@@ -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.
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point!

@safwansamsudeen
Copy link
Contributor Author

OK, I'll create an issue and post it soon hopefully. Could you close this PR, or should I delete it or something?

@kotp
Copy link
Member

kotp commented Nov 13, 2021

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
only track that wants this information, then this can be worked still.

If it turns out that it is managed on problem-specifications, then it
can be referenced and closed.

@BethanyG
Copy link
Member

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 BethanyG closed this Dec 10, 2021
@safwansamsudeen
Copy link
Contributor Author

@BethanyG my apologies, I left Exercism temporarily due to school examinations! Is it fine if I open a PR on problem-specifications now? Or should I open a topic on the forum first?

@BethanyG
Copy link
Member

BethanyG commented May 9, 2023

@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?

@safwansamsudeen
Copy link
Contributor Author

safwansamsudeen commented May 9, 2023

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).

@BethanyG
Copy link
Member

BethanyG commented May 9, 2023

@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.

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.

3 participants