mirror of
https://gitlab.rlp.net/mobitar/ReCo.jl.git
synced 2024-12-30 17:43:34 +00:00
Added elliptical distance graphics
This commit is contained in:
parent
e45438347e
commit
7e52270d86
1 changed files with 33 additions and 0 deletions
33
graphics/elliptical_distance.jl
Normal file
33
graphics/elliptical_distance.jl
Normal file
|
@ -0,0 +1,33 @@
|
|||
using CairoMakie
|
||||
using LaTeXStrings: @L_str
|
||||
|
||||
includet("../src/Visualization/common_CairoMakie.jl")
|
||||
|
||||
function gen_elliptical_distance_graphics()
|
||||
box_length = 100
|
||||
|
||||
init_cairomakie!()
|
||||
|
||||
fig = gen_figure()
|
||||
|
||||
ax = Axis(fig[1, 1]; xlabel=L"x", ylabel=L"y")
|
||||
|
||||
elliptical_a_b_ratio = 0.4
|
||||
as = 1:1:3
|
||||
|
||||
for a in as
|
||||
x = collect(LinRange(-a, a, 1000))
|
||||
y = @. sqrt(a^2 - x^2) * elliptical_a_b_ratio
|
||||
append!(x, reverse(x))
|
||||
append!(y, reverse(-y))
|
||||
lines!(x, y; label=L"a = %$a")
|
||||
end
|
||||
|
||||
axislegend(ax; position=:rt, padding=3, rowgap=-3)
|
||||
|
||||
set_gaps!(fig)
|
||||
|
||||
save_fig("elliptical_distance.pdf", fig)
|
||||
|
||||
return nothing
|
||||
end
|
Loading…
Reference in a new issue