![]() |
NeoPZ
|
#include <TPZProjectEllipse.h>
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... | |
Definition at line 17 of file TPZProjectEllipse.h.
| Enumerator | |
|---|---|
| EVerySimple2D | |
| ESimple2D | |
| E3D | |
| E2D | |
Definition at line 31 of file TPZProjectEllipse.h.
|
inline |
Definition at line 33 of file TPZProjectEllipse.h.
References DebugStop, ESimple2D, EVerySimple2D, LeastSquaresToGetSimpleEllipse(), LeastSquaresToGetVerySimpleEllipse(), and TPZVec< T >::resize().
|
inline |
Definition at line 55 of file TPZProjectEllipse.h.
References EVerySimple2D, fPoints, LeastSquaresToGetVerySimpleEllipse(), TPZVec< T >::resize(), and TPZFMatrix< TVar >::Resize().
|
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().
|
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().
|
private |
Definition at line 374 of file TPZProjectEllipse.cpp.
References LeastSquaresToGetVerySimpleEllipse(), PrintingAsSimpleEquation(), StandardFormatForSimpleEllipse(), and ZeroTolerance().
Referenced by Getcoefficients().
|
private |
Definition at line 233 of file TPZProjectEllipse.cpp.
References TPZMatrix< TVar >::Cols(), fabs, fTol, TPZFMatrix< TVar >::GetVal(), TPZFMatrix< TVar >::PutVal(), and TPZMatrix< TVar >::Rows().
Referenced by Getcoefficients(), and PrintAxes().
|
private |
Definition at line 242 of file TPZProjectEllipse.cpp.
References fabs, fTol, and TPZVec< T >::NElements().
|
private |
Referenced by Getcoefficients().
|
inline |
Definition at line 70 of file TPZProjectEllipse.h.
References AdjustingWithEllipse(), AdjustingWithSimpleEllipse(), AdjustingWithVerySimpleEllipse(), AlmostZeroToZero(), DiagonalizingQuadraticForm(), fcoefficients, LeastSquaresToGetEllipse(), LeastSquaresToGetSimpleEllipse(), LeastSquaresToGetVerySimpleEllipse(), PrintAxes(), PrintingAsSimpleEquation(), and StandardFormatForSimpleEllipse().
|
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().
|
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().
|
private |
Definition at line 178 of file TPZProjectEllipse.cpp.
References ELU, fcoefficients, fPoints, TPZFMatrix< TVar >::PutVal(), TPZFMatrix< TVar >::Redim(), TPZMatrix< TVar >::Rows(), TPZMatrix< TVar >::SolveDirect(), TPZFMatrix< TVar >::Transpose(), and TPZFMatrix< TVar >::Zero().
Referenced by AdjustingWithVerySimpleEllipse(), Getcoefficients(), and TPZProjectEllipse().
|
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().
| void TPZProjectEllipse::PrintingAsSimpleEquation | ( | TPZVec< REAL > & | Center, |
| TPZVec< REAL > & | Ratios, | ||
| std::ostream & | out | ||
| ) |
Definition at line 325 of file TPZProjectEllipse.cpp.
References fcoefficients, and TPZVec< T >::size().
Referenced by AdjustingWithEllipse(), AdjustingWithSimpleEllipse(), AdjustingWithVerySimpleEllipse(), and Getcoefficients().
| 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().
|
private |
coefficients determined by the least squares problem
Definition at line 24 of file TPZProjectEllipse.h.
Referenced by AdjustingWithEllipse(), Getcoefficients(), LeastSquaresToGetEllipse(), LeastSquaresToGetSimpleEllipse(), LeastSquaresToGetVerySimpleEllipse(), PrintingAsSimpleEquation(), and StandardFormatForSimpleEllipse().
|
private |
Points which determine the projection.
Definition at line 20 of file TPZProjectEllipse.h.
Referenced by AdjustingWithEllipse(), AdjustingWithSimpleEllipse(), LeastSquaresToGetEllipse(), LeastSquaresToGetSimpleEllipse(), LeastSquaresToGetVerySimpleEllipse(), and TPZProjectEllipse().
|
private |
Tolerance to project the coefficients to zero value.
Definition at line 27 of file TPZProjectEllipse.h.
Referenced by AlmostZeroToZero().
|
private |
Projection type.
Definition at line 22 of file TPZProjectEllipse.h.
1.8.13