Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm trying to draw a normal vector on a curve, and use the usual "dot in an arc" symbol to indicate that. Here is what I have so far, which looks alright, but needed manual adjustment of angles and distances, and I was wondering if one can automatically place these.

\documentclass{scrartcl}

\usepackage{tikz}

\usetikzlibrary{positioning,arrows}

\begin{document}
\begin{tikzpicture}
    \pgfmathsetmacro\rightAngleRadius{0.2}
    \coordinate (start) at (0,0);
    \coordinate (end) at (2,0);

    \draw (start) .. controls (0.6,0.7) and (1.3,0.2) .. (end)
      node[sloped,inner sep=0cm,above,pos=.5,anchor=south west,
      minimum height=12](N){};

    \path (N.south west) edge[-stealth'] node[above left] 
        {$\vec{n}$} (N.north west);
    \draw (N.south west) ++ (\rightAngleRadius,-1pt) 
        arc (-20:80:\rightAngleRadius);
    \node[above right=-3pt] at (N.south west) {.};
\end{tikzpicture}
\end{document}

enter image description here

share|improve this question
2  
I dont’t think this question should be closed. Post the answer you found as an answer (maybe as community wiki, since it’s not your own idea) to this question and accept it … –  Tobi Feb 16 '13 at 10:22
add comment

1 Answer

up vote 1 down vote accepted

As suggested in this answer, one can use the markings library to make a local coordinate system in which to draw the symbol.

\documentclass{scrartcl}

\usepackage{tikz}
\usetikzlibrary{decorations.markings,positioning}

\begin{document}

\begin{tikzpicture}[
    tangent/.style={
        decoration={
            markings,% switch on markings
            mark=
                at position #1
                with
                {
                    \coordinate (tangent point-\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}) at (0pt,0pt);
                    \coordinate (tangent unit vector-\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}) at (1,0pt);
                    \coordinate (tangent orthogonal unit vector-\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}) at (0pt,1);
                }
        },
        postaction=decorate
    },
    use tangent/.style={
        shift=(tangent point-#1),
        x=(tangent unit vector-#1),
        y=(tangent orthogonal unit vector-#1)
    },
    use tangent/.default=1
]
    \coordinate (start) at (0, 0);
    \coordinate (end) at (5,2);
    \pgfmathsetmacro\rightAngleRadius{0.2}
    \draw[tangent=0.4] (start)
        to [out=20,in=120] (end);
    \draw[->, use tangent] (0,0) -- ++ (0,1);
    \draw[use tangent] (\rightAngleRadius,0) arc (0:90:\rightAngleRadius);
    \draw[use tangent] (0.4*\rightAngleRadius,0.4*\rightAngleRadius) node{.};
    \draw[use tangent,left] (0,1) node {$\vec{n}$};
\end{tikzpicture}
\end{document}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.