[Programming] Cartesian draw functions
12-05-2014, 08:56 PM
Post: #1
 gabrieljcs Junior Member Posts: 18 Joined: Apr 2014
[Programming] Cartesian draw functions
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.
12-06-2014, 04:04 PM (This post was last modified: 12-06-2014 04:05 PM by Tim Wessman.)
Post: #2
 Tim Wessman Senior Member Posts: 2,270 Joined: Dec 2013
RE: [Programming] Cartesian draw functions
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.

TW

Although I work for the HP calculator group, the views and opinions I post here are my own.
12-06-2014, 04:31 PM
Post: #3
 gabrieljcs Junior Member Posts: 18 Joined: Apr 2014
RE: [Programming] Cartesian draw functions
Exactly what I needed, thanks a lot!
12-06-2014, 08:12 PM
Post: #4
 gabrieljcs Junior Member Posts: 18 Joined: Apr 2014
RE: [Programming] Cartesian draw functions
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, 09:28 PM
Post: #5
 toml_12953 Senior Member Posts: 1,781 Joined: Dec 2013
RE: [Programming] Cartesian draw functions
(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

Tom L
Cui bono?
12-06-2014, 09:37 PM
Post: #6
 gabrieljcs Junior Member Posts: 18 Joined: Apr 2014
RE: [Programming] Cartesian draw functions
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:

12-06-2014, 10:36 PM (This post was last modified: 12-06-2014 10:36 PM by Giancarlo.)
Post: #7
 Giancarlo Member Posts: 249 Joined: Dec 2013
RE: [Programming] Cartesian draw functions
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;

bye

Giancarlo
12-06-2014, 11:10 PM
Post: #8
 gabrieljcs Junior Member Posts: 18 Joined: Apr 2014
RE: [Programming] Cartesian draw functions
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).
12-06-2014, 11:19 PM
Post: #9
 Giancarlo Member Posts: 249 Joined: Dec 2013
RE: [Programming] Cartesian draw functions
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
12-06-2014, 11:24 PM
Post: #10
 gabrieljcs Junior Member Posts: 18 Joined: Apr 2014
RE: [Programming] Cartesian draw functions
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
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)