03-21-2022, 10:57 PM
The following is drawing arcs using ARC_P(), and it works as expected most of the way, but at these values it displays an unexpected ARC. The same code works fine on ARCs over radius 15, but at a radius of 10, it jumps to this semicircle. You can see it in the video.
https://www.dropbox.com/s/s2moqdne4nryjl...7.avi?dl=0
Is it a problem with ARC_P? Or is it a problem with the approximation of the equations involving PI?
If I did not add the: -0.0001 in the first ARC_P() command, then the ARCs would also show similar problems with bigger radiuses.
waka waka.
https://www.dropbox.com/s/s2moqdne4nryjl...7.avi?dl=0
Code:
EXPORT ANIM()
BEGIN
DIMGROB_P(G1,320,240);
RECT_P();
LOCAL A:=60;
LOCAL B:=2*π/A;
WHILE ISKEYDOWN(4)=0 DO
LOCAL COL:=RANDINT(16777216);
LOCAL SIZE:=RANDINT(100);
FOR N FROM 1 TO 60 DO
RECT_P(G1);
ARC_P(G1,160,120,10,B*N/2-0.0001,2*π-B*N/2,{#000000h,COL});
BLIT_P(G0,0,0,320,240,G1,0,0,320,240);
TEXTOUT_P(STRING(B*N/2-0.0001)+" , "+STRING(2*π-B*N/2),100,20);
WAIT(.1)
END;
WAIT(.2) ;
FOR N FROM 1 TO 60 DO
RECT_P(G1);
ARC_P(G1,160,120,10,B*(30-N/2),2*π-B*(30-N/2),{#000000h,COL});
BLIT_P(G0,0,0,320,240,G1,0,0,320,240);
TEXTOUT_P(STRING(B*(30-N/2))+" , "+STRING(2*π-B*(30-N/2)),100,20);
WAIT(.1)
END;
WAIT(.2)
END;
END;
Is it a problem with ARC_P? Or is it a problem with the approximation of the equations involving PI?
If I did not add the: -0.0001 in the first ARC_P() command, then the ARCs would also show similar problems with bigger radiuses.
waka waka.