0

I want to draw a tangent and normal line to the circle like the image below:

enter image description here

My written coding is as follows:

\begin{figure}[h!]
    \centering
    \begin{tikzpicture}
    \node (c) at  (2,2) {$c$};
    \coordinate (O) at (0,0);
    \coordinate (A) at (2,2);
    \coordinate (P) at (3,3.2);
    \draw[->,thick] (-1,0)--(4,0) node[right]{$x$};
    \draw[->,thick] (0,-1)--(0,4) node[above]{$y$};
    \draw (O) node [below left]{$0$};
    \draw (2, 2) circle[radius = 1.5cm];
    \foreach \i in {45}{
        \draw (2, 2) --++ (\i:1.5cm);
    }

    \draw [fill=black] (A) circle (1pt);
    \end{tikzpicture}
\end{figure}

which produces.

enter image description here

Anyone, please help.

2

For a circle this is very easy.

\documentclass[tikz,border=3mm]{standalone}
\begin{document}
    \begin{tikzpicture}[>=stealth,font=\sffamily]
    \path (2,2) coordinate[label=below:$c$](c);
    \coordinate (O) at (0,0);
    \coordinate (P) at (3,3.2);
    \draw[->,thick] (-1,0)--(4,0) node[right]{$x$};
    \draw[->,thick] (0,-1)--(0,4) node[above]{$y$};
    \draw (O) node [below left]{$0$};
    \draw (c) circle[radius = 1.5cm];
    \foreach \i [count=\X] in {45}{
        \draw (c) --++ (\i:1.5cm) coordinate (x\X);
        \draw (x\X) -- ++ (\i:1) node[pos=0.8,below right]{normal}; % normal
        \draw (x\X) ++ (\i+90:1) -- ++ (\i-90:2)
        node[pos=0.9,above right]{tangent}; % tangent
    }

    \draw [fill=black] (c) circle (1pt);
    \end{tikzpicture}
\end{document}

enter image description here

Notice that TikZ offers many more options such as tangent cs:, see section 13.2.4 Tangent Coordinate Systems of the pgfmanual v3.1.4.

0

To draw normal to line (p1)--(p2) at point (p1),

\draw ($(p1)!1!-90:(p2)$) -- ($(p1)!1!90:(p2)$);

enter image description here

\documentclass[border=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
    \centering
    \begin{tikzpicture}
    \node (c) at  (2,2) {$c$};
    \coordinate (O) at (0,0);
    \coordinate (A) at (2,2);
    \coordinate (P) at (3,3.2);
    \draw[->,thick] (-1,0)--(4,0) node[right]{$x$};
    \draw[->,thick] (0,-1)--(0,4) node[above]{$y$};
    \draw (O) node [below left]{$0$};
    \draw (2, 2) circle[radius = 1.5cm];
    \foreach \i in {45}{
        \draw (2, 2) --++ (\i:1.5cm)coordinate(p\i){};
        \draw ($(p\i)!1!-90:(2,2)$) -- ($(p\i)!1!90:(2,2)$);
    }

    \draw [fill=black] (A) circle (1pt);

    \end{tikzpicture}
\end{document}

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.