James R. answered • 05/29/19

Developer and Entrepreneur selling C# based commercial software.

By "left" and "right", I assume you mean relative to the x - coordinate, on an x-y plane. I also assume that the straight line you have drawn goes to infinity in both directions.

If the equation of your line is y = mx + b, then x = (y - b)/m, where of course m = slope, except in the special case of a horizontal line (m=0), where of course y = b, or in the special case of a vertical line, where x is a constant, and y can be anything (undefined slope).

**Case 1: If your line is neither vertical nor horizontal:**

For any point p1 (x1, y1) in your set of points to be classified, there is a corresponding point p2 (x2, y2) on your line, such that y1 = y2. Then the corresponding x coordinate on your line for the point to be classified is then x2 = (y1 - b)/m.

Points on the **left **satisfy: x1 < x2.

Points on the **right** satisfy: x1 > x2.

Points on the **line** satisfy x1 = x2.

**Case 2: If your line is vertical, located at x = V, y can be anything:**

Points on the **left **satisfy: x1 < V.

Points on the **right** satisfy: x1 > V.

Points on the **line** satisfy x1 = V.

**Case 3: If your line is horizontal, located at y = H, x can be anything:**

Hence, the concept of "left" and "right" in this case is indeterminate.

**UNLESS**, you now decide to change your perspective and define "left" = "above" and "right" = "below".

Points **above **satisfy: y1 > H.

Points **below** satisfy: y1 < H.

Points on the **line** satisfy y1 = H.