1
+ function Clifford (x:: Float64 , y:: Float64 , a:: Float64 , b:: Float64 , c:: Float64 , d:: Float64 )
2
+ sin (a * y) + c * cos (a * x), sin (b * x) + d * cos (b * y)
3
+ end
4
+ function De_Jong (x:: Float64 , y:: Float64 , a:: Float64 , b:: Float64 , c:: Float64 , d:: Float64 )
5
+ sin (a * y) - cos (b * x),sin (c * x) - cos (d * y)
6
+ end
7
+ function Svensson (x:: Float64 , y:: Float64 , a:: Float64 , b:: Float64 , c:: Float64 , d:: Float64 )
8
+ d * sin (a * x) - sin (b * y), c * cos (a * x) + cos (b * y)
9
+ end
10
+ function Bedhead (x:: Float64 , y:: Float64 , a:: Float64 , b:: Float64 , c:: Float64 , d:: Float64 )
11
+ sin (x* y/ b)* y + cos (a* x- y), x + sin (y)/ b
12
+ end
13
+ function Fractal_Dream (x:: Float64 , y:: Float64 , a:: Float64 , b:: Float64 , c:: Float64 , d:: Float64 )
14
+ sin (y* b)+ c* sin (x* b), sin (x* a) + d* sin (y* a)
15
+ end
16
+ function trajectory (fn, x0:: Float64 , y0:: Float64 , a:: Float64 , b:: Float64 , c:: Float64 , d:: Float64 ,
17
+ dθ:: Float64 , n:: Int64 )
18
+ x, y, θ = zeros (n), zeros (n), 0.0
19
+ x[1 ], y[1 ] = x0, y0
20
+ for i = 1 : n
21
+ xd, yd = fn (x[i], y[i], a, b, c, d)
22
+ @inbounds x[i+ 1 ], y[i+ 1 ] = xd* cos (θ), yd* cos (θ)
23
+ θ += dθ
24
+ end
25
+ x, y
26
+ end
27
+ # Examples
28
+ cliffordExamples = [
29
+ [- 1.3 , - 1.3 , - 1.8 , - 1.9 ],
30
+ [- 1.4 , 1.6 , 1.0 , 0.7 ],
31
+ [1.7 , 1.7 , 0.6 , 1.2 ],
32
+ [1.7 , 0.7 , 1.4 , 2.0 ],
33
+ [- 1.6 , 1.6 , 0.7 , - 1.0 ],
34
+ [- 1.32 , - 1.65 , 0.74 , 1.81 ]]
35
+ De_JongExamples = [
36
+ [- 1.244 , - 1.251 , - 1.815 , - 1.908 ],
37
+ [1.4 , - 2.3 , 2.4 , - 2.1 ],
38
+ [1.4 , 1.56 , 1.4 , - 6.56 ],
39
+ [2.01 , - 2.53 , 1.61 , - 0.33 ],
40
+ [- 0.827 , - 1.637 , 1.659 , - 0.943 ],
41
+ [- 0.709 , 1.638 , 0.452 , 1.740 ]]
42
+ SvenssonExamples = [
43
+ [1.5 , - 1.8 , 1.6 , 0.9 ],
44
+ [- 1.78 , 1.29 , - 0.09 , - 1.18 ],
45
+ [- 0.91 , - 1.29 , - 1.97 , - 1.56 ],
46
+ [1.4 , 1.56 , 1.4 , - 6.56 ],
47
+ [- 0.827 , - 1.637 , 1.659 , - 0.943 ],
48
+ [1.7 , 1.7 , 0.6 , 1.2 ]]
49
+ BedheadExamples = [
50
+ [- 0.81 , - 0.92 , 0.0 , 0.0 ],
51
+ [- 0.64 , 0.76 , 0.0 , 0.0 ],
52
+ [0.06 , 0.98 , 0.0 , 0.0 ],
53
+ [- 0.67 , 0.83 , 0.0 , 0.0 ],
54
+ [0.65343 , 0.7345345 , 0.0 , 0.0 ],
55
+ [1.7 , 1.7 , 0.0 , 0.0 ]]
56
+
57
+ attractorExamples = OrderedDict (Clifford => cliffordExamples,
58
+ De_Jong => De_JongExamples, Svensson => SvenssonExamples,
59
+ Bedhead => BedheadExamples)
0 commit comments