Skip to content

Instantly share code, notes, and snippets.

@stephengruppetta
Created November 12, 2023 00:15
Show Gist options
  • Save stephengruppetta/d42b3a695dc90fc1a726f2bec9ed1333 to your computer and use it in GitHub Desktop.
Save stephengruppetta/d42b3a695dc90fc1a726f2bec9ed1333 to your computer and use it in GitHub Desktop.
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(-1, 1, 500)
X, Y = np.meshgrid(x, x)
radius = 0.5
disc = (X ** 2) + (Y ** 2) < radius ** 2
plt.imshow(disc, cmap="gray")
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment