0.1.1 relativity

This commit is contained in:
rob tillaart 2021-06-07 08:51:29 +02:00
parent 286c88327f
commit 27325c4077
6 changed files with 12 additions and 13 deletions

View File

@ -48,8 +48,10 @@ These functions are the same however the math to calculate a given factor and ga
- **double gravitationalTime(double time, double speed)** returns time dilation due to gravitational effects.
- **double diameterEarth(uint8_t longitude = 45)** calculates the diameter of the Earth given it is not a nice circle but more an ellipse, flatter on the poles and thicker on the equator.
Longitude is in (absolute) degrees.
- **double getPlanetMass(uint8_t n)** returns planet mass in kg where 0 = Sun, 1 = Mercury etc
- **double getPlanetRadius(uint8_t n)** returns planet radius in kg where 0 = Sun, 1 = Mercury etc
- **double getPlanetMass(uint8_t n)** returns planet mass in **kg**
where param n: 0 = Sun, 1 = Mercury etc
- **double getPlanetRadius(uint8_t n)** returns planet radius in **km**
where param n: 0 = Sun, 1 = Mercury etc
## Operations

View File

@ -20,11 +20,11 @@ void setup()
Serial.print("\nSpeed of light (m/s):\t");
Serial.println(R.getC());
for (uint8_t p = 0; p < 4; p++)
for (uint8_t p = 0; p < 10; p++)
{
Serial.print(p);
Serial.print(":\t");
Serial.println(R.gravitationalTime(1, R.getPlanetMass(p), R.getPlanetRadius(p)));
Serial.println(1 - R.gravitationalTime(1, R.getPlanetMass(p), R.getPlanetRadius(p)), 6);
}
Serial.println("\ndone...");

View File

@ -15,7 +15,7 @@
"type": "git",
"url": "https://github.com/RobTillaart/relativity.git"
},
"version": "0.1.0",
"version": "0.1.1",
"license": "MIT",
"frameworks": "*",
"platforms": "*"

View File

@ -1,5 +1,5 @@
name=relativity
version=0.1.0
version=0.1.1
author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=library with relativity functions.

View File

@ -2,18 +2,19 @@
//
// FILE: relativity.h
// AUTHOR: Rob Tillaart
// VERSION: 0.1.0
// VERSION: 0.1.1
// PURPOSE: Collection relativity formulas
// URL: https://github.com/RobTillaart/relativity
//
// HISTORY:
// 0.1.0 2021-05-29 initial version
// 0.1.1 2021-06-02 fix in tests
#include "Arduino.h"
#define RELATIVITY_LIB_VERSION (F("0.1.0"))
#define RELATIVITY_LIB_VERSION (F("0.1.1"))
class relativity

View File

@ -3,7 +3,7 @@
// AUTHOR: Rob Tillaart
// DATE: 2021-05-29
// PURPOSE: unit tests for the relativity library
// https://github.com/RobTillaart/TSL235R
// https://github.com/RobTillaart/relativity
// https://github.com/Arduino-CI/arduino_ci/blob/master/REFERENCE.md
//
@ -32,23 +32,19 @@
#include <ArduinoUnitTests.h>
#include "Arduino.h"
#include "relativity.h"
unittest_setup()
{
}
unittest_teardown()
{
}
unittest(test_constructor)
{
fprintf(stderr, "VERSION: %s\n", RELATIVITY_LIB_VERSION);