Discussion:
Plot parametric 3D curves
j***@se.abb.com
2006-03-20 09:41:28 UTC
Permalink
Hello everybody,
I'm new to this list and I have a simple question regarding plotting.

How can I plot parametric 3D curves in Maxima (using gnuplot)?

For instance, I'm interested in plotting a Helix using the arclength "s"
as the parameter.

Best regards,
Johan


Johan Ekh

ABB AB, Corporate Research
GFCR / CS
Västerås

Phone: +46 21 323227
Fax: +46 21 323212
email: ***@se.abb.com
van Nek
2006-03-20 22:28:09 UTC
Permalink
Post by j***@se.abb.com
Hello everybody,
I'm new to this list and I have a simple question regarding plotting.
How can I plot parametric 3D curves in Maxima (using gnuplot)?
For instance, I'm interested in plotting a Helix using the arclength "s" as the parameter.
Best regards,
Johan
Hello Johan,

for 3d parametric functions you have to use gnuplot instead of Maxima (or am I
wrong?).

Try this, perhaps you like it.

First some preambles. Nice, but not necessary:
gnuplot> set size ratio -1
gnuplot> set ticslevel 0
gnuplot> set grid
gnuplot> set xtics 0.5
gnuplot> set ytics 0.5

Now we plot:
gnuplot> set parametric

dummy variable is t for curves, u/v for surfaces
gnuplot> splot [t=0:6*pi] cos(t),sin(t),t

Hope that helps.

Volker van Nek
Andrej Vodopivec
2006-03-21 01:20:25 UTC
Permalink
This is not most efficient, but

plot3d([cos(t), sin(t), t], [t,0,6*%pi], [u,-5,5], [gnuplot_pm3d,false])$

produces a curve.

Andrej
Post by j***@se.abb.com
Post by j***@se.abb.com
Hello everybody,
I'm new to this list and I have a simple question regarding plotting.
How can I plot parametric 3D curves in Maxima (using gnuplot)?
For instance, I'm interested in plotting a Helix using the arclength "s"
as the parameter.
Post by j***@se.abb.com
Best regards,
Johan
Hello Johan,
for 3d parametric functions you have to use gnuplot instead of Maxima (or am
I wrong?).
Try this, perhaps you like it.
gnuplot> set size ratio -1
gnuplot> set ticslevel 0
gnuplot> set grid
gnuplot> set xtics 0.5
gnuplot> set ytics 0.5
gnuplot> set parametric
dummy variable is t for curves, u/v for surfaces
gnuplot> splot [t=0:6*pi] cos(t),sin(t),t
Hope that helps.
Volker van Nek
Mario Rodriguez
2006-03-21 06:06:55 UTC
Permalink
Post by Andrej Vodopivec
This is not most efficient, but
plot3d([cos(t), sin(t), t], [t,0,6*%pi], [u,-5,5], [gnuplot_pm3d,false])$
produces a curve.
I think something is wrong with plot3d and nticks. The following code
should make a nicer curve:


plot3d([cos(t), sin(t), t], [t,0,6*%pi], [u,-5,5], [nticks,200])$

But it works with plot2d:

(%i1) plot2d([parametric,cos(t),sin(t)],[t,0,2*%pi])$
(%i2) plot2d([parametric,cos(t),sin(t)],[t,0,2*%pi],[nticks,200])$

This is a work around:

I have just commited a new version of the descriptive package, so that
it is now possible to join 3d points. It will be accesible in the next
hours here:

http://cvs.sourceforge.net/viewcvs.py/maxima/maxima/share/contrib/descriptive/


Download descriptive.mac and execute the following code:


load("....your path to/descriptive.mac")$
a: 1$ b: 1$
setofdistances: makelist(k/10,k,1,1000)$
points: makelist([a*cos(s/sqrt(a^2+b^2)),
a*sin(s/sqrt(a^2+b^2)),
b*s/sqrt(a^2+b^2)], s, setofdistances),numer$
dataplot(apply(matrix,points), joined=true)$


Hope this helps, Johan.
--
Mario Rodriguez Riotorto
www.biomates.net
Andrej Vodopivec
2006-03-21 06:12:11 UTC
Permalink
Post by Mario Rodriguez
I think something is wrong with plot3d and nticks. The following code
plot3d([cos(t), sin(t), t], [t,0,6*%pi], [u,-5,5], [nticks,200])$
Use grid for plot3d:

plot3d([sin(t), cos(t), t], [t,-5,5], [y,-5,5], [grid,100,2],
[gnuplot_pm3d,false])$

Andrej

Continue reading on narkive:
Loading...