code: public static double intersectRayLineSegment(Vector2dc origin, Vector2dc dir, Vector2dc a, Vector2dc b) {
          return intersectRayLineSegment(origin.x(), origin.y(), dir.x(), dir.y(), a.x(), a.y(), b.x(), b.y());
      }
docs: Determine whether the ray with given <code>origin</code> and direction <code>dir</code> intersects the undirected line segment
  given by the two end points <code>a</code> and <code>b</code>, and return the value of the parameter <i>t</i> in the ray equation
  <i>p(t) = origin + t * dir</i> of the intersection point, if any.
  <p>
  This method returns <code>-1.0</code> if the ray does not intersect the line segment.
  
  @see #intersectRayLineSegment(double, double, double, double, double, double, double, double)
  
  @param origin
  the ray's origin
  @param dir
  the ray's direction
  @param a
  the line segment's first end point
  @param b
  the line segment's second end point
  @return the value of the parameter <i>t</i> in the ray equation <i>p(t) = origin + t * dir</i> of the intersection point, if the ray
  intersects the line segment; <code>-1.0</code> otherwise