double ft_mandelbrot(t_env *e, int i, int j) { double d; int x; t_complex new_z; t_complex inital; e->motion = 0; inital.r = 1.5 * (j - e->width / 2) / (0.5 * e->zoom * e->width) + e->x; inital.i = (i - e->height / 2) / (0.5 * e->zoom * e->height) - e->y; if ((x = ft_mandelbrot2(e, inital, &new_z)) == -1) return (-1); return (d = (double)x + 1.0 - log(log(sqrt(new_z.r * new_z.r + new_z.i * new_z.i))) / log(2)); }
int main(int ac, char **av) { if (ac == 1) { ft_putstr("\nFractales disponibles:\nJulia\nMan\nMan2\n"); return (0); } if (ac == 2) { if (ft_strcmp(av[1], "Julia") == 0) ft_julia(); else if (ft_strcmp(av[1], "Man") == 0) ft_mandelbrot(); else if (ft_strcmp(av[1], "Man2") == 0) ft_mandelbrot2(); else ft_putstr("\nFractales disponibles:\nJulia\nMan\nMan2\n"); } return (0); }