我試圖找到一種通用方法來自動找到這張圖片的A
點。B
我不明白。我必須用手計算。
\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{fouriernc}
\usepackage{tikz}
\usepackage{tkz-euclide}
\usetkzobj{all}
\usepackage{tikz-3dplot}
\usetikzlibrary{calc,backgrounds}
\begin{document}
\tdplotsetmaincoords{60}{110}
\begin{tikzpicture}
[scale=1,tdplot_main_coords]
\path
coordinate (O) at (0,0,0)
coordinate (T) at (0,0,3)
coordinate (B) at (3,{-sqrt(7)},0)
coordinate (A) at (0,4,0);
\draw[thick, dashed] (O) -- (A) node[midway,sloped,below] {$r$};
\draw[thick, dashed] (T) -- (A) node[midway,right] {$R$};
\draw[thick, dashed] (T) -- (O) node[midway,left] {$d$};
\foreach \v/\position in {T/above,O/below,A/below,B/below} {
\draw[draw =black, fill=black] (\v) circle (1.2pt) node [\position=0.2mm] {$\v$};
}
\begin{scope}[tdplot_screen_coords, on background layer]
\pgfmathsetmacro{\R}{5}%
\pgfmathsetmacro{\r}{4}%
\fill[ball color=cyan!50, opacity=1.0] (T) circle (\R);
\end{scope}
\tkzMarkRightAngle[size = 0.3](T,O,A);
\draw [thick] (B) arc (318.5:450:4);
\draw [thick, dashed] (A) arc (90:318.5:4);
\end{tikzpicture}
\end{document}
有沒有辦法自動找到A
點B
?
答案1
據我所知,第一篇研究區分前側和後側延伸的臨界值的文章是這。 (對於所有有興趣的人:這就是我所說的「給予信用」。儘管下面將使用不同的公式和宏,但對我來說很高興看到一篇文章,其中解釋了推導過程,我可以用它來比較我的結果。這些事情都完成了tikz-3dplot
。tikz-3dplot
這個答案。有了這些,你就可以換飛機xy
,你需要說的是
\draw[thick] ({alpha1(\tdplotmaintheta,\tdplotmainphi,{atan(4/5)})}:4)
coordinate (A)
arc({alpha1(\tdplotmaintheta,\tdplotmainphi,{atan(4/5)})}:
{alpha2(\tdplotmaintheta,\tdplotmainphi,{atan(4/5)})}:4) coordinate(B);
這裡,alpha1
和是決定路徑從前到後的過渡位置的alpha2
臨界值,從而在分析上固定和的位置。phi
A
B
\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{fouriernc}
\usepackage{tikz-3dplot}
\usetikzlibrary{backgrounds}
\begin{document}
\tdplotsetmaincoords{60}{110}
\begin{tikzpicture}[scale=1,tdplot_main_coords,declare function={R=5;
alpha1(\th,\ph,\b)=\ph-asin(cot(\th)*tan(\b));%
alpha2(\th,\ph,\b)=-180+\ph+asin(cot(\th)*tan(\b));%
beta1(\th,\ph,\a)=90+atan(cot(\th)/sin(\a-\ph));%
beta2(\th,\ph,\a)=270+atan(cot(\th)/sin(\a-\ph));%
}]
\path
coordinate (O) at (0,0,0)
coordinate (T) at (0,0,3);
\begin{scope}[tdplot_screen_coords, on background layer]
\fill[ball color=cyan!50, opacity=1.0] (T) circle (R);
\end{scope}
\begin{scope}[canvas is xy plane at z={3-sqrt(5^2-4^2)}]
\draw[thick,dashed] circle[radius=4cm];
\draw[thick] ({alpha1(\tdplotmaintheta,\tdplotmainphi,{atan(4/5)})}:4)
coordinate (A)
arc({alpha1(\tdplotmaintheta,\tdplotmainphi,{atan(4/5)})}:
{alpha2(\tdplotmaintheta,\tdplotmainphi,{atan(4/5)})}:4) coordinate(B);
\end{scope}
\begin{scope}[on background layer]
\draw[thick, dashed] (O) -- (A) node[midway,sloped,below] {$r$};
\draw[thick, dashed] (T) -- (A) node[midway,right] {$R$};
\draw[thick, dashed] (T) -- (O) node[midway,left] {$d$};
\foreach \v/\position in {T/above,O/below,A/below,B/below} {
\draw[draw =black, fill=black] (\v) circle (1.2pt) node [\position=0.2mm] {$\v$};
}
\end{scope}
\end{tikzpicture}
\end{document}
如果您非常仔細地將其與輸出進行比較,那麼您會發現 的位置有微小差異A
。這可能是數字問題,或是使用過程中出現了錯誤。