2022-01-31 20:15:09 +00:00
|
|
|
using CairoMakie
|
|
|
|
using LaTeXStrings: @L_str
|
|
|
|
|
2022-02-08 22:06:22 +00:00
|
|
|
include("../src/Visualization/common_CairoMakie.jl")
|
2022-01-31 20:15:09 +00:00
|
|
|
|
|
|
|
function gen_elliptical_distance_graphics()
|
|
|
|
init_cairomakie!()
|
|
|
|
|
|
|
|
fig = gen_figure()
|
|
|
|
|
2022-02-01 21:57:56 +00:00
|
|
|
ax = Axis(fig[1, 1]; xlabel=L"x", ylabel=L"y")
|
2022-01-31 20:15:09 +00:00
|
|
|
|
2022-02-01 21:57:56 +00:00
|
|
|
elliptical_b_a_ratio = 0.4
|
2022-01-31 20:15:09 +00:00
|
|
|
as = 1:1:3
|
|
|
|
|
|
|
|
for a in as
|
|
|
|
x = collect(LinRange(-a, a, 1000))
|
2022-02-01 21:57:56 +00:00
|
|
|
y = @. sqrt(a^2 - x^2) * elliptical_b_a_ratio
|
2022-01-31 20:15:09 +00:00
|
|
|
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
|
2022-03-19 22:11:03 +00:00
|
|
|
end
|