1 #ifndef Trapezoid2RectangleMappingX_h
2 #define Trapezoid2RectangleMappingX_h
31 x0_(x0), y0_(y0), parallel_(
false)
33 k_ = 2/h * (bovera-1.) / (bovera+1.);
36 std::cout <<
"Trapezoid2RectangleMappingX constructed with x0,y0 " << x0 <<
" " << y0
37 <<
" b/a= " << bovera <<
" h= " << h << std::endl;
43 x0_(x0), y0_(y0), k_(k), parallel_(
true)
46 std::cout <<
"Trapezoid2RectangleMappingX constructed with x0,y0 " << x0 <<
" " << y0
47 <<
" k= " << k << std::endl;
52 double& xrec,
double& yrec)
const {
55 if (!parallel_) xrec = (xtrap - x0_) / (1.+ yrec*k_);
56 else xrec = xtrap - x0_ + k_*yrec;
59 std::cout << xtrap <<
" " << ytrap <<
" transformed to rectangle " << xrec <<
" " << yrec << std::endl;
64 double& xtrap,
double& ytrap)
const {
65 if (!parallel_) xtrap = x0_ + xrec * (1.+ yrec*k_);
66 else xtrap = x0_ + xrec - k_*yrec;
70 std::cout << xrec <<
" " << yrec <<
" transformed to trapezoid " << xtrap <<
" " << ytrap << std::endl;
void trapezoid(double xrec, double yrec, double &xtrap, double &ytrap) const
void rectangle(double xtrap, double ytrap, double &xrec, double &yrec) const
Trapezoid2RectangleMappingX()
Trapezoid2RectangleMappingX(double x0, double y0, double k)
special parallelogram case, a == b. The meaning of k changes.
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Trapezoid2RectangleMappingX(double x0, double y0, double bovera, double h)
normal trapezoid case, a != b