# # KLEIN: Test of the IF function and logical expression in the calculator # # Plot of a Klein bottle after Paul Bourke # set camangle 55 -100 40 set use_planes .true. set zoom 1 set background & disc {<0,0,-1.0>,<0,0,1>,1.0 & pigment {checker color White color Black scale 0.15} & finish {Dull} } parametric map cartesian uname u vname v urange 0 6.283185 31 open vrange 0 6.283185 31 open c1 if( (0 <= u && u < pi) , & 6*cos(u)*(1+sin(u))+4*(1-0.5*cos(u))*cos(u)*cos(v) , & 6*cos(u)*(1+sin(u))+4*(1-0.5*cos(u))*cos(v+pi) ) c2 if( (0 <= u && u < pi) , & 16*sin(u)+4*(1-0.5*cos(u))*sin(u)* cos(v) , & 16*sin(u) ) c3 4*(1-0.5*cos(u))*sin(v) colormode none povray klein.pov endparametric run povray klein.pov +W400 +H400 +A0.2 +R3 run cjpeg -Q 80 klein.tga > klein.jpg run rm klein.tga end