r108: merged files
[ctsim.git] / include / kmath.h
diff --git a/include/kmath.h b/include/kmath.h
deleted file mode 100644 (file)
index e4c577b..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/*****************************************************************************
-** FILE IDENTIFICATION
-**
-**    Name:          kmath.h
-**    Purpose:       Header file containing definitions for numerical app
-**    Programmer:    Kevin Rosenberg
-**    Date Started:  Nov 84
-**
-**  This is part of the CTSim program
-**  Copyright (C) 1983-2000 Kevin Rosenberg
-**
-**  $Id: kmath.h,v 1.16 2000/06/19 15:48:23 kevin Exp $
-**
-**  This program is free software; you can redistribute it and/or modify
-**  it under the terms of the GNU General Public License (version 2) as
-**  published by the Free Software Foundation.
-**
-**  This program is distributed in the hope that it will be useful,
-**  but WITHOUT ANY WARRANTY; without even the implied warranty of
-**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-**  GNU General Public License for more details.
-**
-**  You should have received a copy of the GNU General Public License
-**  along with this program; if not, write to the Free Software
-**  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-******************************************************************************/
-
-#ifndef _H_kmath
-#define _H_kmath
-
-#include <stdio.h>
-#include <math.h>
-
-#define PI      3.14159265358979323846
-#define HALFPI  1.57079632679489661923 /* PI divided by 2 */
-#define QUARTPI 0.78539816339744830962 /* PI divided by 4 */
-#define I_PI   0.31830988618379067154  /* Inverse of PI */
-#define I_PID2 0.63661977236758134308  /* Inverse of PID2 */
-#define TWOPI  6.28318530717958647692
-#define SQRT2   1.414213562373095049
-
-#define F_EPSILON      1.0E-6
-#define D_EPSILON      1.0E-10
-
-#define ASSUMEDZERO  1E-10
-
-typedef double GRFMTX_2D[3][3];
-typedef double GRFMTX_3D[4][4];
-
-inline double 
-convertDegreesToRadians (double x)
-{ return (x * (PI/180.)); }
-
-inline double
-convertRadiansToDegrees (double x)
-{ return (x*(180./PI)); }
-
-template<class T>
-inline T nearest (double x)
-{ return (x > 0 ? static_cast<T>(x+0.5) : static_cast<T>(x-0.5)); }
-
-template<class T>
-inline T clamp (T value, T lowerBounds, T upperBounds)
-{ return (value >= upperBounds ? upperBounds : (value <= lowerBounds ? lowerBounds : value )); }
-
-template<class T>
-inline T lineLength (T x1, T y1, T x2, T y2)
-{ return static_cast<T>( sqrt ((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1)) ); }
-
-template<class T>
-inline void minmax_array (const T* array, const int n, T& min, T& max)
-{
-  max = min = array[0];
-
-  for (int i = 1; i < n; i++)
-    if (array[i] < min)
-      min = array[i];
-    else if (array[i] > max)
-      max = array[i];
-}
-
-
-//////////////////////////////////////////////////////////////
-// FUNTION DECLARATIONS
-//////////////////////////////////////////////////////////////
-
-// clip.cpp 
-int clip_rect(double& x1, double& y1, double& x2, double& y2, const double rect[4]);
-int clip_segment(double& x1, double& y1, double& x2, double& y2, const double u, const double v);
-int clip_sector(double& x1, double& y1, double& x2, double& y2, const double u, const double v);
-int clip_circle(double& x1, double& y1, double& x2, double& y2, const double cx, const double cy, const double radius, double t1, double t2);
-int clip_triangle(double& x1, double& y1, double& x2, double& y2, const double u, const double v, const int clip_xaxis);
-
-// norm_ang.cpp 
-double norm_ang (double theta);
-
-// xform.cpp 
-void indent_mtx2(GRFMTX_2D m);
-void xlat_mtx2(GRFMTX_2D m, const double x, const double y);
-void scale_mtx2(GRFMTX_2D m, const double sx, const double sy);
-void rot_mtx2(GRFMTX_2D m, const double theta);
-void mult_mtx2(GRFMTX_2D m1, GRFMTX_2D m2, GRFMTX_2D result);
-void xform_mtx2(GRFMTX_2D m, double& x, double& y);
-void rotate2d(double x[], double y[], int pts, double angle);
-void xlat2d(double x[], double y[], int pts, double xoffset, double yoffset);
-void scale2d(double x[], double y[], int pts, double xfact, double yfact);
-
-// simpson.cpp
-double integrateSimpson (const double xmin, const double xmax, const double *y, const int np);
-
-#endif