[Maxima] solving equations, plotting is next
l.butler at ed.ac.uk
Sat Feb 27 04:02:09 CST 2010
On Fri, 26 Feb 2010, Janek Kozicki wrote:
< ok, I managed to do what I wanted here. It plots lines tangent to an ellipse!
< Please have a look at my first wxmaxima script :)
< Last question - is it possible to make the last step shorter and more readable?
< The one, where I declare A_RES,EL,LINE_1,LINE_2.
I think that some programming styles require one to store intermediate
results in variables, and to handle list/array variables by accessing
the elements individually. I think Maxima style is more compact:
feel free to use multiple commands in one line, and use built-in
functions to iterate over lists where possible.
Here is how I would write the last bit of your script:
/* since these parameters define your problem, define them in 1 line */
I don't know if you consider this more readable at this point, but an
advantage is that I don't need to know how many solutions in A_res there
are, nor how many solutions in line_y there are, my definition of
'lines' will work and so therefore will the plot2d command.
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
More information about the Maxima