Skip to content
Snippets Groups Projects
Commit 27dbe088 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

simplify alpha test in Pyramid2

parent fc45f778
No related branches found
No related tags found
1 merge request!1153Adapt to libformfactor!32
......@@ -45,12 +45,11 @@ std::string Pyramid2::validate() const
requestGt0(errs, m_length, "length");
requestGt0(errs, m_width, "width");
requestGt0(errs, m_height, "height");
const double cot_alpha = Math::cot(m_alpha);
if (m_alpha <= 0 || !std::isfinite(cot_alpha) || cot_alpha < 0)
errs.push_back("pyramid angle alpha " + std::to_string(m_alpha) + " out of bounds");
requestIn(errs, m_alpha, "alpha", 0, M_PI_2);
if (!errs.empty())
return jointError(errs);
const double cot_alpha = Math::cot(m_alpha);
double r = cot_alpha * 2 * m_height / m_length;
double s = cot_alpha * 2 * m_height / m_width;
if (r > 1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment