I know this question has already been asked a couple times in a similar way to mine. However, I can't figure out, what I am doing wrong. I want to color this quadrilateral.
\begin{tikzpicture}
\draw (3,-.5) to [<-, bend right=10] (1.5,0) node[left]{};
\draw (2,-1) to [<-, bend left=10] (.5,-.8) node[left]{};
\draw[dashed] (2,-1) -- (3,-.5) node[left] {};
\draw (.5,-.8) to (1.5,0) node[left]{};
\end{tikzpicture}
You might have to include some of the following in order to compile it.
\usepackage{tikz}
\usepackage{tkz-euclide}
\usetkzobj{all}
\usepackage{verbatim}
\usetikzlibrary{intersections}
\usepackage{pgfplots}
\usepgfplotslibrary{fillbetween}
\usetikzlibrary{backgrounds}
I found a site which used this code to color a triangle.
\def\KurveI{(3,-.5) to (1.5,0)}
\def\KurveII{(.5,-.8) to (1.5,0)}
\def\KurveIII
{(.5,-.8) to (3,-.5)}
\draw \KurveI \KurveII \KurveIII
(current path bounding box.south west)coordinate(UL)
(current path bounding box.north east)coordinate(OR);
\begin{scope}[on background layer]
\clip (UL)--\KurveI--(UL-|OR)--cycle;% Fläche unterhalb der 1.Kurve
\clip (UL-|OR)--\KurveII--(OR)--cycle;% Fläche rechts von 2.Kurve
\clip (UL|-OR)--\KurveIII--(OR)--cycle;% Fläche oberhalb von 3.Kurve
\fill[yellow!50](UL)rectangle(OR);% Füllen der Schnittfläche
\end{scope}
However, when I copy it, it only colors part of my triangle. Is there a site, where it is explained how to color surfaces with tikz? Or what am I doing wrong?
Here is some Code that should compile.
\documentclass[12pt]{article}
\usepackage[ngerman]{babel}
\usepackage{tikz}
\usetikzlibrary{intersections}
\usepackage{pgfplots}
\usepgfplotslibrary{fillbetween}
\usetikzlibrary{backgrounds}
\begin{document}
\begin{tikzpicture}
\draw (3,-.5) to [<-, bend right=10] (1.5,0);
\draw (2,-1) to [<-, bend left=10] (.5,-.8);
\draw[dashed] (2,-1) -- (3,-.5) ;
\draw (.5,-.8) to (1.5,0);
\end{tikzpicture}
\begin{tikzpicture}
\def\KurveI{(3,-.5) to (1.5,0)}
\def\KurveII{(.5,-.8) to (1.5,0)}
\def\KurveIII
{(.5,-.8) to (3,-.5)}
\draw \KurveI \KurveII \KurveIII
(current path bounding box.south west)coordinate(UL)
(current path bounding box.north east)coordinate(OR);
\begin{scope}[on background layer]
\clip (UL)--\KurveI--(UL-|OR)--cycle;
\clip (UL-|OR)--\KurveII--(OR)--cycle;
\clip (UL|-OR)--\KurveIII--(OR)--cycle;
\fill[yellow!50](UL)rectangle(OR);
\end{scope}
\end{tikzpicture}
\end{document}
tikz
has manual, where are described all aspect of its use in detail.node[left]{}
statements?node[left]{}
statements are not important here, I will use them later for adding formulas.