Skip to content

Instantly share code, notes, and snippets.

@ThomasParistech
Last active July 7, 2024 18:58
Show Gist options
  • Save ThomasParistech/eade14944ede308762bc9298c46e3fad to your computer and use it in GitHub Desktop.
Save ThomasParistech/eade14944ede308762bc9298c46e3fad to your computer and use it in GitHub Desktop.
... # 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