ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 18 Oct 2010 05:12:12 -0500GRE Math Subject Test Sample Question #1https://ask.sagemath.org/question/7731/gre-math-subject-test-sample-question-1/What is the length of the parametric curve: f(t) = (x,y) = (cos(t),sin(t)), for t in [0,Pi] ?
Update: Mike got the answer lightning-/mike-fast. Here's the output of parametric_plot() below:
![alt text][2]
Update 2: Per Mitesh's suggestion, I called parametric_plot() with keyword argument "aspect_ratio=1"; the image below looks more round with a 1:1 aspect ratio:
![alt text][1]
[1]: /upfiles/12873540266117765.png
[2]: /upfiles/12873516345197655.pngSun, 17 Oct 2010 09:33:15 -0500https://ask.sagemath.org/question/7731/gre-math-subject-test-sample-question-1/Comment by ccanonc for <p>What is the length of the parametric curve: f(t) = (x,y) = (cos(t),sin(t)), for t in [0,Pi] ?</p>
<p>Update: Mike got the answer lightning-/mike-fast. Here's the output of parametric_plot() below:</p>
<p><img alt="alt text" src="/upfiles/12873516345197655.png"/></p>
<p>Update 2: Per Mitesh's suggestion, I called parametric_plot() with keyword argument "aspect_ratio=1"; the image below looks more round with a 1:1 aspect ratio:</p>
<p><img alt="alt text" src="/upfiles/12873540266117765.png"/></p>
https://ask.sagemath.org/question/7731/gre-math-subject-test-sample-question-1/?comment=22561#post-id-22561I think you should take credit Mitesh. :-)Mon, 18 Oct 2010 02:50:55 -0500https://ask.sagemath.org/question/7731/gre-math-subject-test-sample-question-1/?comment=22561#post-id-22561Comment by Mitesh Patel for <p>What is the length of the parametric curve: f(t) = (x,y) = (cos(t),sin(t)), for t in [0,Pi] ?</p>
<p>Update: Mike got the answer lightning-/mike-fast. Here's the output of parametric_plot() below:</p>
<p><img alt="alt text" src="/upfiles/12873516345197655.png"/></p>
<p>Update 2: Per Mitesh's suggestion, I called parametric_plot() with keyword argument "aspect_ratio=1"; the image below looks more round with a 1:1 aspect ratio:</p>
<p><img alt="alt text" src="/upfiles/12873540266117765.png"/></p>
https://ask.sagemath.org/question/7731/gre-math-subject-test-sample-question-1/?comment=22568#post-id-22568Should we use the plot option `aspect_ratio=1` here to make the semicircle appear more circular?Sun, 17 Oct 2010 11:55:20 -0500https://ask.sagemath.org/question/7731/gre-math-subject-test-sample-question-1/?comment=22568#post-id-22568Comment by ccanonc for <p>What is the length of the parametric curve: f(t) = (x,y) = (cos(t),sin(t)), for t in [0,Pi] ?</p>
<p>Update: Mike got the answer lightning-/mike-fast. Here's the output of parametric_plot() below:</p>
<p><img alt="alt text" src="/upfiles/12873516345197655.png"/></p>
<p>Update 2: Per Mitesh's suggestion, I called parametric_plot() with keyword argument "aspect_ratio=1"; the image below looks more round with a 1:1 aspect ratio:</p>
<p><img alt="alt text" src="/upfiles/12873540266117765.png"/></p>
https://ask.sagemath.org/question/7731/gre-math-subject-test-sample-question-1/?comment=22567#post-id-22567Good point Mitesh. Is there a reason it's not the default?Sun, 17 Oct 2010 11:59:05 -0500https://ask.sagemath.org/question/7731/gre-math-subject-test-sample-question-1/?comment=22567#post-id-22567Comment by ccanonc for <p>What is the length of the parametric curve: f(t) = (x,y) = (cos(t),sin(t)), for t in [0,Pi] ?</p>
<p>Update: Mike got the answer lightning-/mike-fast. Here's the output of parametric_plot() below:</p>
<p><img alt="alt text" src="/upfiles/12873516345197655.png"/></p>
<p>Update 2: Per Mitesh's suggestion, I called parametric_plot() with keyword argument "aspect_ratio=1"; the image below looks more round with a 1:1 aspect ratio:</p>
<p><img alt="alt text" src="/upfiles/12873540266117765.png"/></p>
https://ask.sagemath.org/question/7731/gre-math-subject-test-sample-question-1/?comment=22564#post-id-22564I think it would be a nice feature if all plot docstrings sucked in a note about useful common kwargs like aspect_ratio.Sun, 17 Oct 2010 12:27:27 -0500https://ask.sagemath.org/question/7731/gre-math-subject-test-sample-question-1/?comment=22564#post-id-22564Comment by Mitesh Patel for <p>What is the length of the parametric curve: f(t) = (x,y) = (cos(t),sin(t)), for t in [0,Pi] ?</p>
<p>Update: Mike got the answer lightning-/mike-fast. Here's the output of parametric_plot() below:</p>
<p><img alt="alt text" src="/upfiles/12873516345197655.png"/></p>
<p>Update 2: Per Mitesh's suggestion, I called parametric_plot() with keyword argument "aspect_ratio=1"; the image below looks more round with a 1:1 aspect ratio:</p>
<p><img alt="alt text" src="/upfiles/12873540266117765.png"/></p>
https://ask.sagemath.org/question/7731/gre-math-subject-test-sample-question-1/?comment=22562#post-id-22562Perhaps we could use a decorator to augment docstrings with "See Also:" or other sections. Could you post to sage-devel about your request?Mon, 18 Oct 2010 00:01:18 -0500https://ask.sagemath.org/question/7731/gre-math-subject-test-sample-question-1/?comment=22562#post-id-22562Comment by kcrisman for <p>What is the length of the parametric curve: f(t) = (x,y) = (cos(t),sin(t)), for t in [0,Pi] ?</p>
<p>Update: Mike got the answer lightning-/mike-fast. Here's the output of parametric_plot() below:</p>
<p><img alt="alt text" src="/upfiles/12873516345197655.png"/></p>
<p>Update 2: Per Mitesh's suggestion, I called parametric_plot() with keyword argument "aspect_ratio=1"; the image below looks more round with a 1:1 aspect ratio:</p>
<p><img alt="alt text" src="/upfiles/12873540266117765.png"/></p>
https://ask.sagemath.org/question/7731/gre-math-subject-test-sample-question-1/?comment=22560#post-id-22560There is a Trac ticket on choosing better aspect ratios waiting for review...Mon, 18 Oct 2010 04:35:40 -0500https://ask.sagemath.org/question/7731/gre-math-subject-test-sample-question-1/?comment=22560#post-id-22560Comment by ccanonc for <p>What is the length of the parametric curve: f(t) = (x,y) = (cos(t),sin(t)), for t in [0,Pi] ?</p>
<p>Update: Mike got the answer lightning-/mike-fast. Here's the output of parametric_plot() below:</p>
<p><img alt="alt text" src="/upfiles/12873516345197655.png"/></p>
<p>Update 2: Per Mitesh's suggestion, I called parametric_plot() with keyword argument "aspect_ratio=1"; the image below looks more round with a 1:1 aspect ratio:</p>
<p><img alt="alt text" src="/upfiles/12873540266117765.png"/></p>
https://ask.sagemath.org/question/7731/gre-math-subject-test-sample-question-1/?comment=22565#post-id-22565Maybe some library, say GraphicsMagick (a subset of ImageMagick) could intelligently use a heuristic to pick a better default aspect ratio? .... My 5.0 wishlist ;-)Sun, 17 Oct 2010 12:25:21 -0500https://ask.sagemath.org/question/7731/gre-math-subject-test-sample-question-1/?comment=22565#post-id-22565Comment by Mitesh Patel for <p>What is the length of the parametric curve: f(t) = (x,y) = (cos(t),sin(t)), for t in [0,Pi] ?</p>
<p>Update: Mike got the answer lightning-/mike-fast. Here's the output of parametric_plot() below:</p>
<p><img alt="alt text" src="/upfiles/12873516345197655.png"/></p>
<p>Update 2: Per Mitesh's suggestion, I called parametric_plot() with keyword argument "aspect_ratio=1"; the image below looks more round with a 1:1 aspect ratio:</p>
<p><img alt="alt text" src="/upfiles/12873540266117765.png"/></p>
https://ask.sagemath.org/question/7731/gre-math-subject-test-sample-question-1/?comment=22566#post-id-22566I think this is to avoid squashed plots, e.g., `parametric_plot((100*cos(x), sin(x)), (x, 0, pi), aspect_ratio=1)`. Sun, 17 Oct 2010 12:19:44 -0500https://ask.sagemath.org/question/7731/gre-math-subject-test-sample-question-1/?comment=22566#post-id-22566Answer by Mike Hansen for <p>What is the length of the parametric curve: f(t) = (x,y) = (cos(t),sin(t)), for t in [0,Pi] ?</p>
<p>Update: Mike got the answer lightning-/mike-fast. Here's the output of parametric_plot() below:</p>
<p><img alt="alt text" src="/upfiles/12873516345197655.png"/></p>
<p>Update 2: Per Mitesh's suggestion, I called parametric_plot() with keyword argument "aspect_ratio=1"; the image below looks more round with a 1:1 aspect ratio:</p>
<p><img alt="alt text" src="/upfiles/12873540266117765.png"/></p>
https://ask.sagemath.org/question/7731/gre-math-subject-test-sample-question-1/?answer=11738#post-id-11738The curve is a semicircle with radius 1 -- it's length is $\pi$. You can use the arc-length formula to get this
$$
\int_0^\pi \sqrt{cos(t)^2+sin(t)^2} dt = \int_0^\pi 1 dt = \pi
$$.
Finally, in Sage:
sage: parametric_plot((cos(x), sin(x)), (x, 0, pi))
sage: integrate(sqrt(cos(x)^2+sin(x)^2),x, 0, pi)
pi
Sun, 17 Oct 2010 10:35:33 -0500https://ask.sagemath.org/question/7731/gre-math-subject-test-sample-question-1/?answer=11738#post-id-11738Comment by ccanonc for <p>The curve is a semicircle with radius 1 -- it's length is $\pi$. You can use the arc-length formula to get this </p>
<p>$$
\int_0^\pi \sqrt{cos(t)^2+sin(t)^2} dt = \int_0^\pi 1 dt = \pi
$$.</p>
<p>Finally, in Sage:</p>
<pre><code>sage: parametric_plot((cos(x), sin(x)), (x, 0, pi))
sage: integrate(sqrt(cos(x)^2+sin(x)^2),x, 0, pi)
pi
</code></pre>
https://ask.sagemath.org/question/7731/gre-math-subject-test-sample-question-1/?comment=22563#post-id-22563The MathJax "bar of inclusion" on the sqrt doesn't have a terminating down stroke before the "dt". ;p Outrageous!Sun, 17 Oct 2010 21:20:14 -0500https://ask.sagemath.org/question/7731/gre-math-subject-test-sample-question-1/?comment=22563#post-id-22563Comment by ccanonc for <p>The curve is a semicircle with radius 1 -- it's length is $\pi$. You can use the arc-length formula to get this </p>
<p>$$
\int_0^\pi \sqrt{cos(t)^2+sin(t)^2} dt = \int_0^\pi 1 dt = \pi
$$.</p>
<p>Finally, in Sage:</p>
<pre><code>sage: parametric_plot((cos(x), sin(x)), (x, 0, pi))
sage: integrate(sqrt(cos(x)^2+sin(x)^2),x, 0, pi)
pi
</code></pre>
https://ask.sagemath.org/question/7731/gre-math-subject-test-sample-question-1/?comment=22558#post-id-22558I was just joking. Mike's post is nearly flawless as usual.Mon, 18 Oct 2010 05:12:12 -0500https://ask.sagemath.org/question/7731/gre-math-subject-test-sample-question-1/?comment=22558#post-id-22558Comment by kcrisman for <p>The curve is a semicircle with radius 1 -- it's length is $\pi$. You can use the arc-length formula to get this </p>
<p>$$
\int_0^\pi \sqrt{cos(t)^2+sin(t)^2} dt = \int_0^\pi 1 dt = \pi
$$.</p>
<p>Finally, in Sage:</p>
<pre><code>sage: parametric_plot((cos(x), sin(x)), (x, 0, pi))
sage: integrate(sqrt(cos(x)^2+sin(x)^2),x, 0, pi)
pi
</code></pre>
https://ask.sagemath.org/question/7731/gre-math-subject-test-sample-question-1/?comment=22559#post-id-22559Does LaTex do that downstroke? Mine doesn't usually.Mon, 18 Oct 2010 04:37:56 -0500https://ask.sagemath.org/question/7731/gre-math-subject-test-sample-question-1/?comment=22559#post-id-22559Comment by ccanonc for <p>The curve is a semicircle with radius 1 -- it's length is $\pi$. You can use the arc-length formula to get this </p>
<p>$$
\int_0^\pi \sqrt{cos(t)^2+sin(t)^2} dt = \int_0^\pi 1 dt = \pi
$$.</p>
<p>Finally, in Sage:</p>
<pre><code>sage: parametric_plot((cos(x), sin(x)), (x, 0, pi))
sage: integrate(sqrt(cos(x)^2+sin(x)^2),x, 0, pi)
pi
</code></pre>
https://ask.sagemath.org/question/7731/gre-math-subject-test-sample-question-1/?comment=22569#post-id-22569Nice formatting!Sun, 17 Oct 2010 10:44:45 -0500https://ask.sagemath.org/question/7731/gre-math-subject-test-sample-question-1/?comment=22569#post-id-22569