if (std::fabs(t1+t2) < THRESHOLD_F*MULT_PREC_F)
return false;
- return (t1*t2 <= 0.0) && !epsilonEqual(t1,t2, (double)MULT_PREC_F);
+ return (t1*t2 <= 0.0) && !epsilonEqual(t1,t2, MULT_PREC_F);
}
inline bool TransformedTriangle::testFacetSurroundsSegment(const TriSegment seg, const TetraFacet facet) const
{
// this value will not be used - we set it to whatever
LOG(6, "Triple product not calculated for corner " << corner );
- _tripleProducts[corner] = -3.14159265;
+ _tripleProducts[corner] = std::nan("triplep");
_validTP[corner] = false;
}
anglesForRows.clear();
//? is this more stable? -> no subtraction
// return asin( dotProd / ( lenNormal * lenEdgeVec ) ) + 3.141592625358979 / 2.0;
- double tmp=dotProd / ( lenNormal * lenEdgeVec );
- tmp=std::max(tmp,-1.);
- tmp=std::min(tmp,1.);
- return atan(1.0)*4.0 - acos(tmp);
-
+ const double tmp=dotProd / ( lenNormal * lenEdgeVec );
+ const double safe_tmp=std::max(std::min(tmp,1.),-1.);
+ return M_PI - std::acos(safe_tmp);
}
/**