Last active
July 7, 2024 18:58
-
-
Save ThomasParistech/eade14944ede308762bc9298c46e3fad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... # Generate disk_xy | |
# Compute radius | |
r = np.linalg.norm(disk_xy, axis=-1) | |
# Change radius | |
new_radius = 2 - r | |
reflected_disk_xy = np.multiply((new_radius/r)[:, None], | |
disk_xy) | |
# Append new reflected points | |
disk_xy = np.vstack((disk_xy, reflected_disk_xy)) | |
... # Compute and evaluate density | |
# Compensate for the fact that we have twice as many samples. | |
density *= 2. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment