#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#define PI 3.14159265358979323846
int main (int argc, char **argv)
{
double offset, x, y, z, r, angle;
int order, n;

order = atoi (argv[1]);
r = atof (argv[2]);

printf ("<gml>\n  <molecule>\n");

z = -0.1;
offset = (2 * PI) / 36;
for (n = 0; n < 2 * order; n++)
  {
  angle = (2 * PI) / (2 * order);
  x = r * cos (n * angle);
  y = r * sin (n * angle);
  printf ("    <atom element=\"H\" x =\"%f\" y=\"%f\" z=\"%f\"/>\n", x, y, 1.0 + z);
  z = -z;
  }

printf ("  </molecule>\n</gml>\n");

return 0;
}
