set pm3d depth lighting primary 0.4 specular 0.3
set palette defined (\
0.05 "#ffffff" , 0.15 "#ffffff", 0.15 "#ff3333", 0.25 "#ff3333",\
0.25 "#33ff33", 0.35 "#33ff33", 0.35 "#3333ff", 0.45 "#3333ff",\
0.45 "#33cccc", 0.55 "#33cccc", 1.0 "#000000")

unset border
unset tics
unset colorbox
unset key
L = 1.5
set xrange [-L:L]
set yrange [-L:L]
set zrange [-L:L]
set cbrange [0:1]
set xyplane 0
set view 140,120, 1.6
set samples 36
set isosamples 36
set parametric
set urange [-pi/36:pi]
set vrange [-pi:pi]

x(u,v)=sin(u)*cos(v)
y(u,v)=sin(u)*sin(v)
z(u,v)=cos(u)

set macro
x="x($1,$2)"
y="y($1,$2)"
z="z($1,$2)"

### structure of H20
ay = 0.957*sin(104.5*pi/180/2)
az = 0.957*cos(104.5*pi/180/2)
rH = 1.2*0.25
rO = 1.4*0.5 

set term wxt size 360,360 background "#114400"
splot \
'++' using (rO*@x):(rO*@y):(rO*@z+az):(0.2) with pm3d,\
'++' using (rH*@x):(rH*@y-ay):(rH*@z):(0.1) with pm3d,\
'++' using (rH*@x):(rH*@y+ay):(rH*@z):(0.1) with pm3d
pause -1

set term pngcairo size 360,360 background "#114400"
set out "H2O.png"