Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
fang::math::CoolLerp Class Reference

#include <cool_lerp.hpp>

Public Types

using Vector2D = math::Vector2D< double >
 

Public Member Functions

 CoolLerp (const Vector2D &dataPoint1, const Vector2D &dataPoint2)
 
double interpolate (double input) const
 

Detailed Description

This interpolates arbitrary values between two datapoints x is input, y is the output for that given input

This is not as convoluted as modm's lerp but it's more capable than std::lerp Hence, it is the coolest lerp :D

Member Typedef Documentation

◆ Vector2D

Constructor & Destructor Documentation

◆ CoolLerp()

fang::math::CoolLerp::CoolLerp ( const Vector2D dataPoint1,
const Vector2D dataPoint2 
)

x corresponds to the intput y corresponds to the output dataPoint1 should have the lesser input value The datapoints should have different input values to have a defined slope.

Member Function Documentation

◆ interpolate()

double fang::math::CoolLerp::interpolate ( double  input) const

The documentation for this class was generated from the following files: