REM Start of BASIC! Program FN.DEF rotate(x,y,adeg,x0,y0,resx,resy) LET a=TORADIANS(adeg) LET resx=(x-x0)*COS(a)- (y-y0)*SIN(a)+ x0 LET resy=(x-x0)*SIN(a)+ (y-y0)*COS(a)+ y0 FN.END !test GR.OPEN 255,255,255,255,0,1 PAUSE 500 GR.SCREEN sx,sy GR.COLOR 255,0,0,0,1 !the point to rotate x=sx/10*8 y=sy/2 !the centre of rotation x0=sx/2 y0=sy/2 DO FOR i=0 TO 360 !the angle to rotate adeg=i rotate(x,y,adeg,x0,y0,&resx,&resy) GR.LINE vd,x0,y0,resx,resy GR.RENDER NEXT i PAUSE 1000 GR.CLS x0=sx/10*2+int(rnd()*sx/10*6) y0=sy/10*2+int(rnd()*sy/10*6) UNTIL 0