def check_if_parallel(dx1, dy1, dx2, dy2, tolerence=1e-05):
 theta1 = np.arctan2(dx1, dy1)
 theta2 = np.arctan2(dx2, dy2)
 dtheta = np.abs((theta1 - theta2))
 if (dtheta < tolerence):
  return 1
 elif (np.abs((dtheta - np.pi)) < tolerence):
  return (-1)
 else:
  return False

def check_if_parallel ( dx1 , dy1 , dx2 , dy2 , tolerence = 1e-05 ) : theta1 = np . arctan2 ( dx1 , dy1 ) theta2 = np . arctan2 ( dx2 , dy2 ) dtheta = np . abs ( ( theta1 - theta2 ) ) if ( dtheta < tolerence ) : return 1 elif ( np . abs ( ( dtheta - np . pi ) ) < tolerence ) : return ( - 1 ) else : return False
returns * 1 if two lines are parralel in same direction * -1 if two lines are parralel in opposite direction * 0 otherwise .