intersectRayLine

Test whether the ray with given <code>origin</code> and direction <code>dir</code> intersects the line containing the given <code>point</code> and having the given <code>normal</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. <p> This method returns <code>-1.0</code> if the ray does not intersect the line, because it is either parallel to the line or its direction points away from the line or the ray's origin is on the <i>negative</i> side of the line (i.e. the line's normal points away from the ray's origin).

@param origin the ray's origin @param dir the ray's direction @param point a point on the line @param normal the line's normal @param epsilon some small epsilon for when the ray is parallel to the line @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; <code>-1.0</code> otherwise

  1. double intersectRayLine(double originX, double originY, double dirX, double dirY, double pointX, double pointY, double normalX, double normalY, double epsilon)
  2. double intersectRayLine(Vector2d origin, Vector2d dir, Vector2d point, Vector2d normal, double epsilon)
    static
    double
    intersectRayLine

Meta