GY-63_MS5611/libraries/relativity/examples/gamma_table/gamma_table.ino
2021-05-30 14:16:54 +02:00

50 lines
882 B
C++

//
// FILE: gamma_table.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.1.0
// PURPOSE: test formulas
// DATE: 2021-05-29
// URL: https://github.com/RobTillaart/relativity
#include "relativity.h"
uint32_t start, stop;
relativity R;
void setup()
{
Serial.begin(115200);
Serial.println(__FILE__);
Serial.print("\nSpeed of light (m/s):\t");
Serial.println(R.getC());
Serial.println("\n Percentage\t Speed\t\t factor\t\t gamma\n");
for (double perc = 1; perc < 99.9999; perc += (100 - perc) / 10)
{
double v = R.getC() * perc * 0.01;
Serial.print(" ");
Serial.print(perc, 5);
Serial.print("\t ");
Serial.print(v * 0.001);
Serial.print("\t ");
Serial.print(R.factor(v), 6);
Serial.print("\t ");
Serial.print(R.gamma(v ), 6);
Serial.println();
}
Serial.println("done...");
}
void loop()
{
}
// -- END OF FILE --