6

I have provided the code for a triangle is to be drawn on the Cartesian plane. The point at the origin is labeled O, and the other points are labeled A and B. The altitude of the triangle is to be drawn as a dashed line segment from O to line segment AB, the foot of the altitude is to be labeled P, and the height is to be labeled x. The lengths of the sides are to be labeled a, b, and c.

I have the angles drawn and labeled. One of the angles does not meet a leg of the triangle. What is wrong with the code? The placement of "alpha" and "beta" is wrong. Why are these labels not place outside of the angles. (These commands are copied from another file from which the labels are appropriately place.)

\documentclass[10pt]{amsart}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{mathtools,array}
\usepackage{tikz}
\usetikzlibrary{calc}

\tikzset{
mydot/.style={
  fill,
  circle,
  inner sep=1.5pt
  }
}

\begin{document}

\begin{tikzpicture}[>=latex]


% the coordinates of the vertices
\coordinate (O) at (0,0);
\coordinate (A) at (122:4cm);
\coordinate (B) at (20:3cm);

% the axis
\draw[help lines,->] (-3.5,0) -- (2.5,0);
\draw[help lines,->] (0,-0.5) -- (0,5.5);

% the edges of the triangle
\draw (O) -- (A) -- (B) -- cycle;

% labelling the vertices
\node[mydot,label={left:$A$}] at (A) {};
\node[mydot,label={right:$B$}] at (B) {};
\node[mydot,label={below left:$O$}] at (O) {};

\draw ($(A)!(O)!(B)$);

% the arcs for the angles
\begin{scope}[gray]
\draw[->]
  (0.75,0) +(0:0.5cm) arc [radius=1cm,start angle=0,end angle=20] node[midway,right] {$\beta$};
\draw[->]
  (0.5,0) +(0:0.25cm) arc [radius=0.75cm,start angle=0,end angle=122] node[midway,above] {$\alpha$};
\end{scope}

\end{tikzpicture}

\end{document}
6

The problem is that the for the \beta angle the arc starts 1.25cm from the origin but the arc radius is specified as 1cm.

By using:

\draw[->] (0:1.25cm) arc (0:20:1.25cm) node[midway,right] {$\beta$};

The arc will be the correct place:

\documentclass[tikz,border=5]{standalone}
\usetikzlibrary{calc}

\tikzset{
mydot/.style={
  fill,
  circle,
  inner sep=1.5pt
  }
}

\begin{document}

\begin{tikzpicture}[>=latex]

% the coordinates of the vertices
\coordinate (O) at (0,0);
\coordinate (A) at (122:4cm);
\coordinate (B) at (20:3cm);

% the axis
\draw[help lines,->] (-3.5,0) -- (2.5,0);
\draw[help lines,->] (0,-0.5) -- (0,5.5);

% the edges of the triangle
\draw (O) -- (A) -- (B) -- cycle;

% labelling the vertices
\node[mydot,label={left:$A$}] at (A) {};
\node[mydot,label={right:$B$}] at (B) {};
\node[mydot,label={below left:$O$}] at (O) {};

% the arcs for the angles
\begin{scope}[gray]
\draw[->] (0:1.25cm) arc (0: 20:1.25cm) node[midway,right] {$\beta$};
\draw[->] (0:0.75cm) arc (0:122:0.75cm) node[midway,above] {$\alpha$};
\end{scope}

\end{tikzpicture}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.