Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!hp-pcd!hpcvra.cv.hp.com!rnews!hpcvbbs!akcs.mitchell From: akcs.mitchell@hpcvbbs.UUCP (Mitchell Dickerman) Newsgroups: comp.sys.handhelds Subject: Re: plotting relations Keywords: truth, relation, plot Message-ID: <276c3a53:1419.8comp.sys.handhelds;1@hpcvbbs.UUCP> Date: 17 Dec 90 03:40:05 GMT References: <62CA96D8A0002764@gacvx2.gac.edu> <1990Dec14.202128.509@portia.Stan Lines: 49 This weekend I've been busy working on the relation-plotting problem. Allow me to update you. I did in fact write a program to take a plot like X^Y-Y^X<=0 and turn it into just the outline of the shaded areas. Unfortunately, it took around 35 minutes, which on top of the intial 15 minutes for the first plot, was unacceptable. Then I worked on a program which, when plotted, returned the graph of where a sign change occurs. I revised it a couple of times, and here it is: %%HP: T(3)A(R)F(.); \<< 'Y^X-X^Y' \->NUM SIGN DUP X Y R\->C C\->PX OBJ\-> DROP SWAP DROP IF # 0h == THEN IF 0 == THEN 1 ELSE 0 END ELSE IF 0 == THEN 1 ELSE IF DUP ROT ROT * -1 == THEN 1 ELSE 0 END END END \>> (Note: replace 'Y^X-X^Y' with whatever relation you want to plot.) This takes about 41 minutes to plot, which is still terribly long. About a third of the time is that initial check to see if we're at the top of the screen. All it's doing is getting the Y pixel coordinate. Does anyone know of a SYSEVAL that returns it? That would speed things up dramatically. Elaborating more on the program, it simply gets the sign at the current point, then checks to see if we're at the top of the screen, in which case we only check to see if the sign is 0. After that, we leave the sign on the stack for the next point to compare against. If we're not at the top, it checks to see if the sign is 0. If it's not, it checks to see if the current sign times the previous one is -1, which would indicate a sign change. Either way, it leaves the last sign on the stack for future checks. The reason for checking for the top of the screen is that I don't want it comparing the top sign of one column to the bottom sign from the previous one, it wouldn't make sense. To use this, simply store the program as the equation to be plotted and choose the TRUTH plot. If someone can speed this up, it would be greatly appreciated. Mitch