import math


def segment_circle_intersect(ax, ay, bx, by, cx, cy, r):
    """
    See if a line segment AB intersects a circle of center C and radius r.
    :return: True if line intersects circle, false otherwise
    """
    length_ab = math.sqrt((ax - bx) ** 2 + (ay - by) ** 2)  # euclidean distance
    dx, dy = (bx - ax) / length_ab, (by - ay) / length_ab  # direction vector from A to B
    # the equation of the line AB is x = Dx * t + Ax, y = Dy * t + Ay with 0 <= t <= length_ab.
    # compute the distance between the points A and E, where
    # E is the point of AB closest the circle center (Cx, Cy)t = Dx * (Cx-Ax) + Dy * (Cy-Ay)
    t = dx * (cx - ax) + dy * (cy - ay)
    ex, ey = t * dx + ax, t * dy + ay
    length_ec = math.sqrt((ex - cx) ** 2 + (ey - cy) ** 2)  # euclidean distance between closest point and center
    return length_ec < r