/
logo.jl
106 lines (88 loc) · 2.96 KB
/
logo.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
using PlanetOrbits
using Plots
using Colors
logocolors = Colors.JULIA_LOGO_COLORS
orbit1 = orbit(
a = 0.8,
i = 0.0,
e = 0.0,
ω = 0.0,
Ω = 0.0,
τ = 0.7,
plx=1000,
M = 1.0,
)
orbit2 = orbit(
a = 1.269,
i = 0.0,
e = 0.16,
ω = 120,
Ω = 0.0,
τ = 0.8,
plx=1000,
M = 1.0,
)
period(orbit1)/period(orbit2)
#
p = plot(xlims=(-1600,1300), ylims=(-1300,1600), size=(300,300), framestyle=:none, legend=nothing, margin=-20Plots.mm, background=:transparent)
scatter!([0], [0], color=logocolors.blue, markersize=20, markerstrokewidth=1, markerstrokecolor="#222")
plot!(orbit1, color=logocolors.green, linewidth=2.5)
scatter!([raoff(orbit1, 0)], [decoff(orbit1, 0)], color=logocolors.green, markersize=13, markerstrokewidth=1, markerstrokecolor="#222")
plot!(orbit2, color=logocolors.red, linewidth=2.5)
x = raoff(orbit2, 0)
y = decoff(orbit2, 0)
scatter!([x],[y], color=logocolors.red, markersize=9, markerstrokewidth=1, markerstrokecolor="#222")
moon = orbit(
# a = 0.2,
a = 0.274,
i = 0,
e = 0.0,
ω = 120,
Ω = 0.0,
τ = 0.0,
plx=1000,
M = 1.0,
)
νs = range(0, 2π, length=100)
xs = raoff.(PlanetOrbits.orbitsolve_ν.(moon, νs)) .+ x
ys = decoff.(PlanetOrbits.orbitsolve_ν.(moon, νs)) .+ y
plot!(xs,ys, color=logocolors.purple, linewidth=2.0)
i = 2
scatter!(xs[i:i],ys[i:i], color=logocolors.purple, markersize=6, markerstrokewidth=1, markerstrokecolor="#222")
savefig("docs/src/assets/logo.svg")
savefig("docs/src/assets/logo.png")
p
##
anim = @animate for t in range(0, period(orbit2), length=120)
p = plot(xlims=(-1730,1400), ylims=(-1450,1700), size=(350,350), framestyle=:none, legend=nothing, margin=-20Plots.mm, background=:white)
plot!(orbit1, color=logocolors.green, linewidth=2.5)
x0 = raoff(orbit1, t)
y0 = decoff(orbit1, t)
scatter!([x0], [y0], color=logocolors.green, markersize=9, markerstrokewidth=1, markerstrokecolor="#222")
plot!(orbit2, color=logocolors.red, linewidth=2.5)
x = raoff(orbit2, t)
y = decoff(orbit2, t)
scatter!([x],[y], color=logocolors.red, markersize=13, markerstrokewidth=1, markerstrokecolor="#222")
moon = orbit(
# a = 0.2,
a = 0.274,
i = 0,
e = 0.0,
ω = 120,
Ω = 0.0,
τ = 0.0,
plx=1000,
M = 1.0,
)
νs = range(0, 2π, length=100)
xs = raoff.(PlanetOrbits.orbitsolve_ν.(moon, νs)) .+ x
ys = decoff.(PlanetOrbits.orbitsolve_ν.(moon, νs)) .+ y
plot!(xs,ys, color=logocolors.purple, linewidth=2.0)
xm = raoff(moon, t)+x
ym = decoff(moon, t)+y
scatter!([xm], [ym], color=logocolors.purple, markersize=6, markerstrokewidth=1, markerstrokecolor="#222")
star_x = -(x0*9^3 + x*13^3)/40^3 # + xm*6^2
star_y = -(y0*9^3 + y*13^3)/40^3 # + ym*6^2
scatter!([star_x], [star_y], color=logocolors.blue, markersize=20, markerstrokewidth=1, markerstrokecolor="#222")
end
gif(anim, "docs/src/assets/logo.gif", fps=30)