diff --git a/EGkPoint3d.h b/EGkPoint3d.h index 2e3dcce..3d23f4c 100644 --- a/EGkPoint3d.h +++ b/EGkPoint3d.h @@ -42,6 +42,9 @@ class EGK_EXPORT Point3d void Set( double dX, double dY, double dZ) { x = dX ; y = dY ; z = dZ ;} public : + //! Verifica la validità delle coordinate del punto + bool IsValid( void) const + { return ( std::isfinite( x) && std::isfinite( y) && std::isfinite( z)) ; } //! Verifica se il punto è quasi l'origine bool IsSmall( void) const { return ( ( x * x + y * y + z * z) < SQ_EPS_SMALL) ; } diff --git a/EGkVector3d.h b/EGkVector3d.h index dc25701..a4f0f69 100644 --- a/EGkVector3d.h +++ b/EGkVector3d.h @@ -44,6 +44,9 @@ class EGK_EXPORT Vector3d void Set( double dX, double dY, double dZ) { x = dX ; y = dY ; z = dZ ; } public : + //! Verifica la validità delle coordinate del vettore + bool IsValid( void) const + { return ( std::isfinite( x) && std::isfinite( y) && std::isfinite( z)) ; } //! Quadrato della lunghezza del vettore double SqLen( void) const { return ( x * x + y * y + z * z) ; }