|
| constexpr | quadratic_equation (const scalar_t &a, const scalar_t &b, const scalar_t &c, const scalar_t &tolerance=1e-6f) |
| | Solve the equation a*x^2 + b*x + c = 0 for SIMD coefficients.
|
| constexpr | quadratic_equation (const scalar_t a, const scalar_t b, const scalar_t c, const scalar_t tolerance=std::numeric_limits< scalar_t >::epsilon()) |
| | Solve the equation a*x^2 + b*x + c = 0 for arithmetic coefficients.
|
| constexpr int | solutions () const |
| | Getters for the solution(s).
|
| constexpr scalar_t | smaller () const |
| constexpr scalar_t | larger () const |
| constexpr const auto & | solutions () const |
| | Getters for the solution(s).
|
| constexpr const scalar_t & | smaller () const |
| constexpr const scalar_t & | larger () const |
template<concepts::scalar scalar_t>
requires std::is_arithmetic_v<scalar_t>
class detray::detail::quadratic_equation< scalar_t >
Class to solve a quadratic equation of type a * x^2 + b * x + c = 0.
- Note
- If there are no real solutions, the result is undefined
-
The solutions are sorted by default. If there is only one solution, the larger value is undefined.