mirror of
https://gitlab.rlp.net/mobitar/ReCo.jl.git
synced 2024-12-21 00:51:21 +00:00
Updated center of mass graphics
This commit is contained in:
parent
01e989c6bb
commit
33c1c8e539
3 changed files with 27 additions and 23 deletions
|
@ -6,13 +6,13 @@ function gen_COM_graphics()
|
||||||
box_length = 100
|
box_length = 100
|
||||||
box_height = 100
|
box_height = 100
|
||||||
|
|
||||||
L = 0.35 * box_length
|
L = 0.39 * box_length
|
||||||
|
|
||||||
R = 0.35 * box_length
|
R = 0.37 * box_length
|
||||||
|
|
||||||
A = -0.9 * L
|
A = -0.9 * L
|
||||||
B = 0.65 * L
|
B = 0.65 * L
|
||||||
particel_radius = 0.04 * L
|
particle_radius = 0.05 * L
|
||||||
|
|
||||||
Ap_vec = Vector(ReCo.Shape.project_to_unit_circle(A, L))
|
Ap_vec = Vector(ReCo.Shape.project_to_unit_circle(A, L))
|
||||||
Bp_vec = Vector(ReCo.Shape.project_to_unit_circle(B, L))
|
Bp_vec = Vector(ReCo.Shape.project_to_unit_circle(B, L))
|
||||||
|
@ -38,9 +38,10 @@ function gen_COM_graphics()
|
||||||
|
|
||||||
Drawing(box_length, box_height, "$graphics_export_dir/linear.pdf")
|
Drawing(box_length, box_height, "$graphics_export_dir/linear.pdf")
|
||||||
origin()
|
origin()
|
||||||
|
fontsize(5)
|
||||||
|
|
||||||
setcolor("black")
|
setcolor("black")
|
||||||
arrow(Point(-1.1 * L, 0), Point(1.2 * L, 0); arrowheadlength=0.1 * L, linewidth=0.8)
|
arrow(Point(-1.1 * L, 0), Point(1.2 * L, 0); arrowheadlength=0.1 * L, linewidth=1.0)
|
||||||
|
|
||||||
green_orange = blend(Point(-1.5 * L, 0), Point(1.5 * L, 0))
|
green_orange = blend(Point(-1.5 * L, 0), Point(1.5 * L, 0))
|
||||||
addstop(green_orange, 0.0, "orange")
|
addstop(green_orange, 0.0, "orange")
|
||||||
|
@ -62,21 +63,20 @@ function gen_COM_graphics()
|
||||||
|
|
||||||
setcolor("blue")
|
setcolor("blue")
|
||||||
for p in (A, B)
|
for p in (A, B)
|
||||||
circle(Point(p, 0), particel_radius, :fill)
|
circle(Point(p, 0), particle_radius, :fill)
|
||||||
end
|
end
|
||||||
|
text("A", Point(A - 0.030 * L, -0.08 * L))
|
||||||
|
text("B", Point(B - 0.030 * L, -0.08 * L))
|
||||||
|
|
||||||
setcolor("brown")
|
setcolor("brown")
|
||||||
circle(Point(COM, 0), particel_radius, :fill)
|
circle(Point(COM, 0), particle_radius, :fill)
|
||||||
|
text("COM", Point(COM - 0.098 * L, -0.08 * L))
|
||||||
|
|
||||||
setcolor("black")
|
setcolor("black")
|
||||||
fontsize(5)
|
|
||||||
text("x", Point(1.2 * L, 0.038 * L))
|
text("x", Point(1.2 * L, 0.038 * L))
|
||||||
text("-L", Point(-L - 0.07 * L, 0.18 * L))
|
text("-L/2", Point(-L - 0.15 * L, 0.20 * L))
|
||||||
text("0", Point(0 - 0.035 * L, 0.18 * L))
|
text("0", Point(0 - 0.030 * L, 0.18 * L))
|
||||||
text("+L", Point(L - 0.07 * L, 0.18 * L))
|
text("+L/2", Point(L - 0.15 * L, 0.20 * L))
|
||||||
text("A", Point(A - 0.038 * L, -0.06 * L))
|
|
||||||
text("B", Point(B - 0.038 * L, -0.06 * L))
|
|
||||||
text("COM", Point(COM - 0.108 * L, -0.06 * L))
|
|
||||||
|
|
||||||
finish()
|
finish()
|
||||||
|
|
||||||
|
@ -84,18 +84,18 @@ function gen_COM_graphics()
|
||||||
|
|
||||||
Drawing(box_length, box_height, "$graphics_export_dir/circular_projectiong.pdf")
|
Drawing(box_length, box_height, "$graphics_export_dir/circular_projectiong.pdf")
|
||||||
origin()
|
origin()
|
||||||
|
fontsize(5)
|
||||||
|
|
||||||
arrow(Point(-1.2 * R, 0), Point(1.2 * R, 0); arrowheadlength=0.1 * R, linewidth=0.8)
|
arrow(Point(-1.2 * R, 0), Point(1.2 * R, 0); arrowheadlength=0.1 * R, linewidth=1.0)
|
||||||
arrow(Point(0, 1.2 * R), Point(0, -1.2 * R); arrowheadlength=0.1 * R, linewidth=0.8)
|
arrow(Point(0, 1.2 * R), Point(0, -1.2 * R); arrowheadlength=0.1 * R, linewidth=1.0)
|
||||||
|
|
||||||
setcolor("black")
|
setcolor("black")
|
||||||
fontsize(5)
|
|
||||||
text("α", Point(1.22 * R, 0.035 * R))
|
text("α", Point(1.22 * R, 0.035 * R))
|
||||||
text("β", Point(-0.04 * R, -1.23 * R))
|
text("β", Point(-0.04 * R, -1.23 * R))
|
||||||
|
|
||||||
orange_green = blend(Point(0, -R), Point(0, R), "green", "orange")
|
orange_green = blend(Point(0, -R), Point(0, R), "green", "orange")
|
||||||
setblend(orange_green)
|
setblend(orange_green)
|
||||||
setline(0.8)
|
setline(1.0)
|
||||||
circle(Point(0, 0), R, :stroke)
|
circle(Point(0, 0), R, :stroke)
|
||||||
|
|
||||||
setcolor("red")
|
setcolor("red")
|
||||||
|
@ -106,8 +106,10 @@ function gen_COM_graphics()
|
||||||
|
|
||||||
setcolor("blue")
|
setcolor("blue")
|
||||||
for pp in (Ap, Bp)
|
for pp in (Ap, Bp)
|
||||||
circle(R * pp, particel_radius, :fill)
|
circle(R * pp, particle_radius, :fill)
|
||||||
end
|
end
|
||||||
|
text("A", 1.07 * R * Ap)
|
||||||
|
text("B", 1.14 * R * Bp)
|
||||||
|
|
||||||
setcolor("black")
|
setcolor("black")
|
||||||
setdash("dot")
|
setdash("dot")
|
||||||
|
@ -115,10 +117,12 @@ function gen_COM_graphics()
|
||||||
line(Point(0, 0), COMp, :stroke)
|
line(Point(0, 0), COMp, :stroke)
|
||||||
|
|
||||||
setcolor("purple1")
|
setcolor("purple1")
|
||||||
circle(M, particel_radius, :fill)
|
circle(M, particle_radius, :fill)
|
||||||
|
text("COM'", 0.019 * R * M + R * Point(0.0, -0.04))
|
||||||
|
|
||||||
setcolor("brown")
|
setcolor("brown")
|
||||||
circle(COMp, particel_radius, :fill)
|
circle(COMp, particle_radius, :fill)
|
||||||
|
text("S", 0.029 * R * COMp)
|
||||||
|
|
||||||
finish()
|
finish()
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ function run_rl(;
|
||||||
seed::Int64=42,
|
seed::Int64=42,
|
||||||
ϵ_stable::Float64=0.0001,
|
ϵ_stable::Float64=0.0001,
|
||||||
skin_to_interaction_r_ratio::Float64=ReCo.DEFAULT_SKIN_TO_INTERACTION_R_RATIO,
|
skin_to_interaction_r_ratio::Float64=ReCo.DEFAULT_SKIN_TO_INTERACTION_R_RATIO,
|
||||||
packing_ratio::Float64=0.22,
|
packing_ratio::Float64=0.15,
|
||||||
show_progress::Bool=true,
|
show_progress::Bool=true,
|
||||||
) where {E<:Env}
|
) where {E<:Env}
|
||||||
@assert 0.0 <= elliptical_a_b_ratio <= 1.0
|
@assert 0.0 <= elliptical_a_b_ratio <= 1.0
|
||||||
|
|
|
@ -9,8 +9,8 @@ using LinearAlgebra: LinearAlgebra as LA
|
||||||
using ..ReCo: ReCo, Particle
|
using ..ReCo: ReCo, Particle
|
||||||
|
|
||||||
function project_to_unit_circle(x::Real, half_box_len::Real)
|
function project_to_unit_circle(x::Real, half_box_len::Real)
|
||||||
φ = (x + half_box_len) * π / half_box_len
|
θ = (x + half_box_len) * π / half_box_len
|
||||||
si, co = sincos(φ)
|
si, co = sincos(θ)
|
||||||
|
|
||||||
return SVector(co, si)
|
return SVector(co, si)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue