Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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;    
}
            
    