r28: *** empty log message ***
[ctsim.git] / include / kmath.h
index a95c3c3c760e144f2155d5ad89d445647ff3aeec..b8b359e9de241a01bcbcbcf3d836c9da033ac235 100644 (file)
@@ -1,16 +1,41 @@
+/*****************************************************************************
+**  This is part of the CTSim program
+**  Copyright (C) 1983-2000 Kevin Rosenberg
+**
+**  $Id: kmath.h,v 1.6 2000/05/02 20:00:25 kevin Exp $
+**  $Log: kmath.h,v $
+**  Revision 1.6  2000/05/02 20:00:25  kevin
+**  *** empty log message ***
+**
+**  Revision 1.5  2000/05/02 15:31:39  kevin
+**  code cleaning
+**
+**  Revision 1.4  2000/04/30 19:17:35  kevin
+**  Set up include files for conditional INTERACTIVE_GRAPHICS
+**
+**  Revision 1.3  2000/04/28 14:14:16  kevin
+**  *** empty log message ***
+**
+**
+**  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
+******************************************************************************/
 /******************************************************************************
  *
- * FILE IDENTIFICATION
- *
- *     File Name:      NUMR.H
- *     Author:         Kevin Rosenberg
- *     Purpose:        Header file containing definitions for numerical app's
+ * PURPOSE
+ *     Header file containing definitions for numerical app's
  *     Date Started:   Nov 84
  *
- * DESCRIPTION
- *
- * MODIFICATION LOG
- *
  *****************************************************************************/
 
 #ifndef _H_kmath
@@ -62,6 +87,9 @@ typedef double   *DMTX_1D;
 typedef DMTX_1D  *DMTX_2D;
 typedef DMTX_2D  *DMTX_3D;
 
+typedef double GRFMTX_2D[3][3];
+typedef double GRFMTX_3D[4][4];
+
 union elem_val_un {    /* holds an element value */
        char      c;
        int       i;
@@ -138,7 +166,11 @@ typedef struct matrix_st *MTXP;
               )))))
 */
 
-
+/* minmax.c */
+double fmax(const double a, const double b);
+void minmax_dvector(const double array[], const int pts, double *xmin, double *xmax);
+/* cliprect.c */
+int cliprect(double *x1, double *y1, double *x2, double *y2, const double rect[4]);
 /* lnearest.c */
 long int lnearest(double x);
 /* mtx_disp.c */
@@ -160,5 +192,17 @@ int mtx_check(const MTX *mtx, const char *func_name);
 double norm_ang(double theta);
 /* simpson.c */
 double simpson(const double xmin, const double xmax, const double *y, const int np);
+/* clip.c */
+int clipsegment(double *x1, double *y1, double *x2, double *y2, const double u, const double v);
+int clipsector(double *x1, double *y1, double *x2, double *y2, const double u, const double v);
+int clipcircle(double *x1, double *y1, double *x2, double *y2, const double cx, const double cy, const double radius, double t1, double t2);
+int cliptriangle(double *x1, double *y1, double *x2, double *y2, const double u, const double v, const int clip_xaxis);
+/* xform.c */
+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 const m, double *x, double *y);
 
 #endif