EgtGeomKernel :

- migliorati controlli in alcune funzioni di vector3d.
This commit is contained in:
Dario Sassi
2019-12-23 14:57:37 +00:00
parent 186f0a4c28
commit 8ed290f667
+12
View File
@@ -397,6 +397,12 @@ Vector3d::LocToLoc( const Frame3d& frOri, const Frame3d& frDest)
bool
Vector3d::GetAngle( const Vector3d& vtEnd, double& dAngDeg) const
{
// verifico vettori
if ( IsZero() || vtEnd.IsZero()) {
dAngDeg = 0 ;
return false ;
}
// quantità ugualmente proporzionali a coseno e seno
double dProSca = *this * vtEnd ;
double dProVett = ( *this ^ vtEnd).Len() ;
@@ -418,6 +424,12 @@ Vector3d::GetAngle( const Vector3d& vtEnd, double& dAngDeg) const
bool
Vector3d::GetAngleXY( const Vector3d& vtEnd, double& dAngDeg) const
{
// verifico vettori
if ( IsZeroXY() || vtEnd.IsZeroXY()) {
dAngDeg = 0 ;
return false ;
}
// quantità ugualmente proporzionali a coseno e seno
double dProSca = ScalarXY( *this, vtEnd) ;
double dProVett = CrossXY( *this, vtEnd) ;