# Automatically place right angle indicator on normal vector

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}
\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)
\node[above right=-3pt] at (N.south west) {.};
\end{tikzpicture}
\end{document}


-
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

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);
\draw[use tangent,left] (0,1) node {$\vec{n}$};