NeoPZ
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
TPZProjectEllipse Class Reference

#include <TPZProjectEllipse.h>

Collaboration diagram for TPZProjectEllipse:
[legend]

Public Types

enum  EType { EVerySimple2D, ESimple2D, E3D, E2D }
 

Public Member Functions

 TPZProjectEllipse (EType project, TPZFMatrix< REAL > &Points)
 
 TPZProjectEllipse (std::multimap< REAL, REAL > &Points)
 
void Getcoefficients (TPZVec< REAL > &coef)
 
void PrintingAsSimpleEquation (TPZVec< REAL > &Center, TPZVec< REAL > &Ratios, std::ostream &out)
 
bool StandardFormatForSimpleEllipse (TPZVec< REAL > &Center, TPZVec< REAL > &Ratios)
 

Private Member Functions

bool LeastSquaresToGetVerySimpleEllipse ()
 
bool AdjustingWithSimpleEllipse ()
 
bool AdjustingWithVerySimpleEllipse ()
 
bool AdjustingWithEllipse ()
 
bool DiagonalizingQuadraticForm (int dim, TPZFMatrix< REAL > &Coeffs, TPZFMatrix< REAL > &NewCoeffs)
 
void AlmostZeroToZero (TPZFMatrix< REAL > &mat)
 
void AlmostZeroToZero (TPZVec< REAL > &mat)
 
bool LeastSquaresToGetSimpleEllipse ()
 
bool LeastSquaresToGetEllipse ()
 
void PrintAxes (TPZFMatrix< REAL > &P, std::ostream &out)
 

Private Attributes

TPZFMatrix< REAL > fPoints
 Points which determine the projection. More...
 
int fType
 Projection type. More...
 
TPZManVector< REAL, 6 > fcoefficients
 coefficients determined by the least squares problem More...
 
REAL fTol
 Tolerance to project the coefficients to zero value. More...
 

Detailed Description

Definition at line 17 of file TPZProjectEllipse.h.

Member Enumeration Documentation

◆ EType

Enumerator
EVerySimple2D 
ESimple2D 
E3D 
E2D 

Definition at line 31 of file TPZProjectEllipse.h.

Constructor & Destructor Documentation

◆ TPZProjectEllipse() [1/2]

TPZProjectEllipse::TPZProjectEllipse ( EType  project,
TPZFMatrix< REAL > &  Points 
)
inline

◆ TPZProjectEllipse() [2/2]

TPZProjectEllipse::TPZProjectEllipse ( std::multimap< REAL, REAL > &  Points)
inline

Member Function Documentation

◆ AdjustingWithEllipse()

bool TPZProjectEllipse::AdjustingWithEllipse ( )
private

Process to get the ellipse by least square method from a set of points. First: Find coefficients of the quadratic form (with mixed terms) from a set of points using least square method. Second: Apply diagonalization to transform quadratic form with mixed terms to quadratic form with only quadratic terms of the variables. Third: From new coefficients get the center and axes of the ellipse adjusted Fourth: Print the result and standard form into saida.

Definition at line 402 of file TPZProjectEllipse.cpp.

References TPZMatrix< TVar >::Cols(), DebugStop, fcoefficients, fPoints, IsZero(), LeastSquaresToGetEllipse(), PrintingAsSimpleEquation(), StandardFormatForSimpleEllipse(), and ZeroTolerance().

Referenced by Getcoefficients().

◆ AdjustingWithSimpleEllipse()

bool TPZProjectEllipse::AdjustingWithSimpleEllipse ( )
private

Process to get the ellipse by least square method from a set of points. First: Find coefficients of the simple quadratic form from a set of points using least square method. Second: From coefficients get the center and axes of the ellipse adjusted Third: Print the result and standard form into saida.

Definition at line 351 of file TPZProjectEllipse.cpp.

References TPZMatrix< TVar >::Cols(), fPoints, LeastSquaresToGetSimpleEllipse(), PrintingAsSimpleEquation(), StandardFormatForSimpleEllipse(), and ZeroTolerance().

Referenced by Getcoefficients().

◆ AdjustingWithVerySimpleEllipse()

bool TPZProjectEllipse::AdjustingWithVerySimpleEllipse ( )
private

◆ AlmostZeroToZero() [1/2]

void TPZProjectEllipse::AlmostZeroToZero ( TPZFMatrix< REAL > &  mat)
private

◆ AlmostZeroToZero() [2/2]

void TPZProjectEllipse::AlmostZeroToZero ( TPZVec< REAL > &  mat)
private

Definition at line 242 of file TPZProjectEllipse.cpp.

References fabs, fTol, and TPZVec< T >::NElements().

◆ DiagonalizingQuadraticForm()

