parameters: (a1, a2, b1, b2)
return_statement: return la * db + b1, la
docstring: Works for multiple points in each of the input arguments, i.e., a1, a2, b1, b2 can be Nx2 row arrays of 2D points.
      https://stackoverflow.com/questions/3252194/numpy-and-line-intersections
      Returns also a scale factor which indicates wheter the intersection
      is in positive or negative direction of the b vector.
docstring_summary: Works for multiple points in each of the input arguments, i.e., a1, a2, b1, b2 can be Nx2 row arrays of 2D points.
      https://stackoverflow.com/questions/3252194/numpy-and-line-intersections
      Returns also a scale factor which indicates wheter the intersection
      is in positive or negative direction of the b vector.
docstring_tokens: Works for multiple points in each of the input arguments i . e . a1 a2 b1 b2 can be Nx2 row arrays of 2D points . https : // stackoverflow . com / questions / 3252194 / numpy - and - line - intersections Returns also a scale factor which indicates wheter the intersection is in positive or negative direction of the b vector .
function: def line_intersect2(a1, a2, b1, b2):
      """
      Works for multiple points in each of the input arguments, i.e., a1, a2, b1, b2 can be Nx2 row arrays of 2D points.
      https://stackoverflow.com/questions/3252194/numpy-and-line-intersections
      Returns also a scale factor which indicates wheter the intersection
      is in positive or negative direction of the b vector.
      """
      da = np.atleast_2d(a2 - a1)
      db = np.atleast_2d(b2 - b1)
      dp = np.atleast_2d(a1 - b1)
      dap = np.dot(da, T)
      denom = np.sum(dap * db, axis=1)
      num = np.sum(dap * dp, axis=1)
      la = np.atleast_2d(num / denom).T
      return la * db + b1, la
function_tokens: def line_intersect2 ( a1 , a2 , b1 , b2 ) : da = np . atleast_2d ( a2 - a1 ) db = np . atleast_2d ( b2 - b1 ) dp = np . atleast_2d ( a1 - b1 ) dap = np . dot ( da , T ) denom = np . sum ( dap * db , axis = 1 ) num = np . sum ( dap * dp , axis = 1 ) la = np . atleast_2d ( num / denom ) . T return la * db + b1 , la