ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 27 Oct 2018 04:45:33 +0200Need help with plottinghttps://ask.sagemath.org/question/44092/need-help-with-plotting/ Trying to plot a line that has one point at (0,0) and the second point at (x(t),y(t)). I am trying to get it to range from t = 0 to 2*pi however, I am not sure how to do it with the line command. I am getting the following error but that is because t has no value defined (TypeError: unable to simplify to float approximation). Appreciate any help!
t = var('t')
x(t) = cos(t) + cos(2t)
y(t) = sin(t) + sin(3*t)
line([(0,0),(x(t),y(t))]
Sat, 27 Oct 2018 02:41:40 +0200https://ask.sagemath.org/question/44092/need-help-with-plotting/Comment by dazedANDconfused for <p>Trying to plot a line that has one point at (0,0) and the second point at (x(t),y(t)). I am trying to get it to range from t = 0 to 2*pi however, I am not sure how to do it with the line command. I am getting the following error but that is because t has no value defined (TypeError: unable to simplify to float approximation). Appreciate any help!</p>
<p>t = var('t')</p>
<p>x(t) = cos(t) + cos(2t)</p>
<p>y(t) = sin(t) + sin(3*t)</p>
<p>line([(0,0),(x(t),y(t))]</p>
https://ask.sagemath.org/question/44092/need-help-with-plotting/?comment=44094#post-id-44094This sounds like homework where there's a misunderstanding as to what you're supposed to do. Try:
t = var('t')
parametric_plot((cos(t)+cos(2*t), sin(t) + sin(3*t)), (t, 0, 2*pi), color=hue(0.6))
to see the parametric curve formed by your equations above. You can't form a line without a specific value of t to get the second point.Sat, 27 Oct 2018 04:45:33 +0200https://ask.sagemath.org/question/44092/need-help-with-plotting/?comment=44094#post-id-44094