bn_tol Struct Reference
[Tolerances]

Support for uniform tolerances. More...

#include <bn.h>

Data Fields

uint32_t magic
double dist
 >= 0
double dist_sq
 dist * dist
double perp
 nearly 0
double para
 nearly 1

Detailed Description

Support for uniform tolerances.

B N _ T O L

A handy way of passing around the tolerance information needed to perform approximate floating-point calculations on geometry.

dist & dist_sq establish the distance tolerance.

If two points are closer together than dist, then they are to be considered the same point.

For example:

 point_t a, b;
 vect_t diff;
 VSUB2(diff, a, b);
 if (MAGNITUDE(diff) < tol->dist)       a & b are the same.
 or, more efficiently:
 if (MAQSQ(diff) < tol->dist_sq)

perp & para establish the angular tolerance.

If two rays emanate from the same point, and their dot product is nearly one, then the two rays are the same, while if their dot product is nearly zero, then they are perpendicular.

For example:

 vect_t a, b;
 if (fabs(VDOT(a, b)) >= tol->para)     a & b are parallel
 if (fabs(VDOT(a, b)) <= tol->perp)     a & b are perpendicular
Note:
tol->dist_sq = tol->dist * tol->dist;
tol->para = 1 - tol->perp;

Definition at line 104 of file bn.h.


Field Documentation

uint32_t magic

Definition at line 105 of file bn.h.

Referenced by main().

double dist
double dist_sq
double perp

nearly 0

Definition at line 108 of file bn.h.

Referenced by bn_coplanar(), bn_isect_line3_plane(), bn_mat_is_equal(), and main().

double para

nearly 1

Definition at line 109 of file bn.h.

Referenced by bn_isect_line2_line2(), and main().


The documentation for this struct was generated from the following file:
Generated on Tue Dec 11 13:14:30 2012 for LIBBN by  doxygen 1.6.3