2
$\begingroup$

I need that the appearence labeled of the manipulate take the form rationalize. My code is:

Manipulate[
 Plot[Cos@x, {x, 0, 10}, 
  Epilog -> {PointSize[0.02], Point[{t, Cos[t]}]}], {{t, 0}, 0, 10, 1,
   Appearance -> "Labeled"}]

Something like:

Manipulate[
  Plot[Cos@x, {x, 0, 10}, Epilog -> {PointSize[0.02], Point[{t, 
   Cos[t]}]}], {{t, 0}, 0, 10, 1,   Appearance -> \[Pi] Rationalize[2]}]

I am working in this code:

[![Manipulate\[
 Grid\[{{Graphics\[{Circle\[{0, 0}, 5\], Blue, PointSize\[.04\], 
      Style\[Text\[
        "Q", {4.4 Cos\[\[Theta\] + \[Pi\]/2\], 
         4.4 Sin\[\[Theta\] + \[Pi\]/2\]}\], Black, Bold \] , 
      Point\[{5 Cos\[\[Theta\] + \[Pi\]/2\], 5 Sin\[\[Theta\] + \[Pi\]/2\]}\]}, 
     Axes -> True\], 
    Plot\[-5 Cos\[x\], {x, 0, 11}, 
     Ticks -> {Range\[0, 11\], Range\[-5, 5, 2\]}, 
     PlotLabel -> 
      Style\["x(t)= A Cos(\[Omega\]t+\[Theta\])", Black, Bold\], 
     AxesLabel -> {t\[s\], X\[cm\]}, ImageSize -> 350, 
     Epilog -> {Red, 
       Line\[{{\[Theta\], 0}, {\[Theta\], -5 Cos\[\[Theta\]\]}}\], {Black, 
        Dashed, Line\[{{0, 5}, {10, 5}}\]},
       {Black, Dashed, Line\[{{0, -5}, {10, -5}}\]}, PointSize\[.025\], 
       Point\[{\[Theta\], -5 Cos\[\[Theta\]\]}\] , 
       Style\[Text\["Q", {\[Theta\] + .35, -5.4 Cos\[\[Theta\]\]}\], Black, 
        Bold \]            }\]}}, 
  Frame -> All\], {{\[Theta\], 0, "Position(\[Theta\])"}, 0, 11, 
  Appearance -> "Labeled"}, SaveDefinitions -> True\]][1]][1]

enter image description here

$\endgroup$
  • 1
    $\begingroup$ I don't understand maybe, but would {{t, 0}, 0, 10*Pi, Pi, Appearance -> "Labeled"} do what you seek? $\endgroup$ – Michael E2 May 21 '18 at 20:19
  • $\begingroup$ Or maybe this? Manipulate[ Plot[Cos@x, {x, 0, 10}, Epilog -> {PointSize[0.02], Point[{t, Cos[t]}]}], {{t, 0}, 0, 10, 1/10, Appearance -> "Labeled"}] or do you mean this: Appearance -> {[Pi] Rationalize[2], "Labeled"}} $\endgroup$ – bill s May 21 '18 at 20:19
  • $\begingroup$ I get it !!!!! is this {{[Theta], 0, "tiempo(t)"}, 0, 3 Pi, Pi/2, Appearance -> "Labeled"} $\endgroup$ – Andres May 21 '18 at 21:09
  • $\begingroup$ @Andres It's perfectly ok to post your solution in the preceding comment as an answer below. $\endgroup$ – Michael E2 May 21 '18 at 21:23
  • $\begingroup$ Thanks my friend @Michael E2 and you @ bill s.Your comments helped me to notice my mistake. $\endgroup$ – Andres May 21 '18 at 21:28
2
$\begingroup$

It's easy. Just make your own version of a manipulator control.

Manipulate[
  Plot[Cos @ x, {x, 0, 3 π}, Epilog -> {PointSize[0.02], Point[{t, Cos[t]}]}],
  Row[{Control[{t, 0, 3 π, .1 π}], "  " , Dynamic[Rationalize[t/π]], "π"}]]

demo

$\endgroup$
  • $\begingroup$ Perfect @m_goldberg, this code has implicit step of 0.1.Thanks. $\endgroup$ – Andres May 22 '18 at 14:46
  • $\begingroup$ @Andres. No, it imposes an explicit step of 0.1 π. You can change that to any step size you like. $\endgroup$ – m_goldberg May 23 '18 at 1:54
  • 1
    $\begingroup$ @Andres. You have asked a number of questions and received good answers for which you have left thank-you notes in comments. On Stack Exchange sites that is not the preferred behavior; better to upvote and, in the case of the best answer, accept. Please read this and this $\endgroup$ – m_goldberg May 23 '18 at 2:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.