Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angeloped/e254fa21b199c6b7fde15712aebdeca1 to your computer and use it in GitHub Desktop.
Save angeloped/e254fa21b199c6b7fde15712aebdeca1 to your computer and use it in GitHub Desktop.
# https://gist.github.com/davebiagioni/1ac21feb1c2db04be4e6
# https://stackoverflow.com/questions/60695284/linearly-spaced-array-in-c
def linspace(x1, x2, nstep):
step = (x2 - x1) / (nstep - 1)
return [round(x1 + (i * step), 8) for i in range(0, nstep)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment