fork(1) download
  1. <?php
  2.  
  3. $k=M_PI/180;$h=$x=$y=0;$d="";for($i=5;$i--;){$h+=$a=rand(-179,181);$x+=($l=rand(0,501))*cos($b=$k*$a);$y+=$l*sin($b);$d.=($d?",":"")."$a:$l";}echo"Data: $d\nHeading: $h\nDistance: ".sqrt($x*$x+$y*$y)."\nOrientation: ".atan2($y,$x)/$k."\n"
  4.  
  5. ?>
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
Data: -34:499,28:306,158:294,10:17,158:139
Heading: 320
Distance: 300.62126984052
Orientation: 5.6846932422326