What is the domain in a tikz parametric plot?LaTeX equivalent of ConTeXt buffersHow can I put a coloured outline around fraction lines?How to define the default vertical distance between nodes?Numerical conditional within tikz keys?TikZ: Drawing an arc from an intersection to an intersectionHow to prevent rounded and duplicated tick labels in pgfplots with fixed precision?Drawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingLine up nested tikz enviroments or how to get rid of themHow to draw a square and its diagonals with arrows?Get tikz domain and range

Do the common programs (for example: "ls", "cat") in Linux and BSD come from the same source code?

What is the domain in a tikz parametric plot?

Why does Bach not break the rules here?

How do I hide Chekhov's Gun?

Gantt Chart like rectangles with log scale

Unexpected result from ArcLength

How to simplify this time periods definition interface?

How to read the value of this capacitor?

How to use deus ex machina safely?

What should tie a collection of short-stories together?

What did Alexander Pope mean by "Expletives their feeble Aid do join"?

Have researchers managed to "reverse time"? If so, what does that mean for physics?

Why did it take so long to abandon sail after steamships were demonstrated?

Why doesn't using two cd commands in bash script execute the second command?

Happy pi day, everyone!

Min function accepting varying number of arguments in C++17

Employee lack of ownership

How Could an Airship Be Repaired Mid-Flight

Do these spellcasting foci from Xanathar's Guide to Everything have to be held in a hand?

How to terminate ping <dest> &

What approach do we need to follow for projects without a test environment?

How to write cleanly even if my character uses expletive language?

What are substitutions for coconut in curry?

how to write formula in word in latex



What is the domain in a tikz parametric plot?


LaTeX equivalent of ConTeXt buffersHow can I put a coloured outline around fraction lines?How to define the default vertical distance between nodes?Numerical conditional within tikz keys?TikZ: Drawing an arc from an intersection to an intersectionHow to prevent rounded and duplicated tick labels in pgfplots with fixed precision?Drawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingLine up nested tikz enviroments or how to get rid of themHow to draw a square and its diagonals with arrows?Get tikz domain and range













2















I don't understand what's going on here. If the domain of the parametric parameter t is 0:100, then the function sin(2pi*t) should oscillate about 100 times, but it only oscillates a couple. What am I missing?



documentclassarticle
usepackagetikz
begindocument
begintikzpicture
beginscope[x=.6textwidth,y=.6textwidth]
draw[very thin,color=gray, step=.1] (0.0,0.0) grid (1,1);
draw [ thick, domain=0:100, samples=40, smooth, variable=t]
plot (t/100, sin(2*pi*t)*.5+.5);
endscope
endtikzpicture
enddocument


enter image description here










