Sunday

LaTeX: Draw Yin Yang using TikZ package

Download and install Basic MiKTeX 64-bit Installer from
http://miktex.org/download

Start Menu > MiKTeX > TeXworks

Name and save the empty new file as texworks_yinyang.tex

Write code below:
{
\documentclass[12pt,a4paper]{article}
\usepackage{tikz}

\begin{document}

\begin{figure}[H] %Here placement specifier
\begin{center}
\begin{tikzpicture}[xscale=1.0,yscale=1.0]

\draw[black,ultra thick] (0,0) ellipse (6cm and 6cm); %outer circle

\fill[black] (0,0) (0,-6) arc (270:450:6cm); % right big black filled semicircle, center point, start point
\filldraw[fill=white,draw=black,ultra thick] (0,3) (0,0) arc (270:450:3cm); %right small white filled semicircle
\fill[black] (0,3) ellipse (1cm and 1cm); %upper black filled circle

\filldraw[fill=black,draw=black,,ultra thick] (0,-3) (0,0) arc (90:270:3cm); %left small black filled semicircle
\fill[white] (0,-3) ellipse (1cm and 1cm); %lower white filled circle

\end{tikzpicture}
\end{center}
\end{figure}

\end{document}
}

Toolbar >  Typeset of play icon
or
Hit Ctrl+T to execute and typeset the LaTeX code

Output:

No comments:

Measure execution time with Julia, example using sorting algorithms

# random integers between 1 and 100 inclusive, generate thousands of them x = rand ( 1 : 100 , 100000 ) @time sort (x; alg=InsertionSort, r...