3de7d9530e70340cfbd3891bb844538c3ed785de
1 #ifndef CALIBREUR_F_CPU_H_
2 #define CALIBREUR_F_CPU_H_
4 #include "IntervalF_CPU.h"
13 /*--------------------------------------*\
15 \*-------------------------------------*/
17 CalibreurF(const IntervalF
& input
, const IntervalF
& output
)
19 this->pente
= (output
.b
- output
.a
) / (float) (input
.b
- input
.a
);
20 this->translation
= output
.a
- pente
* input
.a
;
23 /*--------------------------------------*\
25 \*-------------------------------------*/
29 void calibrer(float& value
) const
31 value
= value
* pente
+ translation
;
34 float getPente() const
39 float getTranslation() const
41 return this->translation
;
44 /*--------------------------------------*\
46 \*-------------------------------------*/
59 /*----------------------------------------------------------------------*\
61 \*---------------------------------------------------------------------*/