Geschlossene Einheitsbälle

Geschlossene Einheitsbälle

Ich habe etwas Vorbereitungscode verwendet und das Ergebnis ist wie folgt dargestellt. Was sollen wir tun, um die Kugeln auszufüllen? Bildbeschreibung hier eingeben

\documentclass[border=3mm]{standalone}
\usepackage{pgfplots}

% Unit circle plot style
\pgfplotsset{unit circle/.style={width=4cm,height=4cm,axis lines=middle,xtick=\empty,ytick=\empty,axis equal,enlargelimits,xmax=1,ymax=1,xmin=-1,ymin=-1,domain=0:pi/2}}

\begin{document}
    \begin{tikzpicture}
    \coordinate (prev); % Store previous plot position
    \foreach \p / \t in {2/1, 1/2, 0.0001/\infty} { % Loop through the plots to draw
        % \p is the exponent in the function to plot
        % \t is the p parameter to print
        \begin{axis}[at={(prev)},unit circle,anchor=west]
            \foreach \ss in {1,-1} {
            \foreach \cs in {1,-1} {
                \addplot[] ({\cs*(cos(deg(x)))^\p},{\ss*(sin(deg(x))^\p});
            }
            }
        \end{axis}
        \node[below=0.5cm, anchor=base] at (current axis.south) {$p=\t$}; % Print p
        \coordinate[right=0.5cm] (prev) at (current axis.east) ; % Set position for next plot
    }
    \end{tikzpicture}
\end{document}

Antwort1

Das Problem ist endlich gelöst. Ich habe nur eine Zeile geändert!

‎\addplot[fill=gray‎‎] ({\cs*(cos(deg(x)))^\p},{\ss*(sin(deg(x))^\p})‎\closedcycle‎;

Antwort2

Dies kann leicht mit tkz-euclide erreicht werden - unten finden Sie eine grobe Ähnlichkeit, die an die obige Anforderung angepasst werden kann

Bildbeschreibung hier eingeben

\documentclass{article} % or another class
\usepackage{xcolor} % before tikz or tkz-euclide if necessary

\usepackage{tkz-euclide} % no need to load TikZ
\usepackage{multirow}
\usetikzlibrary{babel} %if there are problems with the active characters
\begin{document}

\begin{tikzpicture}
    \foreach \d/\x/\y in {2/-2/0,3/1/0,4/5/0}{%
        \tkzDefPoint(\x,\y){K}
        \tkzDefShiftPoint[K](0:\d){M}
        \tkzDefSquare(K,M)\tkzGetPoints{N}{O}
        \tkzDrawPolygon[color=red,fill=green](K,M,N,O)
        \tkzLabelSegment[below](K,M){Square side=\d cm}
    }
    \end{tikzpicture}
\end{document}

BEARBEITEN

Bildbeschreibung hier eingeben

\documentclass{article} % or another class
\usepackage{xcolor} % before tikz or tkz-euclide if necessary

\usepackage{tkz-euclide} % no need to load TikZ
\usepackage{multirow}
\usetikzlibrary{babel} %if there are problems with the active characters
\begin{document}
\begin{tikzpicture}\hspace{-4cm}
\tkzInit[xmax=2,ymax=3,xmin=-2.5,ymin=-3]
\tkzDrawXY[label={}]
\tkzDefPoint(-2,-2){K}
\tkzDefShiftPoint[K](0:4){M}
\tkzDefSquare(K,M)\tkzGetPoints{N}{O}
\tkzDrawPolygon[color=red,fill=green](K,M,N,O)
%\tkzLabelSegment[below, yshift=-1.5cm](K,M){p=1}
\end{tikzpicture}
\begin{tikzpicture}\hspace{-3cm}
\tkzInit[xmax=2.5,ymax=3,xmin=-3,ymin=-3]
\tkzDrawXY[label={}]
\tkzDefPoint(0,-(sqrt(18))/2){K}
\tkzDefShiftPoint[K](45:3){M}
\tkzDefSquare(K,M)\tkzGetPoints{N}{O}
\tkzDrawPolygon[color=red,fill=green](K,M,N,O)
%\tkzLabelPoint[below, yshift=0cm](K){p=2}
\end{tikzpicture} \hspace{-2cm}
\begin{tikzpicture}
\tkzInit[xmax=2.5,ymax=3,xmin=-2.5,ymin=-3]
\tkzDrawXY[label={}]
\tkzDefPoint(0,0){K}
\tkzDefShiftPoint[K](0:2){M}
\tkzDrawCircle[color=red,fill=green](K,M)
%\tkzLabelPoint[below, yshift=-2cm](K){p=}

\end{tikzpicture}
\end{document}

verwandte Informationen