QXRD
0.11.16
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
qxrd
source
qxrdplanefitter.cpp
Go to the documentation of this file.
1
#include "
qxrdplanefitter.h
"
2
3
QxrdPlaneFitter::QxrdPlaneFitter
() :
4
s(0),
5
sx(0),
6
sy(0),
7
sxx(0),
8
syy(0),
9
sxy(0),
10
sz(0),
11
sxz(0),
12
syz(0)
13
{
14
}
15
16
void
QxrdPlaneFitter::addPoint
(
double
x,
double
y,
double
z)
17
{
18
s
+= 1;
19
sx
+= x;
20
sy
+= y;
21
sxx
+= x*x;
22
syy
+= y*y;
23
sxy
+= x*y;
24
sz
+= z;
25
sxz
+= x*z;
26
syz
+= y*z;
27
}
28
29
double
QxrdPlaneFitter::value
(
double
x,
double
y)
30
{
31
double
a = -(
sx
*(
sy
*
syz
-
syy
*
sz
)+
sxy
*(
sy
*
sz
-
s
*
syz
)+
sxz
*(
s
*
syy
-
sy
*
sy
))/(
sxx
*(
sy
*
sy
-
s
*
syy
)+
sx
*
sx
*
syy
-2*
sx
*
sxy
*
sy
+
s
*
sxy
*
sxy
);
32
double
b = (
sxx
*(
sy
*
sz
-
s
*
syz
)-
sx
*sxy*
sz
+
sx
*
sx
*syz+
sxz
*(
s
*sxy-
sx
*
sy
))/(
sxx
*(sy*sy-
s
*
syy
)+
sx
*
sx
*syy-2*
sx
*sxy*sy+
s
*sxy*
sxy
);
33
double
c = -(
sxx
*(syy*
sz
-sy*
syz
)-sxy*sxy*
sz
+
sx
*sxy*syz+
sxz
*(sxy*sy-
sx
*syy))/(
sxx
*(sy*sy-
s
*syy)+
sx
*
sx
*syy-2*
sx
*sxy*sy+
s
*sxy*
sxy
);
34
35
return
a*x + b*y + c;
36
}
QxrdPlaneFitter::s
double s
Definition:
qxrdplanefitter.h:13
QxrdPlaneFitter::syz
double syz
Definition:
qxrdplanefitter.h:21
QxrdPlaneFitter::sz
double sz
Definition:
qxrdplanefitter.h:19
QxrdPlaneFitter::sxy
double sxy
Definition:
qxrdplanefitter.h:18
QxrdPlaneFitter::addPoint
void addPoint(double x, double y, double z)
Definition:
qxrdplanefitter.cpp:16
QxrdPlaneFitter::sx
double sx
Definition:
qxrdplanefitter.h:14
QxrdPlaneFitter::sxz
double sxz
Definition:
qxrdplanefitter.h:20
QxrdPlaneFitter::sy
double sy
Definition:
qxrdplanefitter.h:15
QxrdPlaneFitter::QxrdPlaneFitter
QxrdPlaneFitter()
Definition:
qxrdplanefitter.cpp:3
qxrdplanefitter.h
QxrdPlaneFitter::syy
double syy
Definition:
qxrdplanefitter.h:17
QxrdPlaneFitter::sxx
double sxx
Definition:
qxrdplanefitter.h:16
QxrdPlaneFitter::value
double value(double x, double y)
Definition:
qxrdplanefitter.cpp:29
Generated by
1.8.10