** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: kmath.h,v 1.4 2000/04/30 19:17:35 kevin Exp $
+** $Id: kmath.h,v 1.9 2000/05/08 20:00:48 kevin Exp $
** $Log: kmath.h,v $
+** Revision 1.9 2000/05/08 20:00:48 kevin
+** ANSI C changes
+**
+** Revision 1.8 2000/05/07 12:46:19 kevin
+** made c++ compatible
+**
+** Revision 1.7 2000/05/04 18:16:34 kevin
+** renamed filter definitions
+**
+** 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
**
******************************************************************************/
/******************************************************************************
*
- * 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
#include <stdio.h>
#include <math.h>
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
#define PI 3.14159265358979323846
#define HALFPI 1.57079632679489661923 /* PI divided by 2 */
#define QUARTPI 0.78539816339744830962 /* PI divided by 4 */
)))))
*/
+/* clip.c */
+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);
-/* cliprect.c */
-int cliprect(double *x1, double *y1, double *x2, double *y2, const double rect[4]);
/* lnearest.c */
long int lnearest(double x);
+
+/* minmax.c */
+double fmax(const double a, const double b);
+void minmax_dvector(const double array[], const int pts, double *xmin, double *xmax);
+
/* mtx_disp.c */
void mtx_show(const MTX *mtx);
void mtx_prt(const MTX *mtx, FILE *fp);
int mtx_prt_elem(const MTX *mtx, FILE *fp, unsigned int x, unsigned int y, unsigned int z);
+
/* mtx_elem.c */
int mtx_get_elem(const MTX *mtx, MTX_ELEM_VAL *me, const int x, const int y, const int z);
int mtx_put_elem(MTX *mtx, const MTX_ELEM_VAL *me, unsigned int x, unsigned int y, unsigned int z);
+
/* mtx_inp.c */
int mtx_inp_elem(const char *prompt, MTX_ELEM_VAL *mev, const int dtype);
+
/* mtx_main.c */
MTX *mtx_init(const unsigned int order, const unsigned int elem_type, const unsigned int nx, const unsigned int ny, const unsigned int nz);
MTX *mtx_clr(MTX *mtx);
int mtx_free(MTX *mtx);
int mtx_elem_size(const int dt);
int mtx_check(const MTX *mtx, const char *func_name);
+
/* norm_ang.c */
double norm_ang(double theta);
+
/* simpson.c */
double simpson(const double xmin, const double xmax, const double *y, const int np);
+/* 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 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);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
#endif