size(8cm,0); import solids; //Draw 3D right angle (MA,MB) void drawrightangle(picture pic=currentpicture, triple M, triple A, triple B, real radius=0, pen p=currentpen, pen fillpen=nullpen, projection P=currentprojection) { p=linejoin(0)+linecap(0)+p; if (radius==0) radius=arrowfactor*sqrt(2); transform3 T=shift(-M); triple OA=radius/sqrt(2)*unit(T*A), OB=radius/sqrt(2)*unit(T*B), OC=OA+OB; path3 tp=OA--OC--OB; picture tpic; draw(tpic, tp, p=p); if (fillpen!=nullpen) fill(tpic, O--tp--cycle3, fillpen); add(pic,tpic,M); } currentprojection=orthographic(100,150,30); real r=10, h=6; // r=sphere radius; h=altitude section triple Op=(0,0,h); real rs=sqrt(r^2-h^2); // section radius real ch=1-acos(h/r)/pi; path3 arcD=Arc(O,r,90,0,90,180*ch,Y,32)--(0,0,h); revolution sphereD=revolution(O,arcD,Z); sphereD.fill(lightblue); path3 arcU=Arc(O,r,90,180*ch,90,180,Y,32); revolution sphereU=revolution(O,arcU,Z); sphereU.filldraw(opacity(0.5)+lightgrey); // right triangle OO'A triple A=rotate(100,Z)*(rs,0,h); dot("$O$",O,NW); dot("$O'$",Op,W); dot("$A$",A,N); draw(A--O--Op--A); drawrightangle(Op,O,A); shipout(format="pdf", bbox(Fill(paleyellow)));