Jpp 20.0.0-rc.9-29-gccc23c492-D
the software that should make you happy
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
JFIT::JEstimator< JPoint3D > Class Reference

Linear fit of crossing point (position) between axes (objects with position and direction). More...

#include <JPoint3DEstimator.hh>

Inheritance diagram for JFIT::JEstimator< JPoint3D >:
JFIT::JPoint3D

Public Types

typedef double JPoint3D::* parameter_type
 

Public Member Functions

template<class T >
 JEstimator (T __begin, T __end)
 Constructor.
 

Static Public Member Functions

static parameter_type pX ()
 
static parameter_type pY ()
 
static parameter_type pZ ()
 

Public Attributes

JMATH::JMatrix3S V
 co-variance matrix of fit parameters
 

Static Public Attributes

static const int NUMBER_OF_PARAMETERS = 3
 number of parameters of fit
 

Detailed Description

Linear fit of crossing point (position) between axes (objects with position and direction).

\begin{center}\setlength{\unitlength}{0.6cm}\begin{picture}(12,12)

\put( 5.0, 5.0){\circle*{0.3}}
\put( 4.0, 5.0){\makebox(0,0)[r]{$(x_{0},y_{0},z_{0})$}}

\multiput( 5.0, 5.0)(+0.2, 0.0){18}{\makebox(0,0)[c]{.}}
\put( 9.0, 5.0){\circle*{0.2}}
\put( 9.0, 5.0){\vector(+1, 0){0.7}}
\put(10.0, 5.0){\makebox(0,0)[l]{$(\bar{x}_j,\hat{u}_j)$}}

\multiput( 5.0, 5.0)(-0.2,+0.2){18}{\makebox(0,0)[c]{.}}
\put( 1.0, 9.0){\circle*{0.2}}
\put( 1.0, 9.0){\vector(-1,+1){0.6}}
\put( 0.0,10.0){\makebox(0,0)[r]{$(\bar{x}_k,\hat{u}_k)$}}

\multiput( 5.0, 5.0)(-0.2,-0.2){18}{\makebox(0,0)[c]{.}}
\put( 1.0, 1.0){\circle*{0.2}}
\put( 1.0, 1.0){\vector(-1,-1){0.6}}
\put( 0.0, 0.0){\makebox(0,0)[r]{$(\bar{x}_i,\hat{u}_i)$}}

\end{picture}
\end{center}

where:

\begin{eqnarray*}
\bar{x}_i & = & i^{th} \textrm{ position}        \\
\hat{u}_i & = & i^{th} \textrm{ direction}       \\
\end{eqnarray*}

The parameters $\{x_0, y_0, z_0\}$ are estimated in the constructor of this class.

Definition at line 55 of file JPoint3DEstimator.hh.

Member Typedef Documentation

◆ parameter_type

typedef double JPoint3D::* JFIT::JPoint3D::parameter_type
inherited

Definition at line 34 of file JPoint3D.hh.

Constructor & Destructor Documentation

◆ JEstimator()

template<class T >
JFIT::JEstimator< JPoint3D >::JEstimator ( T __begin,
T __end )
inline

Constructor.

The template argument T refers to an iterator of a data structure which should have the following member methods:

  • double getX(); // [m]
  • double getY(); // [m]
  • double getZ(); // [m]
  • double getDX(); // [u]
  • double getDY(); // [u]
  • double getDZ(); // [u]
Parameters
__beginbegin of data
__endend of data

Definition at line 74 of file JPoint3DEstimator.hh.

75 {
76 using namespace std;
77
78 const int N = distance(__begin, __end);
79
80 if (N > 1) {
81
82 double x = 0;
83 double y = 0;
84 double z = 0;
85
86 V.reset();
87
88 for (T i = __begin; i != __end; ++i) {
89
90 const double xx = 1.0 - i->getDX() * i->getDX();
91 const double yy = 1.0 - i->getDY() * i->getDY();
92 const double zz = 1.0 - i->getDZ() * i->getDZ();
93
94 const double xy = -i->getDX() * i->getDY();
95 const double xz = -i->getDX() * i->getDZ();
96 const double yz = -i->getDY() * i->getDZ();
97
98 V.a00 += xx;
99 V.a01 += xy;
100 V.a02 += xz;
101
102 V.a11 += yy;
103 V.a12 += yz;
104
105 V.a22 += zz;
106
107 x += xx * i->getX() + xy * i->getY() + xz * i->getZ();
108 y += xy * i->getX() + yy * i->getY() + yz * i->getZ();
109 z += xz * i->getX() + yz * i->getY() + zz * i->getZ();
110 }
111
112 V.a10 = V.a01;
113 V.a20 = V.a02;
114 V.a21 = V.a12;
115
116 V.invert();
117
118 __x = V.a00 * x + V.a01 * y + V.a02 * z;
119 __y = V.a10 * x + V.a11 * y + V.a12 * z;
120 __z = V.a20 * x + V.a21 * y + V.a22 * z;
121
122 } else {
123 throw JValueOutOfRange("JEstimator<JPoint3D>::JEstimator(): Not enough data points.");
124 }
125 }
JMATH::JMatrix3S V
co-variance matrix of fit parameters

Member Function Documentation

◆ pX()

static parameter_type JFIT::JPoint3D::pX ( )
inlinestaticinherited

Definition at line 36 of file JPoint3D.hh.

36{ return &JPoint3D::__x; }

◆ pY()

static parameter_type JFIT::JPoint3D::pY ( )
inlinestaticinherited

Definition at line 37 of file JPoint3D.hh.

37{ return &JPoint3D::__y; }

◆ pZ()

static parameter_type JFIT::JPoint3D::pZ ( )
inlinestaticinherited

Definition at line 38 of file JPoint3D.hh.

38{ return &JPoint3D::__z; }

Member Data Documentation

◆ NUMBER_OF_PARAMETERS

const int JFIT::JEstimator< JPoint3D >::NUMBER_OF_PARAMETERS = 3
static

number of parameters of fit

Definition at line 128 of file JPoint3DEstimator.hh.

◆ V

JMATH::JMatrix3S JFIT::JEstimator< JPoint3D >::V

co-variance matrix of fit parameters

Definition at line 129 of file JPoint3DEstimator.hh.


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