newLISP Fan Club

Forum => newLISP Graphics & Sound => Topic started by: didi on July 22, 2007, 09:58:46 AM

Title: x-y-graphic
Post by: didi on July 22, 2007, 09:58:46 AM
As a first step,  the axes drawing and autoscaling are already working :


****  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 ?
Title:
Post by: didi on July 22, 2007, 10:12:29 AM
Sorry -  the code seem to be to big for the forum .  I have to delete it.
Title:
Post by: cormullion on July 22, 2007, 11:01:26 AM
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/
Title:
Post by: didi on July 22, 2007, 11:15:05 AM
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?page=Guiserver_user_contributed_Code_Snippets





The code seems to be complete .
Title:
Post by: didi on July 22, 2007, 11:22:36 AM


( 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.
Title:
Post by: didi on July 22, 2007, 12:02:32 PM
A first picture :



//http://img4.shareavenue.com/image.php?file=f073869d7f9395067e398b6b87162b74efb504e9



hope i didn't  wreck your nerves - thanks cormullion for the shareavenue-tip!
Title:
Post by: cormullion on July 22, 2007, 01:50:48 PM
worked OK first time for me! Looks like it will be useful code too.
Title:
Post by: didi on July 22, 2007, 09:57:32 PM
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 .
Title:
Post by: cormullion on July 23, 2007, 01:46:40 AM
Quote from: "didi"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.
Title:
Post by: Lutz on July 23, 2007, 07:14:37 AM
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?page=How_To_Use_Advanced_Features



Lutz



ps: when putting code into the wiki, every line should be preceded by a space, so characters and indentation are not changed.
Title:
Post by: didi on July 23, 2007, 07:47:16 AM
Thanks Lutz  .  

Now copy & paste from the wiki  into the newLISP-edit works, too.