bool TPZProjectEllipse::DiagonalizingQuadraticForm ( int  dim,
TPZFMatrix< REAL > &  Coeffs,
TPZFMatrix< REAL > &  NewCoeffs 
)
private

Referenced by Getcoefficients().

◆ Getcoefficients()

void TPZProjectEllipse::Getcoefficients ( TPZVec< REAL > &  coef)
inline

◆ LeastSquaresToGetEllipse()

bool TPZProjectEllipse::LeastSquaresToGetEllipse ( )
private

Find coefficients of the quadratic equation (Quadratic form) with best adjust to points given y^2 = a x^2 + b x + c xy + d y + e z^2 = a x^2 + b x + c y^2 + d y + e xy + f z + g yz + h xz + i using the least square method.

Definition at line 90 of file TPZProjectEllipse.cpp.

References TPZMatrix< TVar >::Cols(), ELU, fcoefficients, TPZVec< T >::Fill(), fPoints, TPZFMatrix< TVar >::PutVal(), TPZFMatrix< TVar >::Redim(), TPZManVector< T, NumExtAlloc >::Resize(), TPZMatrix< TVar >::Rows(), TPZMatrix< TVar >::SolveDirect(), TPZFMatrix< TVar >::Transpose(), and TPZFMatrix< TVar >::Zero().

Referenced by AdjustingWithEllipse(), and Getcoefficients().

◆ LeastSquaresToGetSimpleEllipse()

bool TPZProjectEllipse::LeastSquaresToGetSimpleEllipse ( )
private

Find coefficients of the quadratic equation with best adjust to points given y^2 = a x^2 + b x + c y + d z^2 = a x^2 + b x + c y^2 + d y + e z + f using the least square method.

Definition at line 16 of file TPZProjectEllipse.cpp.

References TPZMatrix< TVar >::Cols(), ELU, fcoefficients, TPZVec< T >::Fill(), fPoints, TPZFMatrix< TVar >::PutVal(), TPZFMatrix< TVar >::Redim(), TPZManVector< T, NumExtAlloc >::Resize(), TPZMatrix< TVar >::Rows(), TPZMatrix< TVar >::SolveDirect(), TPZFMatrix< TVar >::Transpose(), and TPZFMatrix< TVar >::Zero().

Referenced by AdjustingWithSimpleEllipse(), Getcoefficients(), and TPZProjectEllipse().

◆ LeastSquaresToGetVerySimpleEllipse()

bool TPZProjectEllipse::LeastSquaresToGetVerySimpleEllipse ( )
private

◆ PrintAxes()

void TPZProjectEllipse::PrintAxes ( TPZFMatrix< REAL > &  P,
std::ostream &  out 
)
private

Print the unitary vectors for rotated axes to ellipse

Definition at line 251 of file TPZProjectEllipse.cpp.

References AlmostZeroToZero(), TPZMatrix< TVar >::Cols(), TPZFMatrix< TVar >::GetVal(), and TPZMatrix< TVar >::Rows().

Referenced by Getcoefficients().

◆ PrintingAsSimpleEquation()

void TPZProjectEllipse::PrintingAsSimpleEquation ( TPZVec< REAL > &  Center,
TPZVec< REAL > &  Ratios,
std::ostream &  out 
)

◆ StandardFormatForSimpleEllipse()

bool TPZProjectEllipse::StandardFormatForSimpleEllipse ( TPZVec< REAL > &  Center,
TPZVec< REAL > &  Ratios 
)

From quadratic equation (Quadratic form) y^2 = a x^2 + b x + c xy + d y + e z^2 = a x^2 + b x + c y^2 + d y + e xy + f z + g yz + h xz + i compute the coordinates of the center and axes of the ellipse. Print in the standard equation.

Definition at line 274 of file TPZProjectEllipse.cpp.

References fcoefficients, IsZero(), TPZVec< T >::size(), and sqrt.

Referenced by AdjustingWithEllipse(), AdjustingWithSimpleEllipse(), AdjustingWithVerySimpleEllipse(), and Getcoefficients().

Member Data Documentation

◆ fcoefficients

TPZManVector<REAL,6> TPZProjectEllipse::fcoefficients
private

◆ fPoints

TPZFMatrix<REAL> TPZProjectEllipse::fPoints
private

◆ fTol

REAL TPZProjectEllipse::fTol
private

Tolerance to project the coefficients to zero value.

Definition at line 27 of file TPZProjectEllipse.h.

Referenced by AlmostZeroToZero().

◆ fType

int TPZProjectEllipse::fType
private

Projection type.

Definition at line 22 of file TPZProjectEllipse.h.


The documentation for this class was generated from the following files: