I have a diagram that is to be used to define the sine, cosine, and tangent functions. How do I label the drawn radius "r"? How do I draw the angle for alpha? (I am trying to adapt the code that I have. There isn't a manual that explains the syntax.) Two line segments are to be drawn that are perpendicular to the x-axis. One of them is the line segment between the x-axis and the intersection P of the radius and the circle; the other is between the point (r,0) and the ray containing the drawn radius. (The lengths of these line segments are r\sin\alpha and r\tan\alpha.) How do I put a dot at the intersection Q of the second line segment and the ray containing the drawn radius? How do I draw a dotted line segment from P to Q?
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
%\usetikzlibrary{calc,angles,quotes}
\usepackage{pgfplots}
\begin{document}
\begin{center}
\begin{tikzpicture}[
dot/.style={
fill,
circle,
inner sep=2pt
}
]
\clip (-0.5,-0.5) rectangle (6,6);
\draw[dashed,fill=white] (0,0) circle [radius=4];
\draw[<->] (-5,0) -- (5,0) node[below] {$x$};
\draw[<->] (0,-5) node (yaxis) {} -- (0,5) node[right] {$y$};
\node[dot,label={right:$(r\cos\alpha, \, r\sin\alpha)$}] at (3.464101615,2) {};
\draw (0,0) -- (3.464101615,2);
\draw[->] (1,0) +(0:1cm) [radius=1cm,start angle=0,end angle=30] node[midway,right]{$\alpha$};
\end{tikzpicture}
\end{center}
\end{document}
Best Answer
This is a possible solution. The point c are on the ray of radius found by the intersections skill from
intersections
library. Based on\tan \alpha
expression, the 2nd line segment has length 1 on the x-axis which is inside the circle of radius 4.Update Further automation is attempted where a macro
\ang
can be set between 0 and 90 degree, the intersections library will find the intersection points autmatically. The demonstration is for\ang=45
.\node[dot](<internal label>){};
Code
Code