steiner.flx

Animation flash

steiner.flx
/* -*-flix-*- */
// Steiner's Roman surface, using "surface" plots
// May 19, 2006
#include "epix.h"

using namespace ePiX;

double MAX=2.5, rad=0.8*MAX;

P F(double u, double v)
{
  double x=rad*Cos(u)*Cos(v), y=rad*Cos(u)*Sin(v), z=rad*Sin(u);
  return P(y*z, x*z, x*y);
}

int main(int argc, char* argv[])
{
  if (argc == 3)
    {
      char* arg;
      double temp1, temp2;
      temp1=strtod(argv[1], &arg);
      temp2=strtod(argv[2], &arg);

      tix=temp1/temp2;
    }
  bounding_box(P(-MAX,-MAX),P(MAX,MAX));
  unitlength("1in");
  picture(4,4);

  use_pstricks();
  begin();

  std::cout << "\n\\newrgbcolor{sky_blue}{0.7 0.9 1}";

  psset("fillcolor=sky_blue,line_color=sky_blue");
  fill();
  rect(P(x_min,y_min), P(x_max, y_max));
  use_pstricks(false);

  revolutions();
  camera.at(cyl(10,0.5*tix,2)); // exploit 2-fold symmetry
  domain R(P(-0.25,0), P(0.25,1), mesh(36,72), mesh(36, 72));

  fill();
  surface(F, R);

  end();
}