def height(R, H, r):
    """
    find the height of the intersection at x = r of the line from (0, H) to (R, 0)
    """
    if 0 <= r <= R:
        h = H - (H * r) / R
        return h

    else:
        print("height function: radius is not in range")