Hi, TerryRitchie.
Thank you for the answer that, logically, works with the extraordinary beauty of simplicity.
This is in summary the origin of the stupid typo that confused me:
================================
SCREEN 12
CLS
CIRCLE (100, 100), 20
circlr (-200, -200), 400
END
================================
Obtaining, of course, the relevant error message:
ILLEGAL FUNCTION CALL
Highlighting the text in red (making it less legible for me) and indicating the line of the error.
Without further compiler information my attention was focused on the incorrect function call that I attributed to the negative parameters and not to the writing error.
(CIRCLE "is" a system function
circlr would be a user defined function)
A message like:
undefined user function circlr
would have served me as a better warning.
Confused in this way, I tackled the problem hard:
================================
REM Aproximacion a dibujo de arco con centro fuera de pantalla.
' QB64 15 ABR 2020
'
'
' Pendiente: precisar punto de entrada y salida en los bordes.
CONST PI = 3.1416
DIM ancho AS INTEGER
DIM alto AS INTEGER
DIM ox AS INTEGER
DIM oy AS INTEGER
DIM r AS INTEGER
' DIM x AS INTEGER No hacen falta
' DIM y AS INTEGER
DIM x2 AS INTEGER
DIM y2 AS INTEGER
DIM a AS SINGLE
DIM paso AS SINGLE
DIM primera AS INTEGER
ancho = 640
alto = 480
SCREEN 12 'REM_NEWIMAGE(ancho, alto)
ox = 700
oy = 500
r = 400
paso = 0.1
' x = INT(ox + r * COS(0))
' y = INT(oy + r * SIN(0))
primera = 1
FOR a = 0 TO 2 * PI STEP paso
x2 = INT(ox + r * COS(a))
y2 = INT(oy + r * SIN(a))
' Clipping
IF ((x2 >= 0 AND (x2 < ancho))) AND ((y2 >= 0) AND (y2 < alto)) THEN
' La primera vez se establece el punto para las coordenadas relativas.
IF primera = 1 THEN
PSET (x2, y2)
primera = 0
ELSE
LINE -(x2, y2)
END IF
END IF
NEXT a
END
================================
Code that works even though it is unrefined and leaves a "gap" between the input of the segments that will make up the circle (arc) and the edges of the window.
With this a PAINT (x, y),c command would fail to find no limit.
Now a new question: By establishing 'logical' coordinates linked to other 'physics', would PMAP also work with coordinates of the circle outside the window to remap?
Thanks again.
PD: OldMoses.
I will read your message carefully. It is something similar to my interest.
Specifically, simulate a (very elementary) approach to the shock waves of an object by breaking the sound barrier.