Class CoolLerp

Class Documentation

class CoolLerp

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

Public Types

using Vector2D = math::Vector2D<double>

Public Functions

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.

double interpolate(double input) const