Realtime Fractal Renderer Documentation
complex.cl
Go to the documentation of this file.
1
#ifndef COMPLEX_CL
3
#define COMPLEX_CL
5
9
typedef
struct
10
{
11
float
real
;
12
float
imaginary
;
13
}
14
Complex
;
15
16
Complex
add
(
const
Complex
a,
const
Complex
b)
17
{
18
Complex
c;
19
c.
real
= a.
real
+ b.
real
;
20
c.
imaginary
= a.
imaginary
+ b.
imaginary
;
21
return
c;
22
}
23
24
Complex
subtract
(
const
Complex
a,
const
Complex
b)
25
{
26
Complex
c;
27
c.
real
= a.
real
- b.
real
;
28
c.
imaginary
= a.
imaginary
- b.
imaginary
;
29
return
c;
30
}
31
32
Complex
multiply
(
const
Complex
a,
const
Complex
b)
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
multiply
Complex multiply(const Complex a, const Complex b)
Definition:
complex.cl:32
subtract
Complex subtract(const Complex a, const Complex b)
Definition:
complex.cl:24
add
Complex add(const Complex a, const Complex b)
Definition:
complex.cl:16
Complex
Partially implemented complex numbers type.
Definition:
complex.cl:10
Complex::real
float real
Definition:
complex.cl:11
Complex::imaginary
float imaginary
Definition:
complex.cl:12
FractalGeometryRenderer
kernels
include
complex.cl
Generated by
1.9.3