function [ if_intersection ] = Fast_intersection_judgment_algorithm( a,b,c,d )
%input 4 points of 2 vectors: a1 a2 b1 b2
if_intersection = 0;
product1 = ((c(1)-a(1))*(d(2)-a(2))-(d(1)-a(1))*(c(2)-a(2)))*((c(1)-b(1))*(d(2)-b(2))-(d(1)-b(1))*(c(2)-b(2)));
product2 = ((c(1)-a(1))*(c(2)-b(2))-(c(1)-b(1))*(c(2)-a(2)))*((d(1)-a(1))*(d(2)-b(2))-(d(1)-b(1))*(d(2)-a(2)));
if product1<=0 && product2<=0 
    if_intersection = 1;  
end
end