James Kiwic
/
RT2_P3_students
Fertig
Fork of RT2_P3_students by
LinearCharacteristics.cpp
- Committer:
- altb
- Date:
- 2018-04-09
- Revision:
- 3:769ce5f06d3e
- Parent:
- 0:78ca29b4c49e
- Child:
- 6:2cc56521aa16
File content as of revision 3:769ce5f06d3e:
#include "LinearCharacteristics.h" using namespace std; LinearCharacteristics::LinearCharacteristics(float g, float o){ // standard lin characteristics this->gain = g; this->offset = o; // ... } LinearCharacteristics::LinearCharacteristics(float x_min, float x_max, float y_min, float y_max){ // standard lin characteristics this->gain = (y_max-y_min)/(x_max-x_min); this->offset = x_max - y_max/this->gain; } LinearCharacteristics::~LinearCharacteristics() {} float LinearCharacteristics::eval(float x){ return (gain * (x-offset)); }