[Tex/LaTex] How to draw a circle using TikZ

tikz-pgf

I want to draw a disc using TikZ whose two halves are of different color.

like this

Best Answer

There are many possibilities to realize this. I implemented a center coordinate, which is a bit more flexible. Explanations as comments:

\begin{tikzpicture}
    % Circle's center
    \coordinate (center) at (2,2);

    % Create a blue filled arc, starting 2 above the center, 
    % with a start angle of 90°, an end angle of 270° and a radius of 2
    \fill[blue] (center) + (0, 2) arc (90:270:2);

    % Create a red filled arc, starting 2 below the center, 
    % with a start angle of 270°, an end angle of 450° and a radius of 2
    \fill[red] (center) + (0, -2) arc (270:450:2);
\end{tikzpicture}

Circle

Related Question