Changeset 375 for cpp/frams/util/3d.cpp
 Timestamp:
 04/26/15 00:59:09 (8 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

cpp/frams/util/3d.cpp
r372 r375 4 4 5 5 #include <common/nonstd_math.h> 6 #include <common/ hmessage.h>6 #include <common/log.h> 7 7 #include "3d.h" 8 8 … … 17 17 { 18 18 double q = x*x + y*y + z*z; 19 if (q < 0) { if (report_errors) Hprintf("Pt3D", "operator()", HMLV_ERROR, "sqrt(%g): domain error", q); return 0; }19 if (q < 0) { if (report_errors) logPrintf("Pt3D", "operator()", LOG_ERROR, "sqrt(%g): domain error", q); return 0; } 20 20 return sqrt(q); 21 21 } … … 24 24 { 25 25 double len = length(); 26 if (fabs(len) < 1e50) { if (report_errors) Hprintf("Pt3D", "normalize()", HMLV_WARN, "vector[%g,%g,%g] too small", x, y, z); x = 1; y = 0; z = 0; return false; }26 if (fabs(len) < 1e50) { if (report_errors) logPrintf("Pt3D", "normalize()", LOG_WARN, "vector[%g,%g,%g] too small", x, y, z); x = 1; y = 0; z = 0; return false; } 27 27 operator/=(len); 28 28 return true; … … 64 64 if (dx == 0 && dy == 0) 65 65 { 66 if (report_errors) Hprintf("Pt3D", "getAngle()", HMLV_WARN, "atan2(%g,%g)", dy, dx);66 if (report_errors) logPrintf("Pt3D", "getAngle()", LOG_WARN, "atan2(%g,%g)", dy, dx); 67 67 return 0; // incorrect result, but there is no correct one 68 68 } … … 147 147 { 148 148 double q = x*x + y*y; 149 if (q < 0) { if (Pt3D::report_errors) Hprintf("", "d2()", HMLV_ERROR, "sqrt(%g): domain error", q); return 0; }149 if (q < 0) { if (Pt3D::report_errors) logPrintf("", "d2()", LOG_ERROR, "sqrt(%g): domain error", q); return 0; } 150 150 return sqrt(q); 151 151 }
Note: See TracChangeset
for help on using the changeset viewer.