Test program with the RT black boxes

Dependencies:   mbed

LinearCharacteristics.cpp

Committer:
pmic
Date:
5 months ago
Revision:
43:a577f752dd7a
Parent:
22:cef093edb441

File content as of revision 43:a577f752dd7a:

#include "LinearCharacteristics.h"

using namespace std;

LinearCharacteristics::LinearCharacteristics(float gain,float offset){    // standard lin characteristics
    this->gain = gain;
    this->offset = offset;
}

LinearCharacteristics::LinearCharacteristics(float xmin,float xmax, float ymin, float ymax){    // standard lin characteristics
    this->gain = (ymax - ymin)/(xmax - xmin);
    this->offset = xmax - ymax/this->gain;
}

LinearCharacteristics::~LinearCharacteristics() {}


float LinearCharacteristics::evaluate(float x)
{   
return this->gain*(x - this->offset);
    }