Realtime Fractal Renderer Documentation
complex.cl
Go to the documentation of this file.
1#ifndef COMPLEX_CL
3#define COMPLEX_CL
5
9typedef struct
10{
11 float real;
12 float imaginary;
13}
15
16Complex add(const Complex a, const Complex b)
17{
18 Complex c;
19 c.real = a.real + b.real;
21 return c;
22}
23
25{
26 Complex c;
27 c.real = a.real - b.real;
29 return c;
30}
31
33{
34 Complex c;
35 c.real = a.real * b.real - a.imaginary * b.imaginary;
36 c.imaginary = a.imaginary * b.real + a.real * b.imaginary;
37 return c;
38}
39
40#endif
41
Complex multiply(const Complex a, const Complex b)
Definition: complex.cl:32
Complex subtract(const Complex a, const Complex b)
Definition: complex.cl:24
Complex add(const Complex a, const Complex b)
Definition: complex.cl:16
Partially implemented complex numbers type.
Definition: complex.cl:10
float real
Definition: complex.cl:11
float imaginary
Definition: complex.cl:12