Created
August 9, 2025 14:34
-
-
Save ctralie/7d5ab371a27a96d4218798a580519ea9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Find two points that achieve the diameter | |
i1, j1 = np.unravel_index(np.argmax(D), (N, N)) | |
# Find the closest pair of points are at least 5 apart from the diagonal | |
I, J = np.meshgrid(np.arange(N), np.arange(N), indexing='ij') | |
i2, j2 = np.unravel_index(np.argmin(D + np.max(D)*(J - I < 5)), (N, N)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment