21 FootprintSquare::FootprintSquare(
const std::vector<double> P)
26 FootprintSquare::FootprintSquare(
double width_ratio)
38 if (alpha < 0.0 || alpha > M_PI_2)
40 if (widthRatio() == 0.0)
42 const double arg = std::sin(alpha) / widthRatio();
43 return std::min(arg, 1.0);
48 std::stringstream result;
49 result <<
"\n" <<
pyfmt::indent() <<
"# Defining footprint:\n";
51 result <<
"ba.FootprintSquare";
52 result <<
"(" << pyfmt::printDouble(widthRatio()) <<
")";
56 static_assert(!std::is_copy_constructible<FootprintSquare>::value,
57 "FootprintSquare should not be copy constructable");
58 static_assert(!std::is_copy_assignable<FootprintSquare>::value,
59 "FootprintSquare should not be copy assignable");
Defines M_PI and some more mathematical constants.
Defines functions in namespace pyfmt.
std::string indent(size_t width)
Returns a string of blanks with given width.