下面的代码是如何构造三角形。我想扩展它。点 E 将与射线 BA 位于同一条线上,具有与点 A 和 B 相同的 y 坐标,位于 A 的左侧。角度 BCE = 90。这意味着角度 ACE = 15 度。这意味着您需要延长水平线,并且该线将与构造的角度相交。看起来像这样:
这是我目前的代码。忽略 %code。
\documentclass[margin=10pt]{standalone}
\usepackage{amsmath,tkz-euclide}
\usepackage{tikz}
\usetkzobj{all}
\usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations.markings,shapes}
\tikzset{
myangle/.style={fill=green!20!white, draw=green!50!black,size=.3,opacity=.3},
intnode/.style={circle,fill=black,inner sep=1pt,outer sep=0pt}
}
\begin{document}
\begin{tikzpicture}
% Drawing the triangle and the coordinates
\draw coordinate[label=left:A] (a) --++(60:6) coordinate[label=above:B] (b);
\path[name path=ac] (a)--++(0:8.5);
\path[name path=bc] (b)--++(-45:8);
\path[name intersections={of = ac and bc, by=c}];
\node[anchor=west] at (c) {C};
\draw[use as bounding box] (a)--(b)--(c)--cycle;
% Drawing the coordinates S and T
%\coordinate (s) at ($(a)!0.75!(b)$);
%\path[name path=incls] (s) --++ (-10:5);
\path[name path=altbc] (b) -- (c);
%\path[name intersections={of = incls and altbc, by=t}];
%\draw[dashed] (s) -- (t) node[intnode,label={right:{\color{black}\scriptsize $T$}}] (t) {};
% Angles
\tkzFindAngle(a,b,c)
\tkzGetAngle{angleABC};
\FPround\angleABC\angleABC{0}
\tkzFindAngle(c,a,b)
\tkzGetAngle{angleCAB};
\FPround\angleCAB\angleCAB{0}
\tkzFindAngle(b,c,a)
\tkzGetAngle{angleBCA};
\FPround\angleBCA\angleBCA{0}
%\tkzFindAngle(a,s,t)
%\tkzGetAngle{angleAST};
%\FPround\angleAST\angleAST{0}
\tkzMarkAngle[myangle](a,b,c)
\tkzLabelAngle[pos=.4](a,b,c){\tiny $\angleABC^\circ$}
\tkzMarkAngle[myangle](c,a,b)
\tkzLabelAngle[pos=0.5](c,a,b){\tiny $\angleCAB^\circ$}
\tkzMarkAngle[myangle](b,c,a)
\tkzLabelAngle[pos=0.45](b,c,a){\tiny $\angleBCA^\circ$}
%\tkzMarkAngle[myangle](a,s,t)
%\tkzLabelAngle[pos=0.4](a,s,t){\tiny $\angleAST^\circ$}
%\node[intnode,label={left:\scriptsize $S$}] at (s) {};
\end{tikzpicture}
\end{document}
答案1
对谁我感兴趣。我的原始代码是通过它生成的图像在我的回答中关于您评论中的后续问题:
\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{angles, backgrounds, calc, intersections, positioning, quotes}
\usepackage{siunitx}
\begin{document}
\begin{tikzpicture}[
myangle/.style args = {#1/#2/#3}{angle radius=#1mm, angle eccentricity=#2,
draw=#3!80!black, fill=#3!20!white},
myangle/.default = 7/1.4/green
]
% triangle's coordinates and edges
\coordinate[label=below:A] (a);
\coordinate[label=below:B,right=8.5 of a] (b);
% triangle's coordinate determined by intersection
\path[name path=ac] (a) -- ++ ( 60:6.5);
\path[name path=bc] (b) -- ++ (135:8);
\path[name intersections={of = ac and bc, by=c}] node[label=C] at (c) {};;
% triangle's edges
\draw (a)--(c)--(b)--cycle;
% draw perpedicular line for intersection E
\path[name path=ae] (a) -- ++ (-2.5,0);
\path[name path=ce] (c) -- ($(c)!7.7cm!-90:(b)$);
\draw[name intersections={of = ce and ae, by=e},red]
(a) -- (e) node[below] {E} -- (c);
% angles at A, B, C
\pic [myangle, "\ang{60}"] {angle = b--a--c};
\pic [myangle, "\ang{45}"] {angle = c--b--a};
\pic [myangle, "\ang{75}"] {angle = a--c--b};
% angle for C-E and at E
\scoped[on background layer]
\pic [myangle=12/1.2/red, "\ang{90}"] {angle = e--c--b};
\pic [myangle=7/1.4/red, "\ang{45}"] {angle = a--e--c};
% triangle height
\draw[dashed] (c) -- (c |- a) coordinate[label=below:D] (d);
\end{tikzpicture}
\end{document}