/********************************************************/
/* mercator.h This file contains basic mathmatics		*/
/* functions for coordinate conversion.					*/
/* Alexander Kolesnikov.				*/
/********************************************************/

#ifndef MERCATOR_INCLUDED
#define MERCATOR_INCLUDED

/*------------------------------------------------------*/

#include "geo_def.h"

#include <assert.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include  <float.h>
#include  "math.h"
#include  "string.h"
#include  <stddef.h>

/*------------------------------------------------------*/

#define PI 3.1415926535897932384626433832795

static const int	MAX_VAL	=	4;
static const int	MAXLONG	=	2147483647;
static const double	DBLLONG	=	4.61168601e18;
static const double	D2R		=	PI/180;
static const double	R2D		=	180/PI;
static const double	EPSLN	=	1.0e-10;

/*------------------------------------------------------*/

void ForwardConversion(TCoordinate *Coordinate, double lon_center,
	 TProjected *Projected);

void InverseConversion(TProjected *Projected, double lat_origin,
					   double lon_center, double scale_fact,
					   TCoordinate *Coordinate);

double asinz(double Con);

int signum(double arg);

/*------------------------------------------------------*/

#endif /*MERCATOR_INCLUDED*/
