Saga
Saga Game Engine
Loading...
Searching...
No Matches
Saga::Math Namespace Reference

Functions

std::optional< float > solvePositiveQuadratic (float a, float b, float c)
 Solve for the minimum t such that quadratic equation at^2 + bt + c = 0 is satisfied.
 
std::vector< float > solveQuadraticReals (float a, float b, float c)
 

Function Documentation

◆ solvePositiveQuadratic()

std::optional< float > Saga::Math::solvePositiveQuadratic ( float  a,
float  b,
float  c 
)

Solve for the minimum t such that quadratic equation at^2 + bt + c = 0 is satisfied.

Parameters
a
b
c
Returns
float the minimum positive t.
nothing if no such value exists, or it's complex.
Here is the call graph for this function:

◆ solveQuadraticReals()

std::vector< float > Saga::Math::solveQuadraticReals ( float  a,
float  b,
float  c 
)

Solve the quadratic formula for real solutions for the equation at^2 + bt + c = 0.

Parameters
a
b
c
Returns
a vector containing either 0, 1, or 2 solutions.