如何绘制椭圆轨道

如何绘制椭圆轨道

在此处输入图片描述

我如何制作这样的图表?

在此处输入图片描述

答案1

欢迎来到 TeX.SE!!

例如(我没有使用您的代码,因为我无法复制粘贴):

\documentclass[tikz,border=1.618mm]{standalone}

\begin{document}
\begin{tikzpicture}
% coordinates
\coordinate (P1) at (-4,0);
\coordinate (P2) at  (4,0);
\coordinate (P3) at  (0,2);
\coordinate (F)  at ({-sqrt(12)},0); % focus
% ellipse
\draw (0,0) ellipse (4cm and 2cm);
% points
\foreach\i in {1,2,3}
  \path[fill] (0,0) -- (P\i) circle (1pt) node[pos=1.1] {$P_\i$};
% dashed lines
\draw[dashed] (P1) -- (P2) (F) -- (P3);
% focus
\fill[gray] (F) circle (2pt);
\end{tikzpicture}
\end{document}

在此处输入图片描述

答案2

使用 Mathcha 完成的绘图。

\documentclass[a4paper,12pt]{article}
\usepackage{tikz}

\begin{document}


\tikzset{every picture/.style={line width=0.75pt}} %set default line width to 0.75pt        

\begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-1,xscale=1]
%uncomment if require: \path (0,360); %set diagram left start at 0, and has height of 360

%Shape: Ellipse [id:dp15785165904467924] 
\draw   (140,188.86) .. controls (140,130.95) and (222.16,84) .. (323.5,84) .. controls (424.84,84) and (507,130.95) .. (507,188.86) .. controls (507,246.77) and (424.84,293.71) .. (323.5,293.71) .. controls (222.16,293.71) and (140,246.77) .. (140,188.86) -- cycle ;
%Straight Lines [id:da5183197559567378] 
\draw  [dash pattern={on 4.5pt off 4.5pt}]  (140,188.86) -- (507,188.86) ;
%Shape: Circle [id:dp5897705856293303] 
\draw  [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ,fill opacity=1 ] (137,188.86) .. controls (137,186.92) and (138.57,185.36) .. (140.5,185.36) .. controls (142.43,185.36) and (144,186.92) .. (144,188.86) .. controls (144,190.79) and (142.43,192.36) .. (140.5,192.36) .. controls (138.57,192.36) and (137,190.79) .. (137,188.86) -- cycle ;
%Shape: Circle [id:dp498742723813576] 
\draw  [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ,fill opacity=1 ] (504,187.86) .. controls (504,185.92) and (505.57,184.36) .. (507.5,184.36) .. controls (509.43,184.36) and (511,185.92) .. (511,187.86) .. controls (511,189.79) and (509.43,191.36) .. (507.5,191.36) .. controls (505.57,191.36) and (504,189.79) .. (504,187.86) -- cycle ;
%Straight Lines [id:da9921658470559045] 
\draw  [dash pattern={on 4.5pt off 4.5pt}]  (264,90) -- (214,188.36) ;
%Shape: Circle [id:dp36918987721612306] 
\draw  [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ,fill opacity=1 ] (260,90.86) .. controls (260,88.92) and (261.57,87.36) .. (263.5,87.36) .. controls (265.43,87.36) and (267,88.92) .. (267,90.86) .. controls (267,92.79) and (265.43,94.36) .. (263.5,94.36) .. controls (261.57,94.36) and (260,92.79) .. (260,90.86) -- cycle ;
%Shape: Circle [id:dp5320092251619593] 
\draw  [draw opacity=0][fill={rgb, 255:red, 155; green, 155; blue, 155 }  ,fill opacity=1 ] (209,188.36) .. controls (209,185.6) and (211.24,183.36) .. (214,183.36) .. controls (216.76,183.36) and (219,185.6) .. (219,188.36) .. controls (219,191.12) and (216.76,193.36) .. (214,193.36) .. controls (211.24,193.36) and (209,191.12) .. (209,188.36) -- cycle ;

% Text Node
\draw (115,178.4) node [anchor=north west][inner sep=0.75pt]    {$P_{1}$};
% Text Node
\draw (516,179.4) node [anchor=north west][inner sep=0.75pt]    {$P_{2}$};
% Text Node
\draw (256,63.4) node [anchor=north west][inner sep=0.75pt]    {$P_{3}$};


\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容