Skip to content

Instantly share code, notes, and snippets.

@theengineear
Created May 4, 2014 20:36
Show Gist options
  • Save theengineear/c3c8fea5051f944a6468 to your computer and use it in GitHub Desktop.
Save theengineear/c3c8fea5051f944a6468 to your computer and use it in GitHub Desktop.
size = 100
x = linspace(-2*np.pi, 2*np.pi, size)
y = linspace(-2*np.pi, 2*np.pi, size)
z = empty((size, size))
loop over length of x with (i):
loop over length of y with (j):
r2 = (x(i)^2 + y(j)^2)
z(i,j) = sin(x(i))*cos(y(j))*sin(r2)/log(r2+1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment