def does_intersection_exist_line2d(line_ray_a, line_ray_b):
    """Boolean denoting whether an intersection exists between Ray2D or LineSegment2D.

    This is slightly faster than actually computing the intersection but should only be
    used in cases where the actual point of intersection is not needed.

    Args:
        line_ray_a: A LineSegment2D or Ray2D object.
        line_ray_b: Another LineSegment2D or Ray2D to intersect.

    Returns:
        True if an intersection exists. False if no intersection exists.
    """
    d = line_ray_b.v.y * line_ray_a.v.x - line_ray_b.v.x * line_ray_a.v.y
    if d == 0:
        return False
    dy = line_ray_a.p.y - line_ray_b.p.y
    dx = line_ray_a.p.x - line_ray_b.p.x
    ua = (line_ray_b.v.x * dy - line_ray_b.v.y * dx) / d
    if not line_ray_a._u_in(ua):
        return False
    ub = (line_ray_a.v.x * dy - line_ray_a.v.y * dx) / d
    if not line_ray_b._u_in(ub):
        return False
    return True
