geom_r.h
Go to the documentation of this file.
1 /*<html><pre> -<a href="qh-geom_r.htm"
2  >-------------------------------</a><a name="TOP">-</a>
3 
4  geom_r.h
5  header file for geometric routines
6 
7  see qh-geom_r.htm and geom_r.c
8 
9  Copyright (c) 1993-2015 The Geometry Center.
10  $Id: //main/2015/qhull/src/libqhull_r/geom_r.h#2 $$Change: 2042 $
11  $DateTime: 2016/01/03 13:26:21 $$Author: bbarber $
12 */
13 
14 #ifndef qhDEFgeom
15 #define qhDEFgeom 1
16 
17 #include "libqhull_r.h"
18 
19 /* ============ -macros- ======================== */
20 
21 /*-<a href="qh-geom_r.htm#TOC"
22  >--------------------------------</a><a name="fabs_">-</a>
23 
24  fabs_(a)
25  returns the absolute value of a
26 */
27 #define fabs_( a ) ((( a ) < 0 ) ? -( a ):( a ))
28 
29 /*-<a href="qh-geom_r.htm#TOC"
30  >--------------------------------</a><a name="fmax_">-</a>
31 
32  fmax_(a,b)
33  returns the maximum value of a and b
34 */
35 #define fmax_( a,b ) ( ( a ) < ( b ) ? ( b ) : ( a ) )
36 
37 /*-<a href="qh-geom_r.htm#TOC"
38  >--------------------------------</a><a name="fmin_">-</a>
39 
40  fmin_(a,b)
41  returns the minimum value of a and b
42 */
43 #define fmin_( a,b ) ( ( a ) > ( b ) ? ( b ) : ( a ) )
44 
45 /*-<a href="qh-geom_r.htm#TOC"
46  >--------------------------------</a><a name="maximize_">-</a>
47 
48  maximize_(maxval, val)
49  set maxval to val if val is greater than maxval
50 */
51 #define maximize_( maxval, val ) { if (( maxval ) < ( val )) ( maxval )= ( val ); }
52 
53 /*-<a href="qh-geom_r.htm#TOC"
54  >--------------------------------</a><a name="minimize_">-</a>
55 
56  minimize_(minval, val)
57  set minval to val if val is less than minval
58 */
59 #define minimize_( minval, val ) { if (( minval ) > ( val )) ( minval )= ( val ); }
60 
61 /*-<a href="qh-geom_r.htm#TOC"
62  >--------------------------------</a><a name="det2_">-</a>
63 
64  det2_(a1, a2,
65  b1, b2)
66 
67  compute a 2-d determinate
68 */
69 #define det2_( a1,a2,b1,b2 ) (( a1 )*( b2 ) - ( a2 )*( b1 ))
70 
71 /*-<a href="qh-geom_r.htm#TOC"
72  >--------------------------------</a><a name="det3_">-</a>
73 
74  det3_(a1, a2, a3,
75  b1, b2, b3,
76  c1, c2, c3)
77 
78  compute a 3-d determinate
79 */
80 #define det3_( a1,a2,a3,b1,b2,b3,c1,c2,c3 ) ( ( a1 )*det2_( b2,b3,c2,c3 ) \
81  - ( b1 )*det2_( a2,a3,c2,c3 ) + ( c1 )*det2_( a2,a3,b2,b3 ) )
82 
83 /*-<a href="qh-geom_r.htm#TOC"
84  >--------------------------------</a><a name="dX">-</a>
85 
86  dX( p1, p2 )
87  dY( p1, p2 )
88  dZ( p1, p2 )
89 
90  given two indices into rows[],
91 
92  compute the difference between X, Y, or Z coordinates
93 */
94 #define dX( p1,p2 ) ( *( rows[p1] ) - *( rows[p2] ))
95 #define dY( p1,p2 ) ( *( rows[p1]+1 ) - *( rows[p2]+1 ))
96 #define dZ( p1,p2 ) ( *( rows[p1]+2 ) - *( rows[p2]+2 ))
97 #define dW( p1,p2 ) ( *( rows[p1]+3 ) - *( rows[p2]+3 ))
98 
99 /*============= prototypes in alphabetical order, infrequent at end ======= */
100 
101 void qh_backnormal(qhT *qh, realT **rows, int numrow, int numcol, boolT sign, coordT *normal, boolT *nearzero);
102 void qh_distplane(qhT *qh, pointT *point, facetT *facet, realT *dist);
103 facetT *qh_findbest(qhT *qh, pointT *point, facetT *startfacet,
104  boolT bestoutside, boolT isnewfacets, boolT noupper,
105  realT *dist, boolT *isoutside, int *numpart);
106 facetT *qh_findbesthorizon(qhT *qh, boolT ischeckmax, pointT *point,
107  facetT *startfacet, boolT noupper, realT *bestdist, int *numpart);
108 facetT *qh_findbestnew(qhT *qh, pointT *point, facetT *startfacet, realT *dist,
109  boolT bestoutside, boolT *isoutside, int *numpart);
110 void qh_gausselim(qhT *qh, realT **rows, int numrow, int numcol, boolT *sign, boolT *nearzero);
111 realT qh_getangle(qhT *qh, pointT *vect1, pointT *vect2);
112 pointT *qh_getcenter(qhT *qh, setT *vertices);
113 pointT *qh_getcentrum(qhT *qh, facetT *facet);
114 realT qh_getdistance(qhT *qh, facetT *facet, facetT *neighbor, realT *mindist, realT *maxdist);
115 void qh_normalize(qhT *qh, coordT *normal, int dim, boolT toporient);
116 void qh_normalize2(qhT *qh, coordT *normal, int dim, boolT toporient,
117  realT *minnorm, boolT *ismin);
118 pointT *qh_projectpoint(qhT *qh, pointT *point, facetT *facet, realT dist);
119 
120 void qh_setfacetplane(qhT *qh, facetT *newfacets);
121 void qh_sethyperplane_det(qhT *qh, int dim, coordT **rows, coordT *point0,
122  boolT toporient, coordT *normal, realT *offset, boolT *nearzero);
123 void qh_sethyperplane_gauss(qhT *qh, int dim, coordT **rows, pointT *point0,
124  boolT toporient, coordT *normal, coordT *offset, boolT *nearzero);
126 
127 /*========= infrequently used code in geom2_r.c =============*/
128 
129 coordT *qh_copypoints(qhT *qh, coordT *points, int numpoints, int dimension);
130 void qh_crossproduct(int dim, realT vecA[3], realT vecB[3], realT vecC[3]);
131 realT qh_determinant(qhT *qh, realT **rows, int dim, boolT *nearzero);
132 realT qh_detjoggle(qhT *qh, pointT *points, int numpoints, int dimension);
133 void qh_detroundoff(qhT *qh);
134 realT qh_detsimplex(qhT *qh, pointT *apex, setT *points, int dim, boolT *nearzero);
135 realT qh_distnorm(int dim, pointT *point, pointT *normal, realT *offsetp);
136 realT qh_distround(qhT *qh, int dimension, realT maxabs, realT maxsumabs);
137 realT qh_divzero(realT numer, realT denom, realT mindenom1, boolT *zerodiv);
138 realT qh_facetarea(qhT *qh, facetT *facet);
139 realT qh_facetarea_simplex(qhT *qh, int dim, coordT *apex, setT *vertices,
140  vertexT *notvertex, boolT toporient, coordT *normal, realT *offset);
141 pointT *qh_facetcenter(qhT *qh, setT *vertices);
142 facetT *qh_findgooddist(qhT *qh, pointT *point, facetT *facetA, realT *distp, facetT **facetlist);
143 void qh_getarea(qhT *qh, facetT *facetlist);
144 boolT qh_gram_schmidt(qhT *qh, int dim, realT **rows);
145 boolT qh_inthresholds(qhT *qh, coordT *normal, realT *angle);
146 void qh_joggleinput(qhT *qh);
147 realT *qh_maxabsval(realT *normal, int dim);
148 setT *qh_maxmin(qhT *qh, pointT *points, int numpoints, int dimension);
150 void qh_maxsimplex(qhT *qh, int dim, setT *maxpoints, pointT *points, int numpoints, setT **simplex);
151 realT qh_minabsval(realT *normal, int dim);
152 int qh_mindiff(realT *vecA, realT *vecB, int dim);
154 void qh_outerinner(qhT *qh, facetT *facet, realT *outerplane, realT *innerplane);
155 coordT qh_pointdist(pointT *point1, pointT *point2, int dim);
156 void qh_printmatrix(qhT *qh, FILE *fp, const char *string, realT **rows, int numrow, int numcol);
157 void qh_printpoints(qhT *qh, FILE *fp, const char *string, setT *points);
158 void qh_projectinput(qhT *qh);
159 void qh_projectpoints(qhT *qh, signed char *project, int n, realT *points,
160  int numpoints, int dim, realT *newpoints, int newdim);
161 void qh_rotateinput(qhT *qh, realT **rows);
162 void qh_rotatepoints(qhT *qh, realT *points, int numpoints, int dim, realT **rows);
163 void qh_scaleinput(qhT *qh);
164 void qh_scalelast(qhT *qh, coordT *points, int numpoints, int dim, coordT low,
165  coordT high, coordT newhigh);
166 void qh_scalepoints(qhT *qh, pointT *points, int numpoints, int dim,
167  realT *newlows, realT *newhighs);
168 boolT qh_sethalfspace(qhT *qh, int dim, coordT *coords, coordT **nextp,
169  coordT *normal, coordT *offset, coordT *feasible);
170 coordT *qh_sethalfspace_all(qhT *qh, int dim, int count, coordT *halfspaces, pointT *feasible);
171 pointT *qh_voronoi_center(qhT *qh, int dim, setT *points);
172 
173 #endif /* qhDEFgeom */
174 
175 
176 
Definition: libqhull.h:465
boolT qh_sethalfspace(qhT *qh, int dim, coordT *coords, coordT **nextp, coordT *normal, coordT *offset, coordT *feasible)
Definition: geom2_r.c:1846
void qh_detroundoff(qhT *qh)
Definition: geom2_r.c:193
facetT * qh_findbesthorizon(qhT *qh, boolT ischeckmax, pointT *point, facetT *startfacet, boolT noupper, realT *bestdist, int *numpart)
Definition: geom_r.c:281
#define boolT
Definition: libqhull.h:121
void qh_projectinput(qhT *qh)
Definition: geom2_r.c:1426
Definition: qset.h:83
void qh_rotateinput(qhT *qh, realT **rows)
Definition: geom2_r.c:1586
facetT * qh_findgooddist(qhT *qh, pointT *point, facetT *facetA, realT *distp, facetT **facetlist)
Definition: geom2_r.c:631
boolT qh_gram_schmidt(qhT *qh, int dim, realT **rows)
Definition: geom2_r.c:764
#define pointT
Definition: libqhull.h:96
pointT * qh_facetcenter(qhT *qh, setT *vertices)
Definition: geom2_r.c:592
void qh_projectpoints(qhT *qh, signed char *project, int n, realT *points, int numpoints, int dim, realT *newpoints, int newdim)
Definition: geom2_r.c:1533
void qh_joggleinput(qhT *qh)
Definition: geom2_r.c:875
facetT * qh_findbest(qhT *qh, pointT *point, facetT *startfacet, boolT bestoutside, boolT isnewfacets, boolT noupper, realT *dist, boolT *isoutside, int *numpart)
Definition: geom_r.c:140
pointT * qh_getcenter(qhT *qh, setT *vertices)
Definition: geom_r.c:669
realT qh_determinant(qhT *qh, realT **rows, int dim, boolT *nearzero)
Definition: geom2_r.c:83
void qh_scaleinput(qhT *qh)
Definition: geom2_r.c:1648
realT qh_minabsval(realT *normal, int dim)
Definition: geom2.c:1197
realT qh_getangle(qhT *qh, pointT *vect1, pointT *vect2)
Definition: geom_r.c:644
facetT * qh_findbestnew(qhT *qh, pointT *point, facetT *startfacet, realT *dist, boolT bestoutside, boolT *isoutside, int *numpart)
Definition: geom_r.c:412
void qh_sethyperplane_gauss(qhT *qh, int dim, coordT **rows, pointT *point0, boolT toporient, coordT *normal, coordT *offset, boolT *nearzero)
Definition: geom_r.c:1201
void qh_sethyperplane_det(qhT *qh, int dim, coordT **rows, coordT *point0, boolT toporient, coordT *normal, realT *offset, boolT *nearzero)
Definition: geom_r.c:1103
#define coordT
Definition: libqhull.h:80
void qh_normalize(qhT *qh, coordT *normal, int dim, boolT toporient)
Definition: geom_r.c:768
#define qh
Definition: libqhull.h:457
void qh_printmatrix(qhT *qh, FILE *fp, const char *string, realT **rows, int numrow, int numcol)
Definition: geom2_r.c:1347
boolT qh_inthresholds(qhT *qh, coordT *normal, realT *angle)
Definition: geom2_r.c:812
realT * qh_maxabsval(realT *normal, int dim)
Definition: geom2.c:937
void qh_printpoints(qhT *qh, FILE *fp, const char *string, setT *points)
Definition: geom2_r.c:1371
void qh_setfacetplane(qhT *qh, facetT *newfacets)
Definition: geom_r.c:929
realT qh_distround(qhT *qh, int dimension, realT maxabs, realT maxsumabs)
Definition: geom2_r.c:377
boolT qh_orientoutside(qhT *qh, facetT *facet)
Definition: geom2_r.c:1245
coordT * qh_sethalfspace_all(qhT *qh, int dim, int count, coordT *halfspaces, pointT *feasible)
Definition: geom2_r.c:1920
realT qh_getdistance(qhT *qh, facetT *facet, facetT *neighbor, realT *mindist, realT *maxdist)
Definition: geom_r.c:728
void qh_normalize2(qhT *qh, coordT *normal, int dim, boolT toporient, realT *minnorm, boolT *ismin)
Definition: geom_r.c:804
realT qh_facetarea(qhT *qh, facetT *facet)
Definition: geom2_r.c:458
realT qh_detsimplex(qhT *qh, pointT *apex, setT *points, int dim, boolT *nearzero)
Definition: geom2_r.c:305
void qh_scalepoints(qhT *qh, pointT *points, int numpoints, int dim, realT *newlows, realT *newhighs)
Definition: geom2_r.c:1723
pointT * qh_projectpoint(qhT *qh, pointT *point, facetT *facet, realT dist)
Definition: geom_r.c:893
boolT qh_sharpnewfacets(qhT *qh)
Definition: geom2_r.c:1963
void qh_outerinner(qhT *qh, facetT *facet, realT *outerplane, realT *innerplane)
Definition: geom2_r.c:1280
coordT * qh_copypoints(qhT *qh, coordT *points, int numpoints, int dimension)
Definition: geom2_r.c:30
void qh_maxsimplex(qhT *qh, int dim, setT *maxpoints, pointT *points, int numpoints, setT **simplex)
Definition: geom2_r.c:1099
void qh_rotatepoints(qhT *qh, realT *points, int numpoints, int dim, realT **rows)
Definition: geom2_r.c:1612
pointT * qh_voronoi_center(qhT *qh, int dim, setT *points)
Definition: geom2_r.c:2014
int qh_mindiff(realT *vecA, realT *vecB, int dim)
Definition: geom2.c:1217
pointT * qh_getcentrum(qhT *qh, facetT *facet)
Definition: geom_r.c:700
void qh_gausselim(qhT *qh, realT **rows, int numrow, int numcol, boolT *sign, boolT *nearzero)
Definition: geom_r.c:581
void qh_crossproduct(int dim, realT vecA[3], realT vecB[3], realT vecC[3])
Definition: geom2.c:54
void qh_backnormal(qhT *qh, realT **rows, int numrow, int numcol, boolT sign, coordT *normal, boolT *nearzero)
Definition: geom_r.c:521
realT qh_distnorm(int dim, pointT *point, pointT *normal, realT *offsetp)
Definition: geom2.c:348
void qh_scalelast(qhT *qh, coordT *points, int numpoints, int dim, coordT low, coordT high, coordT newhigh)
Definition: geom2_r.c:1677
coordT qh_pointdist(pointT *point1, pointT *point2, int dim)
Definition: geom2.c:1320
realT qh_detjoggle(qhT *qh, pointT *points, int numpoints, int dimension)
Definition: geom2_r.c:130
setT * qh_maxmin(qhT *qh, pointT *points, int numpoints, int dimension)
Definition: geom2_r.c:980
realT qh_divzero(realT numer, realT denom, realT mindenom1, boolT *zerodiv)
Definition: geom2.c:409
realT qh_facetarea_simplex(qhT *qh, int dim, coordT *apex, setT *vertices, vertexT *notvertex, boolT toporient, coordT *normal, realT *offset)
Definition: geom2_r.c:518
void qh_getarea(qhT *qh, facetT *facetlist)
Definition: geom2_r.c:703
#define realT
Definition: user.h:154
void qh_distplane(qhT *qh, pointT *point, facetT *facet, realT *dist)
Definition: geom_r.c:36
realT qh_maxouter(qhT *qh)
Definition: geom2_r.c:1067


hpp-fcl
Author(s):
autogenerated on Fri Jun 2 2023 02:39:01