lib/toxi/geom/mesh/SphericalHarmonics.js
function(p,phi,theta) {
        var r = 0;
        r += Math.pow(mathUtils.sin(this.m[0] * theta), this.m[1]);
        r += Math.pow(mathUtils.cos(this.m[2] * theta), this.m[3]);
        r += Math.pow(mathUtils.sin(this.m[4] * phi), this.m[5]);
        r += Math.pow(mathUtils.cos(this.m[6] * phi), this.m[7]);

        var sinTheta = mathUtils.sin(theta);
        p.x = r * sinTheta * mathUtils.cos(phi);
        p.y = r * mathUtils.cos(theta);
        p.z = r * sinTheta * mathUtils.sin(phi);
        return p;
    }
function(p,phi,theta) {
        var r = 0;
        r += Math.pow(mathUtils.sin(this.m[0] * theta), this.m[1]);
        r += Math.pow(mathUtils.cos(this.m[2] * theta), this.m[3]);
        r += Math.pow(mathUtils.sin(this.m[4] * phi), this.m[5]);
        r += Math.pow(mathUtils.cos(this.m[6] * phi), this.m[7]);

        var sinTheta = mathUtils.sin(theta);
        p.x = r * sinTheta * mathUtils.cos(phi);
        p.y = r * mathUtils.cos(theta);
        p.z = r * sinTheta * mathUtils.sin(phi);
        return p;
    }
function ( p , phi , theta ) { var r = 0 ; r += Math . pow ( mathUtils . sin ( this . m [ 0 ] * theta ) , this . m [ 1 ] ) ; r += Math . pow ( mathUtils . cos ( this . m [ 2 ] * theta ) , this . m [ 3 ] ) ; r += Math . pow ( mathUtils . sin ( this . m [ 4 ] * phi ) , this . m [ 5 ] ) ; r += Math . pow ( mathUtils . cos ( this . m [ 6 ] * phi ) , this . m [ 7 ] ) ; var sinTheta = mathUtils . sin ( theta ) ; p . x = r * sinTheta * mathUtils . cos ( phi ) ; p . y = r * mathUtils . cos ( theta ) ; p . z = r * sinTheta * mathUtils . sin ( phi ) ; return p ; }
toxiclibs - FIXME check where flipped vertex order is coming from sometimes
toxiclibs - FIXME check where flipped vertex order is coming from sometimes