
Ich habe einige Skalierungsprobleme beim Zeichnen von Diagrammen mit TIKZ. Ich habe eine konvexe Hülle. Ich möchte eine Parabel zeichnen, die durch die ersten beiden von Null verschiedenen Eckpunkte der konvexen Hülle (a bzw. b) verläuft. Ich habe die Koeffizienten so berechnet, dass die Parabel durch die ersten beiden von Null verschiedenen Eckpunkte der konvexen Hülle verläuft. Obwohl ich den Maßstab vereinheitlicht habe, kann ich nicht das gewünschte Ergebnis erzielen. Hier ist MWE
\documentclass[crop,tikz]{standalone}
\begin{document}
\begin{tikzpicture}[scale=.35]
\draw[draw=none,scale=5](0,0)--(-1.1730,0.9848)--(-1.5,0.8660)--(-1.7660,0.6428)--(-1.9397,0.3420)--(-1.9397,-0.3420)--(-1.7660,-0.6428)--(-1.5,-0.8660)--(-1.1730,-0.9848)--(0,0)--cycle;
\draw[thick,scale=5,color=black] (0,0)--(-1.1730,0.9848)--(-1.5,0.8660)--(-1.7660,0.6428)--(-1.9397,0.3420);
\draw[thick,scale=5] (-1.9397,-0.3420)--(-1.7660,-0.6428)--(-1.5,-0.8660)--(-1.1730,-0.9848)--(0,0);
\draw[scale=5, domain=-2:2, smooth, variable=\y, red] plot ({1.48720*\y*\y+2.615340}, {\y});
\node[] at (0.75,0.75) {$0$};
\node[] at (-5.75,5.5) {$a$};
\node[] at (-7.5,5.0) {$b$};
\draw[thick,->,,>=stealth] (-11.5,0)--(2,0) node[right]{$X$};
\draw[thick,->,,>=stealth] (0,-8)--(0,8) node[above]{$Y$};
\end{tikzpicture}
\end{document}
Antwort1
Ich versuche deine Bilder nachzubilden:
\documentclass[margin=3mm, tikz]{standalone}
\begin{document}
\begin{tikzpicture}[
T/.style = {font=\scriptsize, fill=white, inner sep=1pt},% ticks
dot/.style = {circle, fill, inner sep=1pt},
scale = 2]
% axis
\draw[thick,-stealth] (-3,0) -- (2,0) node[right] {$X$};
\draw[thick,-stealth] (0,-2) -- (0,2) node[above]{$Y$};
\foreach \i in {-2.5,-2,...,1.5}
\draw (\i,1mm) -- ++ (0,-2mm) node[T, below] {\i};
\foreach \i in {-1.5,-1,-0.5,0.5,1,1.5}
\draw (1mm,\i) -- ++ (-2mm,0) node[T, left] {\i};
% rotated parabola
\draw[domain=0:1.2, variable=\y,
red, very thick] (-3,0) -- plot (3*\y*\y-2.5, \y);%- 1.00456
% a and b points on parabola
\node (a) [dot,label=$a$] at (3*0.5*0.5-2.5,0.5) {};
\node (b) [dot,label=$b$] at (3*0.6*0.6-2.5,0.6) {};
% line
\draw (a) -- ++ (-0.4,-0.3) node[dot] {}
-- ++ (0,-1.2) node[dot] {}
-- ++ (0.4,-0.2) node[dot] {}
-- ++ (0.5,-0.1) node[dot] {}
-- (0,0) node[dot] {}
-- (b);
\end{tikzpicture}
\end{document}