Page 1 of 1

x-y-graphic

Posted: Sun Jul 22, 2007 4:58 pm
by didi
As a first step, the axes drawing and autoscaling are already working :

Code: Select all

****  sorry  cut & paste doesn't work correctly ****
This works :
- autoscaling to user-units
- automatic adaption of the frame and text-size to the screen-resolution
- draws only the used quadrants of the graph
- coordinate-transformation

The next tasks are - the user-interface to interact with the x-y-graph - formula input - x-range-input - start-calculation and so on .
The target-application for me is a x-y-graph with multiple y-axes , to do some iterative simulations for dc-motor-drives or similar things.

Ok - it's still a long way to version 1.000 , but i promised Lutz that i'll show what i'm working on .

PS : the code doesn't fit exactly in the forum-width , i hope it works anyway - how can i store pictures and text-files into this forum ?

Posted: Sun Jul 22, 2007 5:12 pm
by didi
Sorry - the code seem to be to big for the forum . I have to delete it.

Posted: Sun Jul 22, 2007 6:01 pm
by cormullion
If you have a flickr account, you could link to images there. Or use www.shareavenue.com or something similar.

Or how about posting your code on the newLISP wiki?

http://alh.net/newlisp/wiki/

Posted: Sun Jul 22, 2007 6:15 pm
by didi
Many thanks Cormullion , i copied the code to this - i don't know if you meant it this way .

http://alh.net/newlisp/wiki/index.cgi?p ... e_Snippets


The code seems to be complete .

Posted: Sun Jul 22, 2007 6:22 pm
by didi

Code: Select all


( define ( xrel-to-screen rel )  ( / (* rel ( gs:screen 0 ))  100 ))   
( define ( yrel-to-screen rel )  ( / (* rel (gs:screen 1  ))  100 ))


( define ( xrel-to-screen rel ) ( / (• rel ( gs:screen 0 )) 100 )) 
( define ( yrel-to-screen rel ) ( / (• rel (gs:screen 1 )) 100 )) 
Sorry - the wiki translated two times the * on two places into circles , see code above .

If i change the circles into * the program-snippet works correct.

Posted: Sun Jul 22, 2007 7:02 pm
by didi
A first picture :

http://img4.shareavenue.com/image.php?f ... 74efb504e9

hope i didn't wreck your nerves - thanks cormullion for the shareavenue-tip!

Posted: Sun Jul 22, 2007 8:50 pm
by cormullion
worked OK first time for me! Looks like it will be useful code too.

Posted: Mon Jul 23, 2007 4:57 am
by didi
Somehow the code disappeared out of the wiki - i think someone deleted it.
I give up , i'll programm the next task and hopefully be soon back with the complete application .

Posted: Mon Jul 23, 2007 8:46 am
by cormullion
didi wrote:Somehow the code disappeared out of the wiki - i think someone deleted it.
It was there when I looked yesterday - perhaps I deleted it accidentally by looking at it? (Schrödinger's Wiki...?) :-) Hope not - sorry if I did.

Posted: Mon Jul 23, 2007 2:14 pm
by Lutz
somebody deleted it because the page was not password protected. I restored it clicking on the link, then typing 'restore' where it says 'page'. Then I protected it with the usual password, Ryon gave us, see here:

http://alh.net/newlisp/wiki/index.cgi?p ... d_Features

Lutz

ps: when putting code into the wiki, every line should be preceded by a space, so characters and indentation are not changed.

Posted: Mon Jul 23, 2007 2:47 pm
by didi
Thanks Lutz .
Now copy & paste from the wiki into the newLISP-edit works, too.