$sine=rand(2)-1; $cosine=sqrt(1-$sine**2); #### $angle=rand(2*3.14159); $sine=sin($angle); $cosine=cos($angle);