Post Reply 
[Programming] Cartesian draw functions
12-05-2014, 08:56 PM
Post: #1
[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.
Find all posts by this user
Quote this message in a reply
12-06-2014, 04:04 PM (This post was last modified: 12-06-2014 04:05 PM by Tim Wessman.)
Post: #2
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.
Find all posts by this user
Quote this message in a reply
12-06-2014, 04:31 PM
Post: #3
RE: [Programming] Cartesian draw functions
Exactly what I needed, thanks a lot!
Find all posts by this user
Quote this message in a reply
12-06-2014, 08:12 PM
Post: #4
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?
Find all posts by this user
Quote this message in a reply
12-06-2014, 09:28 PM
Post: #5
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
I think therefore I am-Descartes
I think therefore you are-Gorgias
You're not here to think-Army Sergeant
Find all posts by this user
Quote this message in a reply
12-06-2014, 09:37 PM
Post: #6
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:
   
Find all posts by this user
Quote this message in a reply
12-06-2014, 10:36 PM (This post was last modified: 12-06-2014 10:36 PM by Giancarlo.)
Post: #7
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;

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

bye

Giancarlo
Find all posts by this user
Quote this message in a reply
12-06-2014, 11:10 PM
Post: #8
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).
Find all posts by this user
Quote this message in a reply
12-06-2014, 11:19 PM
Post: #9
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
Find all posts by this user
Quote this message in a reply
12-06-2014, 11:24 PM
Post: #10
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
Find all posts by this user
Quote this message in a reply
Post Reply 




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