def calc_p2(p, p_p, p_pp, i, cd):
    """Calculate the control point p2 of the current cubic Bezier curve."""
    x1 = -(p_pp.x - p_p.x) / cd
    y1 = - (p_pp.y - p_p.y) / cd
    x2 = (p.x - p_p.x) / cd
    y2 = (p.y - p_p.y) / cd
    x = p_p.x + (x1 + x2) / cd
    y = p_p.y + (y1 + y2) / cd
    return x, y