Currently I can detect whether the point belongs to a line segment with the following code:

```
uint8_t point_lies_onSegment(const POINT2D *point, const POINT2D *linea, const POINT2D *lineb) {
double slope, intercept;
  double px, py;
  double left, top, right, bottom; // Bounding Box For Line Segment
  double dx, dy;

px = point->x;
py = point->y;

dx = lineb->x - linea->x;
dy = lineb->y - linea->y;

  slope = dy / dx;
  // y = mx + c
  // intercept c = y - mx
  intercept = linea->y - slope * linea->x; // which is same as y2 - slope * x2

  // For Bounding Box
  if(linea->x < lineb->x) {
    left = linea->x;
    right = lineb->x;
  } else {
    left = lineb->x;
    right = linea->x;
  }
  if(linea->y < lineb->y) {
    top = linea->y;
    bottom = lineb->y;
  } else {
    top = linea->y;
    bottom = lineb->y;
  }

  //"Equation of the line: %.2f X %c %.2f\n", slope, ((intercept < 0) ? ' ' : '+'), intercept;

  if( slope * px + intercept > (py - FP_TOLERANCE) &&
    slope * px + intercept < (py + FP_TOLERANCE)) {
      if( px >= left && px <= right && 
          py >= top && py <= bottom ) {
            return VG_TRUE;
      }
      else
        return VG_FALSE;
  }
  else
    return VG_FALSE;
}

```

But if the line is vertical it does not work as expected. 
Eg: 

line segment = (10, 10) - (10, 30)
point = (10, 20)

This return FALSE.

How to solve?