9 lines
301 B
Mathematica
9 lines
301 B
Mathematica
|
function ret = computeCollisionProbability(this, ovenObj, tau_2D)
|
||
|
collision = rand(1);
|
||
|
CollisionProbability = 1 - exp(-tau_2D/ovenObj.CollisionTime);
|
||
|
if this.BackgroundCollision && collision <= CollisionProbability
|
||
|
ret = true;
|
||
|
else
|
||
|
ret = false;
|
||
|
end
|
||
|
end
|