6 #include <boost/regex.hpp>
10 std::string indent(indentwidth,
' ');
11 std::string indent2(indentwidth + 8,
' ');
14 std::cout << indent <<
"ellipse, \n"
15 << indent2 <<
"w: " <<
width_m <<
", \n"
16 << indent2 <<
"h: " <<
height_m <<
", \n"
17 << indent2 <<
"origin: " << origin[0] <<
", " << origin[1] <<
",\n"
18 << indent2 <<
"angle: " << angle <<
"\n"
19 << indent2 << std::setw(14) <<
trafo_m(0, 0) << std::setw(14) <<
trafo_m(0, 1) << std::setw(14) <<
trafo_m(0, 2) <<
"\n"
20 << indent2 << std::setw(14) <<
trafo_m(1, 0) << std::setw(14) <<
trafo_m(1, 1) << std::setw(14) <<
trafo_m(1, 2) <<
"\n"
21 << indent2 << std::setw(14) <<
trafo_m(2, 0) << std::setw(14) <<
trafo_m(2, 1) << std::setw(14) <<
trafo_m(2, 2)
26 const unsigned int N = 101;
28 const unsigned int colwidth = out.precision() + 8;
31 for (
unsigned int i = 0; i < N; ++ i, phi += dp) {
37 pt[1] = pt[0] *
tan(phi);
40 out << std::setw(colwidth) << pt[0]
41 << std::setw(colwidth) << pt[1]
47 item->writeGnuplot(out);
54 bfuncs.emplace_back(this->
clone());
58 std::shared_ptr<Ellipse> elps(
new Ellipse);
65 elps->divisor_m.emplace_back(item->clone());
68 return std::static_pointer_cast<Base>(elps);
73 const Vector_t e_x(1.0, 0.0, 0.0), e_y(0.0, 1.0, 0.0);
77 const double &M11 = e_xp[0];
78 const double &M12 = e_yp[0];
79 const double &M21 = e_xp[1];
80 const double &M22 = e_yp[1];
83 double halfwidth = 0.5 * (M11 *
width_m *
cos(t) +
85 llc[0] = center[0] -
std::abs(halfwidth);
86 urc[0] = center[0] +
std::abs(halfwidth);
90 double halfheight = 0.5 * (M21 *
width_m *
cos(t) +
93 llc[1] = center[1] -
std::abs(halfheight);
94 urc[1] = center[1] +
std::abs(halfheight);
99 item->computeBoundingBox();
110 if (item->isInside(
R))
return false;
122 double width, height;
126 }
catch (std::runtime_error &
e) {
136 std::cout <<
"Ellipse: a negative width provided '"
137 << arguments.
get(0) <<
" = " << elps->
width_m <<
"'"
142 std::cout <<
"Ellipse: a negative height provided '"
143 << arguments.
get(1) <<
" = " << elps->
height_m <<
"'"
Tps< T > cos(const Tps< T > &x)
Cosine.
Tps< T > pow(const Tps< T > &x, int y)
Integer power.
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.
PartBunchBase< T, Dim >::ConstIterator end(PartBunchBase< T, Dim > const &bunch)
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
PETE_TBTree< FnArcTan2, PETE_Scalar< Vektor< T1, Dim > >, typename T2::PETE_Expr_t > atan2(const Vektor< T1, Dim > &l, const PETE_Expr< T2 > &r)
PETE_TBTree< FnCopysign, PETE_Scalar< Vektor< T1, Dim > >, typename T2::PETE_Expr_t > copysign(const Vektor< T1, Dim > &l, const PETE_Expr< T2 > &r)
Inform & endl(Inform &inf)
constexpr double two_pi
The value of.
constexpr double e
The value of.
constexpr double rad2deg
The conversion factor from radians to degrees.
double parseMathExpression(const std::string &str)
std::string::iterator iterator
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)
std::vector< std::shared_ptr< Base > > divisor_m
AffineTransformation trafo_m
Vektor< double, 3 > Vector_t