EgtGeomKernel :
- piccola miglioria estetica.
This commit is contained in:
+10
-26
@@ -397,13 +397,9 @@ Vector3d::LocToLoc( const Frame3d& frOri, const Frame3d& frDest)
|
||||
bool
|
||||
Vector3d::GetAngle( const Vector3d& vtEnd, double& dAngDeg) const
|
||||
{
|
||||
double dProSca ;
|
||||
double dProVett ;
|
||||
|
||||
|
||||
// quantità ugualmente proporzionali a coseno e seno
|
||||
dProSca = *this * vtEnd ;
|
||||
dProVett = ( *this ^ vtEnd).Len() ;
|
||||
double dProSca = *this * vtEnd ;
|
||||
double dProVett = ( *this ^ vtEnd).Len() ;
|
||||
|
||||
// se entrambe nulle
|
||||
if ( fabs( dProSca) < EPS_ZERO && fabs( dProVett) < EPS_ZERO) {
|
||||
@@ -422,13 +418,9 @@ Vector3d::GetAngle( const Vector3d& vtEnd, double& dAngDeg) const
|
||||
bool
|
||||
Vector3d::GetAngleXY( const Vector3d& vtEnd, double& dAngDeg) const
|
||||
{
|
||||
double dProSca ;
|
||||
double dProVett ;
|
||||
|
||||
|
||||
// quantità ugualmente proporzionali a coseno e seno
|
||||
dProSca = ScalarXY( *this, vtEnd) ;
|
||||
dProVett = CrossXY( *this, vtEnd) ;
|
||||
double dProSca = ScalarXY( *this, vtEnd) ;
|
||||
double dProVett = CrossXY( *this, vtEnd) ;
|
||||
|
||||
// se entrambe nulle
|
||||
if ( fabs( dProSca) < EPS_ZERO && fabs( dProVett) < EPS_ZERO) {
|
||||
@@ -448,29 +440,21 @@ Vector3d::GetAngleXY( const Vector3d& vtEnd, double& dAngDeg) const
|
||||
bool
|
||||
Vector3d::GetRotation( const Vector3d& vtEnd, const Vector3d& vtAx, double& dAngDeg, bool& bDet) const
|
||||
{
|
||||
double dKcosA ;
|
||||
double dKsinA ;
|
||||
Vector3d vtDirAx ;
|
||||
Vector3d vtPerp ;
|
||||
Vector3d vtPerpE ;
|
||||
Vector3d vtPerp2 ;
|
||||
|
||||
|
||||
// ricavo versore asse di rotazione
|
||||
vtDirAx = vtAx ;
|
||||
Vector3d vtDirAx = vtAx ;
|
||||
if ( ! vtDirAx.Normalize())
|
||||
return false ;
|
||||
|
||||
// ricavo le componenti perpendicolari all'asse di rotazione
|
||||
vtPerp = *this - vtDirAx * ( *this * vtDirAx) ;
|
||||
vtPerpE = vtEnd - vtDirAx * ( vtEnd * vtDirAx) ;
|
||||
Vector3d vtPerp = *this - vtDirAx * ( *this * vtDirAx) ;
|
||||
Vector3d vtPerpE = vtEnd - vtDirAx * ( vtEnd * vtDirAx) ;
|
||||
// se sono entrambe non nulle : angolo determinato
|
||||
if ( ! vtPerp.IsZero() && ! vtPerpE.IsZero()) {
|
||||
// secondo vettore perpendicolare ad asse e a componente perpendicolare
|
||||
vtPerp2 = vtDirAx ^ vtPerp ;
|
||||
Vector3d vtPerp2 = vtDirAx ^ vtPerp ;
|
||||
// proporzionali a seno e coseno del perpendicolare E
|
||||
dKcosA = vtPerpE * vtPerp ;
|
||||
dKsinA = vtPerpE * vtPerp2 ;
|
||||
double dKcosA = vtPerpE * vtPerp ;
|
||||
double dKsinA = vtPerpE * vtPerp2 ;
|
||||
// angolo di rotazione
|
||||
dAngDeg = atan2( dKsinA, dKcosA) * RADTODEG ;
|
||||
bDet = true ;
|
||||
|
||||
Reference in New Issue
Block a user