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.

When teaching trigonometry, sometimes it is useful to represent angles greater than 360º with some kind of "spiral arc". For example:

angles

the angle of -440º in the figure.

My question is:

How can I do this in nicely TikZ?

I can do it by using several consecutive arcs, but I wish to know if is there a more elegant solution to this.

share|improve this question
1  
spiral spring in tikz might be of interest here. –  Jake Jun 18 '12 at 17:28
    
Notice that the spiral here do not start at its center –  leo Jun 18 '12 at 17:33
1  
Yes, it's not an exact duplicate. But the general approach works here too: Try \draw [domain=0:10,variable=\t,smooth,samples=75] plot ({\t r}: {0.05*\t+0.1}); –  Jake Jun 18 '12 at 17:39
2  
BTW, I believe that the -440 angle is incorrectly labelled, it should be 440 degrees (not minus). –  Peter Grill Jun 18 '12 at 18:22
    
@PeterGrill you are absolutely right! thanks for point that –  leo Jun 18 '12 at 19:30
add comment

2 Answers

up vote 24 down vote accepted
 \documentclass[11pt]{scrartcl}
 \usepackage{tikz}
 \usetikzlibrary{arrows}

 \begin{document} 

 \newcommand\bigangle[2][]{% 
    \draw[->,domain=0:#2,variable=\t,samples=200,>=latex,#1]
      plot ({(\t+#2)*cos(\t)/(#2)},
           {(\t+#2)*sin(\t)/(#2)}) node[right=.5cm] {$#2^\circ$}
        ;}

 \begin{tikzpicture}
 \draw [thick] ( 0,0) -- (3,0);
 \draw [thick] ( 0,0) -- (0,3); 
 \draw [red,thick] ( 0,0) -- (400:3); 
 \bigangle[blue,dashed]{400}      
 \end{tikzpicture}
 \end{document}

enter image description here

enter image description here

share|improve this answer
    
This is exactly what I want. –  leo Jun 18 '12 at 21:19
    
Incredible, good math skills to achieve the desired output. –  azetina Jul 3 '12 at 19:52
    
The command works great for angles grater than 360. But it looks weird when we pass an angle a with 0 < abs(a) < 360. So far I've managed to fix it by using a conditional construct via the ifthen package. Is it possible to fix this without using any extra package? –  leo Sep 4 '13 at 16:04
add comment

Jake's method is probably simpler, but here I have adapted the standard parametric equation for a spiral and added an offset so that the spiral does not start at the origin to yield:

enter image description here

Notes:

  • The 440 in the denominator is to normalize the graph so that the arc ends at a y=1.
  • Polar equations should yield similar results with simpler equations.
  • There is something wrong with the brown line (even though it is in the correct spot) as it is not ending where I think it should, but this is not related to generating the spiral.

Code:

\documentclass{article}
\usepackage{pgfplots}

\newcommand*{\Offset}{360}%
\begin{document}
\begin{tikzpicture}
\begin{axis}[xmin=-2.5,xmax=2.5,ymin=-2.5,ymax=2.5, axis lines=center]
    \addplot[blue,densely dashed,domain=0:440,samples=200,-latex] 
        ({(x+\Offset)*cos(x+\Offset)/(440+\Offset)},
         {(x+\Offset)*sin(x+\Offset)/(440+\Offset)});

    % Show the 440 degree angle
    \pgfmathsetmacro{\XValue}{1.0}%
    \pgfmathsetmacro{\YValue}{\XValue*tan(440)}%
    \draw [brown, thick] (axis cs: 0,0) -- (axis cs: \XValue,\YValue);
\end{axis}
\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.