17 std::string indent(indentwidth,
' ');
18 std::string indent2(indentwidth + 8,
' ');
21 std::cout << indent <<
"ellipse, \n"
22 << indent2 <<
"w: " <<
width_m <<
", \n"
23 << indent2 <<
"h: " <<
height_m <<
", \n"
24 << indent2 <<
"origin: " << origin[0] <<
", " << origin[1] <<
",\n"
25 << indent2 <<
"angle: " << angle <<
"\n"
26 << indent2 << std::setw(14) <<
trafo_m(0, 0) << std::setw(14) <<
trafo_m(0, 1) << std::setw(14) <<
trafo_m(0, 2) <<
"\n"
27 << indent2 << std::setw(14) <<
trafo_m(1, 0) << std::setw(14) <<
trafo_m(1, 1) << std::setw(14) <<
trafo_m(1, 2) <<
"\n"
28 << indent2 << std::setw(14) <<
trafo_m(2, 0) << std::setw(14) <<
trafo_m(2, 1) << std::setw(14) <<
trafo_m(2, 2)
33 const unsigned int N = 101;
35 const unsigned int colwidth = out.precision() + 8;
38 for (
unsigned int i = 0; i < N; ++ i, phi += dp) {
44 pt[1] = pt[0] *
tan(phi);
47 out << std::setw(colwidth) << pt[0]
48 << std::setw(colwidth) << pt[1]
54 item->writeGnuplot(out);
61 bfuncs.emplace_back(this->
clone());
65 std::shared_ptr<Ellipse> elps(
new Ellipse);
72 elps->divisor_m.emplace_back(item->clone());
75 return std::static_pointer_cast<Base>(elps);
80 const Vector_t e_x({1.0, 0.0, 0.0}), e_y({0.0, 1.0, 0.0});
84 const double &M11 = e_xp[0];
85 const double &M12 = e_yp[0];
86 const double &M21 = e_xp[1];
87 const double &M22 = e_yp[1];
90 double halfwidth = 0.5 * (M11 *
width_m *
cos(t) +
92 llc[0] = center[0] - std::abs(halfwidth);
93 urc[0] = center[0] + std::abs(halfwidth);
97 double halfheight = 0.5 * (M21 *
width_m *
cos(t) +
100 llc[1] = center[1] - std::abs(halfheight);
101 urc[1] = center[1] + std::abs(halfheight);
106 item->computeBoundingBox();
117 if (item->isInside(R))
return false;
129 double width, height;
133 }
catch (std::runtime_error &e) {
134 std::cout << e.what() << std::endl;
143 std::cout <<
"Ellipse: a negative width provided '"
144 << arguments.
get(0) <<
" = " << elps->
width_m <<
"'"
149 std::cout <<
"Ellipse: a negative height provided '"
150 << arguments.
get(1) <<
" = " << elps->
height_m <<
"'"
PartBunchBase< T, Dim >::ConstIterator end(PartBunchBase< T, Dim > const &bunch)
Tps< T > cos(const Tps< T > &x)
Cosine.
Tps< T > tan(const Tps< T > &x)
Tangent.
Tps< T > sin(const Tps< T > &x)
Sine.
Tps< T > sqrt(const Tps< T > &x)
Square root.
PETE_TBTree< FnArcTan2, PETE_Scalar< Vektor< T1, Dim > >, typename T2::PETE_Expr_t > atan2(const Vektor< T1, Dim > &l, const PETE_Expr< T2 > &r)
constexpr double two_pi
The value of.
double parseMathExpression(const std::string &str)
std::string::iterator iterator
std::vector< std::shared_ptr< Base > > divisor_m
AffineTransformation trafo_m
Vector_t getOrigin() const
Vector_t transformTo(const Vector_t &v) const
Vector_t transformFrom(const Vector_t &v) const
std::string get(unsigned int i) const
unsigned int getLengthConsumed() const
bool isInside(const Vector_t &X) const
virtual void computeBoundingBox()
virtual void print(int indentwidth)
virtual bool isInside(const Vector_t &R) const
virtual std::shared_ptr< Base > clone() const
virtual void writeGnuplot(std::ofstream &out) const
virtual void apply(std::vector< std::shared_ptr< Base > > &bfuncs)
static bool parse_detail(iterator &it, const iterator &end, Function *fun)
Vektor< double, 3 > Vector_t