/* Steven Andrews, 8/7/96. Modified 9/2/98 */ /* See documentation called math2 doc */ /* Copyright 2003 by Steven Andrews. Permission is granted for non-commercial use of and modifications to the code. */ #ifndef __math2_h #define __math2_h #define PI 3.14159265358979323846 #define SQRT2 1.41421356237 #define SQRTPI 1.7724538509 #define SQRT2PI 2.50662827462 #define SQUARE(X) ((X)*(X)) #define QUADPLUS(A,B,C) ((-(B)+sqrt((B)*(B)-4*(A)*(C)))/(2*(A))) #define QUADMINUS(A,B,C) ((-(B)-sqrt((B)*(B)-4*(A)*(C)))/(2*(A))) int sign(float x); int signD(double x); float sinc(float x); float box(float x); float bessj0(float x); float bessj1(float x); float gauss(float x,float mean,float sd); float gammaln(float x); float gammp(float a,float x); float erfn(float x); float erfnc(float x); float betaln(float x1,float x2); int iseven(int x); int is2ton(int x); int isinteger(float x); int next2ton(int x); float factorial(int n); float choose(int n,int m); int minus1to(int x); int intpower(int n,int p); int gcomdiv(int m,int n); float hermite(float x,int n); float constrain(float x,float lo,float hi); float reflect(float x,float lo,float hi); float inversefn(float (*fn)(float),float y,float x1,float x2,int n); double quadpts2paramsD(double *x,double *y,double *abc); double fouriersumD(double *a,double *b,int n,double l,double x); void SetHillParam(float *hp,float a,float e,float n); float HillFn(float *hp,float x); void HillFnCompose(float *hp1,float *hp2,float *hptot); void HillFnComposeNF1(float *hp1,float *hp2,float *hpf1,float *hpf12); #endif