Skip to main content
. Author manuscript; available in PMC: 2018 Nov 1.
Published in final edited form as: J Biomed Inform. 2017 Sep 22;75:48–62. doi: 10.1016/j.jbi.2017.09.010

Algorithm 2.

self-collision response

1: procedure selfCollisionResponse
2: for each pair of line segments i, j do
3:   evaluate direction to move = sign(w(t).w(tt)).ŵ(tt)
4:   evaluate distance to move u = Dsign(w(t).w(tt))|w(tt)|
5:   compute displacements Δp̄i and Δp̄j
6:   evaluate p¯i(t+Δt) and p¯j(t+Δt) (points at the end of (tt))
7:   compute gi =Δp̄i, gj = Δp̄j and g = gi + gj
8:   compute vectors giguq^ and gjguq^
9:   apply response to line segnrents i,j
10: end for
11: end procedure