EgtGeomKernel 1.5h3 :
- aggiunta IsFlat a tutte le Curve - aggiunta ApproxWithArcs a tutte le Curve - aggiunto oggetto PolyArc (raccolta ordinata di linee e archi con bulge) - aggiunto oggetto PointsPCA per stima componenti principali di un insieme di punti - FromSpheriical e FromPolar di Vector3d sono diventati funzioni e aggiunto FromUprightOrtho - aggiunte Invert e a Vector3d.
This commit is contained in:
+33
-12
@@ -13,7 +13,6 @@
|
||||
|
||||
//--------------------------- Include ----------------------------------------
|
||||
#include "stdafx.h"
|
||||
#include "\EgtDev\Include\EGkGeoConst.h"
|
||||
#include "\EgtDev\Include\EGkVector3d.h"
|
||||
#include "\EgtDev\Include\EGKFrame3d.h"
|
||||
|
||||
@@ -21,27 +20,49 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// Definizione a partire da coordinate sferiche
|
||||
//----------------------------------------------------------------------------
|
||||
void
|
||||
Vector3d::FromSpherical( double dLen, double dAngVertDeg, double dAngOrizzDeg)
|
||||
Vector3d
|
||||
FromSpherical( double dLen, double dAngVertDeg, double dAngOrizzDeg)
|
||||
{
|
||||
double dAngVertRad = dAngVertDeg * DEGTORAD ;
|
||||
double dAngOrizzRad = dAngOrizzDeg * DEGTORAD ;
|
||||
double dSinAngVert = sin( dAngVertRad) ;
|
||||
x = dLen * dSinAngVert * cos( dAngOrizzRad) ;
|
||||
y = dLen * dSinAngVert * sin( dAngOrizzRad) ;
|
||||
z = dLen * cos( dAngVertRad) ;
|
||||
Vector3d vtV( dLen * dSinAngVert * cos( dAngOrizzRad),
|
||||
dLen * dSinAngVert * sin( dAngOrizzRad),
|
||||
dLen * cos( dAngVertRad)) ;
|
||||
return vtV ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Definizione a partire da coordinate polari
|
||||
// Definizione a partire da coordinate polari ( nel piano XY, Z = 0)
|
||||
//----------------------------------------------------------------------------
|
||||
void
|
||||
Vector3d::FromPolar( double dLen, double dAngDeg)
|
||||
Vector3d
|
||||
FromPolar( double dLen, double dAngDeg)
|
||||
{
|
||||
double dAngRad = dAngDeg * DEGTORAD ;
|
||||
x = dLen * cos( dAngRad) ;
|
||||
y = dLen * sin( dAngRad) ;
|
||||
z = 0 ;
|
||||
Vector3d vtV( dLen * cos( dAngRad),
|
||||
dLen * sin( dAngRad),
|
||||
0) ;
|
||||
return vtV ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Definizione dal più verticale dei vettori ortogonali a quello ricevuto
|
||||
//----------------------------------------------------------------------------
|
||||
Vector3d
|
||||
FromUprightOrtho( const Vector3d& vtV)
|
||||
{
|
||||
// se vettore nullo, imposto asse Z+
|
||||
if ( vtV.IsZero())
|
||||
return Z_AX ;
|
||||
// se vettore coincidente con asse Z, imposto asse X+
|
||||
if ( vtV.IsZplus() || vtV.IsZminus())
|
||||
return X_AX ;
|
||||
// caso generico
|
||||
Vector3d vtAx = vtV ;
|
||||
vtAx.z = 0 ;
|
||||
vtAx.Normalize( EPS_ZERO) ;
|
||||
vtAx.Rotate( Z_AX, 0, 1) ;
|
||||
return ( vtV ^ vtAx) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user