![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Fertig
Dependencies: mbed
Fork of RT2_P3_students by
LinearCharacteristics.cpp
- Committer:
- Kiwicjam
- Date:
- 2018-04-17
- Revision:
- 9:dc0eb7dd0d92
- Parent:
- 7:72982ede2ff6
File content as of revision 9:dc0eb7dd0d92:
#include "LinearCharacteristics.h" using namespace std; LinearCharacteristics::LinearCharacteristics(float gain,float offset){ // standard lin characteristics this->gain = gain; this->offset = offset; } LinearCharacteristics::LinearCharacteristics(float minX, float maxX,float minY, float maxY){ // standard lin characteristics this->gain = (maxY-minY)/(maxX-minX); this->offset = maxX - (maxY/this->gain); } LinearCharacteristics::~LinearCharacteristics() {} float LinearCharacteristics::evaluate(float x) { return this->gain*(x - this->offset); }