|
Post by danuthorincas on Apr 7, 2022 12:23:33 GMT
Hello I nedd help .I dont how to start to calculate how many circles(30 mm) and fill complite Circles.pdf (44.47 KB)(600x600 mm) >I atached one picture
|
|
|
Post by plus on Apr 7, 2022 12:45:56 GMT
Is that 30 a radius or diameter?
Regardless can you calculate the height of 1 circle stacked above 2 sitting side by side (all same radius)? Hint: the centers form an equilateral triangle with side 2 radii and that sits 1 radius from bottom edge.
Come to think of it, I think it is same or very similar as hexagons.
|
|
|
Post by tsh73 on Apr 7, 2022 12:48:33 GMT
600/30 = 20 so
oooooooooooooooooooo oooooooooooooooooooo oooooooooooooooooooo oooooooooooooooooooo oooooooooooooooooooo oooooooooooooooooooo oooooooooooooooooooo oooooooooooooooooooo oooooooooooooooooooo oooooooooooooooooooo oooooooooooooooooooo oooooooooooooooooooo oooooooooooooooooooo oooooooooooooooooooo oooooooooooooooooooo oooooooooooooooooooo oooooooooooooooooooo oooooooooooooooooooo oooooooooooooooooooo oooooooooooooooooooo
will fill it nicely.
|
|
|
Post by tsh73 on Apr 7, 2022 12:49:33 GMT
|
|
|
Post by danuthorincas on Apr 7, 2022 13:18:34 GMT
Is that 30 a radius or diameter? Regardless can you calculate the height of 1 circle stacked above 2 sitting side by side (all same radius)? Hint: the centers form an equilateral triangle with side 2 radii and that sits 1 radius from bottom edge. Come to think of it, I think it is same or very similar as hexagons. Diameter
|
|
|
Post by plus on Apr 7, 2022 16:29:10 GMT
Of course if you can stack them all perfectly vertical you have 20 X 20 = 400 but they will fit in between 20, 19, 20, 19... per row and you might fit more, you lose 1 every other row but you gain maybe another row or 2 in height after a certain number of rows.
|
|
|
Post by tenochtitlanuk on Apr 7, 2022 16:47:55 GMT
Takes me back to Crystallography at Uni in the Sixties! Following code squeezes circles into 600 by 600.Up to you to decide what to do about the edge cases that are partly outside. nomainwin
WindowWidth =640 WindowHeight =650
graphicbox #w.g 4, 4, 600, 600
open "Circle Packing" for window as #w
#w "trapclose quit"
diameter =40 radius =diameter /2
for x =0 to 600 step diameter for y =600 to 0 step 0 -int( diameter *sin( 60 *3.14159265 /180)) r =int( 256 *rnd( 1)): g =int( 256 *rnd( 1)): b =int( 256 *rnd( 1)) #w.g "backcolor "; str$( r); " "; str$( g); " ";str$( b) if row =1 then #w.g "up ; goto "; x +radius; " "; y; " ; down ; circlefilled "; diameter /2 row =0 else #w.g "up ; goto "; x ; " "; y; " ; down ; circlefilled "; diameter /2 row =1 end if scan next y next x
#w.g "flush ; getbmp scr 0 0 600 600" bmpsave "scr", "packedSpheres.bmp"
wait
sub quit h$ close #h$ end end sub
|
|
|
Post by tsh73 on Apr 7, 2022 17:31:19 GMT
*working upon John's (tenochtitlanuk) code*
Run it. Look that it does READ what it printed to a mainwin - not obvious!
But still, hex packing fits more circles then rectangular one.
' nomainwin
WindowWidth =640 WindowHeight =650
graphicbox #w.g 4, 4, 600, 600
open "Circle Packing - counting!" for window as #w
#w "trapclose quit"
pi=acs(-1) diameter = 30 radius = diameter /2 dRowY = diameter*sin(pi/3) evenRow=0 'starts from 1, 1 is odd
'for y = 600-radius to dRowY step 0-dRowY for y = 600-radius to 0 step 0-dRowY dRowX=evenRow*radius for x =radius+dRowX to 600-radius step diameter r =int( 256 *rnd( 1)): g =int( 256 *rnd( 1)): b =int( 256 *rnd( 1)) #w.g "backcolor "; str$( r); " "; str$( g); " ";str$( b) if row =1 then '#w.g "up ; goto "; x +radius; " "; y; " ; down ; circlefilled "; diameter /2 row =0 else '#w.g "up ; goto "; x ; " "; y; " ; down ; circlefilled "; diameter /2 row =1 end if #w.g "up ; goto "; x+dx ; " "; y; " ; down ; circlefilled "; diameter /2 scan
timer 10, [nxt] wait [nxt] timer 0 k=k+1 #w.g "place 10 30" #w.g "\ ";k;" " next evenRow=1-evenRow next
print "So we *see* 23 rows of 20-19-20 circles" print k ;" circles" print "But, if we start *counting*" print "radius below + 22 spaces beween rows + radius above" print "gives us ";15+22*dRowY+15 print "Since it is more the 600 we are given, upper row does not fit." print "That leaves us "; k-20 ;" circles."
wait
sub quit h$ close #h$ end end sub
|
|
|
Post by plus on Apr 7, 2022 17:52:24 GMT
429 is what I got for air bubbles floating to top last row doesn't make cut inside 600 pixel square, almost but not quite. Screenshot 600 x 600 window. Now Easter Eggs is a different story! Attachments:
|
|
|
Post by plus on Apr 7, 2022 18:34:49 GMT
never mind... rethought my thoughts
|
|
|
Post by tsh73 on Apr 8, 2022 6:24:15 GMT
So, using constants from given program After what number of lines we get extra line?
for i = 1 to 20 print i, i*diameter, radius+(i-1)*dRowY+radius, (i*diameter)-( radius+(i-1)*dRowY+radius) next
It happens that on 9th line for rectangular grid we get extra line at hex grid And 2 lines on 16th line.
1 30 30.0 0.0 2 60 55.9807621 4.01923789 3 90 81.9615242 8.03847577 4 120 107.942286 12.0577137 5 150 133.923048 16.0769515 6 180 159.903811 20.0961894 7 210 185.884573 24.1154273 8 240 211.865335 28.1346652 9 270 237.846097 32.1539031 10 300 263.826859 36.173141 11 330 289.807621 40.1923789 12 360 315.788383 44.2116168 13 390 341.769145 48.2308546 14 420 367.749907 52.2500925 15 450 393.73067 56.2693304 16 480 419.711432 60.2885683 17 510 445.692194 64.3078062 18 540 471.672956 68.3270441 19 570 497.653718 72.346282 20 600 523.63448 76.3655198
|
|
|
Post by marshawn on Apr 9, 2022 1:11:31 GMT
Is that 30 a radius or diameter? Regardless can you calculate the height of 1 circle stacked above 2 sitting side by side (all same radius)? Hint: the centers form an equilateral triangle with side 2 radii and that sits 1 radius from bottom edge. Come to think of it, I think it is same or very similar as hexagons.
Is this why bees use hexagons for storage?
|
|
|
Post by plus on Apr 9, 2022 3:05:33 GMT
I always thought it was the hexagons using the bees.
|
|
|
Post by marshawn on Aug 12, 2022 3:19:59 GMT
wow, pretty cool variant of Boggle, B+
|
|
|
Post by danuthorincas on Aug 29, 2022 18:26:07 GMT
Please switch diam to 50 .The result should by 150 because last row dosen fit complitly.I forgot to mention (haow many circles fit complitly)
|
|