function intersectingYN = isIntersecting(A, B, C, D)
% A: Cell1Tip1XY
% B: Cell1Tip2XY
% C: Cell2Tip1XY
% D: Cell2Tip2XY

    d1 = [B(1) - A(1), B(2) - A(2)];
    d2 = [D(1) - C(1), D(2) - C(2)];
    
    cross1 = sign((C(1) - A(1)) * d1(2) - (C(2) - A(2)) * d1(1));
    cross2 = sign((D(1) - A(1)) * d1(2) - (D(2) - A(2)) * d1(1));
    cross3 = sign((A(1) - C(1)) * d2(2) - (A(2) - C(2)) * d2(1));
    cross4 = sign((B(1) - C(1)) * d2(2) - (B(2) - C(2)) * d2(1));
    
    intersectingYN = (cross1 * cross2 < 0) && (cross3 * cross4 < 0);
end