1
$\begingroup$

enter image description here

I want to plot a trigonometry function (for example : $\lfloor 2\cos x\rfloor$) using Mathematica. And I want to scaling x axis using multiples of $\pi$ . For example $\frac{\pi}{2}$ , $\pi$ , $\frac{3\pi}{2}$ and $2\pi$. But in the graph doesn't show exact point of roots.

Please Help!

$\endgroup$
  • 1
    $\begingroup$ stackoverflow.com/questions/8936579/… $\endgroup$ – Alan Dec 3 '16 at 20:33
  • $\begingroup$ @Alan Thank you , But it doesn't show exact values of roots in the graph versus $\pi$ multiples. $\endgroup$ – S.H.W Dec 3 '16 at 20:47
3
$\begingroup$
sol = Sort@
  DeleteDuplicates@
   Cases[Table[
     Reduce[Floor[2 Cos[x]] == i && 0 < x < 2 Pi, x], {i, -2, 2}], 
   _Times, Infinity]

enter image description here

ticks = Transpose@{sol, sol};

Plot[Floor[2 Cos[x]], {x, 0, 2 Pi}, Mesh -> {Range[-2, 2]}, 
 MeshFunctions -> {#2 &}, MeshStyle -> Directive[Red, PointSize[.02]],
  Ticks -> {ticks, Automatic}, Filling -> Axis]

enter image description here

$\endgroup$
  • $\begingroup$ Fantastic ! Thank You. $\endgroup$ – S.H.W Dec 3 '16 at 23:49
  • $\begingroup$ Can you provide a good source for learning Mathematica ? $\endgroup$ – S.H.W Dec 3 '16 at 23:52
  • $\begingroup$ @S.H.W Practice and this site :) $\endgroup$ – corey979 Dec 3 '16 at 23:53
  • $\begingroup$ In your picture , some of points must be empty. How I can determine this points ? $\endgroup$ – S.H.W Dec 3 '16 at 23:55
  • $\begingroup$ What is an empty point? $\endgroup$ – corey979 Dec 4 '16 at 10:02

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.