我在这里读如何绘制椭圆?。如果椭圆的方程是x^2/25+y^2/144=1
,我试过
\documentclass[border=2]{standalone}
\usepackage{tikz}
\begin{document}
\newcommand{\boundellipse}[3]% center, xdim, ydim
{(#1) ellipse (#2 and #3)
}
\begin{tikzpicture}
\draw \boundellipse{0,0}{5}{12};
\end{tikzpicture}
\end{document}
我无法使用上述代码绘制具有四个顶点的椭圆\left (-\dfrac{52}{5},-\dfrac{39}{5}\right )
,,,。椭圆的半长为 12,半短为 5。\left (\dfrac{52}{5},\dfrac{39}{5}\right )
\left (-\dfrac{36}{5},\dfrac{48}{5}\right )
\left (\dfrac{36}{5},-\dfrac{48}{5}\right )
我怎样才能画出那个椭圆。
答案1
这是相当延伸的评论...
- 该网站致力于解决
tex
问题 - 我可以得出结论,你喜欢解决如何通过四个(任意)顶点绘制椭圆的问题。这是数学问题,并且是无关这里
说明我如何理解你的问题:
上图的 mwe:
\documentclass[border=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}
\usepackage{nccmath}
\begin{document}
\begin{tikzpicture}[scale=0.5,% for scaling coordinates of vertices
E/.style args = {#1/#2}{ellipse, draw,
minimum width=#1cm, % major length
minimum height=#2cm,% minor length
inner sep=0pt},
dot/.style = {circle, fill}
]
\node[E=24/10, rotate=0] {};
\node (a) [dot,
pin=225: {$\left(-\mfrac{52}{5},-\mfrac{39}{5}\right)$}] at (-52/5,-39/5) {};
\node (b) [dot,
pin= 45: {$\left( \mfrac{52}{5}, \mfrac{39}{5}\right)$}] at ( 52/5, 39/5) {};
\node (c) [dot,
pin=135: {$\left(-\mfrac{36}{5},-\mfrac{48}{5}\right)$}] at (-36/5, 48/5) {};
\node (d) [dot,
pin=315: {$\left( \mfrac{36}{5},-\mfrac{48}{5}\right)$}] at ( 36/5,-48/5) {};
%
\draw[red, dashed] (a) -- (d) -- (b) -- (c) -- (a);
% elipse 1
\node[E=24/10] {}; % <major length>/<minor length>
% elpise 2
\node[E=24/10, rotate=-9, dashed] {};
\end{tikzpicture}
\end{document}
当您正确确定了顶点坐标并计算出了椭圆旋转角度(如果需要)时,您会问,如何绘制这样的椭圆。如何绘制椭圆的基本思想如上面的 mwe 所示。