You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
because the plot is centered on 0,0 and mandelbrot is symmetric around the x-axis, this inversion is not obvious in the plot. But it is obvious if y_max,y_min is not not centered on 0 ...
Here is a fix - update compute_mandelbrot() - like this:
fn compute_mandelbrot() -> Tensor[float_type]:
# create a matrix. Each element of the matrix corresponds to a pixel
var t = Tensor[float_type](height, width)
let dx = (max_x - min_x) / width
let dy = (max_y - min_y) / height
#y = min_y
var y = max_y
for row in range(height):
var x = min_x
for col in range(width):
t[Index(row, col)] = mandelbrot_kernel(ComplexFloat64(x, y))
x += dx
y -= dy
#y += dy
return t
The text was updated successfully, but these errors were encountered:
The y-axis is inverted in the mandelbrot plot on this page
https://docs.modular.com/mojo/notebooks/Mandelbrot.html
because the plot is centered on 0,0 and mandelbrot is symmetric around the x-axis, this inversion is not obvious in the plot. But it is obvious if y_max,y_min is not not centered on 0 ...
Here is a fix - update compute_mandelbrot() - like this:
The text was updated successfully, but these errors were encountered: