SmtC: Show me the Code
Ole Peter Smith
Instituto de Matemática e Estatística
Universidade Federal de Goiás
http://www.olesmith.com.br

TikZ (Palestra)
A seriedade dos acontecimentos da minha época.
Me enche de esperança.
Karl Marx
< Plotting | Filling | Clipping >

Filling & Opacity

TiKZ Listing: Fig.tikz.tex. PDF   PNG   SVG   ZIP*  
\tikzmath{\xr=8;};
\tikzmath{\yt=4.5;};
\tikzmath{\xl=-0.1;};
\tikzmath{\yb=-0.1;};


\clip (\xl,\yb) rectangle (\xr,\yt);
\draw [>=stealth,->] (\xl,0) -- (\xr,0) node [right] {$x$};
\draw [>=stealth,->] (0,\yb) -- (0,\yt) node [above] {$y$};

\tikzmath{\a=1;};
\tikzmath{\b=3.5;};
\tikzmath{\Alpha=1;};
\tikzmath{\Beta=4;};

\tikzmath{\YB=0.2;};
\tikzmath{\YT=8;};

\draw [color=blue,name path=a,samples=200,domain=\YB:\YT] plot ({\a/\x}, {\x});
\draw [color=blue,name path=b,samples=200,domain=\YB:\YT] plot ({\b/\x}, {\x});

\draw [color=orange,name path=alpha,samples=200,domain=\YB:\YT] plot ({\Alpha/(\x*\x*\x)}, {\x});
\draw [color=orange,name path=beta, samples=200,domain=\YB:\YT] plot ({\Beta/(\x*\x*\x)},  {\x});

\tikzfillbetween[of=a and b]{blue, opacity=0.1};
\tikzfillbetween[of=alpha and beta]{blue, opacity=0.1};

\foreach \t in {\a,\b} {
  \tikzmath{\y=sqrt(\Alpha/\t);};
  \tikzmath{\x=sqrt(\t*\t*\t/\Alpha);};
  \filldraw (\x,\y) circle(1pt);
}
\foreach \t in {\a,\b} {
  \tikzmath{\y=sqrt(\Beta/\t);};
  \tikzmath{\x=sqrt(\t*\t*\t/\Beta);};
  \filldraw (\x,\y) circle(1pt);
}


%Calculate area
\tikzmath{\A=\b-\a;};
\tikzmath{\A=\A*ln(\Beta/\Alpha);};
\tikzmath{\A=0.5*\A;};

\coordinate (P1) at (4,3);
\coordinate (P2) at (4+\A,4);

\draw [draw=black,fill=blue, opacity=0.1] (P1) rectangle (P2);
\draw [draw=black,fill=blue, opacity=0.1] (P1) rectangle (P2);
\draw [draw=black] (P1) rectangle (P2) node[color=black,pos=.5] {A};
< Plotting | Filling | Clipping >
Messages:
0 secs.