Jump to content

Total circles area: Difference between revisions

→‎Python: 2D Van der Corput sequence: Add image and remove second print of bbox.
(→‎Python: 2D Van der Corput sequence: Add image and remove second print of bbox.)
Line 817:
 
===Python: 2D [[Van der Corput sequence]]===
[[File:Van_der_Corput_2D.png|200px|thumb|right]]
Remembering that the [[Van der Corput]] sequence is used for Monte Carlo-like simulations. This example uses a Van der Corput sequence generator of base 2 for the first dimension, and base 3 for the second dimension of the 2D space which seems to cover evenly:.
 
To aid in efficiency.:
Remembering that the [[Van der Corput]] sequence is used for Monte Carlo-like simulations. This example uses a Van der Corput sequence generator of base 2 for the first dimension, and base 3 for the second dimension of the 2D space which seems to cover evenly:
 
To aid in efficiency.
* Circles are uniquified,
* Sorted in descending order of size,
Line 914:
print(' down to %i due to some being wholly covered by others' % len(circles))
minx, maxx, miny, maxy = bounding_box(circles)
print(' Bounding box: %r' % (bounding_box(circles),))
# Shift to 0,0 and compute r**2 once
circles2 = [(x - minx, y - miny, r*r) for x, y, r in circles]
Line 948 ⟶ 947:
Bounding box: (-2.598415801, 2.8356525417, -2.2017717074, 3.1743670698999997)
down to 14 due to some being wholly covered by others
Bounding box: (-2.598415801, 2.8356525417, -2.2017717074, 3.1743670698999997)
Points: 100000, Area estimate: 21.57125892144117
Points: 200000, Area estimate: 21.565708203389384
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.