我想画这个图形,其中两个圆与一个半圆相切,如下图所示:
我可以部分绘制:
\documentclass[12pt]{article}
\usepackage{tikz}
\begin{document}
\begin{center}
\begin{tikzpicture}[scale=0.3]
\draw [ultra thick] (0,0) arc (0:180:6);
\draw [ultra thick] (-12,0)--(0,0);
\node at (-6,0) {$\bullet$};
\node at (-12,0) {$\bullet$};
\node at (0,0) {$\bullet$};
\end{tikzpicture}
\end{center}
\end{document}
答案1
\documentclass[12pt]{article}
\usepackage{tikz}
\begin{document}
\begin{center}
\begin{tikzpicture}[scale=0.3,declare
function={R=6;a=1;},bullet/.style={circle,fill,inner sep=1.5pt}]
\draw [ultra thick] (R,0) arc (0:180:R) -- cycle;
\pgfmathsetmacro{\myalpha}{asin(a/(R-a))}
\draw[blue] ({(a-R)*cos(\myalpha)},a) node[bullet] (L){} circle[radius=a]
({(R-a)*cos(\myalpha)},a) node[bullet] (R){} circle[radius=a];
\draw[dashed] (L) -- (R);
\path (-R,0) node[bullet]{} (-R,0) node[bullet]{} (0,0) node[bullet]{}
(180-\myalpha:R) node[bullet]{} (\myalpha:R) node[bullet]{};
\end{tikzpicture}
\end{center}
\end{document}
这是一个可能的推导。
\documentclass[12pt,fleqn]{article}
\usepackage{tikz}
\begin{document}
Call the large radius $R$ and the small radius $a$. The condition that the
circles ``touch'' means that the slopes of the circles at the touching point
coincide. This implies that the circles touch at points with coinciding polar
angle $\alpha$ (see figure~\ref{fig:Computation}). Therefore,
\[ a+a\,\sin\alpha~=~R\,\sin\alpha\]
and thus
\[ \alpha~=~\arcsin\frac{a}{R-a}\;.\]
This means that the centers of the circles are at
$(\pm(R-a)\cos\alpha,a)=(\pm\sqrt{R\,(R-2 a)},a)$.
\begin{figure}[!h]
\centering
\begin{tikzpicture}[scale=0.8,declare function={R=6;a=1;}]
\draw [ultra thick] (R,0) arc (0:180:R) -- cycle;
\node at (-R,0) {$\bullet$};
\node at (R,0) {$\bullet$};
\node at (0,0) {$\bullet$};
\pgfmathsetmacro{\myalpha}{asin(a/(R-a))}
\draw[red] (0,0) -- (180-\myalpha:R)
(-2,0) arc(180:180-\myalpha:2) node[midway,left]{$\alpha$};
\draw[red] ({(a-R)*cos(\myalpha)-2},a) -- ({(a-R)*cos(\myalpha)},a)
-- ++ (180-\myalpha:2)
({(a-R)*cos(\myalpha)-2},a) arc(180:180-\myalpha:2) node[midway,left]{$\alpha$};
\draw ({(a-R)*cos(\myalpha)},a) -- ({(a-R)*cos(\myalpha)},0)
node[midway,fill=white]{$a$};
\draw (0,0) -- (40:R) node[midway,fill=white]{$R$};
\draw[blue] ({(a-R)*cos(\myalpha)},a) circle[radius=a]
({(R-a)*cos(\myalpha)},a) circle[radius=a];
\end{tikzpicture}
\caption{Computation of the center of the circle.}
\label{fig:Computation}
\end{figure}
\end{document}
当然,你可以改变a
。
\documentclass[tikz,border=3mm]{standalone}
\begin{document}
\foreach \X in {1,1.1,...,3,2.9,2.8,...,1.1}
{\begin{tikzpicture}[declare function={R=6;a=\X;},bullet/.style={circle,fill,inner sep=1.5pt}]
\path[use as bounding box] (-R-0.2,-0.2) rectangle (R+0.2,R+0.2);
\draw [ultra thick] (R,0) arc (0:180:R) -- cycle;
\pgfmathsetmacro{\myalpha}{asin(a/(R-a))}
\draw[blue] ({(a-R)*cos(\myalpha)},a) node[bullet] (L){} circle[radius=a]
({(R-a)*cos(\myalpha)},a) node[bullet] (R){} circle[radius=a];
\draw[dashed] (L) -- (R);
\path (-R,0) node[bullet]{} (-R,0) node[bullet]{} (0,0) node[bullet]{}
(180-\myalpha:R) node[bullet]{} (\myalpha:R) node[bullet]{};
\end{tikzpicture}}
\end{document}