11 lines
527 B
Matlab
11 lines
527 B
Matlab
function ret = exitCondition(this, ovenObj, PositionVector, VelocityVector, 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
|
|
ret = true;
|
|
else
|
|
ret = false;
|
|
end
|
|
end |