@@ -220,7 +220,7 @@ ofQuaternion ofMatrix4x4::getRotate() const
220220 QZ = tq[3 ];
221221 }
222222
223- s = sqrt (0.25 /tq[j]);
223+ s = std:: sqrt (0 .25f /tq[j]);
224224 QW *= s;
225225 QX *= s;
226226 QY *= s;
@@ -239,10 +239,10 @@ ofQuaternion ofMatrix4x4::getRotate() const
239239 ofQuaternion q;
240240
241241 // From http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm
242- QW = 0.5 * sqrt ( osg::maximum ( 0.0 , 1.0 + _mat[0 ][0 ] + _mat[1 ][1 ] + _mat[2 ][2 ] ) );
243- QX = 0.5 * sqrt ( osg::maximum ( 0.0 , 1.0 + _mat[0 ][0 ] - _mat[1 ][1 ] - _mat[2 ][2 ] ) );
244- QY = 0.5 * sqrt ( osg::maximum ( 0.0 , 1.0 - _mat[0 ][0 ] + _mat[1 ][1 ] - _mat[2 ][2 ] ) );
245- QZ = 0.5 * sqrt ( osg::maximum ( 0.0 , 1.0 - _mat[0 ][0 ] - _mat[1 ][1 ] + _mat[2 ][2 ] ) );
242+ QW = 0.5 * std:: sqrt ( osg::maximum ( 0.0 , 1.0 + _mat[0 ][0 ] + _mat[1 ][1 ] + _mat[2 ][2 ] ) );
243+ QX = 0.5 * std:: sqrt ( osg::maximum ( 0.0 , 1.0 + _mat[0 ][0 ] - _mat[1 ][1 ] - _mat[2 ][2 ] ) );
244+ QY = 0.5 * std:: sqrt ( osg::maximum ( 0.0 , 1.0 - _mat[0 ][0 ] + _mat[1 ][1 ] - _mat[2 ][2 ] ) );
245+ QZ = 0.5 * std:: sqrt ( osg::maximum ( 0.0 , 1.0 - _mat[0 ][0 ] - _mat[1 ][1 ] + _mat[2 ][2 ] ) );
246246
247247#if 0
248248 // Robert Osfield, June 7th 2007, arggg this new implementation produces many many errors, so have to revert to sign(..) orignal below.
@@ -516,7 +516,7 @@ void ofMatrix4x4::makeOrthoNormalOf(const ofMatrix4x4& rhs)
516516
517517 if (!equivalent ((double )x_colMag, 1.0 ) && !equivalent ((double )x_colMag, 0.0 ))
518518 {
519- x_colMag = sqrt (x_colMag);
519+ x_colMag = std:: sqrt (x_colMag);
520520 _mat[0 ][0 ] = rhs._mat [0 ][0 ] / x_colMag;
521521 _mat[1 ][0 ] = rhs._mat [1 ][0 ] / x_colMag;
522522 _mat[2 ][0 ] = rhs._mat [2 ][0 ] / x_colMag;
@@ -530,7 +530,7 @@ void ofMatrix4x4::makeOrthoNormalOf(const ofMatrix4x4& rhs)
530530
531531 if (!equivalent ((double )y_colMag, 1.0 ) && !equivalent ((double )y_colMag, 0.0 ))
532532 {
533- y_colMag = sqrt (y_colMag);
533+ y_colMag = std:: sqrt (y_colMag);
534534 _mat[0 ][1 ] = rhs._mat [0 ][1 ] / y_colMag;
535535 _mat[1 ][1 ] = rhs._mat [1 ][1 ] / y_colMag;
536536 _mat[2 ][1 ] = rhs._mat [2 ][1 ] / y_colMag;
@@ -544,7 +544,7 @@ void ofMatrix4x4::makeOrthoNormalOf(const ofMatrix4x4& rhs)
544544
545545 if (!equivalent ((double )z_colMag, 1.0 ) && !equivalent ((double )z_colMag, 0.0 ))
546546 {
547- z_colMag = sqrt (z_colMag);
547+ z_colMag = std:: sqrt (z_colMag);
548548 _mat[0 ][2 ] = rhs._mat [0 ][2 ] / z_colMag;
549549 _mat[1 ][2 ] = rhs._mat [1 ][2 ] / z_colMag;
550550 _mat[2 ][2 ] = rhs._mat [2 ][2 ] / z_colMag;
@@ -1056,10 +1056,10 @@ void adjoint_transpose(_HMatrix M, _HMatrix MadjT)
10561056/* * Setup u for Household reflection to zero all v components but first **/
10571057void make_reflector (double *v, double *u)
10581058{
1059- double s = sqrt (vdot (v, v));
1059+ double s = std:: sqrt (vdot (v, v));
10601060 u[0 ] = v[0 ]; u[1 ] = v[1 ];
10611061 u[2 ] = v[2 ] + ((v[2 ]<0.0 ) ? -s : s);
1062- s = sqrt (2.0 /vdot (u, u));
1062+ s = std:: sqrt (2.0 /vdot (u, u));
10631063 u[0 ] = u[0 ]*s; u[1 ] = u[1 ]*s; u[2 ] = u[2 ]*s;
10641064}
10651065
@@ -1116,10 +1116,10 @@ void do_rank2(_HMatrix M, _HMatrix MadjT, _HMatrix Q)
11161116 make_reflector (v2, v2); reflect_rows (M, v2);
11171117 w = M[0 ][0 ]; x = M[0 ][1 ]; y = M[1 ][0 ]; z = M[1 ][1 ];
11181118 if (w*z>x*y) {
1119- c = z+w; s = y-x; d = sqrt (c*c+s*s); c = c/d; s = s/d;
1119+ c = z+w; s = y-x; d = std:: sqrt (c*c+s*s); c = c/d; s = s/d;
11201120 Q[0 ][0 ] = Q[1 ][1 ] = c; Q[0 ][1 ] = -(Q[1 ][0 ] = s);
11211121 } else {
1122- c = z-w; s = y+x; d = sqrt (c*c+s*s); c = c/d; s = s/d;
1122+ c = z-w; s = y+x; d = std:: sqrt (c*c+s*s); c = c/d; s = s/d;
11231123 Q[0 ][0 ] = -(Q[1 ][1 ] = c); Q[0 ][1 ] = Q[1 ][0 ] = s;
11241124 }
11251125 Q[0 ][2 ] = Q[2 ][0 ] = Q[1 ][2 ] = Q[2 ][1 ] = 0.0 ; Q[2 ][2 ] = 1.0 ;
@@ -1155,7 +1155,7 @@ ofQuaternion quatFromMatrix(_HMatrix mat)
11551155 tr = mat[X][X] + mat[Y][Y]+ mat[Z][Z];
11561156 if (tr >= 0.0 )
11571157 {
1158- s = sqrt (tr + mat[W][W]);
1158+ s = std:: sqrt (tr + mat[W][W]);
11591159 qu.w () = s*0.5 ;
11601160 s = 0.5 / s;
11611161 qu.x () = (mat[Z][Y] - mat[Y][Z]) * s;
@@ -1219,7 +1219,7 @@ double polarDecomp( _HMatrix M, _HMatrix Q, _HMatrix S)
12191219 MadjT_one = norm_one (MadjTk);
12201220 MadjT_inf = norm_inf (MadjTk);
12211221
1222- gamma = sqrt (sqrt ((MadjT_one*MadjT_inf)/(M_one*M_inf))/std::abs (det));
1222+ gamma = std:: sqrt (std:: sqrt ((MadjT_one*MadjT_inf)/(M_one*M_inf))/std::abs (det));
12231223 g1 = gamma*0.5 ;
12241224 g2 = 0.5 /(gamma*det);
12251225 matrixCopy (Ek,=,Mk,3 );
@@ -1392,7 +1392,7 @@ ofQuaternion snuggle(ofQuaternion q, HVect *k)
13921392 }
13931393
13941394 qp = Qt_Mul (q, p);
1395- t = sqrt (mag[win]+0.5 );
1395+ t = std:: sqrt (mag[win]+0.5 );
13961396 p = Qt_Mul (p, Qt_ (0.0 ,0.0 ,-qp.z ()/t,qp.w ()/t));
13971397 p = Qt_Mul (qtoz, Qt_Conj (p));
13981398 }
0 commit comments