@@ -87,23 +87,23 @@ $(TYPEDSIGNATURES)
8787Rotate along the positive z-axis.
8888- `ratio`: rotational motion v.s. random motion. If equals `1`, only rotational component
8989"""
90- function rotational_velocity_acc (x, y, z, a, ratio = 1.0 )
90+ function rotational_velocity_acc (x, y, z, a, rot_ratio = 1.0 )
9191 u = unit (x)
9292 r = sqrt (x^ 2 + y^ 2 + z^ 2 )
9393 v = sqrt (a * r)
94- v_vec = - normalize (PVector (ustrip (u,x), ustrip (u,y), 0.0 ) × PVector (0.0 , 0.0 , 1.0 )) * v
95- v_vec = ratio * v_vec + (1 - ratio ) * randn (PVector{Float64}) * v # this will change the average velocity
96- v_vec = v_vec + (1 - ratio ) * randn (PVector{Float64}) * v
94+ v_vec_rot = - normalize (PVector (ustrip (u,x), ustrip (u,y), 0.0 ) × PVector (0.0 , 0.0 , 1.0 )) * v
95+ v_vec = rot_ratio * v_vec_rot + (1 - rot_ratio ) * normalize ( randn (PVector{Float64})) * v
96+ # v_vec = v_vec_rot + (1-rot_ratio ) * randn(PVector{Float64}) * v # this will change the average velocity
9797end
9898
9999"""
100100$(TYPEDSIGNATURES)
101101Rotate along the positive z-axis.
102- - `ratio `: rotational motion v.s. random motion. If equals `1`, only rotational component
102+ - `rot_ratio `: rotational motion v.s. random motion. If equals `1`, only rotational component
103103"""
104- function rotational_velocity (x, y, v, ratio = 1.0 )
104+ function rotational_velocity (x, y, v, rot_ratio = 1.0 )
105105 u = unit (x)
106- v_vec = - normalize (PVector (ustrip (u,x), ustrip (u,y), 0.0 ) × PVector (0.0 , 0.0 , 1.0 )) * v
107- # v_vec = ratio * v_vec + (1-ratio ) * randn(PVector{Float64}) * v # this will change the average velocity
108- v_vec = v_vec + (1 - ratio ) * randn (PVector{Float64}) * v
106+ v_vec_rot = - normalize (PVector (ustrip (u,x), ustrip (u,y), 0.0 ) × PVector (0.0 , 0.0 , 1.0 )) * v
107+ v_vec = rot_ratio * v_vec_rot + (1 - rot_ratio ) * normalize ( randn (PVector{Float64})) * v
108+ # v_vec = v_vec_rot + (1-rot_ratio ) * randn(PVector{Float64}) * v # this will change the average velocity
109109end
0 commit comments