From 80423a1eb68bdc326e8ea078ca758200a6951e55 Mon Sep 17 00:00:00 2001 From: DarioS Date: Mon, 15 May 2023 14:51:16 +0200 Subject: [PATCH] =?UTF-8?q?Include=20:=20-=20modifiche=20a=20Vector3d=20e?= =?UTF-8?q?=20Point3d=20per=20controllo=20validit=C3=A0=20coordinate=20(is?= =?UTF-8?q?finite).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EGkPoint3d.h | 3 +++ EGkVector3d.h | 3 +++ 2 files changed, 6 insertions(+) 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) ; }