00001 // 00002 // File: Util.cpp 00003 // Author: Steve Kilthau 00004 // Date: August, 1999 00005 // 00006 // This file implements several utility functions 00007 // used in other parts of the program. 00008 // 00009 00010 #include <math.h> 00011 #include "Util.h" 00012 00013 namespace ns_vu1112112 { 00014 using namespace ns_vu1112112; 00015 00016 // Check if value is within TOLERANCE of zero. If it 00017 // is then make value equal to zero. 00018 float SnapToZero(float t) 00019 { 00020 return (fabs(t)<SNAP_TOLERANCE)?(float)(0.0):t; 00021 } 00022 00023 } // end of namespace ns_vu1112112