![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Fertig
Dependencies: mbed
Fork of RT2_P3_students by
Diff: LinearCharacteristics.cpp
- Revision:
- 9:dc0eb7dd0d92
- Parent:
- 7:72982ede2ff6
diff -r 8ed679044a72 -r dc0eb7dd0d92 LinearCharacteristics.cpp --- a/LinearCharacteristics.cpp Tue Apr 17 11:47:35 2018 +0000 +++ b/LinearCharacteristics.cpp Tue Apr 17 13:30:52 2018 +0000 @@ -7,10 +7,15 @@ 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); - } +}