[Tex/LaTex] How to draw the projection of a three-dimensional domain of integration onto the xy-plane by TikZ/PGF

geogebragraphstikz-pgf

I want to draw the following picture by using TikZ:

Projection of R onto xy-plane

But I do not know how to hatch the projection, that is the two-dimensional domain: $\{(x,y,z} \mid z=0, x^2+y^2\leq 4\}$. And I do not know how to draw it fairly precisionly. Can anyone help me?

I've draw it by Geogebra, and then converted it into TikZ file. But when I compile it by PDFLaTeX, I could not get the desired result! I do not why it is like this:
geogebra-convert-tikz
Maybe someone can tell me why?

According to Lionel MANSUY's sugestion, I construct it as follows:

%compile it by pdflatex
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows,trees}
\usetikzlibrary{shapes,backgrounds,calc,intersections,patterns}

\begin{document}
\begin{tikzpicture}[scale=2]
\draw[very thin,gray,opacity=.3](-3,-3)grid (4,4);

\draw[pattern=north east lines,name path=bottom](0,0) ellipse (2 and .6); %draw the projection onto xy-plane, then hatch it by north east lines

\draw[fill=white,name path=ellipse](0,2) ellipse (2 and .5);%draw top disc

\draw[name path=line,dotted,thick,green](-2,2)--(2,2);

\fill[red,opacity=.5,name intersections={of=ellipse and line}]
(intersection-1) circle(1pt)node{.}
(intersection-2)circle(1pt)node{.};
\draw(intersection-1)node[right]{$D$};\draw(intersection-2)node[left]{$E$};
\filldraw[fill=white,name path=lateral](intersection-2)..controls (-1,0) and (-1/2,0)..(0,0)..controls(1/2,0) and (1,0)..(intersection-1);
\draw[fill=white](0,2) ellipse (2 and .5);
\draw[dotted,thick](-2,2)--(2,2);
\fill[blue,opacity=.5,name intersections={name=intersection-second,of=lateral and bottom}](intersection-second-1)circle(1pt)node{.} (intersection-second-2)circle(1pt)node{.};
\draw (intersection-second-1)node[left]{$A$}; 
\draw(intersection-second-2)node[right]{$B$};
\draw[->](2,0)--(3,0)node[below]{$y$};
\draw(-3,0)--(-2,0);
\draw[->](0,2)--(0,3)node[left]{$z$};
\path[name path=yy](0,0)--(-3,-3);
\draw[->,name intersections={name=intersection-third,of=bottom and yy}](intersection-third-1)node[anchor=north west]{$C$}--(-2,-2)node[right]{$x$};
\fill[blue,opacity=.5](intersection-third-1)circle(1pt)node{.};
\draw[dashed](-2,0)--(-2,2);
\path[name path=zz](0,1/2)--(0,3);
\draw[name intersections={name=yz,of=zz and ellipse}](yz-2)--(0,2);
\path[name path=lineup](0,2)--+(45:3);
\path[name path=linedown](0,2)--+(45:-1);
\draw[dotted,thick,name intersections={name=up,of=lineup and ellipse},name intersections={name=down,of=linedown and ellipse}](up-1)--(down-1);
\draw(0,2)node[red,above left]{\tiny$(0,2)$};
\fill[opacity=.5](0,2)circle(1pt)node{.};
\draw[->](1,1)--(1.8,1)node[right]{$\displaystyle z=\frac{x^2+y^2}{2}$};

\end{tikzpicture}
\end{document}

And the result picture is here:

my-result

Can we draw this picture fairly precisionly by using TikZ?

Best Answer

You could arrange the order of your drawings:

  1. Draw your hatched surface as an ellipse (circle with a x- and a y-radius)
  2. Draw the parabolic curve (filled with white)
  3. Draw the top area (filled with white)
  4. Draw your axis

Edit: I'm not sure, but I think that the major axis of the ellipse should not be horizontal, but be slightly inclined

Edit2: you should forget Geogebra code and draw your sketch directly with Tikz; you only have simple structure: lines, ellipse and parabol