Total circles area: Difference between revisions

m
→‎{{header|REXX}}: changed output units to number of points instead of number of boxes.
m (→‎optimized: added an output for over ¼ billion points.)
m (→‎{{header|REXX}}: changed output units to number of points instead of number of boxes.)
Line 1,664:
end /*row*/
/*stick a fork in it, we're done.*/
say 'The approximate area is: ' #*dx*dy " using" box **2 "boxespoints."</lang>
'''outputs''' when using the default input:
<pre>
The approximate area is: 21.5615597720034 using 500250000 boxespoints.
</pre>
 
Line 1,674:
<br>Also, another optimization is the sorting of the circles by (descending) radii,
<br>this reduces the computation time (for overlapping circles) by around 25%.
<br>This, with other optimizations, makes this 2<sup>nd</sup> version about twice as fast as the 1<sup>st</sup>.
 
This version also has additional information displayed.
Line 1,757 ⟶ 1,758:
end /*row*/
say
say 'The approximate area is: ' #*dx*dy " using" box**2 "boxespoints."
/*stick a fork in it, we're done.*/</lang>
'''output''' using various number of boxes:
Line 1,775 ⟶ 1,776:
11 circles are fully contained within other circles.
 
The approximate area is: 21.5353837542434 using 12515625 boxespoints.
·
·
·
The approximate area is: 21.5536134808976 using 25062500 boxespoints.
 
The approximate area is: 21.5615597720034 using 500250000 boxespoints.
 
The approximate area is: 21.5638384878351 using 10001000000 boxespoints.
 
The approximate area is: 21.5646564883901 using 20004000000 boxespoints.
 
The approximate area is: 21.5649121135635 using 400016000000 boxespoints.
 
The approximate area is: 21.5650006694272 using 800064000000 boxespoints.
 
The approximate area is: 21.5650301119695 using 16000256000000 boxespoints.
</pre>