_ellipsoid = function(){
      var u,v,p;
      for (var i = 0; i <= this.detailY; i++){
        v = i / this.detailY;
        for (var j = 0; j <= this.detailX; j++){
          u = j / this.detailX;
          var theta = 2 * Math.PI * u;
          var phi = Math.PI * v - Math.PI / 2;
          p = new p5.Vector(radiusX * Math.cos(phi) * Math.sin(theta),
            radiusY * Math.sin(phi),
            radiusZ * Math.cos(phi) * Math.cos(theta));
          this.vertices.push(p);
          this.uvs.push([u,v]);
        }
      }
    }
Draw a torus with given radius and tube radius
@method torus
@param  {Number} radius        radius of the whole ring
@param  {Number} tubeRadius    radius of the tube
@param  {Number} [detailX]     optional: number of segments in x-dimension,
                               the more segments the smoother geometry
                               default is 24
@param  {Number} [detailY]     optional: number of segments in y-dimension,
                               the more segments the smoother geometry
                               default is 16
@chainable
@example
<div>
<code>
//draw a spinning torus with radius 200 and tube radius 60
function setup(){
  createCanvas(100, 100, WEBGL);
}

function draw(){
  background(200);
  rotateX(frameCount * 0.01);
  rotateY(frameCount * 0.01);
  torus(200, 60);
}
</code>
</div>