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 |
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
Definition at line 104 of file bn.h.
double dist |
>= 0
Definition at line 106 of file bn.h.
Referenced by bn_between(), bn_dist_line3_line3(), bn_dist_line3_lseg3(), bn_dist_pt2_lseg2(), bn_dist_pt3_lseg3(), bn_isect_line2_lseg2(), bn_isect_line3_plane(), bn_isect_line_lseg(), bn_isect_lseg2_lseg2(), bn_isect_lseg3_lseg3(), bn_mat_is_equal(), bn_math_cmd(), and main().
double dist_sq |
dist * dist
Definition at line 107 of file bn.h.
Referenced by bn_2line3_colinear(), bn_3pts_distinct(), bn_dist_line3_line3(), bn_dist_pt2_lseg2(), bn_dist_pt3_lseg3(), bn_isect_line2_lseg2(), bn_isect_line3_line3(), bn_isect_line_lseg(), bn_isect_pt2_lseg2(), bn_isect_pt_lseg(), bn_mk_plane_3pts(), bn_npts_distinct(), bn_pt2_pt2_equal(), bn_pt3_pt3_equal(), and main().
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 |