1
0
Fork 0
mirror of https://gitlab.rlp.net/mobitar/ReCo.jl.git synced 2024-09-19 19:01:17 +00:00

sqrt in elliptical_distance

This commit is contained in:
Mo8it 2022-01-14 13:26:51 +01:00
parent fe7c65c4a3
commit 978c3f39fb

View file

@ -6,7 +6,7 @@ export center_of_mass,
using StaticArrays: SVector, SMatrix using StaticArrays: SVector, SMatrix
using LinearAlgebra: eigvals, eigvecs, Hermitian, dot using LinearAlgebra: eigvals, eigvecs, Hermitian, dot
using ..ReCo: Particle using ..ReCo: ReCo, Particle
function project_to_unit_circle(x::Float64, half_box_len::Float64) function project_to_unit_circle(x::Float64, half_box_len::Float64)
φ = (x + half_box_len) * π / half_box_len φ = (x + half_box_len) * π / half_box_len
@ -126,7 +126,7 @@ function elliptical_distance(
x = dot(v, gyration_tensor_eigvec_to_bigger_eigval) x = dot(v, gyration_tensor_eigvec_to_bigger_eigval)
y = dot(v, gyration_tensor_eigvec_to_smaller_eigval) y = dot(v, gyration_tensor_eigvec_to_smaller_eigval)
return x^2 + (y / goal_gyration_tensor_eigvals_ratio)^2 return sqrt(x^2 + (y / goal_gyration_tensor_eigvals_ratio)^2)
end end
end # module end # module