HP Forums

Full Version: Cartesian drawing commands ? (how to add persistent graphical elements)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I have a question and a request.

I would like to add graphic elements in the drawing area of an application based on the "function" application (lines, circles respecting the scale of the drawing).

Here is a basic example to illustrate:

You must first add two functions in the symbolic view or download the sample in app format...

[Image: Test-APP.png]

Code:

#pragma mode( separator(.,;) integer(h32) )

Plot()
BEGIN
CHOOSE(A,"Choose a graph","sincard","cos");
CASE
IF A==1 THEN CHECK(1);UNCHECK(2) END;
IF A==2 THEN CHECK(2);UNCHECK(1) END;
END;
STARTVIEW(1,1);
END;

VIEW "Circle", circle()
BEGIN
  LOCAL r;
  r:=Ymax-Ymin;
  r:=218/r;
  ARC(G0,0,0,r);
  //WAIT();
END;

VIEW "Auto scale", auto()
BEGIN
  STARTVIEW(10);
END;

With this method I can add graphic elements (here a simple circle of radius 1 unit) but unfortunately if I move the graph or if I zoom (with touch screen capabilities) , the added elements are destroyed ... How to make them persistent so that it moves with the function curves plotted ?


And now a request to HP team:

Often I want (as in this basic example) to use the plot key to allow a choice between different types of plots. I then reserve the function "view" for other tasks (often those provided by default: "autoscale", etc.)
Unfortunately currently, the code contained in the block "Plot () BEGIN END" is not executed when I press the "Plot" key when the graphic view is already active ... I have to leave the graphic view so that the "Plot" key is operational. Could not we imagine a change in this behavior so that the press on the keys "Plot" "Num" etc. is taken into account even if the corresponding view is already active?

Thank you for the time you have spent reading me.
I think the answer is using the Geometry app, it is quite advanced (you can add functions, sliders, etc) but I haven't explored it a lot like to propose a working example

A good start would be to check
Code:
plotFunc
on the help catalog
(10-28-2018 04:14 PM)eried Wrote: [ -> ]I think the answer is using the Geometry app, it is quite advanced (you can add functions, sliders, etc) but I haven't explored it a lot like to propose a working example

A good start would be to check
Code:
plotFunc
on the help catalog
Thank's Eried for your answer. I have indeed already explore the geometry app... But I appreciate being able to use the commands associated with the function app (root, min max intersection etc...).

And for the request ? How is this proposal perceived by the HP team?
Reference URL's