share|improve this question


























    2















    I don't understand what's going on here. If the domain of the parametric parameter t is 0:100, then the function sin(2pi*t) should oscillate about 100 times, but it only oscillates a couple. What am I missing?



    documentclassarticle
    usepackagetikz
    begindocument
    begintikzpicture
    beginscope[x=.6textwidth,y=.6textwidth]
    draw[very thin,color=gray, step=.1] (0.0,0.0) grid (1,1);
    draw [ thick, domain=0:100, samples=40, smooth, variable=t]
    plot (t/100, sin(2*pi*t)*.5+.5);
    endscope
    endtikzpicture
    enddocument


    enter image description here










    share|improve this question
























      2












      2








      2








      I don't understand what's going on here. If the domain of the parametric parameter t is 0:100, then the function sin(2pi*t) should oscillate about 100 times, but it only oscillates a couple. What am I missing?



      documentclassarticle
      usepackagetikz
      begindocument
      begintikzpicture
      beginscope[x=.6textwidth,y=.6textwidth]
      draw[very thin,color=gray, step=.1] (0.0,0.0) grid (1,1);
      draw [ thick, domain=0:100, samples=40, smooth, variable=t]
      plot (t/100, sin(2*pi*t)*.5+.5);
      endscope
      endtikzpicture
      enddocument


      enter image description here










      share|improve this question














      I don't understand what's going on here. If the domain of the parametric parameter t is 0:100, then the function sin(2pi*t) should oscillate about 100 times, but it only oscillates a couple. What am I missing?



      documentclassarticle
      usepackagetikz
      begindocument
      begintikzpicture
      beginscope[x=.6textwidth,y=.6textwidth]
      draw[very thin,color=gray, step=.1] (0.0,0.0) grid (1,1);
      draw [ thick, domain=0:100, samples=40, smooth, variable=t]
      plot (t/100, sin(2*pi*t)*.5+.5);
      endscope
      endtikzpicture
      enddocument


      enter image description here







      tikz-pgf plot domain






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 4 hours ago









      argentum2fargentum2f

      1336




      1336




















          1 Answer
          1






          active

          oldest

          votes


















          4














          You got the domain right. The problem is that the trigonometric functions in TikZ are (oddly, in my opinion) in degrees by default. So 2*pi*t with t between 0 and 100 will give you the sine function (in degrees) between 0 and 628.3 degrees (which is about 10.96 radians) which almost 1.75 periods of the function. This is exactly what you see there: one full period and 3/4 of another.



          You can tell TikZ to use radians by appending an r to the argument or using the rad function (see page 1005 of the TikZ-PGF manual, section 93.3.4 “Trigonometric functions”). I also added the FPU to allow the domain up to 100 and increased the number of samples to 400 following Kpym's suggestion (notice the aliasing):




          enter image description here




          documentclassarticle
          usepackagetikz
          usetikzlibraryfpu
          begindocument
          begintikzpicture
          beginscope[x=.6textwidth,y=.6textwidth]
          pgfkeys/pgf/fpu=true,/pgf/fpu/output format=fixed
          draw[very thin,color=gray, step=.1] (0.0,0.0) grid (1,1);
          draw [ thick, domain=0:100, samples=400, smooth, variable=t]
          plot (t/100, sin(2*pi*t r)*.5+.5);
          endscope% ^
          endtikzpicture
          enddocument





          share|improve this answer




















          • 1





            with samples=400,smooth it looks better, but this is not the question ;)

            – Kpym
            4 hours ago











          • @Kpym Certainly! I just removed the smooth to show that 100 cycles with 40 samples won't do (unless OP wants to show the aliasing). Thanks anyway :)

            – Phelype Oleinik
            4 hours ago











          • Doh! Degrees... Yeah, don't know why that didn't occur to me. I'm just so used to thinking in radians. Usually trigonometric functions are defined assuming radians, but I guess it makes sense since everywhere else in latex assumes angles are degrees. I actually did try and turn up the samples at first - thought it was just aliasing.

            – argentum2f
            3 hours ago











          • @argentum2f Yes, as I said “oddly”. All programming languages I know (which aren't that many, but...) have a sin function for argument radians and sind function for argument in degrees. Anyhow, Till must have had his reasons :)

            – Phelype Oleinik
            3 hours ago










          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "85"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f479719%2fwhat-is-the-domain-in-a-tikz-parametric-plot%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          4














          You got the domain right. The problem is that the trigonometric functions in TikZ are (oddly, in my opinion) in degrees by default. So 2*pi*t with t between 0 and 100 will give you the sine function (in degrees) between 0 and 628.3 degrees (which is about 10.96 radians) which almost 1.75 periods of the function. This is exactly what you see there: one full period and 3/4 of another.



          You can tell TikZ to use radians by appending an r to the argument or using the rad function (see page 1005 of the TikZ-PGF manual, section 93.3.4 “Trigonometric functions”). I also added the FPU to allow the domain up to 100 and increased the number of samples to 400 following Kpym's suggestion (notice the aliasing):




          enter image description here




          documentclassarticle
          usepackagetikz
          usetikzlibraryfpu
          begindocument
          begintikzpicture
          beginscope[x=.6textwidth,y=.6textwidth]
          pgfkeys/pgf/fpu=true,/pgf/fpu/output format=fixed
          draw[very thin,color=gray, step=.1] (0.0,0.0) grid (1,1);
          draw [ thick, domain=0:100, samples=400, smooth, variable=t]
          plot (t/100, sin(2*pi*t r)*.5+.5);
          endscope% ^
          endtikzpicture
          enddocument





          share|improve this answer




















          • 1





            with samples=400,smooth it looks better, but this is not the question ;)

            – Kpym
            4 hours ago











          • @Kpym Certainly! I just removed the smooth to show that 100 cycles with 40 samples won't do (unless OP wants to show the aliasing). Thanks anyway :)

            – Phelype Oleinik
            4 hours ago











          • Doh! Degrees... Yeah, don't know why that didn't occur to me. I'm just so used to thinking in radians. Usually trigonometric functions are defined assuming radians, but I guess it makes sense since everywhere else in latex assumes angles are degrees. I actually did try and turn up the samples at first - thought it was just aliasing.

            – argentum2f
            3 hours ago











          • @argentum2f Yes, as I said “oddly”. All programming languages I know (which aren't that many, but...) have a sin function for argument radians and sind function for argument in degrees. Anyhow, Till must have had his reasons :)

            – Phelype Oleinik
            3 hours ago















          4














          You got the domain right. The problem is that the trigonometric functions in TikZ are (oddly, in my opinion) in degrees by default. So 2*pi*t with t between 0 and 100 will give you the sine function (in degrees) between 0 and 628.3 degrees (which is about 10.96 radians) which almost 1.75 periods of the function. This is exactly what you see there: one full period and 3/4 of another.



          You can tell TikZ to use radians by appending an r to the argument or using the rad function (see page 1005 of the TikZ-PGF manual, section 93.3.4 “Trigonometric functions”). I also added the FPU to allow the domain up to 100 and increased the number of samples to 400 following Kpym's suggestion (notice the aliasing):




          enter image description here




          documentclassarticle
          usepackagetikz
          usetikzlibraryfpu
          begindocument
          begintikzpicture
          beginscope[x=.6textwidth,y=.6textwidth]
          pgfkeys/pgf/fpu=true,/pgf/fpu/output format=fixed
          draw[very thin,color=gray, step=.1] (0.0,0.0) grid (1,1);
          draw [ thick, domain=0:100, samples=400, smooth, variable=t]
          plot (t/100, sin(2*pi*t r)*.5+.5);
          endscope% ^
          endtikzpicture
          enddocument





          share|improve this answer




















          • 1





            with samples=400,smooth it looks better, but this is not the question ;)

            – Kpym
            4 hours ago











          • @Kpym Certainly! I just removed the smooth to show that 100 cycles with 40 samples won't do (unless OP wants to show the aliasing). Thanks anyway :)

            – Phelype Oleinik
            4 hours ago











          • Doh! Degrees... Yeah, don't know why that didn't occur to me. I'm just so used to thinking in radians. Usually trigonometric functions are defined assuming radians, but I guess it makes sense since everywhere else in latex assumes angles are degrees. I actually did try and turn up the samples at first - thought it was just aliasing.

            – argentum2f
            3 hours ago











          • @argentum2f Yes, as I said “oddly”. All programming languages I know (which aren't that many, but...) have a sin function for argument radians and sind function for argument in degrees. Anyhow, Till must have had his reasons :)

            – Phelype Oleinik
            3 hours ago













          4












          4








          4







          You got the domain right. The problem is that the trigonometric functions in TikZ are (oddly, in my opinion) in degrees by default. So 2*pi*t with t between 0 and 100 will give you the sine function (in degrees) between 0 and 628.3 degrees (which is about 10.96 radians) which almost 1.75 periods of the function. This is exactly what you see there: one full period and 3/4 of another.



          You can tell TikZ to use radians by appending an r to the argument or using the rad function (see page 1005 of the TikZ-PGF manual, section 93.3.4 “Trigonometric functions”). I also added the FPU to allow the domain up to 100 and increased the number of samples to 400 following Kpym's suggestion (notice the aliasing):




          enter image description here




          documentclassarticle
          usepackagetikz
          usetikzlibraryfpu
          begindocument
          begintikzpicture
          beginscope[x=.6textwidth,y=.6textwidth]
          pgfkeys/pgf/fpu=true,/pgf/fpu/output format=fixed
          draw[very thin,color=gray, step=.1] (0.0,0.0) grid (1,1);
          draw [ thick, domain=0:100, samples=400, smooth, variable=t]
          plot (t/100, sin(2*pi*t r)*.5+.5);
          endscope% ^
          endtikzpicture
          enddocument





          share|improve this answer















          You got the domain right. The problem is that the trigonometric functions in TikZ are (oddly, in my opinion) in degrees by default. So 2*pi*t with t between 0 and 100 will give you the sine function (in degrees) between 0 and 628.3 degrees (which is about 10.96 radians) which almost 1.75 periods of the function. This is exactly what you see there: one full period and 3/4 of another.



          You can tell TikZ to use radians by appending an r to the argument or using the rad function (see page 1005 of the TikZ-PGF manual, section 93.3.4 “Trigonometric functions”). I also added the FPU to allow the domain up to 100 and increased the number of samples to 400 following Kpym's suggestion (notice the aliasing):




          enter image description here




          documentclassarticle
          usepackagetikz
          usetikzlibraryfpu
          begindocument
          begintikzpicture
          beginscope[x=.6textwidth,y=.6textwidth]
          pgfkeys/pgf/fpu=true,/pgf/fpu/output format=fixed
          draw[very thin,color=gray, step=.1] (0.0,0.0) grid (1,1);
          draw [ thick, domain=0:100, samples=400, smooth, variable=t]
          plot (t/100, sin(2*pi*t r)*.5+.5);
          endscope% ^
          endtikzpicture
          enddocument






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 4 hours ago

























          answered 4 hours ago









          Phelype OleinikPhelype Oleinik

          24.2k54688




          24.2k54688







          • 1





            with samples=400,smooth it looks better, but this is not the question ;)

            – Kpym
            4 hours ago











          • @Kpym Certainly! I just removed the smooth to show that 100 cycles with 40 samples won't do (unless OP wants to show the aliasing). Thanks anyway :)

            – Phelype Oleinik
            4 hours ago











          • Doh! Degrees... Yeah, don't know why that didn't occur to me. I'm just so used to thinking in radians. Usually trigonometric functions are defined assuming radians, but I guess it makes sense since everywhere else in latex assumes angles are degrees. I actually did try and turn up the samples at first - thought it was just aliasing.

            – argentum2f
            3 hours ago











          • @argentum2f Yes, as I said “oddly”. All programming languages I know (which aren't that many, but...) have a sin function for argument radians and sind function for argument in degrees. Anyhow, Till must have had his reasons :)

            – Phelype Oleinik
            3 hours ago












          • 1





            with samples=400,smooth it looks better, but this is not the question ;)

            – Kpym
            4 hours ago











          • @Kpym Certainly! I just removed the smooth to show that 100 cycles with 40 samples won't do (unless OP wants to show the aliasing). Thanks anyway :)

            – Phelype Oleinik
            4 hours ago











          • Doh! Degrees... Yeah, don't know why that didn't occur to me. I'm just so used to thinking in radians. Usually trigonometric functions are defined assuming radians, but I guess it makes sense since everywhere else in latex assumes angles are degrees. I actually did try and turn up the samples at first - thought it was just aliasing.

            – argentum2f
            3 hours ago











          • @argentum2f Yes, as I said “oddly”. All programming languages I know (which aren't that many, but...) have a sin function for argument radians and sind function for argument in degrees. Anyhow, Till must have had his reasons :)

            – Phelype Oleinik
            3 hours ago







          1




          1





          with samples=400,smooth it looks better, but this is not the question ;)

          – Kpym
          4 hours ago





          with samples=400,smooth it looks better, but this is not the question ;)

          – Kpym
          4 hours ago













          @Kpym Certainly! I just removed the smooth to show that 100 cycles with 40 samples won't do (unless OP wants to show the aliasing). Thanks anyway :)

          – Phelype Oleinik
          4 hours ago





          @Kpym Certainly! I just removed the smooth to show that 100 cycles with 40 samples won't do (unless OP wants to show the aliasing). Thanks anyway :)

          – Phelype Oleinik
          4 hours ago













          Doh! Degrees... Yeah, don't know why that didn't occur to me. I'm just so used to thinking in radians. Usually trigonometric functions are defined assuming radians, but I guess it makes sense since everywhere else in latex assumes angles are degrees. I actually did try and turn up the samples at first - thought it was just aliasing.

          – argentum2f
          3 hours ago





          Doh! Degrees... Yeah, don't know why that didn't occur to me. I'm just so used to thinking in radians. Usually trigonometric functions are defined assuming radians, but I guess it makes sense since everywhere else in latex assumes angles are degrees. I actually did try and turn up the samples at first - thought it was just aliasing.

          – argentum2f
          3 hours ago













          @argentum2f Yes, as I said “oddly”. All programming languages I know (which aren't that many, but...) have a sin function for argument radians and sind function for argument in degrees. Anyhow, Till must have had his reasons :)

          – Phelype Oleinik
          3 hours ago





          @argentum2f Yes, as I said “oddly”. All programming languages I know (which aren't that many, but...) have a sin function for argument radians and sind function for argument in degrees. Anyhow, Till must have had his reasons :)

          – Phelype Oleinik
          3 hours ago

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f479719%2fwhat-is-the-domain-in-a-tikz-parametric-plot%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Are there any AGPL-style licences that require source code modifications to be public? Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Force derivative works to be publicAre there any GPL like licenses for Apple App Store?Do you violate the GPL if you provide source code that cannot be compiled?GPL - is it distribution to use libraries in an appliance loaned to customers?Distributing App for free which uses GPL'ed codeModifications of server software under GPL, with web/CLI interfaceDoes using an AGPLv3-licensed library prevent me from dual-licensing my own source code?Can I publish only select code under GPLv3 from a private project?Is there published precedent regarding the scope of covered work that uses AGPL software?If MIT licensed code links to GPL licensed code what should be the license of the resulting binary program?If I use a public API endpoint that has its source code licensed under AGPL in my app, do I need to disclose my source?

          2013 GY136 Descoberta | Órbita | Referências Menu de navegação«List Of Centaurs and Scattered-Disk Objects»«List of Known Trans-Neptunian Objects»

          Button changing it's text & action. Good or terrible? The 2019 Stack Overflow Developer Survey Results Are Inchanging text on user mouseoverShould certain functions be “hard to find” for powerusers to discover?Custom liking function - do I need user login?Using different checkbox style for different checkbox behaviorBest Practices: Save and Exit in Software UIInteraction with remote validated formMore efficient UI to progress the user through a complicated process?Designing a popup notice for a gameShould bulk-editing functions be hidden until a table row is selected, or is there a better solution?Is it bad practice to disable (replace) the context menu?