def cerc_triunghi():
    R = 6
    C.setXminXmaxYminYmax(-10, 10, -10, 10)
    C.fillScreen(Color.Whitesmoke)


    A = complex(-6, 0)
    B = complex(6, 0)
    D = complex(0, 6)


    centru = complex(0, 0)
    raza = R


    for z in C.screenAffixes():
        x, y = z.real, z.imag


        in_cerc = abs(z - centru) <= raza


        cond1 = (y - A.imag) * (B.real - A.real) - (x - A.real) * (B.imag - A.imag) > 0
        cond2 = (y - B.imag) * (D.real - B.real) - (x - B.real) * (D.imag - B.imag) > 0
        cond3 = (y - D.imag) * (A.real - D.real) - (x - D.real) * (A.imag - D.imag) > 0
        cond4 = (y - A.imag) * (B.real - A.real) - (x - A.real) * (B.imag - A.imag) < 0
        cond5 = (y - B.imag) * (D.real - B.real) - (x - B.real) * (D.imag - B.imag) < 0
        cond6 = (y - D.imag) * (A.real - D.real) - (x - D.real) * (A.imag - D.imag) < 0

        in_triunghi = cond1 and cond2 and cond3


        if in_triunghi:
            col = Color.Yellow
        elif in_cerc and cond4:
            col = Color.Cyan
        elif in_cerc and cond5:
            col = Color.Magenta
        elif in_cerc and cond6:
            col = Color.Blueviolet
        elif not in_cerc and cond4 and cond2 and cond3:
            col = Color.Green
        elif not in_cerc and cond5 and cond1 and cond3:
            col = Color.Darkolivegreen
        elif not in_cerc and cond6 and cond1 and cond2:
            col = Color.Firebrick
        elif not in_cerc and cond1 and cond5 and cond6:
            col = Color.Orange
        elif not in_cerc and cond2 and cond4 and cond6:
            col = Color.Pink
        elif not in_cerc and cond3 and cond4 and cond5:
            col = Color.Ghostwhite

        C.setPixel(z, col)