# how to calculate the number of grid lines within a circle?

• September 23rd 2010, 09:28 AM
tiong
how to calculate the number of grid lines within a circle?
need help with the following qns (Speechless)

http://img210.imageshack.us/img210/5...reenshothc.png
• September 23rd 2010, 09:34 AM
Traveller
Observe that what you are looking for is the number of grid-lines inside the square circumscribing the circle, with its sides parallel to the axis. Can you do it now ?
• September 23rd 2010, 10:24 AM
tiong
Quote:

Originally Posted by Traveller
Observe that what you are looking for is the number of grid-lines inside the square circumscribing the circle, with its sides parallel to the axis. Can you do it now ?

hi, thanks for reply but i don't really get what u mean, do u mean i just count those "incomplete" grid lines as 1?, so in the second diagram i will have the result as 24/(10x11+11x10)?
• September 23rd 2010, 10:56 AM
Traveller
Yes, the problem asks you to count the lines including those that are partially covered.
• September 24th 2010, 12:36 AM
tiong
Is there any existing math formula that can describe this concept?
• September 24th 2010, 12:41 AM
tiong
Quote:

Originally Posted by Traveller
Yes, the problem asks you to count the lines including those that are partially covered.

thanks, but is there a way to count those partially covered lines as .X of the line?
• September 24th 2010, 01:21 AM
Wilmer
Quote:

Originally Posted by tiong
thanks, but is there a way to count those partially covered lines as .X of the line?

But then you're not counting the "number of lines"; instead you're "measuring" cut off portion of lines.
Seems like a useless task, like if some lines are cut off at the 3/4 point, this leaves a 1/4 line inside
circle, so 4 of those make up a line? I suggest you clarify this...
• September 24th 2010, 05:36 AM
tiong
---Quote (Originally by tiong)---
need help with the following qns (Speechless)

Image: http://img210.imageshack.us/img210/5...reenshothc.png
---End Quote---

The number of line segments within the circle is 2(1)+2(1) initially.
Then if you double the number of lines, you get 4(3)+4(3).
If you double again, you get 8(7)+8(7).

If you keep doubling, the number of segments (irrespective of length) is 2^n\left(2^n-1\right)

Similarly, the number of segments in the external square is (5)\left(2^{n-1}\right)(5)\left(2^{n-1}+1\right)

You could express this as a ratio and if you take the limit as n goes to infinity,
you will get the ratio of the area of a 2x2 square to the area of a 5x5 square,
since the formula doesn't take into consideration the varying line segment lengths.

I doubt if that's the purpose of the question.

Does the question have anything to do with {\pi} ?
***************

ya, when the number of gird lines goes to inifinity,
the ratio suppose to be area of the circle over overall area, which is (pie*(sqrt))/x*y
actually what im trying to prove is as the no of grid lines increases within the same area, the ratio of the area covered by the circle over the overall area increases as well
wondering if there any existing math formula that have similiar density concept?
• September 24th 2010, 07:43 AM
tiong
Quote:

Originally Posted by Wilmer
But then you're not counting the "number of lines"; instead you're "measuring" cut off portion of lines.
Seems like a useless task, like if some lines are cut off at the 3/4 point, this leaves a 1/4 line inside
circle, so 4 of those make up a line? I suggest you clarify this...

Hi, actually this qns is needed to explain my network project stuff, but i didn't go into that because it will become irrelevant in this math forum, basically i need to count the number of lines regardless whether they are full or partial length, so wondering is there a way to count it or do i have to roughly estimate like what u mention?
• September 24th 2010, 07:51 AM
Wilmer
you said earlier:
"thanks, but is there a way to count those partially covered lines as .X of the line?"
now you're saying:
"i need to count the number of lines regardless whether they are full or partial length"

I leave you in travellers' hands...
• September 24th 2010, 07:56 AM
tiong
Quote:

Originally Posted by Wilmer
you said earlier:
"thanks, but is there a way to count those partially covered lines as .X of the line?"
now you're saying:
"i need to count the number of lines regardless whether they are full or partial length"

I leave you in travellers' hands...

hi, i think phrased my sentence ""i need to count the number of lines regardless whether they are full or partial length" wrongly sry,
what i mean is if its a full length line i need to count it as 1, if the line has only 2/3 of it within the circle, i have to count it as 2/3.
• September 24th 2010, 09:33 AM
Wilmer
Quote:

Originally Posted by tiong
... if the line has only 2/3 of it within the circle, i have to count it as 2/3.

Well, I'm sure Traveller and/or Archie will have an answer for you!!
• September 24th 2010, 11:10 AM
Traveller
Quote:

Originally Posted by tiong
hi, i think phrased my sentence ""i need to count the number of lines regardless whether they are full or partial length" wrongly sry,
what i mean is if its a full length line i need to count it as 1, if the line has only 2/3 of it within the circle, i have to count it as 2/3.

You have already written about the solution when n approaches infinity. I don't think that there is any closed form for the expression for a given n. If there are n-1 equally spaced lines in between each line in the original grid, the formula will look like:
$
\frac {2 + 4(\frac{1}{n}( \sum_{k=1}^{n}\sqrt{(n^2 - k^2)}) }{ 5( 5n + 1) }$