7 #include <boost/regex.hpp>
11 std::string indent(indentwidth,
' ');
12 std::string indent2(indentwidth + 8,
' ');
15 std::cout << indent <<
"ellipse, \n"
16 << indent2 <<
"w: " <<
width_m <<
", \n"
17 << indent2 <<
"h: " <<
height_m <<
", \n"
18 << indent2 <<
"origin: " << origin[0] <<
", " << origin[1] <<
",\n"
19 << indent2 <<
"angle: " << angle <<
"\n"
20 << indent2 << std::setw(14) <<
trafo_m(0, 0) << std::setw(14) <<
trafo_m(0, 1) << std::setw(14) <<
trafo_m(0, 2) <<
"\n"
21 << indent2 << std::setw(14) <<
trafo_m(1, 0) << std::setw(14) <<
trafo_m(1, 1) << std::setw(14) <<
trafo_m(1, 2) <<
"\n"
22 << indent2 << std::setw(14) <<
trafo_m(2, 0) << std::setw(14) <<
trafo_m(2, 1) << std::setw(14) <<
trafo_m(2, 2)
27 const unsigned int N = 101;
29 const unsigned int colwidth = out.precision() + 8;
32 for (
unsigned int i = 0; i < N; ++ i, phi += dp) {
38 pt[1] = pt[0] *
tan(phi);
41 out << std::setw(colwidth) << pt[0]
42 << std::setw(colwidth) << pt[1]
48 item->writeGnuplot(out);
55 bfuncs.emplace_back(this->
clone());
59 std::shared_ptr<Ellipse> elps(
new Ellipse);
66 elps->divisor_m.emplace_back(item->clone());
69 return std::static_pointer_cast<
Base>(elps);
74 const Vector_t e_x(1.0, 0.0, 0.0), e_y(0.0, 1.0, 0.0);
78 const double &M11 = e_xp[0];
79 const double &M12 = e_yp[0];
80 const double &M21 = e_xp[1];
81 const double &M22 = e_yp[1];
84 double halfwidth = 0.5 * (M11 *
width_m *
cos(t) +
86 llc[0] = center[0] -
std::abs(halfwidth);
87 urc[0] = center[0] +
std::abs(halfwidth);
91 double halfheight = 0.5 * (M21 *
width_m *
cos(t) +
94 llc[1] = center[1] -
std::abs(halfheight);
95 urc[1] = center[1] +
std::abs(halfheight);
100 item->computeBoundingBox();
111 if (item->isInside(R))
return false;
123 double width, height;
127 }
catch (std::runtime_error &
e) {
137 std::cout <<
"Ellipse: a negative width provided '"
138 << arguments.
get(0) <<
" = " << elps->
width_m <<
"'"
143 std::cout <<
"Ellipse: a negative height provided '"
144 << arguments.
get(1) <<
" = " << elps->
height_m <<
"'"
Tps< T > sqrt(const Tps< T > &x)
Square root.
AffineTransformation trafo_m
item[EANGLE] Entrance edge angle(radians).\item[ROTATION] Rotation of the magnet about its central axis(radians
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two distribute and or modify the software for each author s protection and we want to make certain that everyone understands that there is no warranty for this free software If the software is modified by someone else and passed we want its recipients to know that what they have is not the so that any problems introduced by others will not reflect on the original authors reputations any free program is threatened constantly by software patents We wish to avoid the danger that redistributors of a free program will individually obtain patent in effect making the program proprietary To prevent we have made it clear that any patent must be licensed for everyone s free use or not licensed at all The precise terms and conditions for distribution and modification follow GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR DISTRIBUTION AND MODIFICATION This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License The refers to any such program or and a work based on the Program means either the Program or any derivative work under copyright a work containing the Program or a portion of it
Tps< T > tan(const Tps< T > &x)
Tangent.
PETE_TBTree< FnCopysign, PETE_Scalar< Vektor< T1, Dim > >, typename T2::PETE_Expr_t > copysign(const Vektor< T1, Dim > &l, const PETE_Expr< T2 > &r)
constexpr double two_pi
The value of .
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
double parseMathExpression(const std::string &str)
bool isInside(const Vector_t &X) const
virtual std::shared_ptr< Base > clone() const
virtual bool isInside(const Vector_t &R) const
Vektor< double, 3 > Vector_t
std::vector< std::shared_ptr< Base > > divisor_m
virtual void print(int indentwidth)
Inform & endl(Inform &inf)
PETE_TBTree< FnArcTan2, PETE_Scalar< Vektor< T1, Dim > >, typename T2::PETE_Expr_t > atan2(const Vektor< T1, Dim > &l, const PETE_Expr< T2 > &r)
Vector_t transformTo(const Vector_t &v) const
static bool parse_detail(iterator &it, const iterator &end, Function *fun)
virtual void apply(std::vector< std::shared_ptr< Base > > &bfuncs)
std::string::iterator iterator
unsigned int getLengthConsumed() const
Vector_t transformFrom(const Vector_t &v) const
Tps< T > cos(const Tps< T > &x)
Cosine.
std::string get(unsigned int i) const
virtual void writeGnuplot(std::ofstream &out) const
Vector_t getOrigin() const
virtual void computeBoundingBox()
constexpr double e
The value of .
Tps< T > pow(const Tps< T > &x, int y)
Integer power.
Tps< T > sin(const Tps< T > &x)
Sine.