-
Notifications
You must be signed in to change notification settings - Fork 0
/
fractol_julia.c
33 lines (30 loc) · 1.39 KB
/
fractol_julia.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* fractol_julia.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tpeters <[email protected] +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/05/14 00:24:08 by tpeters #+# #+# */
/* Updated: 2022/06/01 04:21:31 by tpeters ### ########.fr */
/* */
/* ************************************************************************** */
#include "fractol.h"
//https://theses.liacs.nl/pdf/2018-2019-JonckheereLSde.pdf
//http://www.nongnu.org/hpalib/
//https://scipython.com/book2/chapter-8-scipy/examples/the-newton-fractal/
//https://www.ibiblio.org/e-notes/MSet/TheAlmondBreadHomepage.htm
int julia(struct s_fract_arguments *s)
{
int depth;
double tmp;
depth = 0;
while ((s->x * s->x + s->y * s->y <= 4) && depth < s->depth_max)
{
tmp = s->x * s->x - s->y * s->y + s->xn;
s->y = 2 * s->x * s->y + s->yn;
s->x = tmp;
depth++;
}
return (depth);
}