title: Intersection volume of ellipsoids
body: <p>I plot two ellipsoids with ellipsoid function and also use rotation handle. In order to compute the intersection volume (i.e. lens) and for the case of intersection volume between ellipsoids without rotation , i used analytical code for spheres intersection volume.
  But I am stuck ,if ellipsoids are at some rotations ,how i will compute the intersection volume(i.e.lens) between them. Also i need to compute intersection dia. of lens.
  ellipsoids have different rotational angles with respect to their max axis along z axis. here is a code:</p>
  
  <pre><code> draw ellipsoid, [x,y,z] = ellipsoid(xc,yc,zc,xr,yr,zr,n);
   (xc,yc,zc)=center; semi-axis lengths = (Fmax,Fmin,Fmin);n
  X=[0,2];  two ellipsoid x coordinates  i.e 0 is first ellipsoid
             and 2 is second ellipsoid respectively
  Y=[0,2];   two ellipsoid y coordinates
  Z=[0,2];   two ellipsoid z coordinates;
  ROTATIONANGLE=[90,30];
  RMIN=[1,2];  two ellipsoid minor axis radius 
  RMAX=[3,5];  two ellipsoid major axis radius.
  for a = 1:2  display ellipsoid
          [x, y, z] = ellipsoid(X(a),Y(a),Z(a),RMIN(a),RMAX(a),3.25,30);
  S = surfl(x, y, z);
      rotate(S,[0,0,1],ROTATIONANGLE(a))
  colormap copper
  axis equal
  xlabel('X')
  ylabel('Y')`enter code here
  zlabel('Z')
  check the boolean condition 
  hold on
  end
  </code></pre>