/*
AxisScale.h
Automatic scales axes for diagrams and data plots
|_;_;_;_;_|_;_;_;_;_| this is 2 majors with 5 minors each; x1=0, x2=20
0         10        20
Version 0.03
S. Salewski 10-JUN-2010
License: GPL
gcc -lm -Wall AxisScale.c
*/

#include <stdbool.h>

#ifndef _AXIS_SCALE_H_
#define _AXIS_SCALE_H_

typedef struct
{
  double val;
  bool major;
} Tic;

/*
x1, x2: range to partition
majors, minors: DESIRED! number of intervals==(tics-1). 1 <= majors <= 50, 1 <= minors <= 10.
extend: if true, we may extend bounds with major tics, else only with subtics.
array t holds position of tics. Its size should be at least 3*majors*minors.
For major tics we may generate a string and write it at that position in diagram, for subtics we may print a |.
return: total number of generated tics.
*/
int scaleaxis(double x1, double x2, int majors, int minors, int arraysize, bool extend, Tic t[]);

// simple output for testing/debugging
void printscale(Tic t[], int count);

#endif

