From dbbe3222bfef2b36497adbd21a489f7e5c0e8cc0 Mon Sep 17 00:00:00 2001 From: MoBit Date: Fri, 3 Dec 2021 14:56:45 +0100 Subject: [PATCH] Fixed center_of_mass graphics --- graphics/center_of_mass.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/graphics/center_of_mass.jl b/graphics/center_of_mass.jl index 448b492..fd37944 100644 --- a/graphics/center_of_mass.jl +++ b/graphics/center_of_mass.jl @@ -15,14 +15,14 @@ A = -0.9 * L B = 0.65 * L pr = 0.03 * L -Ap_array = project_to_unit_circle(A, L) -Bp_array = project_to_unit_circle(B, L) -for p in (Ap_array, Bp_array) +Ap_vec = Vector(project_to_unit_circle(A, L)) +Bp_vec = Vector(project_to_unit_circle(B, L)) +for p in (Ap_vec, Bp_vec) p[2] *= -1 end -Ap = Point(Ap_array) -Bp = Point(Bp_array) +Ap = Point(Ap_vec[1], Ap_vec[2]) +Bp = Point(Bp_vec[1], Bp_vec[2]) M = R * ((Ap + Bp) / 2)