Got it, this was the last missing piece, thank you!
My proof-of-concept works now as expected - except one flaw, which I can't understand why: Could it be, that PPAR is not updated internally right before(!) the first plotfunction evaluation, if the 2-cursor-points method is used in the plot-app for interactive replotting? (All other interactive replotting methods seem to feed PPAR directly before the plotfunction is called for first evaluation...)
For your better understanding, allow me to explain the intended algorithm for parametric plotting [x(t),y(t)] in more detail:
Prerequisit:
Initialize tmin, tmax, dt=(tmax-tmin)/(WIDTH+2), SF 00 [Flag setting will be explained later]
Start Plot-App (manual, interactive handling!)
Set PGM to MYPSTUFF
Set PARM to x:STK, y:STK
Set VIEW : xmin, ..., ymax
With these settings, I assume that MYPSTUFF will be executed/called WIDTH+2 times.
Ending MYPSTUFF by " ...(body)... 0 END " will plot the x-axis - does not harm.
In (body) however, you are allowed to do whatever you want: In the current PLUS42-implementation, LINE and PIXEL commands within (body) will generate arbitrary line-segments or dots/axes in the current plot window. This behavior opens the door to realize nearly arbitrary visualizations within the plot-app (not only parametric curves). Example: Using [x(t_i-1), y(t_i-1)] and [x(t_i), y(t_i)] as coordinates for LINE will plot the corresponding parametric curve, where the i-th evaluation of MYPSTUFF will add the i-th line segment.
Scaling parameters:
Of course, to produce the dots at the right position, LINE or PIXEL need display-coordinates nx, ny instead of x,y directly. Scaling parameters SCLxxx are necessary here:
nx = SCLXF * x(t) + SCLXAD
ny = SCLYF * y(t) + SCLYAD
The current xmin, ....ymax are required within MYPSTUFF to initiate the SCLxxx at begin of a new plot-process, i.e., at begin of the first evaluation of MYPSTUFF. In principle, you could calculate the SCLxxx during each evaluation of MYPSTUFF -- but this would be... you know...
I use the flag 00 to test the "first evaluation"-status (see initiation for tmin, ... as given above)
All in all, (body) looks roughly like this in my current POC:
FS? 00 ; if yes, we are in first round
do scaling factors + CF 00 + set counter for evaluation number ( 1 STO EC )
...
Do what you want to do during each evaluation: Calculating sth from EQN-objects or SOLVE-Processes or ...
Make it appear on screen by LINE or PIXEL: nx+i*ny PIXEL
...
1
STO+ EC ; current evaluation is done
RCL EC
WIDTH + 2
-
X=0? ; was this the last evaluation?
SF 00 ; Next call will be a new plot and required new scaling setup
0
end
Now, I could verify that this idea works with the current PLUS42 as expected - except if you initiate a re-plot by the 2-cursor-points method in the plot-app: Doing so, the curve [x(t),y(t)] stays at the same place on the screen and is not reframed according to the intended new plot-window. This means, SCLxxx are "updated" during first evaluation based on the old xmin, ...,ymax instead of the new values.
Can you verify this from the internal update-behavior for PPAR?
(sorry for this lengthy message - hope you get my points...)
(Maybe, you or somebody else knows a more elegant way of doing parametric plots in PLUS42. Or maybe you plan a corresponding feature for upcoming versions. I am open for hints to other ways... just tried here to use the wonderful efficient plot-app interface for other visualizations as well...)
Thank you in advance!
BR
Dominik