如何让我的作业看起来不错

如何让我的作业看起来不错

例如我有以下乳胶:

\documentclass[12pt]{article}

\usepackage[margin=1.0in]{geometry}
\usepackage{tikz}

\begin{document}
  \begin{tikzpicture}
    \draw[->,thick] (0,0) -- (30:5.7735);
    \draw[->,thick] (30:5.7735) -- (-25:5.5169);
    \draw[->,thick] (-25:5.5169) -- (0,0);
    \draw[dashed] (0,0) -- (5,0);
    \node[above] at (1,0) {\(30^{\circ}\)};
    \node[below] at (1,0) {\(25^{\circ}\)};
    \node at (30:5.7735) {\(60^{\circ}\)};
    \node at (-25:5.5169) {\(65^{\circ}\)};
    \node[above] at (30:2.8868) {\(v_0t = 10t\)};
    \node[right] at (2.5:5.0048) {\(\frac{1}{2}at^2 = 5t^2\)};
    \node[below] at (-25:2.7585) {\(R\)};
  \end{tikzpicture}\\
  \(\frac{\sin(55^{\circ})}{\sin(65^{\circ})} = \frac{5t^2}{10t} = \frac{t}{2}\)\\
  \(t = \frac{2\sin(55^{\circ})}{\sin(65^{\circ})} = 1.808\)\\
  \(R = \sqrt{{(10t)}^2 + {(5t^2)}^2} = \sqrt{{(10 \cdot 1.808)}^2 + {(5 \cdot 1.808^2)}^2} = 4.89\)\\
  4.89 m
\end{document}

这还不错,但有些节点的位置有点奇怪,看起来有点凌乱。有什么简单的技巧可以让它看起来更好/更专业?例如,正确放置节点并使矢量箭头更明显。此外,除了计算距离并插入它们之外,还有更好的解决方案来绘制这三个矢量吗?

答案1

\documentclass[12pt]{article}

\usepackage[margin=1.0in]{geometry}
\usepackage{tikz}
\usetikzlibrary{angles,quotes,positioning}
\usepackage{siunitx}
\usepackage{amsmath}
\begin{document}
  \begin{tikzpicture}[>= latex]
    \draw[->,thick] (0,0) coordinate (a) -- node[sloped,above]{\(v_0t = 10t\)} (30:5.7735) coordinate (b);
    \draw[->,thick] (b) -- node[sloped,below,rotate=180]{\(\frac{1}{2}at^2 = 5t^2\)} (-25:5.5169) coordinate (c);
    \draw[->,thick] (c) -- node[sloped,below] {\(R\)} (0,0);
    \draw[dashed] (0,0) -- (5,0)coordinate (aa);
    \path pic[draw, angle radius=12mm,"\SI{30}{\degree}",angle eccentricity=1.3] {angle = aa--a--b};
    \path pic[draw, angle radius=14mm,"\SI{25}{\degree}",angle eccentricity=1.3] {angle = c--a--aa};
    \path pic[draw, angle radius=7mm,"\SI{60}{\degree}",angle eccentricity=1.4] {angle = a--b--c};
    \path pic[draw, angle radius=7mm,"\SI{65}{\degree}",angle eccentricity=1.4] {angle = b--c--a};
    \node[right = of b,anchor=north west,text width=5cm] {%
       \begin{align*}
         \frac{\sin(55^{\circ})}{\sin(65^{\circ})} &= \frac{5t^2}{10t} = \frac{t}{2}\\
         t &= \frac{2\sin(55^{\circ})}{\sin(65^{\circ})} = 1.808\\
         R &= \sqrt{{(10t)}^2 + {(5t^2)}^2} \\
           &= \sqrt{{(10 \cdot 1.808)}^2 +{(5 \cdot 1.808^2)}^2} \\
          &=\SI{4.89}{\meter}
       \end{align*}
       };
  \end{tikzpicture}
\end{document}

在此处输入图片描述

答案2

如果你不想计算距离,你可以使用calctikzlibrary 来帮你计算,或者直接使用intersectionstikzlibrary 来帮你找到三角形顶点。以下代码就是这样做的:

\documentclass[12pt]{article}

\usepackage[margin=1.0in]{geometry}

\usepackage{tikz}
\usetikzlibrary{intersections, angles, quotes, positioning}
\usepackage{siunitx}
\usepackage{amsmath}

\begin{document}
\begin{tikzpicture}[>=latex, vector/.style={thick, ->}]

\draw[vector] (0,0) coordinate (A)  -- node[above,sloped] {$v_0t=10t$} ++(30:6cm) coordinate (B);

\path[name path=B--C] (B) --++(-90:6cm);
\path[name path=A--C] (A) --++(-25:6cm);
\path[name path=A--D] (A) --++(0:6);

\path [name intersections={of=B--C and A--C, by=C}];
\path [name intersections={of=A--D and B--C, by=D}];

\draw[vector] (B)-- node[below, sloped, rotate=180] {$\frac{1}{2}at^2=5t^2$}(C);
\draw[vector] (C)-- node[below, sloped] {$R$} (A);
\draw[dashed] (A)--(D);

\path pic[draw, angle radius=12mm,"\SI{30}{\degree}",angle eccentricity=1.3] {angle = D--A--B};
\path pic[draw, angle radius=14mm,"\SI{25}{\degree}",angle eccentricity=1.3] {angle = C--A--D};
\path pic[draw, angle radius=7mm,"\SI{60}{\degree}",angle eccentricity=1.4] {angle = A--B--C};
\path pic[draw, angle radius=7mm,"\SI{65}{\degree}",angle eccentricity=1.4] {angle = B--C--A};

 \node[right = of B, anchor=north west,text width=5cm] {%
       \begin{align*}
         \frac{\sin(55^{\circ})}{\sin(65^{\circ})} &= \frac{5t^2}{10t} = \frac{t}{2}\\
         t &= \frac{2\sin(55^{\circ})}{\sin(65^{\circ})} = 1.808\\
         R &= \sqrt{{(10t)}^2 + {(5t^2)}^2} \\
           &= \sqrt{{(10 \cdot 1.808)}^2 +{(5 \cdot 1.808^2)}^2} \\
          &=\SI{4.89}{\meter}
       \end{align*}
       };
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容