5 个椭圆的交点

5 个椭圆的交点

我想用相同的颜色(例如黑色)填充 5 个椭圆的交点。两个椭圆效果很好。但如果有第三个或更多个椭圆,我不知道如何“保存”第一个交点。问题在于颜色的叠加。

代码如下:

\begin{tikzpicture}

\def\firstellip{(0, 1.6) ellipse [x radius=4cm, y radius=1.5cm, rotate=90]} \\
\def\secondellip{(2.9, -0.25) ellipse [x radius=4cm, y radius=1.5cm, rotate=29]} 
\def\thirdellip{(2, -3.5) ellipse [x radius=4cm, y radius=1.5cm, rotate=-57]} 
\def\fourthellip{(-2,-3.5) ellipse [x radius=4cm, y radius=1.5cm, rotate=57]}
\def\fifthellip{(-2.9,-0.25) ellipse [x radius=4cm, y radius=1.5cm, rotate=-29]}

\scope

\fill[red] \firstellip;
\fill[blue] \secondellip;
%\fill[fill=red, even odd rule] \firstellip \secondellip;
\fill[green] \thirdellip;
%\fill[fill=green, even odd rule] \thirdellip \secondellip;
\fill[yellow] \fourthellip;
%\fill[fill=blue, even odd rule] \firstellip \thirdellip \secondellip \fourthellip;
\fill[orange] \fifthellip;

\endscope

\draw \firstellip node [label={[xshift=0cm, yshift=4cm]$A$}] {};
\draw \secondellip node [label={[xshift=3cm, yshift=2.5cm]$B$}] {};
\draw \thirdellip node [label={[xshift=3cm, yshift=-4.5cm]$C$}] {};
\draw \fourthellip node [label={[xshift=-3cm, yshift=-4.5cm]$D$}] {};
\draw \fifthellip node [label={[xshift=-3cm, yshift=2.5cm]$E$}] {};

\end{tikzpicture}

目前情况如下:

答案1

在此处输入图片描述

或者

在此处输入图片描述

\documentclass[border=3pt]{standalone}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}

\def\firstellip{(0, 1.6) ellipse [x radius=4cm, y radius=1.5cm, rotate=90]} \\
\def\secondellip{(2.9, -0.25) ellipse [x radius=4cm, y radius=1.5cm, rotate=29]} 
\def\thirdellip{(2, -3.5) ellipse [x radius=4cm, y radius=1.5cm, rotate=-57]} 
\def\fourthellip{(-2,-3.5) ellipse [x radius=4cm, y radius=1.5cm, rotate=57]}
\def\fifthellip{(-2.9,-0.25) ellipse [x radius=4cm, y radius=1.5cm, rotate=-29]}

\scope

\fill[red] \firstellip;
\fill[blue] \secondellip;
%\fill[fill=red, even odd rule] \firstellip \secondellip;
\fill[green] \thirdellip;
%\fill[fill=green, even odd rule] \thirdellip \secondellip;
\fill[yellow] \fourthellip;
%\fill[fill=blue, even odd rule] \firstellip \thirdellip \secondellip \fourthellip;
\fill[orange] \fifthellip;

\endscope

\draw \firstellip node [label={[xshift=0cm, yshift=4cm]$A$}] {};
\draw \secondellip node [label={[xshift=3cm, yshift=2.5cm]$B$}] {};
\draw \thirdellip node [label={[xshift=3cm, yshift=-4.5cm]$C$}] {};
\draw \fourthellip node [label={[xshift=-3cm, yshift=-4.5cm]$D$}] {};
\draw \fifthellip node [label={[xshift=-3cm, yshift=2.5cm]$E$}] {};

\begin{scope}
\clip \firstellip ;
\clip \secondellip ;
\clip \thirdellip ;
\clip \fourthellip ;
\clip \fifthellip ;

\fill[black] (-2,-3.5) rectangle (2,.5) ;
\end{scope}

\end{tikzpicture}

\end{document}

或者

\documentclass[border=3pt]{standalone}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}

\def\first{%
(0, 1.6) ellipse [x radius=4cm, y radius=1.5cm, rotate=90]} \\

\def\second{%
(2.9, -0.25) ellipse [x radius=4cm, y radius=1.5cm, rotate=29]} 

\def\third{%
(2, -3.5) ellipse [x radius=4cm, y radius=1.5cm, rotate=-57]} 

\def\fourth{%
(-2,-3.5) ellipse [x radius=4cm, y radius=1.5cm, rotate=57]}

\def\fifth{%
(-2.9,-0.25) ellipse [x radius=4cm, y radius=1.5cm, rotate=-29]}

\draw[fill=red] \first node [label={[xshift=0cm, yshift=4cm]$A$}] {};
\draw[fill=blue] \second node [label={[xshift=3cm, yshift=2.5cm]$B$}] {};
\draw[fill=green] \third node [label={[xshift=3cm, yshift=-4.5cm]$C$}] {};
\draw[fill=yellow] \fourth node [label={[xshift=-3cm, yshift=-4.5cm]$D$}] {};
\draw[fill=violet] \fifth node [label={[xshift=-3cm, yshift=2.5cm]$E$}] {};

\begin{scope}[fill=black]
\clip \first ;
\fill \second ;
\fill \third ;
\fill \fourth ;
\fill \fifth ;
\end{scope}

\begin{scope}[fill=black]
\clip \second ;
\fill \first ;
\fill \third ;
\fill \fourth ;
\fill \fifth ;
\end{scope}

\begin{scope}[fill=black]
\clip \third ;
\fill \first ;
\fill \second ;
\fill \fourth ;
\fill \fifth ;
\end{scope}

\begin{scope}[fill=black]
\clip \fourth ;
\fill \first ;
\fill \third ;
\fill \second ;
\fill \fifth ;
\end{scope}

\end{tikzpicture}

\end{document}

相关内容