I'm trying to do a nice sketch using tikz.
My tikz code is like this:
\documentclass[]{scrartcl}
\usepackage{tikz}
\usetikzlibrary{arrows}
\begin{document}
\begin{tikzpicture}[allow upside down, scale=1]
%(0,0)(0.70,1.9)(1.41,3.6)
%\draw plot [smooth, tension=0.5] coordinates{(2.13,5.1)(2.86,6.4)(3.62,7.5)(4.42,8.4)(5.30,9.1)(6.34,9.6)(7.13,9.8)(8.42,9.9)}
\draw[red,line width=1pt] (2.13,5.1) -- (2.86,6.4) -- (3.62,7.5) -- (4.42,8.4) -- (5.30,9.1) -- (6.34,9.6) -- (7.13,9.8) -- (8.42,9.9) [smooth, tension=0.5]
node[sloped,inner sep=0cm,above,pos=.5,
anchor=south west,
minimum height=2cm,minimum width=1cm](N){};
\path (N.south west)
edge[->,blue] node[left] {$\vec{ n}$} (N.north west);
\end{tikzpicture}
\end{document}
Mostly taken from there: How to draw tangent vectors and component vectors on a curve
My Problems:
- How do I define the point for the normal vector?
- I'd really like that smooth … how?
- How do I add another vector (same target, but other angle)
Output of the current code:
What I'm trying to do:
Best Answer
You have to put the
node
at appropriate places:You can use
rounded corners=<dimension>
. Choose proper<dimension>
.Using
calc
library, addx
value to(N.east)
. Reverse the arrow direction:Change
0.3
in($(N.east) + (0.3,0)$)
to suit the angle you want.With all the above, and lot of additions, the full code:
While I did not optimize the code, lot of typing could have been saved. I left it more verbose.