1 | <!-- Do not edit with Front Page, it adds too many spaces -->
|
---|
2 | <html>
|
---|
3 | <head>
|
---|
4 | <meta http-equiv="Content-Type"
|
---|
5 | content="text/html; charset=iso-8859-1">
|
---|
6 | <title>geom.c, geom2.c -- geometric and floating point routines</title>
|
---|
7 | </head>
|
---|
8 |
|
---|
9 | <body>
|
---|
10 | <!-- Navigation links -->
|
---|
11 | <p><a name="TOP"><b>Up:</b></a> <a
|
---|
12 | href="http://www.qhull.org">Home page</a> for Qhull<br>
|
---|
13 | <b>Up:</b> <a href="../../html/index.htm#TOC">Qhull manual</a>: Table of Contents <br>
|
---|
14 | <b>Up:</b> <a href="../../html/qh-quick.htm#programs">Programs</a>
|
---|
15 | • <a href="../../html/qh-quick.htm#options">Options</a>
|
---|
16 | • <a href="../../html/qh-opto.htm#output">Output</a>
|
---|
17 | • <a href="../../html/qh-optf.htm#format">Formats</a>
|
---|
18 | • <a href="../../html/qh-optg.htm#geomview">Geomview</a>
|
---|
19 | • <a href="../../html/qh-optp.htm#print">Print</a>
|
---|
20 | • <a href="../../html/qh-optq.htm#qhull">Qhull</a>
|
---|
21 | • <a href="../../html/qh-optc.htm#prec">Precision</a>
|
---|
22 | • <a href="../../html/qh-optt.htm#trace">Trace</a><br>
|
---|
23 | <b>Up:</b> <a href="../../html/qh-code.htm#TOC">Qhull code: Table of Contents</a><br>
|
---|
24 | <b>To:</b> <a href="index.htm">Qhull functions</a>, macros, and data structures<br>
|
---|
25 | <b>To:</b> <a href="qh-geom.htm#TOC">Geom</a> • <a href="qh-globa.htm">Global</a>
|
---|
26 | • <a href="qh-io.htm">Io</a> • <a href="qh-mem.htm">Mem</a>
|
---|
27 | • <a href="qh-merge.htm">Merge</a> • <a href="qh-poly.htm">Poly</a>
|
---|
28 | • <a href="qh-qhull.htm">Qhull</a> • <a href="qh-set.htm">Set</a>
|
---|
29 | • <a href="qh-stat.htm">Stat</a> • <a href="qh-user.htm">User</a>
|
---|
30 | </p>
|
---|
31 |
|
---|
32 | <hr>
|
---|
33 | <!-- Main text of document. -->
|
---|
34 |
|
---|
35 | <h2>geom.c, geom2.c, random.c -- geometric and floating point routines</h2>
|
---|
36 | <blockquote>
|
---|
37 | <p>Geometrically, a vertex is a point with <em>d</em> coordinates
|
---|
38 | and a facet is a halfspace. A <em>halfspace</em> is defined by an
|
---|
39 | oriented hyperplane through the facet's vertices. A <em>hyperplane</em>
|
---|
40 | is defined by <em>d</em> normalized coefficients and an offset. A
|
---|
41 | point is <em>above</em> a facet if its distance to the facet is
|
---|
42 | positive.</p>
|
---|
43 |
|
---|
44 | <p>Qhull uses floating point coordinates for input points,
|
---|
45 | vertices, halfspace equations, centrums, and an interior point.</p>
|
---|
46 |
|
---|
47 | <p>Qhull may be configured for single precision or double
|
---|
48 | precision floating point arithmetic (see <a href="user.h#realT">realT</a>
|
---|
49 | ). </p>
|
---|
50 |
|
---|
51 | <p>Each floating point operation may incur round-off error (see
|
---|
52 | <a href="qh-merge.htm#TOC">Merge</a>). The maximum error for distance
|
---|
53 | computations is determined at initialization. The roundoff error
|
---|
54 | in halfspace computation is accounted for by computing the
|
---|
55 | distance from vertices to the halfspace. </p>
|
---|
56 | </blockquote>
|
---|
57 | <p><b>Copyright © 1995-2012 C.B. Barber</b></p>
|
---|
58 | <hr>
|
---|
59 | <p><a href="#TOP">»</a> <b>Geom</b>
|
---|
60 | <a name="TOC">•</a> <a href="qh-globa.htm#TOC">Global</a> •
|
---|
61 | <a href="qh-io.htm#TOC">Io</a> • <a href="qh-mem.htm#TOC">Mem</a> •
|
---|
62 | <a href="qh-merge.htm#TOC">Merge</a> • <a href="qh-poly.htm#TOC">Poly</a> •
|
---|
63 | <a href="qh-qhull.htm#TOC">Qhull</a> • <a href="qh-set.htm#TOC">Set</a> •
|
---|
64 | <a href="qh-stat.htm#TOC">Stat</a> • <a href="qh-user.htm#TOC">User</a> </p>
|
---|
65 |
|
---|
66 | <h3>Index to <a href="geom.c">geom.c</a>,
|
---|
67 | <a href="geom2.c">geom2.c</a>, <a href="geom.h">geom.h</a>,
|
---|
68 | <a href="random.c">random.c</a>, <a href="random.h">random.h</a>
|
---|
69 | </h3>
|
---|
70 |
|
---|
71 | <ul>
|
---|
72 | <li><a href="#gtype">geometric data types and constants</a> </li>
|
---|
73 | <li><a href="#gmacro">mathematical macros</a>
|
---|
74 | </li>
|
---|
75 | <li><a href="#gmath">mathematical functions</a> </li>
|
---|
76 | <li><a href="#gcomp">computational geometry functions</a> </li>
|
---|
77 | <li><a href="#gpoint">point array functions</a> </li>
|
---|
78 | <li><a href="#gfacet">geometric facet functions</a> </li>
|
---|
79 | <li><a href="#ground">geometric roundoff functions</a></li>
|
---|
80 | </ul>
|
---|
81 |
|
---|
82 | <h3><a href="qh-geom.htm#TOC">»</a><a name="gtype">geometric data types
|
---|
83 | and constants</a></h3>
|
---|
84 |
|
---|
85 | <ul>
|
---|
86 | <li><a href="libqhull.h#coordT">coordT</a> coordinates and
|
---|
87 | coefficients are stored as realT</li>
|
---|
88 | <li><a href="libqhull.h#pointT">pointT</a> a point is an array
|
---|
89 | of <tt>DIM3</tt> coordinates </li>
|
---|
90 | </ul>
|
---|
91 |
|
---|
92 | <h3><a href="qh-geom.htm#TOC">»</a><a name="gmacro">mathematical macros</a></h3>
|
---|
93 |
|
---|
94 | <ul>
|
---|
95 | <li><a href="geom.h#fabs_">fabs_</a> returns the absolute
|
---|
96 | value of a </li>
|
---|
97 | <li><a href="geom.h#fmax_">fmax_</a> returns the maximum
|
---|
98 | value of a and b </li>
|
---|
99 | <li><a href="geom.h#fmin_">fmin_</a> returns the minimum
|
---|
100 | value of a and b </li>
|
---|
101 | <li><a href="geom.h#maximize_">maximize_</a> maximize a value
|
---|
102 | </li>
|
---|
103 | <li><a href="geom.h#minimize_">minimize_</a> minimize a value
|
---|
104 | </li>
|
---|
105 | <li><a href="geom.h#det2_">det2_</a> compute a 2-d
|
---|
106 | determinate </li>
|
---|
107 | <li><a href="geom.h#det3_">det3_</a> compute a 3-d
|
---|
108 | determinate </li>
|
---|
109 | <li><a href="geom.h#dX">dX, dY, dZ</a> compute the difference
|
---|
110 | between two coordinates </li>
|
---|
111 | </ul>
|
---|
112 |
|
---|
113 | <h3><a href="qh-geom.htm#TOC">»</a><a name="gmath">mathematical functions</a></h3>
|
---|
114 |
|
---|
115 | <ul>
|
---|
116 | <li><a href="geom.c#backnormal">qh_backnormal</a> solve for
|
---|
117 | normal using back substitution </li>
|
---|
118 | <li><a href="geom2.c#crossproduct">qh_crossproduct</a>
|
---|
119 | compute the cross product of two 3-d vectors </li>
|
---|
120 | <li><a href="geom2.c#determinant">qh_determinant</a> compute
|
---|
121 | the determinant of a square matrix </li>
|
---|
122 | <li><a href="geom.c#gausselim">qh_gausselim</a> Gaussian
|
---|
123 | elimination with partial pivoting </li>
|
---|
124 | <li><a href="geom2.c#gram_schmidt">qh_gram_schmidt</a>
|
---|
125 | implements Gram-Schmidt orthogonalization by rows </li>
|
---|
126 | <li><a href="geom2.c#maxabsval">qh_maxabsval</a> return max
|
---|
127 | absolute value of a vector </li>
|
---|
128 | <li><a href="geom2.c#minabsval">qh_minabsval</a> return min
|
---|
129 | absolute value of a dim vector </li>
|
---|
130 | <li><a href="geom2.c#mindiff">qh_mindiff</a> return index of
|
---|
131 | min absolute difference of two vectors </li>
|
---|
132 | <li><a href="geom.c#normalize">qh_normalize</a> normalize a
|
---|
133 | vector </li>
|
---|
134 | <li><a href="geom.c#normalize2">qh_normalize2</a> normalize a
|
---|
135 | vector and report if too small </li>
|
---|
136 | <li><a href="geom2.c#printmatrix">qh_printmatrix</a> print
|
---|
137 | matrix given by row vectors </li>
|
---|
138 | <li><a href="random.c#rand">qh_rand/srand</a> generate random
|
---|
139 | numbers </li>
|
---|
140 | <li><a href="random.c#randomfactor">qh_randomfactor</a> return
|
---|
141 | a random factor near 1.0 </li>
|
---|
142 | <li><a href="random.c#randommatrix">qh_randommatrix</a>
|
---|
143 | generate a random dimXdim matrix in range (-1,1) </li>
|
---|
144 | </ul>
|
---|
145 |
|
---|
146 | <h3><a href="qh-geom.htm#TOC">»</a><a name="gcomp">computational geometry functions</a></h3>
|
---|
147 |
|
---|
148 | <ul>
|
---|
149 | <li><a href="geom2.c#detsimplex">qh_detsimplex</a> compute
|
---|
150 | determinate of a simplex of points </li>
|
---|
151 | <li><a href="io.c#detvnorm">qh_detvnorm</a> determine normal for Voronoi ridge </li>
|
---|
152 | <li><a href="geom2.c#distnorm">qh_distnorm</a> compute
|
---|
153 | distance from point to hyperplane as defined by normal and offset</li>
|
---|
154 | <li><a href="geom2.c#facetarea_simplex">qh_facetarea_simplex</a>
|
---|
155 | return area of a simplex</li>
|
---|
156 | <li><a href="geom.c#getangle">qh_getangle</a> return cosine
|
---|
157 | of angle (i.e., dot product) </li>
|
---|
158 | <li><a href="geom.c#getcenter">qh_getcenter</a> return
|
---|
159 | arithmetic center for a set of vertices </li>
|
---|
160 | <li><a href="geom2.c#pointdist">qh_pointdist</a> return
|
---|
161 | distance between two points </li>
|
---|
162 | <li><a href="geom2.c#rotatepoints">qh_rotatepoints</a> rotate
|
---|
163 | numpoints points by a row matrix </li>
|
---|
164 | <li><a href="geom2.c#sethalfspace">qh_sethalfspace</a> set
|
---|
165 | coords to dual of halfspace relative to an interior point </li>
|
---|
166 | <li><a href="geom.c#sethyperplane_det">qh_sethyperplane_det</a>
|
---|
167 | return hyperplane for oriented simplex using determinates
|
---|
168 | </li>
|
---|
169 | <li><a href="geom.c#sethyperplane_gauss">qh_sethyperplane_gauss</a>
|
---|
170 | return hyperplane for oriented simplex using Gaussian
|
---|
171 | elimination </li>
|
---|
172 | <li><a href="geom2.c#voronoi_center">qh_voronoi_center</a>
|
---|
173 | return Voronoi center for a set of points </li>
|
---|
174 | </ul>
|
---|
175 |
|
---|
176 | <h3><a href="qh-geom.htm#TOC">»</a><a name="gpoint">point array functions</a></h3>
|
---|
177 | <ul>
|
---|
178 | <li><a href="geom2.c#copypoints">qh_copypoints</a> return
|
---|
179 | malloc'd copy of points</li>
|
---|
180 | <li><a href="geom2.c#joggleinput">qh_joggleinput</a> joggle
|
---|
181 | input points by qh.JOGGLEmax </li>
|
---|
182 | <li><a href="geom2.c#maxmin">qh_maxmin</a> return max/min
|
---|
183 | points for each dimension</li>
|
---|
184 | <li><a href="geom2.c#maxsimplex">qh_maxsimplex</a> determines
|
---|
185 | maximum simplex for a set of points </li>
|
---|
186 | <li><a href="geom2.c#printpoints">qh_printpoints</a> print ids for a
|
---|
187 | set of points </li>
|
---|
188 | <li><a href="geom2.c#projectinput">qh_projectinput</a> project
|
---|
189 | input using qh DELAUNAY and qh low_bound/high_bound </li>
|
---|
190 | <li><a href="geom2.c#projectpoints">qh_projectpoints</a>
|
---|
191 | project points along one or more dimensions </li>
|
---|
192 | <li><a href="geom2.c#rotateinput">qh_rotateinput</a> rotate
|
---|
193 | input points using row matrix </li>
|
---|
194 | <li><a href="geom2.c#scaleinput">qh_scaleinput</a> scale
|
---|
195 | input points using qh low_bound/high_bound </li>
|
---|
196 | <li><a href="geom2.c#scalelast">qh_scalelast</a> scale last
|
---|
197 | coordinate to [0,m] for Delaunay triangulations </li>
|
---|
198 | <li><a href="geom2.c#scalepoints">qh_scalepoints</a> scale
|
---|
199 | points to new lowbound and highbound </li>
|
---|
200 | <li><a href="geom2.c#setdelaunay">qh_setdelaunay</a> project
|
---|
201 | points to paraboloid for Delaunay triangulation </li>
|
---|
202 | <li><a href="geom2.c#sethalfspace_all">qh_sethalfspace_all</a>
|
---|
203 | generate dual for halfspace intersection with interior
|
---|
204 | point </li>
|
---|
205 | </ul>
|
---|
206 |
|
---|
207 | <h3><a href="qh-geom.htm#TOC">»</a><a name="gfacet">geometric facet functions</a></h3>
|
---|
208 | <ul>
|
---|
209 | <li><a href="geom.c#distplane">qh_distplane</a> return
|
---|
210 | distance from point to facet </li>
|
---|
211 | <li><a href="geom2.c#facetarea">qh_facetarea</a> return area
|
---|
212 | of a facet </li>
|
---|
213 | <li><a href="geom2.c#facetcenter">qh_facetcenter</a> return
|
---|
214 | Voronoi center for a facet's vertices </li>
|
---|
215 | <li><a href="geom.c#findbest">qh_findbest</a> find visible
|
---|
216 | facet or best facet for a point </li>
|
---|
217 | <li><a href="geom.c#findbesthorizon">qh_findbesthorizon</a>
|
---|
218 | update best new facet with horizon facets</li>
|
---|
219 | <li><a href="geom.c#findbestnew">qh_findbestnew</a> find best
|
---|
220 | new facet for point </li>
|
---|
221 | <li><a href="geom2.c#getarea">qh_getarea</a> get area of all
|
---|
222 | facets in facetlist, collect statistics </li>
|
---|
223 | <li><a href="geom.c#getcentrum">qh_getcentrum</a> return
|
---|
224 | centrum for a facet </li>
|
---|
225 | <li><a href="geom.c#getdistance">qh_getdistance</a> returns
|
---|
226 | the max and min distance of a facet's vertices to a
|
---|
227 | neighboring facet</li>
|
---|
228 | <li><a href="geom2.c#findgooddist">qh_findgooddist</a> find
|
---|
229 | best good facet visible for point from facet </li>
|
---|
230 | <li><a href="geom2.c#inthresholds">qh_inthresholds</a> return
|
---|
231 | True if facet normal within 'Pdn' and 'PDn'</li>
|
---|
232 | <li><a href="geom2.c#orientoutside">qh_orientoutside</a>
|
---|
233 | orient facet so that <tt>qh.interior_point</tt> is inside</li>
|
---|
234 | <li><a href="geom.c#projectpoint">qh_projectpoint</a> project
|
---|
235 | point onto a facet </li>
|
---|
236 | <li><a href="geom.c#setfacetplane">qh_setfacetplane</a> sets
|
---|
237 | the hyperplane for a facet </li>
|
---|
238 | <li><a href="geom2.c#sharpnewfacets">qh_sharpnewfacets</a> true
|
---|
239 | if new facets contains a sharp corner</li>
|
---|
240 | </ul>
|
---|
241 |
|
---|
242 | <h3><a href="qh-geom.htm#TOC">»</a><a name="ground">geometric roundoff functions</a></h3>
|
---|
243 | <ul>
|
---|
244 | <li><a href="geom2.c#detjoggle">qh_detjoggle</a> determine
|
---|
245 | default joggle for points and distance roundoff error</li>
|
---|
246 | <li><a href="geom2.c#detroundoff">qh_detroundoff</a>
|
---|
247 | determine maximum roundoff error and other precision constants</li>
|
---|
248 | <li><a href="geom2.c#distround">qh_distround</a> compute
|
---|
249 | maximum roundoff error due to a distance computation to a
|
---|
250 | normalized hyperplane</li>
|
---|
251 | <li><a href="geom2.c#divzero">qh_divzero</a> divide by a
|
---|
252 | number that is nearly zero </li>
|
---|
253 | <li><a href="geom2.c#maxouter">qh_maxouter</a> return maximum outer
|
---|
254 | plane</li>
|
---|
255 | <li><a href="geom2.c#outerinner">qh_outerinner</a> return actual
|
---|
256 | outer and inner planes
|
---|
257 | </ul>
|
---|
258 |
|
---|
259 | <p><!-- Navigation links --> </p>
|
---|
260 | <hr>
|
---|
261 | <p><b>Up:</b>
|
---|
262 | <a href="http://www.qhull.org">Home page for
|
---|
263 | Qhull</a> <br>
|
---|
264 | <b>Up:</b> <a href="index.htm#TOC">Qhull manual: Table of Contents</a> <br>
|
---|
265 | <b>Up:</b> <a href="../../html/qh-quick.htm#programs">Programs</a>
|
---|
266 | • <a href="../../html/qh-quick.htm#options">Options</a>
|
---|
267 | • <a href="../../html/qh-opto.htm#output">Output</a>
|
---|
268 | • <a href="../../html/qh-optf.htm#format">Formats</a>
|
---|
269 | • <a href="../../html/qh-optg.htm#geomview">Geomview</a>
|
---|
270 | • <a href="../../html/qh-optp.htm#print">Print</a>
|
---|
271 | • <a href="../../html/qh-optq.htm#qhull">Qhull</a>
|
---|
272 | • <a href="../../html/qh-optc.htm#prec">Precision</a>
|
---|
273 | • <a href="../../html/qh-optt.htm#trace">Trace</a><br>
|
---|
274 | <b>Up:</b> <a href="../../html/qh-code.htm#TOC">Qhull code: Table of Contents</a> <br>
|
---|
275 | <b>To:</b> <a href="index.htm">Qhull functions</a>, macros, and data structures<br>
|
---|
276 | <b>To:</b> <a href="qh-geom.htm">Geom</a> •
|
---|
277 | <a href="qh-globa.htm">Global</a> • <a href="qh-io.htm">Io</a>
|
---|
278 | • <a href="qh-mem.htm">Mem</a> • <a href="qh-merge.htm">Merge</a>
|
---|
279 | • <a href="qh-poly.htm">Poly</a> • <a href="qh-qhull.htm#TOC">Qhull</a>
|
---|
280 | • <a href="qh-set.htm">Set</a> • <a href="qh-stat.htm">Stat</a>
|
---|
281 | • <a href="qh-user.htm">User</a><br>
|
---|
282 |
|
---|
283 |
|
---|
284 | <p><!-- GC common information --> </p>
|
---|
285 | <hr>
|
---|
286 | <p><a href="http://www.geom.uiuc.edu/"><img
|
---|
287 | src="../../html/qh--geom.gif" align="middle" width="40" height="40"></a><i>The
|
---|
288 | Geometry Center Home Page </i></p>
|
---|
289 | <p>Comments to: <a href=mailto:qhull@qhull.org>qhull@qhull.org</a>
|
---|
290 | </a><br>
|
---|
291 | Created: May 2, 1997 --- <!-- hhmts start --> Last modified: see top <!-- hhmts end --> </p>
|
---|
292 | </body>
|
---|
293 | </html>
|
---|