-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomplex.h
38 lines (27 loc) · 934 Bytes
/
complex.h
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
34
35
36
37
38
#pragma once
#include "util.h"
/* Functii utile pentru lucrul cu numere complexe */
typedef struct _complex_t {
double re;
double im;
} complex_t;
/* Initializeaza un numar complex z = 0 + 0i */
complex_t new_zero_complex();
/* Initializeaza un numar complex z = a + bi */
complex_t new_complex(double a, double b);
/* Copiaza numarul complex, similar cu comportamentul strdup */
complex_t complexdup(complex_t z);
/* Aduna doua numere complexe z + w */
complex_t add(complex_t z, complex_t w);
/* Inmulteste doua numere complexe z * w */
complex_t mult(complex_t z, complex_t w);
/* Intoarce modulul unui numar complex */
double modul(complex_t z);
/* Calculeaza multimea Mandelbrot a punctului aflat
* la coordonatele (row, col)
*/
int compute_Mandelbrot(Input in, int row, int col);
/* Calculeaza multimea Julia a punctului aflat
* la coordonatele (row, col)
*/
int compute_Julia(Input in, int row, int col);