intersectRayLine

Test whether the ray with given origin <code>(originX, originY)</code> and direction <code>(dirX, dirY)</code> intersects the line containing the given point <code>(pointX, pointY)</code> and having the normal <code>(normalX, normalY)</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 originX the x coordinate of the ray's origin @param originY the y coordinate of the ray's origin @param dirX the x coordinate of the ray's direction @param dirY the y coordinate of the ray's direction @param pointX the x coordinate of a point on the line @param pointY the y coordinate of a point on the line @param normalX the x coordinate of the line's normal @param normalY the y coordinate of 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)
    static
    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)

Meta