#define pi 3.1416
float seno = 0;
float senop = 0;
float deriv_seno = 0;
float int_seno = 0;
float radianes = 0;
float h = 0.01;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
}
void loop() {
// put your main code here, to run repeatedly:
for(float i = 0; i<2*pi;i = i+h){
//radianes = (i*pi)/180;
seno = 10*sin(i);
deriv_seno = derivada(i,h);
//int_seno =
Serial.print(seno);
Serial.print(" ");
Serial.print(deriv_seno);
Serial.println(" ");
delay(100);
}
}
float derivada (float valor, float paso) {
float deriv_seno = 10*((sin(valor+paso)-sin(valor))/paso);
return deriv_seno;
}