HP Forums

Full Version: [Programming] Cartesian draw functions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What are the differences between the "Cartesian" vs "Pixel" drawing functions? Is there any way to create an app which draws to a cartesian plane, like the Graphing and Geometry apps?

Sorry if I haven't made myself clear and thanks in advance.
The non _P version reads the current x/y bounds from the application and graphs using the definied window. Thus LINE(-1,-1,1,1) will draw using your window setting from the active application between catesian coordinates (-1,-1) and (1,1) passing through 0,0. If you are not in an application that has a plot view with definiable x/y window position, the system application default will be used.

If you are trying to draw things on a plot/graph or to create your own - these are exactly the commands you should be using.
Exactly what I needed, thanks a lot!
Still need some help, though... couldn't manage to draw a single line on a plot.
Tried calling from "Program", didn't work -- just drew the line on the screen, on top of everything. Then tried editing inside the app, e.g.:
Code:
EXPORT Geometry()
BEGIN
  IF GETKEY == 30 THEN
     LINE(-1,-1,1,1);
   END;
END;
Didn't work either...
Would you mind clarifying a little bit?
(12-06-2014 08:12 PM)gabrieljcs Wrote: [ -> ]Still need some help, though... couldn't manage to draw a single line on a plot.
Tried calling from "Program", didn't work -- just drew the line on the screen, on top of everything. Then tried editing inside the app, e.g.:
Code:
EXPORT Geometry()
BEGIN
  IF GETKEY == 30 THEN
     LINE(-1,-1,1,1);
   END;
END;
Didn't work either...
Would you mind clarifying a little bit?

You have to clear the screen first with RECT();

Tom L
I get it, but what I want to do is to draw into a "cartesian plane" (I don't really know how to call it), like the Graphing and Geometry apps do:
[attachment=1269]
Hello,
something like this?

Code:

EXPORT Cartesian_line()
BEGIN
RECT();
LINE(G0,0,10,0,-10); //axis
LINE(G0,-15,0,15,0); //axis
LINE(G0,-1,-1,1,1); // your line
WAIT(0);
END;

[Image: 67abd2fe-2ac1-45b9-bade-4ec3fda7bd7d_zps6a3f58a5.png]

bye

Giancarlo
Thanks a lot for the answer, Giancarlo.

The issue is not the axis, but the ability to move around and zoom in and out. I thought there was a way of doing it systematically and not by painfully programming a pan and zoom function (I wouldn't even know where to begin).
Hello,
as far as i know the current firmware (6940) allow to "programatic access to geometry constructions."
The quoted part was extracted from the new firmware log.

hope it helps,

bye Giancarlo
Very interesting, I'll take a look into it. Thanks a lot, again!

If anyone would be able to give an alternative to panning the screen, that'd be great!

TIA, Gabriel
Reference URL's