From e808c3dbfbfbf1a24dd195a0ad3a7f345bf27b6e Mon Sep 17 00:00:00 2001 From: Karthik Chandrashekara Date: Thu, 15 Jul 2021 16:52:07 +0200 Subject: [PATCH] Divergence Angle is now calculated by taking the arctan of d/y, velocity condition was removed. --- +Simulator/@TwoDimensionalMOT/exitCondition.m | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/+Simulator/@TwoDimensionalMOT/exitCondition.m b/+Simulator/@TwoDimensionalMOT/exitCondition.m index ac24d29..33c1406 100644 --- a/+Simulator/@TwoDimensionalMOT/exitCondition.m +++ b/+Simulator/@TwoDimensionalMOT/exitCondition.m @@ -1,9 +1,8 @@ -function ret = exitCondition(this, ovenObj, PositionVector, VelocityVector, CollisionEvent) +function ret = exitCondition(this, PositionVector, CollisionEvent) d = Helper.calculateDistanceFromPointToLine(PositionVector, [0 0 0], [0 1 0]); y = PositionVector(2); - DivergenceAngle = (d/abs(y)); - %DivergenceAngle = atan(norm(cross(PositionVector, )) / norm(dot(PositionVector, [0 1 0]))); - if (y >= 0) && (DivergenceAngle <= this.ExitDivergence) && (abs(VelocityVector(2))<=ovenObj.VelocityCutoff) && ~CollisionEvent + DivergenceAngle = atan(d/abs(y)); + if (y >= 0) && (DivergenceAngle <= this.ExitDivergence) && ~CollisionEvent ret = true; else ret = false;