我已经问过如何使用Tikz
我刚刚学到的这个迷人库的基础知识来绘制类似的图形,但我真的想使用简单的代码来绘制复杂的图形:
\begin{tikzpicture}[scale=1.5]
\draw[smooth, dashed] (7,-2.15)--(6.5,-2.15);
\draw[smooth] (7.5,-3) arc (0:90:0.989);
\draw[smooth ,dashed] (6.5,-2)--(6.5,-3)--(7.5,-3) node[right] {$D$};
\draw[smooth] (6.5,-3)--(7,-2.15)node[below, midway] {$r$} node[above]{$M$};
\coordinate(x) at (7,-2.15);
\coordinate(y) at (6.5,-3);
\coordinate(z) at (6.5,-2);
\pic [draw=black!15!black,text=black,angle radius=5mm,"$\theta$",angle eccentricity=1.3]{angle = x--y--z};
\end{tikzpicture}
有人能告诉我哪里可以找到一本好书或 YouTube 频道,以便我可以了解更多吗?是的,如果有人能完成我的工作,我会非常感激。提前谢谢!
答案1
纯 Ti 溶液钾Z. 你的工作已经走在正确的道路上了,你会从这里发布的内容中快速学习。tkz-euclide
如果你想更轻松地绘制这种图形,我强烈建议你看一下这个包。
编辑:我编辑了代码,让您通过选择值来缩放图形,\r
并允许自动计算其余距离(不包括线宽)。
\documentclass[tikz,border=3.141592mm]{standalone}
\usetikzlibrary{calc,positioning}
\begin{document}
\begin{tikzpicture}
\def\r{4} % radius
\def\t{25} % Theta
\def\d{2*\r/5} % distance for Theta angle mark
\draw (0,0) coordinate (O) -- (\r,0) coordinate (D) arc (0:90:\r) coordinate (C) -- cycle;
\draw (0,0) -- (90-\t:\r) coordinate (M) node [midway,right] {$r$};
\draw (0,\d) arc (90:90-\t:\d) node [midway,above] {$\theta$};
\node [below left] at (O) {$O$};
\node [below right] at (D) {$D$};
\node [above left] at (C) {$C$};
\node [above left=3pt and -5pt] at (M) {$M$};
% Vectors
\begin{scope}[line width=1.5pt,-stealth]
\draw[red] (M) --++ (0,-3*\r/5) node [midway,right] {$\vec{P}$};
\draw[olive] (M) -- ($(M)+(-\t:\r/2)$) node [midway,above] {$\vec{u}$};
\draw[olive] (M) -- ($(M)!0.4!(O)$) node [midway,left] {$\vec{n}$};
\draw[blue] (M) -- ($(M)!-0.5!(O)$) node [midway,left] {$\vec{R}$};
\end{scope}
\def\angledist{0.05*\r} % distance for right angle
\draw[olive,line width=1pt] (M)--++ (-90-\t:\angledist) --++ (-\t:\angledist) --++ (90-\t:\angledist);
\end{tikzpicture}
\end{document}