#include "stdafx.h"
#include <math.h>

double RtoTemp (double odpor){

	const double R0=100;
	double A = 3.9692e-3;
	double B = -5.829e-7;
	double C = -4.3303e-12;

	//teplota = teplota - 273.15;

	double teplota;
	if (odpor<100)
	teplota = (odpor-R0)/(R0*A+(2*R0*B)+(4*R0*C)-(3*R0*100*C));
	else 
	teplota = (odpor-R0)/(R0*A+2*R0*B);

	return teplota;

}