-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvis.jl
28 lines (23 loc) · 840 Bytes
/
vis.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
function vis(t,data)
#plot earth orbit
to = LinRange(59396,59396+365,366)
xo = zeros(6,length(to))
for i = 1:length(to)
xo[:,i] = earth(to[i]);
end
plot(xo[1,:],xo[2,:],xo[3,:],
linecolor = :cyan,
background_color = "black",
showaxis = false,
grid = false,
ticks = false,
legend = false)
#get current earth position
xe = earth(t)
scatter!([xe[1]],[xe[2]],[xe[3]], markersize = 3, markercolor = :cyan, markerstrokecolor = :cyan)
#scatter a sun
scatter!([0],[0],[0], markerstrokecolor = :yellow, markersize = 6, markercolor = :yellow)
#get asteroid positions
xa = updateAsteroids(t,data)
scatter!(xa[1,:],xa[2,:],xa[3,:], markersize = 0.5, markeralpha = 0.1, markerstrokecolor = :white, markercolor = :white)
end