code for cone diagram
>
dbarr:=proc(tail,head, text,txtshift, size,
colr,thicknessfactor) local
textoffset,txt,tmp1,tmp2,nrm,dir,cntr:
dir:=head-tail:
textoffset:=txtshift[1]*dir+txtshift[2]*[dir[2],-dir[1]]:
cntr:=.5*(tail+head)+textoffset:
nrm:=sqrt( dir[1]^2+dir[2]^2)*thicknessfactor:
tmp1:=plottools[arrow](head,tail, .01*nrm,.05*nrm,.05,color=colr):
tmp2:=plottools[arrow](tail,head, .01*nrm,.05*nrm,.05,color=colr):
txt:=plots[textplot]([cntr[1],cntr[2],text],
font=[TIMES,BOLD,size]):
plots[display]({tmp1,tmp2,txt},scaling=constrained);
end:
top:=plottools[ellipse]([0,0],5,1,scaling=constrained):
sides:=plot({[[0,-15],[-5,0]],[[0,-15],[5,0]]}):
arrw1:=dbarr([0,0],[5,0], `10`,[-.1,-.1],16,blue,1):
arrw2:=dbarr([5.1,0],[5.1,-15],`20`,[-.1,-.1],16,blue,.4)
dotlinerad:=plot([[3,-6],[0,-6]],linestyle=3):
dotheight:=plot([[0,-6],[0,-12]],linestyle=3):
ttxt:=plots[textplot]({[2,-5.5,`r`],
[-.3,-10,`h`]},font=[TIMES,BOLD,16]):
h20:=plots[polygonplot]([[-1,-12],[1,-12],[0,-15]],
style=patch,color=green):
>
plots[display]({top,sides,arrw1,arrw2,dotlinerad,
dotheight,ttxt,h20},scaling=constrained,thickness=2,
color=blue,axes=none):