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
Error in Twin Prime Conjecture
Is it possible to upcast ritual spells?
Life insurance that covers only simultaneous/dual deaths
What has been your most complicated TikZ drawing?
How difficult is it to simply disable/disengage the MCAS on Boeing 737 Max 8 & 9 Aircraft?
Could the Saturn V actually have launched astronauts around Venus?
How do I hide Chekhov's Gun?
Does Wild Magic Surge trigger off of spells on the Sorcerer spell list, if I learned them from another class?
How could a scammer know the apps on my phone / iTunes account?
Did Ender ever learn that he killed Stilson and/or Bonzo?
If curse and magic is two sides of the same coin, why the former is forbidden?
Existence of subset with given Hausdorff dimension
What are substitutions for coconut in curry?
Most cost effective thermostat setting: consistent temperature vs. lowest temperature possible
Min function accepting varying number of arguments in C++17
Who is flying the vertibirds?
Instead of Universal Basic Income, why not Universal Basic NEEDS?
How to read the value of this capacitor?
Why would a flight no longer considered airworthy be redirected like this?
Is it normal that my co-workers at a fitness company criticize my food choices?
Why one should not leave fingerprints on bulbs and plugs?
Do the common programs (for example: "ls", "cat") in Linux and BSD come from the same source code?
Why is the President allowed to veto a cancellation of emergency powers?
How to deal with taxi scam when on vacation?
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
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
tikz-pgf plot domain
add a comment |
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
tikz-pgf plot domain
add a comment |
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
tikz-pgf plot domain
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
tikz-pgf plot domain
tikz-pgf plot domain
asked 7 hours ago
argentum2fargentum2f
1336
1336
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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):
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
1
withsamples=400,smooth
it looks better, but this is not the question ;)
– Kpym
7 hours ago
@Kpym Certainly! I just removed thesmooth
to show that 100 cycles with 40 samples won't do (unless OP wants to show the aliasing). Thanks anyway :)
– Phelype Oleinik
7 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
6 hours ago
@argentum2f Yes, as I said “oddly”. All programming languages I know (which aren't that many, but...) have asin
function for argument radians andsind
function for argument in degrees. Anyhow, Till must have had his reasons :)
– Phelype Oleinik
6 hours ago
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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):
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
1
withsamples=400,smooth
it looks better, but this is not the question ;)
– Kpym
7 hours ago
@Kpym Certainly! I just removed thesmooth
to show that 100 cycles with 40 samples won't do (unless OP wants to show the aliasing). Thanks anyway :)
– Phelype Oleinik
7 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
6 hours ago
@argentum2f Yes, as I said “oddly”. All programming languages I know (which aren't that many, but...) have asin
function for argument radians andsind
function for argument in degrees. Anyhow, Till must have had his reasons :)
– Phelype Oleinik
6 hours ago
add a comment |
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):
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
1
withsamples=400,smooth
it looks better, but this is not the question ;)
– Kpym
7 hours ago
@Kpym Certainly! I just removed thesmooth
to show that 100 cycles with 40 samples won't do (unless OP wants to show the aliasing). Thanks anyway :)
– Phelype Oleinik
7 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
6 hours ago
@argentum2f Yes, as I said “oddly”. All programming languages I know (which aren't that many, but...) have asin
function for argument radians andsind
function for argument in degrees. Anyhow, Till must have had his reasons :)
– Phelype Oleinik
6 hours ago
add a comment |
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):
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
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):
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
edited 7 hours ago
answered 7 hours ago
Phelype OleinikPhelype Oleinik
24.2k54688
24.2k54688
1
withsamples=400,smooth
it looks better, but this is not the question ;)
– Kpym
7 hours ago
@Kpym Certainly! I just removed thesmooth
to show that 100 cycles with 40 samples won't do (unless OP wants to show the aliasing). Thanks anyway :)
– Phelype Oleinik
7 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
6 hours ago
@argentum2f Yes, as I said “oddly”. All programming languages I know (which aren't that many, but...) have asin
function for argument radians andsind
function for argument in degrees. Anyhow, Till must have had his reasons :)
– Phelype Oleinik
6 hours ago
add a comment |
1
withsamples=400,smooth
it looks better, but this is not the question ;)
– Kpym
7 hours ago
@Kpym Certainly! I just removed thesmooth
to show that 100 cycles with 40 samples won't do (unless OP wants to show the aliasing). Thanks anyway :)
– Phelype Oleinik
7 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
6 hours ago
@argentum2f Yes, as I said “oddly”. All programming languages I know (which aren't that many, but...) have asin
function for argument radians andsind
function for argument in degrees. Anyhow, Till must have had his reasons :)
– Phelype Oleinik
6 hours ago
1
1
with
samples=400,smooth
it looks better, but this is not the question ;)– Kpym
7 hours ago
with
samples=400,smooth
it looks better, but this is not the question ;)– Kpym
7 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
7 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
7 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
6 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
6 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
6 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
6 hours ago
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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