Pohyb po kružnici
Následující algoritmus zařídí pohyb po kružnici pomocí jednoduchých trigonometrických funkcí. Body se pomalu vykreslují po obvodu kružnice.
Delphi:
Var Uhel:Real; Procedure OpisKruh(X,Y,Radius :Integer; Color:Byte); Var Px,Py:Integer; Begin Uhel:=0; While Uhel <=2*Pi Do Begin Px:=Round(X+Cos(Uhel)* Radius); Py:=Round(Y+Sin(Uhel)* Radius); PutPixel(Px,Py,Color); Uhel:=Uhel+0.001; End; End;