Skip to content

Commit

Permalink
Fix rattle!(...) uniform random in radial component
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasschmitz committed Oct 23, 2024
1 parent c9f37f9 commit 76995b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function rattle!(at::FlexibleSystem, r::Quantity)
𝐫ᵢ = p.position
T = typeof(ustrip(𝐫ᵢ[1]))
ui = randn(Vec3{T})
p_new = _set_position(p, 𝐫ᵢ + r * ui / norm(ui))
p_new = _set_position(p, 𝐫ᵢ + rand() * r * ui / norm(ui))
at.particles[i] = p_new
end
return at
Expand Down

0 comments on commit 76995b0

Please sign in to comment.