//>>built
define("dojox/gfx3d/gradient",["dojo/_base/lang","./matrix","./vector"],function(h,g,l){h=h.getObject("dojox.gfx3d",!0);var m=function(d,b){return Math.sqrt(Math.pow(b.x-d.x,2)+Math.pow(b.y-d.y,2))};h.gradient=function(d,b,a,e,c,k,f){f=g.normalize(f);var n=g.multiplyPoint(f,e*Math.cos(c)+a.x,e*Math.sin(c)+a.y,a.z),p=g.multiplyPoint(f,e*Math.cos(k)+a.x,e*Math.sin(k)+a.y,a.z),q=g.multiplyPoint(f,a.x,a.y,a.z),w=(k-c)/32,x=m(n,p)/2,r=d[b.type],t=b.finish;b=b.color;var u=[{offset:0,color:r.call(d,l.substract(n,
q),t,b)}];for(c+=w;c<k;c+=w){var v=g.multiplyPoint(f,e*Math.cos(c)+a.x,e*Math.sin(c)+a.y,a.z),y=m(n,v),z=m(p,v);u.push({offset:y/(y+z),color:r.call(d,l.substract(v,q),t,b)})}u.push({offset:1,color:r.call(d,l.substract(p,q),t,b)});return{type:"linear",x1:0,y1:-x,x2:0,y2:x,colors:u}};return h.gradient});