Skip to content

Commit f401d8f

Browse files
committed
free fall vel [skip ci]
1 parent 21011e0 commit f401d8f

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/Tools.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,15 @@ function rotational_velocity(x, y, v, rot_ratio = 1.0)
106106
v_vec_rot = -normalize(PVector(ustrip(u,x), ustrip(u,y), 0.0) × PVector(0.0, 0.0, 1.0)) * v
107107
v_vec = rot_ratio * v_vec_rot + (1-rot_ratio) * normalize(randn(PVector{Float64})) * v
108108
# v_vec = v_vec_rot + (1-rot_ratio) * randn(PVector{Float64}) * v # this will change the average velocity
109+
end
110+
111+
112+
"""
113+
$(TYPEDSIGNATURES)
114+
"""
115+
function freefall_velocity_acc(x, y, z, a)
116+
u = unit(x)
117+
r = sqrt(x^2 + y^2 + z^2)
118+
v = sqrt(a * r)
119+
v_vec = -normalize(PVector(ustrip(u,x), ustrip(u,y), ustrip(u,z))) * v
109120
end

0 commit comments

Comments
 (0)