Template for group 4

Dependencies:   mbed

Fork of RT2_P3_students by RT2_P3_students

LinearCharacteristics.cpp

Committer:
altb
Date:
2018-04-22
Revision:
7:01a7363583b2
Parent:
5:72982ede2ff6
Child:
10:85840c065e00

File content as of revision 7:01a7363583b2:

#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);
    }