Hi again, im with this problem. Trying to color the region inside the area formed by 4 equation. But there is some places inside that the color doesnt go, as you can see in the picture. Also some little segments wheere the color goes and it shouldnt as you can see in the upper part of the region...
This is the code:
"\begin{tikzpicture}
\begin{axis}[
axis lines=middle,
xlabel=$x$,
ylabel=$y$,
samples=100,
domain=-1.5:3,
ymin=-0.5, ymax=2.5,
xmin=-2, xmax=3.5,
axis equal
]
% Preenchimento da região sombreada
\addplot [
domain=-1.5:3,
fill=gray,
opacity=0.3
]
({x}, {sqrt(1/2 - x/3)}) -- % Arco inferior da parábola
(1.5,2) -- % Ponto final da semicircunferência
({1.5 + sqrt(1 - (0)^2)}, {1+0}) -- % Arco da semicircunferência
(-1.5,2) -- % Segmento de reta superior
cycle; % Fecha o ciclo
% Arco da parábola (1)
\addplot [
domain=-1.5:3,
thick,
purple
]
{sqrt(1/2 - x/3)};
% Arco da parábola (2)
\addplot [
domain=-1.5:1.515,
thick,
purple
]
{2/9*x^2 + 3/2};
% Semi-circunferência rotacionada 90 graus para a direita
\addplot [
domain=-1:1, % Ajuste o domínio conforme necessário
thick,
purple
]
({1.5 + sqrt(1 - (x)^2)}, {x+1});
% Segmento de reta (4)
\draw[thick, purple] (-1.5,1) -- (-1.5,2);
\node at (axis cs: -1.5,1.75) [purple, anchor=east] {(4)};
\node at (axis cs: 0.25,1.95) [purple, anchor=north] {(2)};
\node at (axis cs: 0.55,0.55) [purple, anchor=north] {(1)};
\node at (axis cs: 2.5,1.5) [purple, anchor=west] {(3)};
\end{axis}
\end{tikzpicture}"
The first picture is how is coding and the second is how it should be
reaction for more information.
