24 if (fabs(det) < 1.e-2) {
25 LOG(error) <<
"CaUvConverter: U & V coordinates are too close: " << phiU <<
" " << phiV;
26 phiV = phiU + 10. / 180. * M_PI;
42 double cosU =
cos(phiU);
43 double sinU =
sin(phiU);
44 double du2 = cosU * cosU * dx2 + 2 * sinU * cosU * dxy + sinU * sinU * dy2;
51 double duw = sinU * cosU * (dy2 - dx2) + (cosU * cosU - sinU * sinU) * dxy;
55 double phiV = phiU + atan2(du2, -duw);
62 if (fabs(duv) > 1.e-8) {
63 LOG(error) <<
"can not define V coordinate from XY covariance matrix";
friend fvec cos(const fvec &a)
friend fvec sin(const fvec &a)
void SetFromXYCovMatrix(double phiU, double dx2, double dxy, double dy2)
construct from U angle and XY covariance matrix
double fcosU
U coordinate in XY.
double fcosY
Y coordinate in UV.
std::tuple< double, double, double > ConvertCovMatrixXYtoUV(double dx2, double dxy, double dy2) const
Conversion function (dx2, dxy, dy2) -> (du2, duv, dv2)
double fcosV
V coordinate in XY.
double fcosX
X coordinate in UV.
void SetFromUV(double phiU, double phiV)
construct from U,V angles