File:  [Repository ATC2] / QuadraticMandel / fractalalpha.c
Revision 1.1: download - view: text, annotated - select for diffs
Tue Oct 18 08:42:34 2011 UTC (12 years, 7 months ago) by cvsmgr
Branches: MAIN
CVS tags: HEAD
Quadratic fractal set generation.

/*******************************************************************************
+* Mandel del Alberto.
+*
+* 7.07.2005
+*
+* $Id: fractalalpha.c,v 1.1 2011/10/18 08:42:34 cvsmgr Exp $
+* $Name:  $
*******************************************************************************/
# include <stdlib.h>
# include <stdio.h>
# include <string.h>
# include <math.h>
# include <time.h>
# include "genfractal.h"

int main(int argc, char *argv[])
{
char   img_name[512];
int    img_number = 0;
time_t hora = time(NULL);
struct tm  *t_hora = localtime(&hora);

   if (argc != 7)
   {
      fprintf(stderr, "Usage: %s <output base filename> <itermax> "
                      "<alpha> <side_length> <offset x> <offset y>\n", argv[0]);
      return 1;
   }

   printf("Fractal Generator\n");
   printf("Generating fractal with the following parameters:\n\n");
   printf("Iterations:  %d\n",  atoi(argv[2]));
   printf("Xi:          %lf\n", atof(argv[3]));
   printf("Eta:         %lf\n",           0.0);
   printf("Side length: %lf\n", atof(argv[4]));
   printf("Offset X:    %lf\n", atof(argv[5]));
   printf("Offset Y:    %lf\n", atof(argv[6]));
   printf("Date:        %2d.%02d.%d %2d:%02d\n",
                                t_hora->tm_mday,
                                t_hora->tm_mon  + 1,
                                t_hora->tm_year + 1900,
                                t_hora->tm_hour,
                                t_hora->tm_min);

   sprintf(img_name, "%s_%02d.png", argv[1], img_number++);

   return GenFractalAlpha(img_name, atof(argv[3]), 0.0,
                                    atoi(argv[2]), atof(argv[4]),
                                    atof(argv[5]), atof(argv[6]));
}

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>