Is it possible to define functions that have optional arguments? For
instance, I have defined the function:
polarplot(expr,range) :=
block([theta_var:range[1]],set_plot_option([nticks,500]),set_plot_option([gnuplot_preamble,"set key off; set size ratio -1"]), plot2d( ['parametric, cos(theta_var)*expr, sin(theta_var)*expr, range]))$
but would like it to have the option of including an xrange and a
yrange. So I would like to give the command in a number of ways, for
example,
polarplot(2/(sin(t)+1),[t,0,2*%pi])
or as
polarplot(2/(sin(t)+1),[t,0,2*%pi],[x,-5,5])
or as
polarplot(2/(sin(t)+1),[t,0,2*%pi],[x,-5,5],[y,-5,2])
How do I do this?
Thanks, Bob
--
Dr. Robert J. Jerrard, Professor of Mathematics,
Concordia University College of Alberta,
7128 Ada Blvd., Edmonton, Alberta, T5B 4E4, Canada.
Phone: (780) 479-9291, Fax: (780) 474-1933.