Calculations/MOT-Simulator/+Simulator/@TwoDimensionalMOT/exitCondition.m

10 lines
355 B
Mathematica
Raw Normal View History

2024-06-18 19:01:35 +02:00
function ret = exitCondition(this, PositionVector, CollisionEvent)
d = Helper.calculateDistanceFromPointToLine(PositionVector, [0 0 0], [0 1 0]);
y = PositionVector(2);
DivergenceAngle = atan(d/abs(y));
if (y >= 0) && (DivergenceAngle <= this.ExitDivergence) && ~CollisionEvent
ret = true;
else
ret = false;
end
end