7

I would like to draw a figure that looks like the following scenario:

Consider a circle of radius $r$, described parametrically by $x = cos(t) and y = sin(t)$. I'd like to draw a figure where the 90 to 180 degrees arc and the 270 to 360 arc are stretched by adding 1 to the previous point, while keeping the figure connected. Here is a sketch of the figure below: (x and y axis should not be included in the final figure).

enter image description here

The respective labels are $\Omega_1$, $\partial \varphi(1)$, $\partial \varphi (1)$, $t=0$, $t=1$, $t=0$, $t=1$, $\phi^2$, $\Omega_2$

Any help would be greatly appreciated.

Here is part of the picture that I have drawn:

\begin{pspicture}(-.5,-.5)(3.5,3.5)
\psaxes[labels=none,ticks=none]{->}(0,0)(-.5,-.5)(3,3)[$x$,0][$y$,90]
\pscustom[fillstyle=solid,fillcolor=lightgray]
{
 \psarc(0,0){2.5}{0}{90}
 \psarcn(0,0){1.5}{90}{0}
 \closepath
   }
   \rput(2;45){$\Delta \mathfrak{M}$}
    \end{pspicture}

I'd also like to have an additional label $\Delta \mathfrak{M}$ in each annulus as well as for them to be shaded.

6 Answers6

9
\documentclass[tikz,margin=10pt]{standalone}
\usepackage{mathtools,amssymb}
\begin{document}
\begin{tikzpicture}[scale=2,transform shape]
\draw (1,0) arc (0:90:1);
\draw (-1,0) arc (180:270:1);
\draw[fill=gray!30] (-1,0) -- (-2,0) arc (180:90:2) -- (0,1) arc (90:180:1);
\draw[fill=gray!30] (1,0) -- (2,0) arc (0:-90:2) -- (0,-1) arc (-90:0:1);
\node at (0.2,0.75) {\tiny $\phi^2$};
\node[rotate=50] at (-0.7,0.5) {\tiny $t=0$};
\node[rotate=50] at (0.7,-0.5) {\tiny $t=0$};
\node[rotate=50] at (-1.45,1.2) {\tiny $t=1$};
\node[rotate=50] at (1.45,-1.2) {\tiny $t=1$};
\node[rotate=50] at (-1.6,1.4) {\tiny $\partial \varphi (1)$};
\node[rotate=50] at (1.6,-1.4) {\tiny $\partial \varphi (1)$};
\node at (-2,2) {\tiny $\Omega_1$};
\node at (2,-2) {\tiny $\Omega_2$};
\node at (-1,1) {\tiny $\Delta \mathfrak{M}^2$};
\node at (1,-1) {\tiny $\Delta \mathfrak{M}^2$};
\end{tikzpicture}

\end{document}

enter image description here

5

With the next version of TikZ it is finally possible to place nodes along arcs. This is used here with the CVS version of TikZ. (Although, it is relatively easy to calculate the positions and rotations here manually.)

For more information, refer to

Code

\documentclass[tikz]{standalone}
\usepackage{amssymb}
\begin{document}
\begin{tikzpicture}[>=latex, declare function={smallR=2; bigR=2*smallR;}, delta angle=90,
  my ring sectors/.style={fill=gray, nodes={midway, sloped}}]
\filldraw[my ring sectors]
  (left:smallR) arc[radius=smallR, start angle=180, delta angle=-90] node[below] {$t=0$}
   -- (up:bigR) arc[radius=bigR, start angle=90]                     node[below] {$t=1$}
                  node[above] {$\partial\varphi(1)$} -- cycle
  (right:smallR) arc[radius=smallR, start angle=0, delta angle=-90]  node[above] {$t=0$}
  -- (down:bigR) arc[radius=bigR, start angle=-90]                   node[above] {$t=1$}
                   node[below] {$\partial\varphi(1)$} -- cycle;

\draw[radius=smallR] (right:smallR) arc[start angle=0]
                      (left:smallR) arc[start angle=180];
\node[below] at (up:smallR) {$\phi^2$};
\path (-bigR,bigR) -- 
  node[at start]   {$\Omega_1$}
  node[near start] {$\Delta \mathfrak{M}^2$}% or at (135:.5*bigR+.5*smallR)
  node[near end]   {$\Delta \mathfrak{M}^2$}% or at (-45:.5*bigR+.5*smallR)
  node[at end]     {$\Omega_2$} (bigR,-bigR);
\end{tikzpicture}
\end{document}

Output

enter image description here

Qrrbrbirlbel
  • 119,821
4

Exploiting the symmetrical properties of the diagram in question with PSTricks. It only consumes 583 characters.

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{amssymb}
\SpecialCoor
\degrees[8]

