| Download
All published worksheets from http://sagenb.org
Project: sagenb.org published worksheets
Views: 168822Image: ubuntu2004
- Vector functions of a curve have 1 parameter, i.e. 1 variable (regardless of the number of components).
- Vector functions can have 1, 2, 3 or more components = dimension. Components are separated by commas.
- In SAGE, use DOUBLE parentheses to define a vector function!
- Top section: define and plot vector (parametric) functions of curves.
- Below are commands: extract components r[0], evaluate r(t=3), magnitude abs(r) norm(r), derivatives diff(r,t)
Notice that parametric_plot is 2d or 3d depending on what it is plotting. (No separate command.)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(\sin\left(t\right),\,\cos\left(t\right),\,t\right)
Extract component functions.
To project onto the x-y plane, define a new vector function using the first 2 components of 3d vector function (numbering starts at 0).
You cannot just force a 3d plot of 2d curve with aspect_ratio. (You will get an error as 1- below.)
In order to plot the 2d curve, you need to also plot an actual 3d curve. If you don't want to see it, makes its opacity=0. (See 2-below.)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "_sage_input_15.py", line 10, in <module>
exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("dmFyICgndCcpCnI9dmVjdG9yKChzaW4odCksY29zKHQpLHQpKQpyMj12ZWN0b3IoKHJbMF0sclsxXSkpCnAyXzM9cGFyYW1ldHJpY19wbG90KHIyLCh0LC0yKnBpLDIqcGkpLGNvbG9yPSdyZWQnLHRoaWNrbmVzcz01LCBhc3BlY3RfcmF0aW89KDMsMywxKSkKc2hvdyhwMl8zKQ=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single')
File "", line 1, in <module>
File "/tmp/tmpJik_OI/___code___.py", line 7, in <module>
exec compile(u'show(p2_3)' + '\n', '', 'single')
File "", line 1, in <module>
File "/home/sage/sage-4.7/local/lib/python2.6/site-packages/sage/misc/functional.py", line 1487, in show
return x.show(*args, **kwds)
File "/home/sage/sage-4.7/local/lib/python2.6/site-packages/sage/misc/decorators.py", line 381, in wrapper
return func(*args, **kwds)
File "/home/sage/sage-4.7/local/lib/python2.6/site-packages/sage/plot/plot.py", line 1726, in show
self.save(**kwds)
File "/home/sage/sage-4.7/local/lib/python2.6/site-packages/sage/misc/decorators.py", line 381, in wrapper
return func(*args, **kwds)
File "/home/sage/sage-4.7/local/lib/python2.6/site-packages/sage/plot/plot.py", line 2453, in save
figure = self.matplotlib(**options)
File "/home/sage/sage-4.7/local/lib/python2.6/site-packages/sage/plot/plot.py", line 1945, in matplotlib
ymin=ymin, ymax=ymax)
File "/home/sage/sage-4.7/local/lib/python2.6/site-packages/sage/plot/plot.py", line 3886, in adjust_figsize_for_aspect_ratio
r = max(aspect_ratio * (xmax - xmin)/(ymax-ymin), 0.001)
TypeError: can't multiply sequence by non-int of type 'float'
Click and drag to rotate this to see that we have projected the helix onto the circle.
\newcommand{\Bold}[1]{\mathbf{#1}}\sqrt{t^{2} + \sin\left(t\right)^{2} + \cos\left(t\right)^{2}}
\newcommand{\Bold}[1]{\mathbf{#1}}\sqrt{t^{2} + \sin\left(t\right)^{2} + \cos\left(t\right)^{2}}
\newcommand{\Bold}[1]{\mathbf{#1}}\sqrt{{\left| t \right|}^{2} + {\left| \sin\left(t\right) \right|}^{2} + {\left| \cos\left(t\right) \right|}^{2}}
\newcommand{\Bold}[1]{\mathbf{#1}}\sqrt{{\left| t \right|}^{2} + {\left| \sin\left(t\right) \right|}^{2} + {\left| \cos\left(t\right) \right|}^{2}}
\newcommand{\Bold}[1]{\mathbf{#1}}\left(\cos\left(t\right),\,-\sin\left(t\right),\,1\right)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(\cos\left(t\right),\,-\sin\left(t\right),\,1\right)
\newcommand{\Bold}[1]{\mathbf{#1}}\sqrt{{\left| -\sin\left(t\right) \right|}^{2} + {\left| \cos\left(t\right) \right|}^{2} + 1}
\newcommand{\Bold}[1]{\mathbf{#1}}1.41421356237310
\newcommand{\Bold}[1]{\mathbf{#1}}1.41421356237310
\newcommand{\Bold}[1]{\mathbf{#1}}\sqrt{\sin\left(t\right)^{2} + \cos\left(t\right)^{2}}
sqrt(sin(3)^2 + cos(3)^2)
1.00000000000000