Permutation matrices research.

feat: Add juliaplots gif creator.

+54
+54
src/jupyter/gif.jl
··· 1 + import Pkg 2 + import Serialization 3 + Pkg.add("Combinatorics") 4 + Pkg.add("Primes") 5 + Pkg.add("BenchmarkTools") 6 + Pkg.add("Transducers") 7 + Pkg.add("Plots") 8 + using Combinatorics 9 + using Primes 10 + using BenchmarkTools 11 + using Transducers 12 + using Plots 13 + 14 + include("header.jl") 15 + 16 + import Base.Iterators 17 + 18 + loadvar(file_path::String) = Serialization.deserialize(file_path) 19 + 20 + costas_10x10 = loadvar("costas_10x10.dat") 21 + costas_5x5 = loadvar("costas_5x5.dat") 22 + 23 + size = 5 24 + lists = costas_5x5 25 + last = lists[1][1:size - 3] 26 + inputs = [] 27 + arr = [] 28 + for l in lists 29 + if last != l[1:size - 3] 30 + push!(inputs, arr) 31 + global last = l[1:size - 3] 32 + global arr = [] 33 + end 34 + push!(arr, (l[size - 2], l[size - 1], l[size])) 35 + end 36 + 37 + println("inputs has $(length(inputs)) many elements") 38 + println(inputs) 39 + 40 + kw = (proj_type = :ortho, legend = false, aspect_ratio = :equal, xlimits = (0,10), ylimits = (0,10), zlimits = (0,10)) 41 + limit = length(inputs) 42 + colors = palette([:orange, :blue], limit + 2) 43 + 44 + @gif for i in 0:360 45 + idx = 1 46 + for pts in inputs 47 + x = pts .|> a -> a[1] 48 + y = pts .|> a -> a[2] 49 + z = pts .|> a -> a[3] 50 + idx += 1 51 + println((x, y, z)) 52 + scatter!(x, y, z; markercolor = colors[idx], camera = (i, round(atand(1 / √2); digits = 3)), kw...) 53 + end 54 + end