tangled
alpha
login
or
join now
stau.space
/
costas
0
fork
atom
Permutation matrices research.
0
fork
atom
overview
issues
pulls
pipelines
feat: Add juliaplots gif creator.
Diego A. Estrada Rivera
1 year ago
fa46b3d5
0c88b88e
+54
1 changed file
expand all
collapse all
unified
split
src
jupyter
gif.jl
+54
src/jupyter/gif.jl
···
1
1
+
import Pkg
2
2
+
import Serialization
3
3
+
Pkg.add("Combinatorics")
4
4
+
Pkg.add("Primes")
5
5
+
Pkg.add("BenchmarkTools")
6
6
+
Pkg.add("Transducers")
7
7
+
Pkg.add("Plots")
8
8
+
using Combinatorics
9
9
+
using Primes
10
10
+
using BenchmarkTools
11
11
+
using Transducers
12
12
+
using Plots
13
13
+
14
14
+
include("header.jl")
15
15
+
16
16
+
import Base.Iterators
17
17
+
18
18
+
loadvar(file_path::String) = Serialization.deserialize(file_path)
19
19
+
20
20
+
costas_10x10 = loadvar("costas_10x10.dat")
21
21
+
costas_5x5 = loadvar("costas_5x5.dat")
22
22
+
23
23
+
size = 5
24
24
+
lists = costas_5x5
25
25
+
last = lists[1][1:size - 3]
26
26
+
inputs = []
27
27
+
arr = []
28
28
+
for l in lists
29
29
+
if last != l[1:size - 3]
30
30
+
push!(inputs, arr)
31
31
+
global last = l[1:size - 3]
32
32
+
global arr = []
33
33
+
end
34
34
+
push!(arr, (l[size - 2], l[size - 1], l[size]))
35
35
+
end
36
36
+
37
37
+
println("inputs has $(length(inputs)) many elements")
38
38
+
println(inputs)
39
39
+
40
40
+
kw = (proj_type = :ortho, legend = false, aspect_ratio = :equal, xlimits = (0,10), ylimits = (0,10), zlimits = (0,10))
41
41
+
limit = length(inputs)
42
42
+
colors = palette([:orange, :blue], limit + 2)
43
43
+
44
44
+
@gif for i in 0:360
45
45
+
idx = 1
46
46
+
for pts in inputs
47
47
+
x = pts .|> a -> a[1]
48
48
+
y = pts .|> a -> a[2]
49
49
+
z = pts .|> a -> a[3]
50
50
+
idx += 1
51
51
+
println((x, y, z))
52
52
+
scatter!(x, y, z; markercolor = colors[idx], camera = (i, round(atand(1 / √2); digits = 3)), kw...)
53
53
+
end
54
54
+
end