在坐标位置制作直角符号

在坐标位置制作直角符号

在下图中,我在 (.745,.433) 和 (0.433,0.750) 处制作直角符号时遇到了困难。我能够使用我的代码制作一个所示的直角,但在执行上面列出的其他符号时遇到了麻烦,并寻求帮助,谢谢!

2130.sty可从https://gist.github.com/anonymous/4b9d6f43cf1daf727334

\documentclass{article}
\usepackage{2130}
\begin{document}
\begin{figure}
\begin{scaledpicture}{50}(1,1)(-0.3,0)
\put(0,.866){\makebox(0.5,0.18)\downbracefill}
\put(0,.866){\makebox(0.25,0.045)\downbracefill}
\put(0,0){\circle*{0.03}}
\join(0,.866)(0.05,.866)(0.05,0.816)(0,.816)
\put(0,0){\arc(0.866,0){125}}
\join(0,0)(0.433,0.750)
\dashline{0.03}(0.433,0.750)(0.5,0.866)
\join(0,0)(0,0.866)
\join(0,0)(0.745,0.433)
\join(.6225,.6495)(.745,.433)
\dashline{0.01}(0.25,0.866)(.6225,.6495)
\thicklines \join(-0.5,0.866)(0,.866)
\thicklines \join(0.75,.433)(1,0)
\thicklines \join(0.745,.433)(0.5,0.866)(0,.866)
\wput(0,0.5){$R$}
\nput(0.3725,0.2165){$R$}
\nwput(.2165,.3725){$R$}
\nput(0.25,0.96){$X$}
\nput(0.135,0.888){$Y$}
\tiny \put(.52,.71){$Y$}
\wput(.475,.83){$Z$}
\nput(0.36,.78){$Y$}
\end{scaledpicture}
\caption{Recurrence Relation, Circumscribed Polygon}
\label{2}
\end{figure}
\end{document}

答案1

你只需要计算适当的坐标,例如

\join(0.408,0.707)(0.4513,0.682)(0.4763,0.7253)
\join(0.707,0.408)(0.732,0.3647)(0.775,0.3897)

我如何得到这些值?从您已经绘制的图中,您知道从原点到角度标记起点的线的长度为 0.816,角度标记的边长为 0.05。

第二条射线与水平线成 60 度角,因此如果想让角标记位于射线上的同一位置,则应从坐标 开始(0.816*cos(60), 0.816*sin(60))。接下来需要找到描述角标记下边的向量,即(0.05*sin(60), -0.05*cos(60))。将此向量添加到角标记的起点,即可得到角。我相信您能猜出我是如何得到最后一个点的。

尽管如此,其他制作图表的软件包。下面我提供了一个使用 TikZ 制作该图表的示例。

\documentclass{article}
\usepackage{2130}
\usepackage{tikz}
\usetikzlibrary{
  decorations.pathreplacing,
  intersections,
  calc
}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}[
 declare function={
  R=5;
 }
]

% define a named coordinate at origin
\coordinate (O) at (0,0);

% draw the arc
\draw (O) ++(R,0) arc[start angle=0,end angle=125,radius=R];

% draw the three rays
\foreach \angle in {30,60,90}
{
  % line from origin to arcm using polar coordinates (the ":" indicates that the coordinate is (angle:radius).)
  % at the point where the ray hits the circle, a named coordinate is added
  \draw (O) --node[auto]{$R$} ++(\angle:R) coordinate (r\angle);
  % draw right angle marks, again with polar coordinates
  \draw (\angle:R*0.95) -- ++(\angle-90:R*0.05) -- ++(\angle:R*0.05);
}

% the two next paths doesn't draw anything, but are used to find the intersection of the tangents
\path [overlay,name path=A] (r90) -- ++(R,0);
\path [overlay,name path=B] (r60) -- ++(60:R);

% find the intersection of the two paths above, name the coordinate "z"
% draw the two tangents starting at the point z
\draw [name intersections={of=A and B,by={z}}]
    (z) -- ++(-1.2*R,0)
    (z) -- ++(-60:1.2*R);

% draw the extension of the middle ray
\draw [dashed] (r60) -- node[left,pos=0.7,font=\tiny] {$Z$} (z);

% draw the dashed Y-lines
% the sine law is used to calculate the length of the lines
\draw [densely dashed]
let
\p1=(z),\p2=(r60),\n1={veclen(\x1-\x2,\y1-\y2)*sin(60)/sin(30)}
in
  (r60) -- node[above,pos=0.4,font=\tiny] {$Y$} ++(60+90:\n1) coordinate (y1)
  (r60) -- node[above,pos=0.4,font=\tiny] {$Y$} ++(60-90:\n1) coordinate (y2);

% draw the braces on top
\draw [decoration={brace,raise=1pt,amplitude=3pt},decorate,thick] (r90) -- node[above=2pt,font=\footnotesize]{$Y$} (y1);
\draw [decoration={brace,raise=15pt,amplitude=3pt},decorate,thick] (r90) -- node[above=16pt,font=\footnotesize]{$X$} (z);

% draw black dot in origin
\fill (O) circle[radius=2pt];

\end{tikzpicture}
\caption{Recurrence Relation, Circumscribed Polygon}
\label{descriptivelabel}
\end{figure}

\begin{figure}
\begin{scaledpicture}{50}(1,1)(-0.3,0)
\put(0,.866){\makebox(0.5,0.18)\downbracefill}
\put(0,.866){\makebox(0.25,0.045)\downbracefill}
\put(0,0){\circle*{0.03}}
\join(0,.866)(0.05,.866)(0.05,0.816)(0,.816)
%
\join(0.408,0.707)(0.4513,0.682)(0.4763,0.7253)
\join(0.707,0.408)(0.732,0.3647)(0.775,0.3897)
%
\join(0.408,0.707)(0.4513,0.682)(0.4763,0.7253)%
\put(0,0){\arc(0.866,0){125}}
\join(0,0)(0.433,0.750)
\dashline{0.03}(0.433,0.750)(0.5,0.866)
\join(0,0)(0,0.866)
\join(0,0)(0.745,0.433)
\join(.6225,.6495)(.745,.433)
\dashline{0.01}(0.25,0.866)(.6225,.6495)
\thicklines \join(-0.5,0.866)(0,.866)
\thicklines \join(0.75,.433)(1,0)
\thicklines \join(0.745,.433)(0.5,0.866)(0,.866)
\wput(0,0.5){$R$}
\nput(0.3725,0.2165){$R$}
\nwput(.2165,.3725){$R$}
\nput(0.25,0.96){$X$}
\nput(0.135,0.888){$Y$}
\tiny \put(.52,.71){$Y$}
\wput(.475,.83){$Z$}
\nput(0.36,.78){$Y$}
\end{scaledpicture}
\caption{Recurrence Relation, Circumscribed Polygon}
\label{descriptivelabel}
\end{figure}
\end{document}

代码输出

相关内容