1 /*
2  * Copyright (c) 2019-2020 Kevin Townsend (KTOWN)
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 /**
8  * @defgroup CONSTANTS Constants
9  *
10  * @brief Constant values used by or with zscilib.
11  *
12  * @ingroup CONSTANTS
13  *  @{ */
14 
15 /**
16  * @file
17  * @brief Constant values for zscilib.
18  *
19  * This file contains constant values used by the various APIs in zscilib.
20  */
21 
22 #ifndef ZEPHYR_INCLUDE_ZSL_CONSTS_H_
23 #define ZEPHYR_INCLUDE_ZSL_CONSTS_H_
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 /**
30  * The permitivity of free space (a vacuum), AKA vacuum permitivity or
31  * electric constant, in farads per meter.
32  */
33 #define ZSL_PERM_FREE_SPACE                             (8.85E-12)
34 
35 /**
36  * The universal gravitational constant or Newtonian constant of gravitation,
37  * in meters cubed per kilogram and second squared.
38  */
39 #define ZSL_UNIV_GRAV                                   (6.67408E-11)
40 
41 /**
42  * The irrational number Pi, defined as the ratio between the perimeter and the
43  * diameter of a circle.
44  */
45 #define ZSL_PI                                          (3.14159265359)
46 
47 /**
48  * The gravitational acceleration at the surface of the Earth, in meters per
49  * second squared.
50  */
51 #define ZSL_GRAV_EARTH                                  (9.807)
52 
53 /**
54  * The radius of a nucleon, in meters. This is an empirically determined
55  * constant and it's value is approximately between 1.2 and 1.5 femtometers.
56  */
57 #define ZSL_NUCL_RADIUS                                 (1.25E-15)
58 
59 /**
60  * The irrational number 'e', also known as the Euler's constant.
61  */
62 #define ZSL_E                                           (2.71828182845)
63 
64 /**
65  * Planck's constant, in kilograms and meters squared per second.
66  */
67 #define ZSL_PLANCK                                      (6.62607015E-34)
68 
69 /**
70  * Reduced Planck's constant or Dirac's constant, in kilograms and meters
71  * squared per second. Defined as the Planck's constant divided by 2 pi.
72  */
73 #define ZSL_RED_PLANCK                                  (1.054571800E-34)
74 
75 /**
76  * The elementary change, AKA the electric charge of a proton and minus the
77  * electric charge of an electron, in coulombs.
78  */
79 #define ZSL_E_CHARGE                                    (1.602176634E-19)
80 
81 /**
82  * Coulomb's constant or the electrostatic constant, in newtons and meters
83  * squared per coulombs squared.
84  */
85 #define ZSL_COULOMB                                     (8.987551787E9)
86 
87 /**
88  * The mass of a single electron, in kilograms.
89  */
90 #define ZSL_E_MASS                                      (9.1093835611E-31)
91 
92 /**
93  * The speed of light in vacuum, in meters per second.
94  */
95 #define ZSL_LIGHT_SPEED                                 (299792458.0)
96 
97 /**
98  * The ideal gas constant, in joules per kelvin and mol.
99  */
100 #define ZSL_IDEAL_GAS_CONST                             (8.314462618)
101 
102 /**
103  * Degrees to radians conversion.
104  */
105 #define ZSL_DEG_TO_RAD                                  (0.01745329252)
106 
107 /**
108  * Radians to degrees conversion.
109  */
110 #define ZSL_RAD_TO_DEG                                  (57.295779513)
111 
112 #ifdef __cplusplus
113 }
114 #endif
115 
116 #endif /* ZEPHYR_INCLUDE_ZSL_CONSTS_H_ */
117 
118 /** @} */ /* End of constants group */
119