SecondOrderDynamics¶
File: samarium/math/SecondOrderDynamics.hpp
-
namespace sm
-
template<typename T>
struct SecondOrderDynamics¶ Make a value follow an input value using a second order differential equation.
Public Functions
-
inline explicit SecondOrderDynamics(T initial_input_value = {}, f64 frequency = 4.0, f64 damping = 0.3, f64 response = 0.0)¶
Start responding to
initial_input_value
- Parameters:
initial_input_value –
frequency – Frequency of oscillation. Range: [0, inf)
damping – [0, 1.0): with ocscillation. [1.0, inf): asymptotic approach
response – at 0, takes time to respond. At 1.0, immediate response. When > 1: overshoots target. < 1 anticipates motion
-
inline void update_parameters(f64 frequency, f64 damping, f64 response)¶
Update the equation parameters.
- Parameters:
frequency – Frequency of oscillation. Range: [0, inf)
damping – [0, 1.0): with ocscillation. [1.0, inf): asymptotic approach
response – at 0, takes time to respond. At 1.0, immediate response. When > 1: overshoots target. < 1 anticipates motion
-
inline explicit SecondOrderDynamics(T initial_input_value = {}, f64 frequency = 4.0, f64 damping = 0.3, f64 response = 0.0)¶
-
template<typename T>