问题:我想为图形中所有具有指定角度值的角度添加角度标记。
\documentclass[12pt]{article}
\usepackage{pgf,tikz,pgfplots}
\usetikzlibrary{arrows}
\pagestyle{empty}
\usepackage{tkz-euclide}
\usetkzobj{all}
\begin{document}
\begin{tikzpicture}
\draw [<->,line width=0.8pt] (-3,4)-- (3,4);
\draw [<->,line width=0.8pt] (-3,0)-- (3,0);
\draw [line width=0.5pt] (-1.52,4)-- (1.52,0);
\draw [line width=0.5pt] (1.5,4)-- (-1.52,0);
\draw[color=black] (-1.55,4.30) node {$P$};
\draw[color=black] (1.45,-0.3) node {$B$};
\draw[color=black] (1.45,4.30) node {$S$};
\draw[color=black] (-0.5,2.00) node {$O$};
\draw[color=black] (-1.55,-0.3) node {$S$};
\end{tikzpicture}
\end{document}
答案1
我只添加了一个角度,我想你可以完成其余部分。
\documentclass[tikz]{standalone}
\usetikzlibrary{angles,quotes}
\begin{document}
\begin{tikzpicture}
\draw [<->,line width=0.8pt] (-3,4) coordinate (x1)-- (3,4) coordinate (y1);
\draw [<->,line width=0.8pt] (-3,0) coordinate (x2)-- (3,0) coordinate (y2);
\draw [line width=0.5pt] (-1.52,4) coordinate (p)-- (1.52,0) coordinate (b);
\draw [line width=0.5pt] (1.5,4) coordinate (sa)-- (-1.52,0) coordinate (sb);
\path (p) node[above] {$P$} (b) node[below] {$B$} (sa) node[above] {$S$} (sb) node[below] {$S$} (0,2) node[left] {$O$};
\pic[draw,angle radius=.5cm,angle eccentricity=1.5,"$\alpha$"] {angle=b--p--y1};
\end{tikzpicture}
\end{document}