I would like to express the angle of rotation for the tangent line in terms of atan x using the slope (which is calculated earlier in the problem). I can get it to work using the angle but I do not want to have to calculate it by hand first. I would like the black line to end up where the red line is using a calculation that's similar to the black line.
\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}[xscale=0.4, yscale=0.1]
% draw axis
\draw (-1.5,0) -- (6.5,0);
\draw (0,-10) -- (0,15);
% plot f(x)
\draw [domain=(-1:6)] plot (\x,\x*\x-3*\x-4);
% plot secant line
\draw[dashed] (-1,0) -- (6,14);
% plot tangent line
\draw [rotate around={{180*atan(2)/pi}:(2.5,-5.25)}] (-2,-5.25) -- (7,-5.25);
\draw [red, rotate around={{63.43}:(2.5,-5.25)}] (-2,-5.25) -- (7,-5.25);
% plot cirles as points
\foreach \x/\y in {-1/0,2.5/-5.25,6/14}{\draw [fill=black] (\x,\y) ellipse (0.1cm and 0.4cm);}
\end{tikzpicture}
\end{document}
TIA.
atan2(y, x)function that takes the quadrant in consideration. – Qrrbrbirlbel Nov 28 '22 at 01:49