[Maxima] [patch] 3D curve parametric plot

Alexander Klimov alserkli at inbox.ru
Sun Jan 22 08:08:28 CST 2012


Hi.

It used to be possible to do 3D parametric curve plots with

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

but in the current version it gives

 plot3d: wrong number of variables: [t]. There should be two

The problem can be fixed with the attached patch. It would be nice if
it were committed to the mainline. It is also a good idea to document
the grid trick in plot3d documentation.

-- 
Regards,
ASK
-------------- next part --------------
From 2a7852b79c0185a8e4df325b68dd22548667e599 Mon Sep 17 00:00:00 2001
From: Alexander Klimov <alserkli at users.sourceforge.net>
Date: Sun, 22 Jan 2012 15:49:23 +0200
Subject: [PATCH] Allow 3D parametric plots

---
 src/plot.lisp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/plot.lisp b/src/plot.lisp
index e275758..6219bee 100644
--- a/src/plot.lisp
+++ b/src/plot.lisp
@@ -1901,7 +1901,7 @@ Several functions depending on the two variables v1 and v2:
                                     (coerce-float-fun (fourth exprn) lvars)
                                     (second lvars) (third lvars))))
                 (setq lvars ($listofvars `((mlist) ,vars1 ,vars2 ,vars3)))
-                (if (= 2 ($length lvars))
+                (if (<= ($length lvars) 2)
                     ;; we do have a valid parametric set. Push it into
                     ;; the functions stack, along with their domain
                     (progn
@@ -1915,7 +1915,7 @@ Several functions depending on the two variables v1 and v2:
                         (setf (getf features :const-expr)
                               ($float (meval (fourth exprn))))))
                     (merror
-                     (intl:gettext "plot3d: there must be two variables; found: ~M")
+                     (intl:gettext "plot3d: there must be at most two variables; found: ~M")
                      lvars))))
              
              (3
-- 
1.7.2.5



More information about the Maxima mailing list