Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. bool Sphere::IsValid(void) const throw() {
  2. bool ret = false;
  3. const rt_ell_internal* internalp = Internal();
  4. double dist = 0.0005 * 0.0005;
  5.  
  6. if (!VNEAR_ZERO(internalp->a, SMALL_FASTF) &&
  7. !VNEAR_ZERO(internalp->b, SMALL_FASTF) &&
  8. !VNEAR_ZERO(internalp->c, SMALL_FASTF) &&
  9. NEAR_ZERO(VDOT(internalp->b, Internal()->a ), RT_DOT_TOL) &&
  10. NEAR_ZERO(VDOT(internalp->c, Internal()->a ), RT_DOT_TOL) &&
  11. NEAR_ZERO(VDOT(internalp->b, Internal()->c ), RT_DOT_TOL) &&
  12. NEAR_EQUAL(MAGNITUDE(internalp->a),MAGNITUDE(internalp->b), dist) &&
  13. NEAR_EQUAL(MAGNITUDE(internalp->b),MAGNITUDE(internalp->c), dist))
  14. ret = true;
  15.  
  16. return ret;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement