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

10 lines
355 B
Matlab

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