line_equation_2d#

regridding.geometry.line_equation_2d(x, y, x1, y1, x2, y2)[source]#

Test if a given point lies above, on, or below a line specified by two endpoints.

Returns zero if a point is on the line. Otherwise, points above the line have the opposite sign of points below the line.

Parameters:
  • x (float) – \(x\)-component of the test point

  • y (float) – \(y\)-component of the test point

  • x1 (float) – \(x\)-component of the first endpoint of the line

  • y1 (float) – \(y\)-component of the first endpoint of the line

  • x2 (float) – \(x\)-component of the second endpoint of the line

  • y2 (float) – \(y\)-component of the second endpoint of the line

Return type:

float