5

Mathematica seems to support no "rotation slider" Control which might be used, for instance, in setting an angular direction ($0 \leq \theta \leq 2 \pi$) on a plane. I couldn't find one in the documentation. One can constrain a Slider2D to have a unit length, so that the resulting slider performs as I need, but that seems kludgy and the interface inelegant and non-obvious.

Is there any code creating what we might call a SliderAngle or equivalent, with nice graphics that can be scaled, colored, and such? We should be able to "wind up" the control... that is continually increase the angle clockwise or counterclockwise through multiple revolutions.

user64494
  • 26,149
  • 4
  • 27
  • 56
David G. Stork
  • 41,180
  • 3
  • 34
  • 96

1 Answers1

7
Manipulate[
 ParametricPlot[{Cos[x], Sin[3  x]}, {x, 0, 5 Pi}, 
  MeshFunctions -> {#3 &}, 
  Mesh -> {{Abs @ z}},
  PlotLabel -> z, 
  MeshStyle -> Directive[Red, AbsolutePointSize @ 15]], 
{{z, Pi/4}, Experimental`AngularSlider[#] &}]

enter image description here

Manipulate[
 ParametricPlot[{Cos[x], Sin[3  x]}, {x, 0, 5 Pi}, 
  MeshFunctions -> {#3 &}, 
  Mesh -> {{Abs@z}}, 
  PlotLabel -> Style[Round[z, Pi/32], 16], 
  MeshStyle -> Directive[Red, AbsolutePointSize@15]], 
{{z, Pi/4}, 
  Experimental`AngularSlider[#, 
    Appearance -> Dynamic @ Graphics @
       Text[Style[Round[z, Pi/32], 16], {0, 0}, {0, -1.1},  
          - Cross @ {Cos @ z, Sin @ z}], 
    FrameMargins -> 30] &}]

enter image description here

NotebookTools`AngularSliderTest[]

enter image description here

Options[Experimental`AngularSlider] // Column

enter image description here

kglr
  • 394,356
  • 18
  • 477
  • 896