1 #ifndef Trapezoid2RectangleMappingX_h 2 #define Trapezoid2RectangleMappingX_h 29 x0_(x0), y0_(y0), parallel_(
false)
31 k_ = 2/h * (bovera-1.) / (bovera+1.);
34 std::cout <<
"Trapezoid2RectangleMappingX constructed with x0,y0 " << x0 <<
" " << y0
35 <<
" b/a= " << bovera <<
" h= " << h << std::endl;
41 x0_(x0), y0_(y0), k_(k), parallel_(
true)
44 std::cout <<
"Trapezoid2RectangleMappingX constructed with x0,y0 " << x0 <<
" " << y0
45 <<
" k= " << k << std::endl;
50 double& xrec,
double& yrec)
const {
53 if (!parallel_) xrec = (xtrap - x0_) / (1.+ yrec*k_);
54 else xrec = xtrap - x0_ + k_*yrec;
57 std::cout << xtrap <<
" " << ytrap <<
" transformed to rectangle " << xrec <<
" " << yrec << std::endl;
62 double& xtrap,
double& ytrap)
const {
63 if (!parallel_) xtrap = x0_ + xrec * (1.+ yrec*k_);
64 else xtrap = x0_ + xrec - k_*yrec;
68 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.
Trapezoid2RectangleMappingX(double x0, double y0, double bovera, double h)
normal trapezoid case, a != b