\def\Atom#1%
{%
    \pscustom[fillstyle=solid,fillcolor=lightgray]
    {
        \psarc(0,0){4}{2}{4}
        \psarcn(0,0){2}{4}{2}
        \closepath
    }
    \foreach \A/\B/\C in 
    {   
        1.7/0/t=0, 
        3.0/1/\Delta \mathfrak{M}^2, 
        3.7/0/t=1, 
        4.3/0/\partial \varphi (1)
    }
    {
        \rput{\ifnum\B=1 *0\else *1\fi}(\A;3){$\C$}
        \rput{*0}(-4,4){$\Omega_#1$}
    }%
}

\begin{document}
\begin{pspicture}(-4,-4)(4,4)
    \Atom1
    \rput{4}{\Atom2}
    \pscircle[dimen=m]{2}
    \rput(1.7;2){$\phi^2$}
\end{pspicture}
\end{document}

enter image description here

4

An alternative to the answers already given:

\documentclass{standalone}
\usepackage{tikz}
\usepackage{amssymb}
\begin{document}
\tikz{\foreach\i in{0,180}
 \path[rotate=\i,fill=gray,draw=black](0:0)--(0:3)arc(0:-90:3)--cycle;
\fill[draw=black,fill=white]circle[radius=1.5];
\foreach\i in{1,2}
 \foreach\r/\s[count=\c]in{5/t=0,8/\Delta\mathfrak M^2,11/t=1,20/\Omega_\i,13/\partial\varphi(1)}
  \node[rotate={mod(\c,2)*45}]at(\i*180-45:\r/4){$\s$};
\node at(90:1.25){$\Phi^2$};}
\end{document}

enter image description here

Mark Wibrow
  • 70,437
3

Here is my crack at it. I personally find the notation draw(x1,y1) to[in=A,out=B](x2,y2); much easier to work with, as opposed to the crypto mind-bending arc and friends which makes me want to go and drink something strong.

@Jake made a great suggestion to replace with bend right=45 or bend left=45 instead which is even easier to understand.

\documentclass[tikz]{standalone}
\usepackage{amssymb,mathpazo}
\begin{document}
    \begin{tikzpicture}
        \tikzset{e/.style={rotate=45},
                 n/.style={e,anchor=north},
                 s/.style={e,anchor=south},
                 f/.style={fill=lightgray},
                 bl/.style={bend left=45},
                 br/.style={bend right=45},}
        \draw   (2, 0) to[br] (0, 2) 
                (-2,0) to[br] (0,-2);
        \draw[f](0, 2) to[br] (-2,0) -- (-4,0) to[bl] (0, 4) -- (0, 2) 
                (0,-2) to[br] (2, 0) -- (4, 0) to[bl] (0,-4) -- (0,-2);
        \node[anchor=north]at (0,2){$\phi^2$};
        \node at (-4,4){$\Omega_1$};
        \node at (4,-4){$\Omega_2$};
        \node[n] at (-1.4,1.4){$t=0$};
        \node[s] at (1.4,-1.4){$t=0$};
        \node[n] at (-2.8,2.8){$t=1$};
        \node[s] at (2.8,-2.8){$t=1$};
        \node[s] at (-2.8,2.8){$\partial \varphi(1)$};
        \node[n] at (2.8,-2.8){$\partial \varphi(1)$};
        \node at (-2.1,2.1) {$\Delta \mathfrak{M}^2$};
        \node at (2.1,-2.1) {$\Delta \mathfrak{M}^2$};
    \end{tikzpicture}
\end{document}

Output

3

enter image description here

Countdown=457 characters (Asymptote,Linux). ring.asy:

size(220);
usepackage("amssymb");
draw(unitcircle);
string[] s={"$\partial\varphi(1)$","$t=0$","$t=1$","$\Omega_","$\Delta\mathfrak{M}^2$"};
real[] d={2,1,2,-2,-1,-2};
pair[] p={NW,SE,SE,SE,NW,NW};
guide r=arc(N-N,2,90,180)--arc(N-N,1,180,90,CW)--cycle;
filldraw(rotate(180)*r^^r,gray);
for(int i=0;i<6;++i){
  label(rotate(45)*s[i%3],d[i]*NW,p[i]);
}
label("$\phi^2$",N,S);
label(s[3]+"1$",3NW);
label(s[3]+"2$",3SE);
label(s[4],1.5NW);
label(s[4],1.5SE);

To get a standalone ring.pdf, run asy -f pdf ring.asy.

g.kov
  • 21,864
  • 1
  • 58
  • 95
  • It does not need \documentclass? – kiss my armpit Nov 10 '13 at 15:20
  • 1
    @Marienplatz: AFAIK, for the moment for non-inline standalone mode it uses \documentclass[12pt]{article} as default. – g.kov Nov 10 '13 at 15:30
  • Interesting: I usually find that when I do something with both Asymptote and TikZ, the Asymptote code is a bit longer. But that's probably because I deliberately write in a style that values robustness over compactness, and dividing a task into several lines of code is more natural in Asymptote than in TikZ. – Charles Staats Nov 10 '13 at 20:25