10

I am able to draw a simple circle.

\documentclass{minimal}
\usepackage{tikz}
\usepgflibrary{shapes}
\begin{document}
\begin{tikzpicture}
\draw (10,0) circle (3cm);
\end{tikzpicture}
\end{document}

But when I come across the following figures I face some difficulties.

enter image description here

Please provide some guidance so I can move ahead.

snehal
  • 101
  • Have you tried anything yet? Perhaps you can had the code you used to draw a simple circle first ;-) – Romain Picot Jan 04 '16 at 09:06
  • \documentclass{minimal} \usepackage{tikz} \usepgflibrary{shapes} \begin{document} \begin{tikzpicture} \draw (10,0) circle (3cm); \end{tikzpicture} \end{document} – snehal Jan 04 '16 at 09:09
  • This is what i made it was quit easy that is why i didn't give code. – snehal Jan 04 '16 at 09:10

2 Answers2

11
\documentclass[tikz,border=2mm]{standalone}
\usepackage{lmodern}

\begin{document}
\begin{tikzpicture}[draw=blue!70,thick]
\filldraw[fill=blue!40] circle (2.5cm);
\filldraw[fill=white] 
     (320:2.5cm) node[right] {Q} 
  -- (220:2.5cm) node[left] {P} 
  arc[start angle=220, end angle=320, radius=2.5cm] 
  -- cycle;
\node {Major Segment};
\node at (-90:2) {Minor Segment};

\begin{scope}[xshift=6cm]
\draw circle (2.5cm);
\filldraw[fill=blue!40] 
     (320:2.5cm) node[right] {Q}
  -- (0,0) node[above] {O}
  -- (220:2.5cm) node[left] {P} 
  arc[start angle=220, end angle=320, radius=2.5cm]
  -- cycle;
\node at (90:1cm) {Major Sector};
\node at (-90:1.5) {Minor Sector};
\end{scope}
\end{tikzpicture}
\end{document}

enter image description here

ojdo
  • 2,125
Ignasi
  • 136,588
3

One way to do it with MetaPost, for whom it may interest. To be run with LuaLaTeX.

\documentclass[border=2mm]{standalone}
\usepackage{luamplib}
  \mplibtextextlabel{enable}
  \everymplib{verbatimtex \leavevmode etex;
    u = 2.5cm;
    path circle; circle = fullcircle scaled 2u;
    pair P, Q; P = u*dir 220; Q = u*dir 320; 
    beginfig(0);}
  \everyendmplib{
      draw circle;
      label.llft("$P$", P); 
      label.lrt("$Q$", Q);
    endfig;}
\begin{document}
  \begin{mplibcode}
    fill buildcycle(P--Q, circle rotated -90) withcolor 0.20[white,blue];
    draw P--Q;
    label("Major Segment", origin);
    label.bot("Minor Segment", .5[P,Q]);
  \end{mplibcode}
  \qquad
  \begin{mplibcode}
    fill buildcycle(Q--origin--P, circle) withcolor 0.20[white,blue];
    draw P--origin--Q;
    label.top("$O$", origin);
    label.top("Minor sector", .5[P,Q]); 
    label("Major sector", (0, .5u));
  \end{mplibcode}
\end{document}

enter image description here

Franck Pastor
  • 18,756