Latex 图形中的 Tikz 问题

Latex 图形中的 Tikz 问题

在下图中,我想知道为什么图中的右侧部分不连续,请参见代码和附图。

\documentclass[11pt]{scrartcl}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{float}
\usepackage{tikz}
\usetikzlibrary{patterns}

\begin{document}
\begin{figure}[H]
\centering
\begin{tikzpicture}[domain=-3:15, range=-3:15, scale=0.7, thick, font=\small]
\node [below, color=orange] at (12, 0) {$12$};
\node [left, color=orange] at (0, 12) {$12$};
\node [below, color=orange] at ({34/7}, 0) {$\frac{34}{7}$};
\node [left, color=orange] at (0, {50/7}) {$\frac{50}{7}$};
\draw [white, domain={0}:{12}, pattern=north east lines, variable=\x] (0, 13) -- (0, 12) -- plot ({\x}, {12 - \x}) -- (12, 0) -- (13, 0) -- (13, 13) -- cycle;
\draw [ultra thick, color=orange, domain={0}:{12}] plot (\x, {12 - \x});
\def\r{25};
\draw [thick, color=cyan, samples = 1000, domain={4 - sqrt((70-\r)/5)}:{4 + sqrt((70-\r)/5)}] plot (\x, {5 + sqrt(0.5*(70 -\r - 5*(\x-4)^2))});
\draw [thick, color=cyan, samples = 1000, domain={4 - sqrt((70-\r)/5)}:{4 + sqrt((70-\r)/5)}] plot (\x, {5- sqrt(0.5*(70 -\r - 5*(\x-4)^2))});
\def\r{50};
\draw [thick, color=cyan, samples = 1000, domain={4 - sqrt((70-\r)/5)}:{4 + sqrt((70-\r)/5)}] plot (\x, {5 + sqrt(0.5*(70 -\r - 5*(\x-4)^2))});
\draw [thick, color=cyan, samples = 1000, domain={4 - sqrt((70-\r)/5)}:{4 + sqrt((70-\r)/5)}] plot (\x, {5- sqrt(0.5*(70 -\r - 5*(\x-4)^2))});
\def\r{400/7};
\draw [very thick, color=cyan, samples = 1000, smooth, domain={4 - sqrt((70-\r)/5)}:{4 + sqrt(14-\r/5)}] plot (\x, {5 + sqrt(0.5*(70 -\r - 5*(\x-4)^2))});
\draw [very thick, color=cyan, samples = 1000, smooth, domain={4 - sqrt((70-\r)/5)}:{4 + sqrt(14-\r/5)}] plot (\x, {5- sqrt(0.5*(70 -\r - 5*(\x-4)^2))});
\draw[->] (-.5, 0) -- (14, 0) node [right] {$q_1$};
\draw[->] (0, -.5) -- (0, 14) node [above] {$q_2$};
\draw[dotted, color = orange] ({34/7}, 0) -- ({34/7}, {50/7});
\draw[dotted, color = orange] (0, {50/7}) -- ({34/7}, {50/7});
\fill [white] (8, 9) rectangle (11, 10);
\node [color=cyan] at (9.5, 9.5) {$q_1 + q_2 \ge 12$};
\fill [orange] ({34/7}, {50/7}) circle[radius=4pt];
\end{tikzpicture}
\label{draw2}
\end{figure}
\end{document}

如下图所示。 参见椭圆的右点

答案1

这不是一个真正的答案,但你可以做这样的事情:

\documentclass {scrartcl}
\usepackage    {tikz}
\usetikzlibrary{patterns}

\begin{document}
\begin{tikzpicture}[scale=0.7, thick, font=\small]
\node [below, orange] at (12, 0) {$12$};
\node [left,  orange] at (0, 12) {$12$};
\node [below, orange] at ({34/7}, 0) {$\frac{34}{7}$};
\node [left,  orange] at (0, {50/7}) {$\frac{50}{7}$};
\fill [pattern=north east lines]  (0, 12) -- (12, 0) -- (13, 0) |- (0, 13) -- cycle;
\draw [ultra thick, color=orange] (0, 12) -- (12, 0);
\foreach\r in{25,50}
{
  \pgfmathsetmacro\b{sqrt((70-\r)/2)}
  \pgfmathsetmacro\a{sqrt((70-\r)/5)}
  \draw[thick,cyan] (4,5) ellipse (\a cm and \b cm);
}
\def\r{400/7};
\pgfmathsetmacro\b{sqrt((70-\r)/2)}
\pgfmathsetmacro\a{sqrt((70-\r)/5)}
\draw[very thick,cyan] (4,5) ellipse (\a cm and \b cm);
\draw[->] (-0.5, 0) -- (14, 0) node [right] {$q_1$};
\draw[->] (0, -0.5) -- (0, 14) node [above] {$q_2$};
\draw[dotted, color = orange] ({34/7}, 0) |- (0, {50/7});
\node [cyan,fill=white] at (9.5, 9.5) {$q_1 + q_2 \ge 12$};
\fill [orange] ({34/7}, {50/7}) circle (4pt);
\end{tikzpicture}
\end{document}

相关内容