Skip to content

Commit

Permalink
Adding art
Browse files Browse the repository at this point in the history
  • Loading branch information
cadojo committed Sep 3, 2023
1 parent 36bf30d commit 6219f21
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
format_markdown = true
always_use_return = true
34 changes: 34 additions & 0 deletions art/halos.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using GeneralAstrodynamics
using DifferentialEquations, Plots

amplitudes = 0.0: 1e-3 : 0.1
halos = map(
A -> halo(EarthMoon; Az = A, L = 2),
amplitudes,
)

artsy = (;
background = :transparent,
grid = false,
axis = nothing,
xlabel = "",
ylabel = "",
zlabel = "",
border = :none,
title = "",
dpi = 400,
size = (600, 600),
)

figure = let
plot(; artsy...)
for halo in halos
plot!(
figure,
propagate(halo.orbit, 1.1 * halo.period, reltol=1e-14, abstol=1e-14);
vars = :XYZ,
artsy...,
label = :none,
)
end
end
42 changes: 42 additions & 0 deletions art/stable.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using GeneralAstrodynamics
using DifferentialEquations, Plots

L1 = halo(EarthMoon, Az = 0.01, L=1)
L2 = halo(EarthMoon, Az = 0.01, L=2)

M1 = manifold(
L1...,
duration = 1.95 * L1.period,
eps = -1e-7,
trajectories = 14,
direction = Val{:unstable},
)

M2 = manifold(
L2...,
duration = 2.1 * L2.period,
eps = 1e-7,
trajectories = 14,
direction = Val{:unstable},
)

artsy = (;
aspect_ratio = 1.0,
background = :transparent,
grid = false,
axis = nothing,
xlabel = "",
ylabel = "",
zlabel = "",
border = :none,
title = "",
dpi = 600,
)

plot(M1; vars=:XY, artsy..., palette = :seaborn_colorblind, linestyle = :solid, linewidth = 1)
plot!(M2; vars=:XY, artsy..., palette = :seaborn_colorblind, linestyle = :solid, linewidth = 1)

let xyz = GeneralAstrodynamics.Calculations.secondary_position(massparameter(L1.orbit))
x, y, z = xyz
scatter!([x], [y]; markersize=4, label=:none, color = :black, marker = :x)
end

0 comments on commit 6219f21

Please sign in to comment.