I need to draw a tangent line that intersects a secant line at a right angle outside the circle.
The MWE below correctly renders a circle and a secant line, and labels the intersection points. However, I can't figure out how to reorient the tangent line so it intersects the secant at a 90° angle outside the circle.
Questions:
❓ Questions:
- Is my secant line and labeling code efficient?
- How do I modify the code so the tangent intersects the secant at a right angle outside the circle?
Thank you for taking time to assist me.
mwe:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc,intersections}
\usepackage{amsmath}
\begin{document}
\begin{tikzpicture}[scale=1.5]
% Draw the circle with a name for intersection calculations
\draw[thick, name path=circle] (0,0) circle (2);
% Mark the center
\fill (0,0) circle (1.5pt);
\node at (0.2,-0.2) {$O$};
% Define the secant line path (extend beyond circle)
\path[name path=secant] (-1,3) -- (3,-2);
% Find intersection points automatically and store them
\path[name intersections={of=circle and secant}]
(intersection-1) coordinate (A)
(intersection-2) coordinate (B);
% Extend the secant line beyond the circle in both directions
\draw[thick, red] (-1,3) -- (3,-2);
% Mark intersection points
\fill[red] (A) circle (1.5pt) (B) circle (1.5pt);
% Labels for intersection points
\node at (A) [above right] {$A$};
\node at (B) [below left] {$B$};
% Define tangent point on the circle
\coordinate (T) at (1.6, 1.2); % Point on circle where tangent touches
% Draw tangent line (perpendicular to radius at T)
% The radius to T has direction (1.6, 1.2), so perpendicular direction is (-1.2, 1.6)
\draw[thick, blue] ($(T) + 2*(-1.2, 1.6)$) -- ($(T) + 2*(1.2, -1.6)$);
% Mark the tangent point
\fill[blue] (T) circle (1.5pt);
\node at (T) [above left] {$T$};
\end{tikzpicture}
\end{document}