next up previous contents
Next: Quartet demonstration Up: Main menu in Objective Previous: Single sphere demonstration   Contents

Double sphere demonstration

Figure: Objective C Panel, in which the the difficulties of drawing two spheres, which can occult or intersect one another is shown.
\begin{figure}\begin{picture}(400,400)(60,0)
\epsffile{fig15.eps}\end{picture}\end{figure}

Just as the presentation of a single sphere can be examined in minute detail, so also can the details of sphere intersction and occultation be examined up close. It is particularly convenient to vary the relative positions and radii of the two spheres; for example, to see the differences between clean intersections and near tangencies.

if (drawDisphere) {
drawView=5;
s[0][0]=[[leftCenter cellAt:0:0] doubleValue];
s[0][1]=[[leftCenter cellAt:1:0] doubleValue];
s[0][2]=[[leftCenter cellAt:2:0] doubleValue];
s[0][3]=[leftRadius doubleValue];
s[0][4]=[[leftEuler cellAt:0:0] doubleValue];
s[0][5]=[[leftEuler cellAt:1:0] doubleValue];
s[0][6]=[[leftEuler cellAt:2:0] doubleValue];
spheu(o,&s[0][4]);
sphdc(a,o);
  [[leftAngles cellAt:0:0] setDoubleValue:a[0]]; 
  [[leftAngles cellAt:1:0] setDoubleValue:a[1]]; 
  [[leftAngles cellAt:2:0] setDoubleValue:a[2]]; 
  [[leftAngles cellAt:3:0] setDoubleValue:sphar(o)]; 
s[1][0]=[[rightCenter cellAt:0:0] doubleValue];
s[1][1]=[[rightCenter cellAt:1:0] doubleValue];
s[1][2]=[[rightCenter cellAt:2:0] doubleValue];
s[1][3]=[rightRadius doubleValue];
s[1][4]=[[rightEuler cellAt:0:0] doubleValue];
s[1][5]=[[rightEuler cellAt:1:0] doubleValue];
s[1][6]=[[rightEuler cellAt:2:0] doubleValue];
spheu(o,&s[1][4]);
sphdc(a,o);
  [[rightAngles cellAt:0:0] setDoubleValue:a[0]]; 
  [[rightAngles cellAt:1:0] setDoubleValue:a[1]]; 
  [[rightAngles cellAt:2:0] setDoubleValue:a[2]]; 
  [[rightAngles cellAt:3:0] setDoubleValue:sphar(o)]; 

geosi(s);
  if (drawView==5) PSstroke();
}



Pedro Hernandez 2004-05-13