File indexing completed on 2025-01-18 10:01:52
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef qhDEFgeom
0015 #define qhDEFgeom 1
0016
0017 #include "libqhull.h"
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 #define fabs_( a ) ((( a ) < 0 ) ? -( a ):( a ))
0028
0029
0030
0031
0032
0033
0034
0035 #define fmax_( a,b ) ( ( a ) < ( b ) ? ( b ) : ( a ) )
0036
0037
0038
0039
0040
0041
0042
0043 #define fmin_( a,b ) ( ( a ) > ( b ) ? ( b ) : ( a ) )
0044
0045
0046
0047
0048
0049
0050
0051 #define maximize_( maxval, val ) { if (( maxval ) < ( val )) ( maxval )= ( val ); }
0052
0053
0054
0055
0056
0057
0058
0059 #define minimize_( minval, val ) { if (( minval ) > ( val )) ( minval )= ( val ); }
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069 #define det2_( a1,a2,b1,b2 ) (( a1 )*( b2 ) - ( a2 )*( b1 ))
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080 #define det3_( a1,a2,a3,b1,b2,b3,c1,c2,c3 ) ( ( a1 )*det2_( b2,b3,c2,c3 ) \
0081 - ( b1 )*det2_( a2,a3,c2,c3 ) + ( c1 )*det2_( a2,a3,b2,b3 ) )
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094 #define dX( p1,p2 ) ( *( rows[p1] ) - *( rows[p2] ))
0095 #define dY( p1,p2 ) ( *( rows[p1]+1 ) - *( rows[p2]+1 ))
0096 #define dZ( p1,p2 ) ( *( rows[p1]+2 ) - *( rows[p2]+2 ))
0097 #define dW( p1,p2 ) ( *( rows[p1]+3 ) - *( rows[p2]+3 ))
0098
0099
0100
0101 void qh_backnormal(realT **rows, int numrow, int numcol, boolT sign, coordT *normal, boolT *nearzero);
0102 void qh_distplane(pointT *point, facetT *facet, realT *dist);
0103 facetT *qh_findbest(pointT *point, facetT *startfacet,
0104 boolT bestoutside, boolT isnewfacets, boolT noupper,
0105 realT *dist, boolT *isoutside, int *numpart);
0106 facetT *qh_findbesthorizon(boolT ischeckmax, pointT *point,
0107 facetT *startfacet, boolT noupper, realT *bestdist, int *numpart);
0108 facetT *qh_findbestnew(pointT *point, facetT *startfacet, realT *dist,
0109 boolT bestoutside, boolT *isoutside, int *numpart);
0110 void qh_gausselim(realT **rows, int numrow, int numcol, boolT *sign, boolT *nearzero);
0111 realT qh_getangle(pointT *vect1, pointT *vect2);
0112 pointT *qh_getcenter(setT *vertices);
0113 pointT *qh_getcentrum(facetT *facet);
0114 coordT qh_getdistance(facetT *facet, facetT *neighbor, coordT *mindist, coordT *maxdist);
0115 void qh_normalize(coordT *normal, int dim, boolT toporient);
0116 void qh_normalize2(coordT *normal, int dim, boolT toporient,
0117 realT *minnorm, boolT *ismin);
0118 pointT *qh_projectpoint(pointT *point, facetT *facet, realT dist);
0119
0120 void qh_setfacetplane(facetT *newfacets);
0121 void qh_sethyperplane_det(int dim, coordT **rows, coordT *point0,
0122 boolT toporient, coordT *normal, realT *offset, boolT *nearzero);
0123 void qh_sethyperplane_gauss(int dim, coordT **rows, pointT *point0,
0124 boolT toporient, coordT *normal, coordT *offset, boolT *nearzero);
0125 boolT qh_sharpnewfacets(void);
0126
0127
0128
0129 coordT *qh_copypoints(coordT *points, int numpoints, int dimension);
0130 void qh_crossproduct(int dim, realT vecA[3], realT vecB[3], realT vecC[3]);
0131 realT qh_determinant(realT **rows, int dim, boolT *nearzero);
0132 realT qh_detjoggle(pointT *points, int numpoints, int dimension);
0133 void qh_detmaxoutside(void);
0134 void qh_detroundoff(void);
0135 realT qh_detsimplex(pointT *apex, setT *points, int dim, boolT *nearzero);
0136 realT qh_distnorm(int dim, pointT *point, pointT *normal, realT *offsetp);
0137 realT qh_distround(int dimension, realT maxabs, realT maxsumabs);
0138 realT qh_divzero(realT numer, realT denom, realT mindenom1, boolT *zerodiv);
0139 realT qh_facetarea(facetT *facet);
0140 realT qh_facetarea_simplex(int dim, coordT *apex, setT *vertices,
0141 vertexT *notvertex, boolT toporient, coordT *normal, realT *offset);
0142 pointT *qh_facetcenter(setT *vertices);
0143 facetT *qh_findgooddist(pointT *point, facetT *facetA, realT *distp, facetT **facetlist);
0144 vertexT *qh_furthestnewvertex(unsigned int unvisited, facetT *facet, realT *maxdistp );
0145 vertexT *qh_furthestvertex(facetT *facetA, facetT *facetB, realT *maxdistp, realT *mindistp);
0146 void qh_getarea(facetT *facetlist);
0147 boolT qh_gram_schmidt(int dim, realT **rows);
0148 boolT qh_inthresholds(coordT *normal, realT *angle);
0149 void qh_joggleinput(void);
0150 realT *qh_maxabsval(realT *normal, int dim);
0151 setT *qh_maxmin(pointT *points, int numpoints, int dimension);
0152 realT qh_maxouter(void);
0153 void qh_maxsimplex(int dim, setT *maxpoints, pointT *points, int numpoints, setT **simplex);
0154 realT qh_minabsval(realT *normal, int dim);
0155 int qh_mindiff(realT *vecA, realT *vecB, int dim);
0156 boolT qh_orientoutside(facetT *facet);
0157 void qh_outerinner(facetT *facet, realT *outerplane, realT *innerplane);
0158 coordT qh_pointdist(pointT *point1, pointT *point2, int dim);
0159 void qh_printmatrix(FILE *fp, const char *string, realT **rows, int numrow, int numcol);
0160 void qh_printpoints(FILE *fp, const char *string, setT *points);
0161 void qh_projectinput(void);
0162 void qh_projectpoints(signed char *project, int n, realT *points,
0163 int numpoints, int dim, realT *newpoints, int newdim);
0164 void qh_rotateinput(realT **rows);
0165 void qh_rotatepoints(realT *points, int numpoints, int dim, realT **rows);
0166 void qh_scaleinput(void);
0167 void qh_scalelast(coordT *points, int numpoints, int dim, coordT low,
0168 coordT high, coordT newhigh);
0169 void qh_scalepoints(pointT *points, int numpoints, int dim,
0170 realT *newlows, realT *newhighs);
0171 boolT qh_sethalfspace(int dim, coordT *coords, coordT **nextp,
0172 coordT *normal, coordT *offset, coordT *feasible);
0173 coordT *qh_sethalfspace_all(int dim, int count, coordT *halfspaces, pointT *feasible);
0174 coordT qh_vertex_bestdist(setT *vertices);
0175 coordT qh_vertex_bestdist2(setT *vertices, vertexT **vertexp, vertexT **vertexp2);
0176 pointT *qh_voronoi_center(int dim, setT *points);
0177
0178 #endif
0179
0180
0181