\begin{center}
\begin{tikzpicture}
\draw [line width=1pt, fill=yellow!2] (-1,-3.5) -- (9,-3.5) -- (9,3.5) -- (-1,3.5) -- cycle;
\coordinate (A) at (0,0);
\coordinate (B) at (8,-2);
\coordinate (C) at (8,2);
\draw [line width=1.5pt, fill=white] (A) -- (B) -- (C) -- cycle;
\end{tikzpicture}
\end{center}
我尝试使用圆弧,但我不知道如何在三角形中绘制线条。提前感谢您的帮助。
答案1
纯tikz
溶液:
\documentclass[tikz, border=3mm]{standalone}
\usetikzlibrary{angles, arrows.meta,
intersections,
quotes}
\begin{document}
\begin{tikzpicture}[
my angle/.style = {draw,very thin, Straight Barb-Straight Barb,
angle radius=5mm,
angle eccentricity=0.75,
font=\footnotesize
} % angle label position!
]
\coordinate[label= left:A] (A);
\coordinate[label=right:B] (B) at ( 7.5:8);
\coordinate[label=right:C] (C) at (-7.5:8);
%
\draw[gray] (10:8) arc (10:-10:8);
%
\draw[name path=b1, line width=1pt] (A) -- (B) -- (C) -- cycle;
\pic [my angle, "$\gamma$"] {angle = A--B--C};
%
\path[name path=a1] (C) -- + (37.5+90:2.5);
\draw[name intersections={of=a1 and b1, by={B'}}]
(C) -- (B') node[above] {B'};
\pic [my angle, "$\alpha$"] {angle = C--B'--B};
%
\path[name path=a2] (B') -- + (7.5+240:2);
\draw[name intersections={of=a2 and b1, by={notused,C'}}]
(B') -- (C') node[below] {C'};;
\pic [my angle, "$\alpha$"] {angle = C'--B'--C};
%
\path[name path=a3] (C') -- + (7.5+90:2);
\draw[name intersections={of=a3 and b1, by={B''}}]
(C') -- (B'') node[above] {B''};
\pic [my angle, "$\alpha$"] {angle = B''--B'--C'};
\pic [my angle, "$\cdot$"] {angle = A--B''--C'};
\pic [my angle, "$\beta$"] {angle = C--C'--B'};
\pic [my angle, "$\beta$"] {angle = B''--C'--A};
\end{tikzpicture}
\end{document}
答案2
我自己不会使用你的问题的角度和距离,因为这是一个家庭作业问题(虽然你说你已经找到了它们:P)
不过,我会给你一些工具,让你能够尝试找到所有这些点。你仍然需要自己找到这些点的一些属性,才能写出它们。
但是一旦你知道了它们之间的属性。两点之间的距离、线之间的角度等等,希望下面的方法能帮助你在 TikZ 中找到这些点。
我们将使用以下库:
\usetikzlibrary{calc}
\usetikzlibrary{intersections, through}
比例:
如果你已经知道两点与中间点之间的距离。例如,假设从 A 到 B 的方向上,某个点距离 A 有 1cm,你可以这样写
\coordinate (D) at ($(A)!1cm!(C)$);
另一方面,如果你知道该点在连接它们的线上距离 A 有 30%,距离 C 有 70%,那么你可以这样写
\coordinate (D) at ($(A)!.3!(C)$);
预测
如果知道点 E 是点 D 沿直线 AB 的投影,则可以通过以下方式找到该投影:
\coordinate (E) at ($(A)!(D)!(B)$);
(这意味着线 DE 和 AB 是正交的)
以一定角度指向另一条线
要找到另一条直线上与一条直线成给定角度的点,需要 3 个步骤。找到一条直线上与该角度成给定角度的点,绘制两条直线,找到交点:
找到一个角度的点:假设我们称该点为 F。
如果我想找到与直线 DE 成 30 度角的点,我可以通过以下方式找到它:
\coordinate (F) at ($(D)!3!-30:(E)$);
注意角度是如何逆时针计算的,还要注意 D 是固定的,而 E 是“转动”来找到 F。我选择了“3”倍的距离,因为我稍后会找到这条线与线 AB 的交点,而我不知道那个交点有多远。
绘制两条线:
找到点 F 后,我们需要绘制两条线并保存它们。我们使用以下
name path
选项来实现:\draw [name path=DF] (D) -- (F); \draw [name path=AB] (A) -- (B); % Use \path if you don't want to draw them
找到交点:
我们将用字母 G 来表示交叉点。
\path
你只需要使用name intersections
如下标签:\path[name intersections={of= DF and AB, by = G}];
例子
因此,这是我的建议,包括您应该如何去做。
还有其他方法可以使其更快...但我认为上述 3 条规则对于初学者来说足够简单。
我擅自编写了一个,而不是对某些角度进行硬编码\pgfmathsetmacro{\cmd}{mathsy stuff}
,以便您可以在了解所有角度之前“对其进行编码”。
\documentclass{article}
\usepackage{tikz}
\usepackage[utf8]{inputenc}
\usetikzlibrary{calc}
\usetikzlibrary{intersections, through}
\begin{document}
\begin{tikzpicture}
\draw [line width=1pt, fill=yellow!2] (-1,-3.5) -- (9,-3.5) -- (9,3.5) -- (-1,3.5) -- cycle;
\pgfmathsetmacro{\angle}{30}
\pgfmathsetmacro{\anglealpha}{60}
\pgfmathsetmacro{\anglebeta}{30}
\pgfmathsetmacro{\proportion}{.3}
\coordinate (A) at (0,0);
\coordinate (B) at (\angle/2:8); %
\coordinate (C) at (-\angle/2:8);
\coordinate (D) at ($(A)!\proportion!(C)$); % Point between A and C
\coordinate (E) at ($(A)!(D)!(B)$); % Projection
\coordinate (F) at ($(D)!3!-30:(E)$); % Point in a line 30 degrees from DE (D is fixed and rotated around E to get the new line)
\draw [name path=DF] (D) -- (F);
\draw [name path=AB] (A) -- (B);
\path[name intersections={of= DF and AB, by = G}]; %Finding intersection
\coordinate (H) at ($(G)!3!\anglealpha:(D)$); % We would continue this way
\draw[name path = HG] (H) -- (G);
%... you keep going
%Code to draw all the letters automatically
\foreach \name in {A, ..., H}{
\fill (\name) circle (2pt) node[above]{\name};
}
\draw [line width=1.5pt, fill=none] (A) -- (B) -- (C) -- cycle;
\end{tikzpicture}
\end{document}
答案3
\documentclass[11pt]{article}
%\usepackage[ngerman]{babel}
%\usepackage[applemac]{inputenc}
%\usepackage{amsmath,color,algorithm2e,algorithmic}
%\usepackage{fancyhdr}
%\usepackage{graphicx}
%\usepackage{pgffor}
\usepackage{tkz-euclide}
\usetkzobj{all}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{through}
\usetikzlibrary{intersections, through}
\usepackage[a4paper, left=2.5cm, right=2.5cm]{geometry}
\begin{document}
\begin{center}
\begin{tikzpicture}
\draw [line width=1pt, fill=yellow!2] (-1,-2.5) -- (9,-2.5) -- (9,2.5) -- (-1,2.5) -- cycle;
\pgfmathsetmacro{\angle}{30}
\pgfmathsetmacro{\anglealpha}{60}
\pgfmathsetmacro{\anglebeta}{75}
\pgfmathsetmacro{\anglegamma}{82.5}
\coordinate (A) at (0,0);
\coordinate (B) at (\angle/4:8);
\coordinate (C) at (-\angle/4:8);
\draw [name path=AB] (A) -- (B);
\draw [name path=AC] (A) -- (C);
\coordinate (D) at ($(C)!3!37.5:(B)$);
\path[name path=CD] (C) -- (D);
\path[name intersections={of= CD and AB, by = F}];
\draw[name path = CF] (C) -- (F);
\coordinate (G) at ($(F)!3!-\anglealpha:(C)$);
\path[name path = FG] (F) -- (G);
\path[name intersections={of= FG and AC, by = H}];
\draw[name path = FH] (F) -- (H);
\coordinate (I) at ($(H)!3!\angle:(F)$);
\path[name path = HI] (H) -- (I);
\path[name intersections={of= HI and AB, by = J}];
\draw[name path = HJ] (H) -- (J);
% Winkel Beta
\tkzMarkAngle[fill= none,size=0.6,opacity=.7](J,H,A)
\tkzLabelAngle[pos = 0.4](J,H,A){\tiny$\beta$}
\tkzMarkAngle[fill= none,size=0.6,opacity=.7](C,H,F)
\tkzLabelAngle[pos = 0.4](C,H,F){\tiny$\beta$}
% Winkel Alpha
\tkzMarkAngle[fill= none,size=0.6,opacity=.7](A,F,H)
\tkzLabelAngle[pos = 0.4](A,F,H){\tiny$\alpha$}
\tkzMarkAngle[fill= none,size=0.6,opacity=.7](H,F,C)
\tkzLabelAngle[pos = 0.4](H,F,C){\tiny$\alpha$}
\tkzMarkAngle[fill= none,size=0.6,opacity=.7](C,F,B)
\tkzLabelAngle[pos = 0.4](C,F,B){\tiny$\alpha$}
% Winkel Gamma
\tkzMarkAngle[fill= none,size=0.6,opacity=.7](A,B,C)
\tkzLabelAngle[pos = 0.4](A,B,C){\tiny$\gamma$}
% Rechter Winkel
\tkzMarkAngle[fill= none,size=0.6,opacity=.7](A,J,H)
\tkzLabelAngle[pos = 0.36](A,J,H){\huge$\cdot$}
\draw [line width=1.5pt, fill=none] (A) -- (B) -- (C) -- cycle;
\tkzDrawArc[delta=8](A,C)(B);
\end{tikzpicture}
\end{center}
\end{document}
谢谢 Alex,现在一切都很好。非常感谢。