#!/usr/local/bin/yabasic phase=0:delay=0.03 delta=PI/180 dim X(7), Y(7) R=90:SX=3*R:SY=3*R k=(SX-2*R)*0.5 OX=SX/2:OY=SY/2 clear screen open window SX,SY label loop k$=inkey$(delay) rem clear window box k,k to SX-k,SY-k circle OX,OY,R gosub CalcCoord gosub Trace phase=phase+delta k=k+0.2*R*sin(phase*PI*3) rem print k if k$<>"q" then goto loop fi close window end label CalcCoord for i=1 to 5 X(i)=OX+R*sin(2*PI*(i-1)/5+phase) Y(i)=OY-R*cos(2*PI*(i-1)/5+phase) if Y(i)<0 then Y(i)=-Y(i) fi next i X(6)=X(1) Y(6)=Y(1) X(7)=X(2) Y(7)=Y(2) return label Trace for i=1 to 5 line X(i),Y(i) to X(i+2),Y(i+2) next i return