print <<END;
set terminal povray
set samples 30
set isosamples 30
set xrange [-10:10]
set yrange [-10:10]
set xlabel "X axis"
set ylabel "Y axis"
set zlabel "Z axis"
set style function dots

END

for($i=0; $i<120; $i+=2){
#    $rot_x= 60+0.15*$i;
    if ($i<60){	
	$rot_x= 60+0.3*$i;
    }else{
	$rot_x= 60+0.3*60-0.3*($i-60);
    }
    $rot_z= ($i*3+30)%360;
#    $rot_z= ( atan2(($i-60)/8, 1) + 1.58 )/3.15*360;
    $num= sprintf("%03d",$i);
    print <<END;
set view $rot_x, $rot_z
set out "tmp.pov"
splot x**2+y**2, x**2-y**2, x*y
set out
! povray +FC +A0.1 +I tmp.pov +O tmp$num.tga

END
}
