coding style
case where line p1==p2