![忽略 `\coordinate` 命令](https://linux22.com/image/394355/%E5%BF%BD%E7%95%A5%20%60%5Ccoordinate%60%20%E5%91%BD%E4%BB%A4.png)
$\triangle[ABC]$ 是一个 30-60 直角三角形,其直角位于C
。A
位于原点。其中内接一个圆;其中心位于
O = (2*sqrt(3)*(sqrt(3) - 1), 2*(sqrt(3) - 1))
其半径为12(sqrt(3) - 1)
。腿AC
是短腿。过它的直线方程为y = sqrt(3)*x
。垂直于的直线AC
有斜率,过斜率的-sqrt(3)/3
直线为 。O
-sqrt(3)/3
y = (-sqrt(3)/3)*(x - 2*(sqrt(3))*(sqrt(3)-1)) + 2*(sqrt(3)-1) .
两条线在腿上相交AC
于
Q = (8*sqrt(3)*(sqrt(3)-1), 24*(sqrt(3)-1)) .
因此,该命令\draw (O) -- (Q);
应绘制一个半径为 的圆AC
。在我的计算机上,该命令绘制了一条穿过另一条腿的线段,而且长得离谱。在我看来,命令定位点Q
已被忽略。
\documentclass{amsart}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{calc,intersections}
\begin{document}
\noindent \hspace*{\fill}
\begin{tikzpicture}
\path (0,0) coordinate (A) (8,0) coordinate (B) (2,{2*sqrt(3)}) coordinate (C);
\node[anchor=north, inner sep=0, font=\footnotesize] at (0,-0.15){\textit{A}};
\node[anchor=north, inner sep=0, font=\footnotesize] at ($(B) +(0,-0.15)$){\textit{B}};
\node[anchor=south, inner sep=0, font=\footnotesize] at ($(C) +(0,0.15)$){\textit{C}};
\draw (A) -- (B) -- (C) -- cycle;
\path let \n1={2*(sqrt(3))*(sqrt(3)-1)}, \n2={2*(sqrt(3)-1)} in coordinate (O) at (\n1,\n2);
\draw[fill] (O) circle (1.5pt);
\draw[blue] let \n1={2*(sqrt(3)-1)} in (O) circle (\n1);
\path let \n1={2*(sqrt(3))*(sqrt(3)-1)} in coordinate (P) at (\n1,0);
\node[anchor=north, inner sep=0, font=\footnotesize] at ($(P) +(0,-0.15)$){\textit{P}};
\draw (O) -- (P);
\path let \n1={8*sqrt(3)*(sqrt(3)-1)}, \n2={24*(sqrt(3)-1)} in coordinate (Q) at (\n1,\n2);
\draw[fill=green] (Q) circle (1.5pt);
\draw[green] (O) -- (Q);
\end{tikzpicture}
\end{document}
答案1
抱歉,我完全不明白你的公式。你要求 TikZ 做
\path let \n1={8*sqrt(3)*(sqrt(3)-1)}, \n2={8*3*(sqrt(3)-1)} in coordinate (Q) at (\n1,\n2);
相当于
\path ({8*sqrt(3)*(sqrt(3)-1)},{8*3*(sqrt(3)-1)}) coordinate (Q);
(这意味着你不需要 calc 来做这件事),这就是 TikZ 放置点的位置。我无法告诉你你在计算 时出了什么问题Q
,但这里有一点:你怎么可能不需要 的坐标呢O
?你应该解决
alpha * 1 = O_x + beta
alpha * sqrt(3) = O_y - beta * sqrt(3)/3
AC
如果你想找到与垂直于并穿过的线相交的点O
,但我看不到你这样做。 (顺便说一句,有intersection cs:
专门用于此的,你不需要手动做这样的事情。)
幸运的是,这些预测可以calc
立即完成。
\documentclass{amsart}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\noindent \hspace*{\fill}
\begin{tikzpicture}
\draw (0,0) coordinate[label=below:$\scriptstyle A$] (A) --
({8*1},0) coordinate[label=below:$\scriptstyle B$] (B) --
({8*(1/4)},{8*sqrt(3)/4}) coordinate[label=above:$\scriptstyle A$] (C) -- cycle;
\draw[fill] ({8*(sqrt(3)/4)*(sqrt(3)-1)},{8*(1/4)*(sqrt(3)-1)})
coordinate (O) circle (1.5pt);
\draw[blue] (O) circle({8*(sqrt(3)-1)/4});
\path ($(A)!(O)!(C)$) coordinate[label=left:$\scriptstyle Q$] (Q)
($(A)!(O)!(B)$) coordinate[label=below:$\scriptstyle P$] (P);
\draw (O) -- (P);
\draw[fill=green] (Q) circle (1.5pt);
\draw[green] (O) -- (Q);
\end{tikzpicture}
\end{document}
答案2
画外接圆:画出AB、AC的垂直平分线,它们的交点就是圆心O。
\documentclass{amsart}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{calc,through,intersections}
\begin{document}
\begin{tikzpicture}
\def\fangle{60}
\def\sangle{30}
\coordinate (A) at (0,0);
\coordinate (B) at (8,0);
\coordinate (C) at (2,{2*tan(\fangle)});
\path [draw,name path=AB](A)node[left]{$A$}--(B);
\path [draw,name path=BC](B)node[right]{$B$}--(C);
\path [draw,name path=CA](C)node[above]{$C$}--(A);
\path [name path=A-bisector] (A)--++(\fangle/2:8);
\path [name path=B-bisector] (B)--++(180-\sangle/2:8);
\path [name intersections={of=A-bisector and B-bisector, by={O}}];
\path [name path=radius] (O)--++(-90:8);
\path [name intersections={of=AB and radius, by={P}}];
\node [draw,name path=circle,blue] at (O) [circle through={(P)}] {};
\path [name intersections={of=circle and CA, by={Q}}];
\filldraw (O) circle (1.5pt);
\draw (O)--(P)node[below]{$P$};
\draw[green] (O)--(Q)node[left,color=black]{$Q$};
\filldraw (Q) circle (1.5pt);
\end{tikzpicture}
\end{document}