Last active
June 26, 2022 12:52
-
-
Save ManishAradwad/46574efd2a141eba630e76e58417dcff to your computer and use it in GitHub Desktop.
Create uneven array
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
# cross = True if cross crease is wanted | |
def create_uneven_array(low, up, steps, spacing=1, cross=False): | |
span = up - low | |
dx = 1.0 / steps | |
if cross: | |
arr = np.array([low + (i*dx)**spacing*span for i in range(steps//2)]) | |
return np.append(arr, arr[::-1]) | |
else : | |
arr = np.array([low + (i*dx)**spacing*span for i in range(steps)]) | |
return arr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment