line crossing detection

line crossing detection