-1

I would like to draw a picture as follows:

enter image description here

but I don't know how to start. It consists of two connected semi-rings, $\Omega_1$ and $\Omega_2$. Anyone can help me?

  • 1
    There are examples in the pgfmanual that show circles/arcs, angles, etc. So that should get you started. – Skillmon May 23 at 13:04
5

You may combine this with Skillmon's answer.

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{arrows.meta,bending}
\begin{document}
\begin{tikzpicture}
\draw (0:4) arc(0:180:4) node[midway,above]{WALL} -- (180:0.5) node[midway,above]{$\Omega_{13}$}
 arc (180:0:0.5)
 node[midway,above]{$\Omega_{11}$}-- cycle node[midway,above]{$\Omega_{34}$};
\draw (0,0) -- (35:4);
\draw[-{Latex[bend]}] (1.5,0) arc(0:35:1.5) node[near end,right]{$\theta$};
\draw[-Latex] (0,0) -- (70:3) node[near end,right]{$\Omega$};
\begin{scope}[yshift=-2pt,red]
 \draw (0:4) arc(0:-180:4) node[midway,below]{WATER}
  -- (-180:0.5) node[midway,below]{$\Omega_{23}$}
  arc(-180:0:0.5)
  node[midway,below]{$\Omega_{21}$} -- cycle node[midway,below]{$\Omega_{24}$};
 \draw (0,0) -- (-35:4);
 \draw[-{Latex[bend]}] (3,0) arc(0:-35:3) node[midway,right]{$\varphi$};
 \foreach \X in {1.75,2.25,2.75}
 {\draw[-Latex] (1,-\X) -- (-1,-\X);}
\end{scope}
\end{tikzpicture}
\end{document}

enter image description here

4

To get you started, I've drawn the PokeBall:

EDIT: Fixing some issues, some calculations were wrong (at least based on the names of the variables).

\documentclass[tikz,border=3.14]{standalone}

\pgfkeys
  {%
    /tikz/kim/.cd
    ,gap/.initial=.02cm
    ,radius/.initial=1cm
    ,inner/.initial=.2cm
  }
\newcommand*\kimvalue[1]{\pgfkeysvalueof{/tikz/kim/#1}}

\begin{document}
\begin{tikzpicture}
  \pgfmathsetmacro\kimAngleI{asin(\kimvalue{gap}/\kimvalue{inner})}
  \pgfmathsetmacro\kimAngleO{asin(\kimvalue{gap}/\kimvalue{radius})}
  \draw[red]
    ({180+\kimAngleO}:\kimvalue{radius})
    arc
      [%
        start angle={-180+\kimAngleO},
        end angle={-\kimAngleO},
        radius=\kimvalue{radius}
      ]
    -- ({-\kimAngleI}:\kimvalue{inner})
    arc
      [%
        start angle={-\kimAngleI},
        end angle={-180+\kimAngleI},
        radius=\kimvalue{inner}
      ]
    -- cycle
    ;
  \draw
    ({180-\kimAngleO}:\kimvalue{radius})
    arc
      [%
        start angle=180-\kimAngleO,
        end angle=\kimAngleO,
        radius=\kimvalue{radius}
      ]
    -- ({\kimAngleI}:\kimvalue{inner})
    arc
      [%
        start angle=\kimAngleI,
        end angle=180-\kimAngleI,
        radius=\kimvalue{inner}
      ]
    -- cycle
    ;
\end{tikzpicture}
\end{document}

enter image description here

  • Oh the code indentation is so beautiful! – user156344 May 23 at 14:20
  • @JouleV thank you, I always try to make the code as readable as possible :) – Skillmon May 24 at 7:49
  • It is * too * readable to me :) Perhaps I will try to learn this. – user156344 May 24 at 7:50
  • 1
    @JouleV just look at the indentation rules of the Linux Kernel code, then try to do that in TeX, notice that indentation of 8 spaces is way too much for TeX code, rethink your entire life, cry for 2 days straight, come up with your own conventions which are a reasonable compromise, et voila you got yourself some skills to write readable code :) – Skillmon May 24 at 7:55
  • @TheoldJouleV why did you change your name? – Skillmon May 26 at 20:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.