I would like to draw a right triangle inscribed in a circle on the Cartesian plane. In the following code, a circle of radius 3 and center (1,1) is drawn. One side of the triangle, the hypotenuse, is drawn – it is the diameter through (1,1) that is vertical. The endpoints of this diameter are two vertices of the triangle; they are labeled A and C. I would like to specify B using polar coordinates – with an angle measure of -135 degrees or -150 degrees. (I did not specify the coordinates of B in rectangular coordinates. So, no triangle is drawn by the following code.)
There is one other modification to the display that I would like. Vertical line \ell
should be drawn in light blue, light green, or light gray. I remember seeing an option for help lines
in the manual. Would this draw \ell
the way I want it drawn?
\documentclass[10pt]{amsart}
\usepackage{tikz}
\usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations.markings}
\usepackage{mathtools,systeme,array}
\usepackage{tkz-euclide}
\usetkzobj{all}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}
\begin{document}
\begin{tikzpicture}
\begin{axis}[width=3in,axis equal image,clip=false,
axis lines=middle,
xmin=-3,xmax=5,
xlabel=$x$,ylabel=$y$,
ymin=-5,ymax=5,
restrict y to domain=-5:5,
enlargelimits={abs=0.25cm},
axis line style={latex-latex},
ticklabel style={font=\tiny,fill=white},
xtick={\empty},ytick={\empty},
xlabel style={at={(ticklabel* cs:1)},anchor=north west},
ylabel style={at={(ticklabel* cs:1)},anchor=south west}
]
\draw (1,1) circle (3);
\draw [fill] (1,1) circle [radius=1.5pt] node[anchor=west,font=\tiny]{$(1, \, 1)$};
\addplot [dashed,latex-latex,line width=0.5\pgflinewidth,domain=-5:5] (1,x) node [pos=0.1, anchor=north west, font=\footnotesize] {$\ell$};
\draw (axis cs:1,4) coordinate(A) node[above right]{$A$};
%\draw (axis cs:) coordinate(B) node[above left]{$B$};
\draw (axis cs:1,-2) coordinate(C) node[below right]{$C$};
\end{axis}
%\draw[blue] (A) -- (B) -- (C) -- cycle;
%\tkzMarkRightAngle(A,B,C);
\end{tikzpicture}
\end{document}
Best Answer
with
tikz
And more versatile
tkz-euclide
Here is the version retaining
axis
environment: