def _calc_tri_vert(v0, v1, angle0, angle1):
    '\n    Calculate rest coordinate from other coordinates and angle of end\n    '
    angle = ((math.pi - angle0) - angle1)
    alpha = atan2((v1.y - v0.y), (v1.x - v0.x))
    d = ((v1.x - v0.x) / cos(alpha))
    a = ((d * sin(angle0)) / sin(angle))
    b = ((d * sin(angle1)) / sin(angle))
    s = (((a + b) + d) / 2.0)
    if (fabs(d) < 1e-07):
        xd = 0
        yd = 0
    else:
        r = (((s * (s - a)) * (s - b)) * (s - d))
        if (r < 0):
            xd = 0
            yd = 0
        else:
            xd = ((((b * b) - (a * a)) + (d * d)) / (2 * d))
            yd = ((2 * sqrt(r)) / d)
    x1 = (((xd * cos(alpha)) - (yd * sin(alpha))) + v0.x)
    y1 = (((xd * sin(alpha)) + (yd * cos(alpha))) + v0.y)
    x2 = (((xd * cos(alpha)) + (yd * sin(alpha))) + v0.x)
    y2 = (((xd * sin(alpha)) - (yd * cos(alpha))) + v0.y)
    return (Vector((x1, y1)), Vector((x2, y2)))
Calculate rest coordinate from other coordinates and angle of end
def _calc_tri_vert(v0, v1, angle0, angle1):
    '\n    \n    '
    angle = ((math.pi - angle0) - angle1)
    alpha = atan2((v1.y - v0.y), (v1.x - v0.x))
    d = ((v1.x - v0.x) / cos(alpha))
    a = ((d * sin(angle0)) / sin(angle))
    b = ((d * sin(angle1)) / sin(angle))
    s = (((a + b) + d) / 2.0)
    if (fabs(d) < 1e-07):
        xd = 0
        yd = 0
    else:
        r = (((s * (s - a)) * (s - b)) * (s - d))
        if (r < 0):
            xd = 0
            yd = 0
        else:
            xd = ((((b * b) - (a * a)) + (d * d)) / (2 * d))
            yd = ((2 * sqrt(r)) / d)
    x1 = (((xd * cos(alpha)) - (yd * sin(alpha))) + v0.x)
    y1 = (((xd * sin(alpha)) + (yd * cos(alpha))) + v0.y)
    x2 = (((xd * cos(alpha)) + (yd * sin(alpha))) + v0.x)
    y2 = (((xd * sin(alpha)) - (yd * cos(alpha))) + v0.y)
    return (Vector((x1, y1)), Vector((x2, y2)))