Dear All, With so many exciting activity going around GiNaC already I wish to propose even more. Why do not let GiNaC classes to visualise themselves? There is an Asymptote (http://asymptote.sourceforge.net/): "is a powerful descriptive vector graphics language that provides a natural coordinate-based framework for technical drawing. Labels and equations are typeset with LaTeX, for high-quality PostScript output." Since Asymptote has "C++-like programming syntax"---it looks like a sister package for GiNAC. This can be used to draw anything from Feynman diagram to 2D and 3D graphs of functions. I used Asymptote as standalone application to visualise cycles in GiNaC library (http://arxiv.org/abs/cs.MS/0512073). I think it would be worth to integrate GiNaC with Asymptote. As a start I think to add a method .asy() to the GiNaC::basic which simply put a label at specific position with LaTeX representation of the object. For functions it would be rewritten by a method which try to draw its graph (if this is possible). If the general perception is that this is worthy I may try to produce an initial patch. Best wishes, Vladimir -- Vladimir V. Kisil email: kisilv@maths.leeds.ac.uk -- www: http://maths.leeds.ac.uk/~kisilv/
Dear Vladimir, On Fri, 21 Apr 2006, Vladimir Kisil wrote:
With so many exciting activity going around GiNaC already I wish to propose even more. Why do not let GiNaC classes to visualise themselves?
[... SNIP ...]
I think it would be worth to integrate GiNaC with Asymptote. As a start I think to add a method .asy() to the GiNaC::basic which simply put a label at specific position with LaTeX representation of the object. For functions it would be rewritten by a method which try to draw its graph (if this is possible).
If the general perception is that this is worthy I may try to produce an initial patch.
I think I do not really understand very well in what cases this would be useful. The point of computer algebra is to be able to handle very large expressions, including ones that one wouldn't want to see printed and/or visualized. If I understand correctly, the use of interfacing with Asymptote would be to e.g., print labels that are formulas. However, in order to be readable these need to be rather small. In that case using (La)TeX gives much more control over the appearance of the formulas. However, imagine the result of a very complicated calculation is x-y and that result would need to occur somewhere in a figure. Fine as such but in that case I would almost always like to control how this result appears precisely. E.g. I might prefer to see x-y instead of -y+x. It becomes even worse if one imagines fractions. I generally very much prefer to see x/y in printing than y^(-1)*x. Besides, what if it turns out that this was coded in such a way that a new version of GiNaC yields a much more complicated representation of x-y, one that is to big to be contained in the figure. This would mean that the user needs, in order to regenerate his image, to debug his symbolic calculation. Not so much fun .... Having the result in (La)TeX would be much more stable. Best, Chris
Chris Dams <Chris.Dams@mi.infn.it> wrote: CD> > I think it would be worth to integrate GiNaC with Asymptote. As a CD> > start I think to add a method .asy() to the GiNaC::basic which simply CD> I think I do not really understand very well in what cases this CD> would be useful. Probably I did not explain it properly: at the first stage this will be an expansion of GiNaC with the plotting functionality which provided in other CASes (like Mathematica or Maple) by the functions plot(...) and plot2(...). In other words, this will initially serves for plotting graphs of functions, and is not intended as a substation of the standard LaTeX output. Idea is that many symbolical expressions with one or two parameters may be better understood if plotted as a graphs of functions from these parameters. Expressions with a large numbers of parameters may be plotted if some extra parameters are substituted by appropriate numeric values. Since Asymptote is a powerful scripting language its applications in GiNaC is not necessarily limited to function plotting only. I can imagine that some GiNaC classes can be visualised as trees, graphs or diagrams and Asymptote can handle this as well. Best wishes, Vladimir -- Vladimir V. Kisil email: kisilv@maths.leeds.ac.uk -- www: http://maths.leeds.ac.uk/~kisilv/
Dear Vladimir, On Mon, 24 Apr 2006, Vladimir Kisil wrote:
Probably I did not explain it properly: at the first stage this will be an expansion of GiNaC with the plotting functionality which provided in other CASes (like Mathematica or Maple) by the functions plot(...) and plot2(...). In other words, this will initially serves for plotting graphs of functions, and is not intended as a substation of the standard LaTeX output.
Plotting sounds like a great idea. Don't we all love plotting ;-). Did you ever look at root (root.cern.ch)? It is C++ already, so maybe it could be easier to integrate. Don't know. Best, Chris
Chris Dams <Chris.Dams@mi.infn.it> wrote: CD> ;-). Did you ever look at root (root.cern.ch)? It is C++ CD> already, so maybe it could be easier to integrate. Don't know. Root is too powerful to be used only for simple plotting. The right integration of root with GiNaC is done in gTybalt and I was pleased to see version 1.2.0 released after a long break. I am currently thing on a simple extension of the GiNaC printing facilities, when any object will be able to put at a stream a sort plotting command for itself. Best, Vladimir -- Vladimir V. Kisil email: kisilv@maths.leeds.ac.uk -- www: http://maths.leeds.ac.uk/~kisilv/
Chris Dams wrote:
Plotting sounds like a great idea. Don't we all love plotting ;-).
Sure we do! :)
Did you ever look at root (root.cern.ch)? It is C++ already, so maybe it could be easier to integrate. Don't know.
It already has, hasn't it? Try googling for gTybalt. -richy. -- Richard B. Kreckel <http://www.ginac.de/~kreckel/>
participants (3)
-
Chris Dams
-
Richard B. Kreckel
-
Vladimir Kisil