我是 tikz 新手。我想绘制 x 轴、y 轴、坐标 (4,1) 处的点、从 (0,0) 到 (4,1) 的线、从 (4,0) 到 (4,1) 的虚线以及从 (0,1) 到 (4,1) 的虚线。这是我的代码:
\documentclass[a4paper,oneside,12pt]{book}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,shapes.arrows}
\begin{document}
\begin{tikzpicture}
\draw[->,-Latex, black, thick] (-0.5,0) -- (5,0) node[right]{$X$};
\draw[->,-Latex, black, thick] (0,-0.5) -- (0,5) node[above]{$Y$};
\filldraw[black] (4,1) circle (3pt);
\draw[black, thick, dashed] (4,0) -- (4,1);
\draw[black, thick, dashed] (0,1) -- (4,1);
\draw[black,thick] (0,0) -- (4,1);
\end{tikzpicture}
\end{document}
(a)我想添加从点(4,1)旋转 45 度得到的新点。
(b)我想从(0,0)添加新线到点(a)
(c)我想添加一个圆弧和 45° 的文字(见图)
(d)我想添加一个带箭头的圆弧,从(4,1)到点(a)
如何制作?
答案1
像这样:
代码(一些添加到您的代码中):
\documentclass[a4paper,oneside,12pt]{book}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,shapes.arrows}
\begin{document}
\begin{tikzpicture}
\draw[->,-Latex, black, thick] (-0.5,0) -- (5,0) node[right]{$X$};
\draw[->,-Latex, black, thick] (0,-0.5) -- (0,5) node[above]{$Y$};
\filldraw[red,rotate=45] (4,1) circle (3pt);
\filldraw[black] (4,1) circle(3pt) ;
\draw[black, thick, dashed] (4,0) -- (4,1);
\draw[black, thick, dashed] (0,1) -- (4,1);
\draw[black,thick] (0,0) -- (4,1);
\draw[red,thick,rotate=45] (0,0) -- (4,1);
\draw[-Latex,red,thick] (4,1) arc (atan(.25):{atan(.25)+45}:4);
\draw[dashed] (2,.5) arc (atan(.25):{atan(.25)+45}:2) node[pos=.5,right] () {$45\circ$};
\end{tikzpicture}
\end{document}