2

I have a picture as below:

\documentclass{article}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
  \draw(0,0) -- (4,0) -- (4,4) -- (0,4) -- (0,0);
  \draw(0,0) arc(-90:90:2);
  \draw[dashed](0,0) arc(-90:-270:2);  
  \draw(0,0) arc(180:90:4);
  \draw(0,0) arc(180:90:4);
  \draw[dashed](0,0) arc(-180:90:4);  
  \draw(4,0) arc(-90:-180:4);
  \draw[dashed](4,0) arc(-90:180:4);  
\end{tikzpicture}

\end{document}

Now I would draw shadow on the 3 arc overlapped parts, how should I do this? Just like this picture:

And What if I want to draw line between A-B-C, how should I do? Thank you so much!

enter image description here

  • 2
    Honestly, it would be quite impossible for shadings having shadows. Anyway, \clip circle_1;\clip circle_2;\clip circle_3;\fill rectangle; – Symbol 1 Apr 23 '17 at 15:35
3

Apart from the shadowing of the fill lines, somethng like this. The fill you can do with some help of \clip inside a scope environment. To set coordinates at the intersections use the intersections library.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{patterns,intersections}
\begin{document}

\begin{tikzpicture}
  \begin{scope}
    \clip(0,2) circle (2);
    \clip(4,0) circle (4);
    \fill[pattern=north west lines,pattern color=red](4,4) circle (4);
  \end{scope}
  %\draw(0,0) -- (4,0) -- (4,4) -- (0,4) -- (0,0);
  \draw (0,0) rectangle (4,4);
  \draw[name path=left](0,0) arc(-90:90:2);
  \draw[dashed](0,0) arc(-90:-270:2);  
  \draw[name path=lower](0,0) arc(180:90:4);
  %\draw(0,0) arc(180:90:4);
  \draw[dashed](0,0) arc(-180:90:4);  
  \draw[name path=upper](4,0) arc(-90:-180:4);
  \draw[dashed](4,0) arc(-90:180:4);  
  %%
  \path [name intersections={of=lower and upper}];
  \coordinate (A) at (intersection-1);
  \path [name intersections={of=left and upper}];
  \coordinate (B) at (intersection-1);
  \path [name intersections={of=left and lower}];
  \coordinate (C) at (intersection-2);
  %%
  \node[left,red] at (A) {A};
  \node[below,red] at (B) {B};
  \node[above,red] at (C) {C};
  %%
  \fill[blue,fill=blue,opacity=0.3] (A)--(B)--(C)--cycle;
  \draw[blue,thick] (A)--(B)--(C)--cycle;
\end{tikzpicture}

\end{document}

enter image description here

| improve this answer | |
  • Thank you so much for help. I can't image the power of pgf. – Coeus Wang Apr 30 '17 at 9:38

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.