Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.
  1. How can I draw trigonometric angles of any radian measure associated with the unit circle, complete with the x-axis and y-axis?

  2. How can I draw arcs of rotation inside positive or negative angles?

  3. Is there a method for drawing arcs inside angles of more than one rotation?

Here is a link showing what I would like to draw:

http://hotmath.com/hotmath_help/topics/coterminal-angles.html

share|improve this question
1  
Holy spirals, Batman! –  belisarius Apr 29 '13 at 0:49
1  
Welcome to this site. To continue with your style of writing: Here is a link showing what I would like you to read: FAQ –  halirutan Apr 29 '13 at 2:31

4 Answers 4

Here's something I've used before:

rotCircle[angle_, ctr_, base1_, base2_, directives___] :=
 With[{step = 0.05 Sign[angle], spiral = 0.01},
  {directives,
   Arrow[Table[ctr + (1.1 + spiral s) (Cos[s] base1 + Sin[s] base2),
     {s, Append[Range[0, angle, step], angle]}]]}
  ]

Graphics[rotCircle[10., {0, 0}, {1, 0}, {0, 1},  Red, Thick], PlotRange -> 1.2]

Angle spiral

The argument base1 is the starting side and base2 should be an orthogonal vector pointing in the direction in which the angle increases from base1.


Just too much fun, or trying to avoid work:

Clear[rotCircle];
Module[{spiralPitch = 0.01},
  rotCircle[angle_, ctr_, radius_, directives___] := 
    With[{step = 0.05 Sign[angle]},
      {directives, Arrow[Table[
         ctr + (1.1 + spiralPitch s) (Cos[s] radius + Sin[s] Cross[radius]),
         {s, Append[Range[0, angle, step], angle]}]]}];
  spiral[] := (spiralPitch = 0.01; {});
  spiral[pitch_] := (spiralPitch = pitch; {});
  ];
directedAngle[u_?VectorQ, v_?VectorQ] := Sign[Det[{u, v}]] VectorAngle[u, v];

spiral[pitch] half works like a directive, except that it is processed in the kernel instead of the front end. (Also, I got replace base1, base2 by a single radius, which is the starting side of the angle.

SeedRandom[16];
Module[{pts = RandomReal[{0, 10}, {10, 2}], lines}, 
 lines = Normalize /@ Differences@pts;
 Graphics[{Thick, Line[pts], Arrowheads[Small],
   MapThread[
    rotCircle[directedAngle[#1, -#2] +  2 π RandomChoice[{1, 2, 3, 2, 1} -> Range[-2, 2]],
      #3, -0.4 #1, spiral[0.05], Red, Thickness[Medium]] &,
    {Most[lines], Rest[lines], pts[[2 ;; -2]]}]
   }, PlotRange -> All]
 ]

Many marked angles

share|improve this answer

Does this give you a start?

DynamicModule[{p = {1.5, 0}},
 Deploy@LocatorPane[Dynamic[p],
   Dynamic@Graphics[
     {Brown, Thick, Line[{{0, 0}, p/Norm[p]*1.5}],
      Circle[{0, 0}, 1, {Mod[ArcTan @@ p, 2 Pi], 2 Pi}]}, 
     PlotRange -> {{-2, 2}, {-2, 2}}, Axes -> True, 
     AxesOrigin -> {0, 0}], Appearance -> None
   ]
 ]

enter image description here

share|improve this answer
    
I remember that in version 8 there is an undocumented spinny control like this which also takes into account winding. I don't remember what it was called/what package it was in. –  amr Apr 29 '13 at 4:21
2  
@amr What you mean is probably Experimental`AngularSlider[Dynamic[phi]] –  halirutan Apr 29 '13 at 4:25
    
that's the one! it's such a cute little control –  amr Apr 29 '13 at 4:34

this is the kind of "hack" that I often throw together to illustrate math concepts for my students. The code is terrible but the result looks okay. Perhaps there is something here you can use...

enter image description here

The code...

Manipulate[

 If[angle < 0,

  endpt = {Cos[Abs[angle]  Degree], - Sin[Abs[angle] Degree]} + 
    0.1 Abs[angle] Degree {Cos[
       Abs[angle] Degree], -Sin[Abs[angle] Degree]},

  endpt = {Cos[angle Degree], Sin[angle Degree]} + 
    0.1 angle Degree {Cos[angle Degree], Sin[angle Degree]}];
 (*this is the endpoint of the terminal arm*)



 length = EuclideanDistance[{0, 0}, endpt];
 (*this is the length of the terminal arm*)

 Column[{
   If[showQ1, 
    Row[{"Principal angle:  ", 
      ToString[Mod[angle, 360]] <> "\[Degree]"}], " "],
   If[showQ2, 
    Row[{"Angle measure:  ", ToString[angle] <> "\[Degree]"}], ""],
   Graphics[{

     {GrayLevel[0.8], Line[{{- 1.2 length, 0}, {1.2 length, 0}}], 
      Line[{{0, - 1.2 length}, {0, 1.2 length}}]},
     (*draw the axes*)

     {Blue, Thick, Line[{{0, 0}, {length, 0}}]},
     (*initial arm*)

     {Red, Thick, Line[{{0, 0}, endpt}]},
     (*terminal arm*)

     If[angle < 0,
      Arrow[{#[[1]], -#[[2]]} & /@ Table[
         {Cos[i], Sin[i]} + 0.1 i {Cos[i], Sin[i]} , {i, 0, 
          Abs[angle] Degree, 2 \[Pi]/100.}]],

      Arrow[Table[
        {Cos[i], Sin[i]} + 0.1 i {Cos[i], Sin[i]} , {i, 0, 
         angle Degree, 2 \[Pi]/100.}]],
      Arrow[Table[
        {Cos[i], Sin[i]} - 0.1 i {Cos[i], Sin[i]} , {i,  0, 
         angle Degree, 2 \[Pi]/100.}]]]
     (*the spiral and arrow on end*)

     }, ImageSize -> 600]
   }, Alignment -> Center], 
  {{angle, 30}, -1800, 1800, 1},
 Delimiter,
 {{showQ1, False, "Show principal angle value"}, {True, False}},
 {{showQ2, False, "Show angle 1 value"}, {True, False}},
 ControlPlacement -> Left

 ]
share|improve this answer

To give people ideas:

angle[a_] := Module[{p}, Show[
    p = PolarPlot[1000 + 10 x, {x, 0, a}, PlotStyle -> Thick],
    Graphics[{Thick, Extract[p, Position[p, _Hue]][[1]],
      Line[{{0, 0}, 1.9 Extract[p, Position[p, _Line]][[1, 1, -1]]}]}]]];

angle[(2 360 + 45) Degree]

enter image description here

Remember to watch for negative angles.

share|improve this answer

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.