|
|
| batch files, graph plotting and |
|
William Labbett
Member #4,486
March 2004
|
Hi Allegators, couple of things you might be able to help me with : 1) (dull) - is there an equivalent to a windows batch file for use with MSYS ? 2) Has anyone written a good graph plotter which uses allegro and I could use to plot some graphs ? Help would be appreciated.
|
|
MiquelFire
Member #3,110
January 2003
|
1) Shell scripts. There's Linux tutorials on this. --- |
|
bamccaig
Member #7,536
July 2006
|
William Labbett said: 1) (dull) - is there an equivalent to a windows batch file for use with MSYS ?
Not really. Batch files are horrid. William Labbett said: 2) Has anyone written a good graph plotter which uses allegro and I could use to plot some graphs ?
If this question is related to the first, there are probably some useful Perl modules on CPAN to do graph plotting. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
|
William Labbett
Member #4,486
March 2004
|
that's fab guys. thanks. I'll look into it all in due course.
|
|
MiquelFire
Member #3,110
January 2003
|
I just thought of something, depending on what you use the batch files for, you might be able to use Bash's alias command. Basically, within bash, you can have something like la be the same as typing ls -a. Just something to keep in mind. --- |
|
bamccaig
Member #7,536
July 2006
|
That seemed kind of random. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
|
MiquelFire
Member #3,110
January 2003
|
Yea, I'm a bit random at times (like running the nyan.cat site in the background while I play TF2) --- |
|
Edgar Reynaldo
Major Reynaldo
May 2007
|
William Labbett said: 2) Has anyone written a good graph plotter which uses allegro and I could use to plot some graphs ? I just finished some classes that parse written function strings into evaluatable equations. The next step is to graph them upon request. I may have something you could use here in a few days if I'm productive. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
|
J-Gamer
Member #12,491
January 2011
|
@Edgar: Isn't a viable solution for this to calculate what the delta X for every pixel is( (maxX-minX)/GraphWidth with GraphWidth in pixels), step trough from the minimum X to the max X in steps of delta X and calculate the Y value for each pixel? (And, of course, only draw it when it is visible on the graph " There are plenty of wonderful ideas in The Bible, but God isn't one of them." - Derezo |
|
Edgar Reynaldo
Major Reynaldo
May 2007
|
That's the basic idea, yes. Update I've got basic plotting done along with function and expression evaluation on the command line. Type help inside the program to see available commands. When you use the plot command press ESC to go back to the console or CTRL S to save the plot as a png file.
Some screenshots : 5*sin(x) + x x^2 - 5 5*log(x) I know the colors aren't the best, but I'll adjust that in the future. Other features planned include LMB dragging the view around, mouse wheel zooming, full graphs with guides and evaluation info, simplifying equations, derivatives and possibly integrals as well. You might have to click back and forth between the windows to get the program to continue. Maybe some day I'll figure out a portable way to automatically change the window focus. If you need any help with the commands let me know. Basic operation : >change res(1024,768) >set range(-100,100,-100,100) >f(x) = sin(x^3) >plot f >exit
Update 2 Append My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
|
William Labbett
Member #4,486
March 2004
|
Cool Edgar. As you know I've downloaded it. I need to do a function :- 4(p + q) - pq = 0 will your program be able to do this in future. I think such functions are called implicit functions.
|
|
J-Gamer
Member #12,491
January 2011
|
That OR needs a parameter OR you can work it out to an explicit one yourself. With this example it isn't hard. " There are plenty of wonderful ideas in The Bible, but God isn't one of them." - Derezo |
|
Edgar Reynaldo
Major Reynaldo
May 2007
|
At this point I hadn't planned on trying to solve equations, rather just evaluate expressions and plot functions. It is not a simple thing to teach a program how to solve for variables. However, after doing what J-Gamer did by solving the equation himself you could then enter the equation and evaluate it for any p or plot p as x and the result as y : f(q) = -4*q/(4 - q) f(0) f(1) plot f I may update the program sometime later today, as I fixed a bug where negative numbers were being displayed as positive, fixed a couple small parsing bugs, and I am making some progress on simplifying equations. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
|
|