![](/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-09
- Revision:
- 2:d7b497824b17
- Parent:
- 0:78ca29b4c49e
File content as of revision 2:d7b497824b17:
#include "LinearCharacteristics.h" using namespace std; LinearCharacteristics::LinearCharacteristics(float k, float offset){ // standard lin characteristics this->k = k; this->offset = offset; } LinearCharacteristics::LinearCharacteristics(float x1, float x2, float y1, float y2){ // standard lin characteristics this->k = (y2-y1)/(x2-x1); this->offset = y2-(this->k*x2); } LinearCharacteristics::~LinearCharacteristics(){ } float LinearCharacteristics::calculateValue(float x){ return this->k * x + this->offset; }