1
- namespace UME
1
+ namespace Plugins . Mathematics_Extensions . Runtime
2
2
{
3
- public static partial class UnityMathematicsExtensions
3
+ public static partial class UME
4
4
{
5
5
public const double HPI_DBL = 1.57079632679489661923 ;
6
6
public const float HPI = 1.570796326795f ;
7
-
7
+
8
8
public const double PI_DBL = 3.14159265358979323846 ;
9
9
public const float PI = 3.14159265359f ;
10
-
10
+
11
11
public const double TAU_DBL = 6.283185307179586477 ;
12
12
public const float TAU = 6.28318530718f ;
13
13
public const double PHI_DBL = 1.6180339887498948482 ;
14
- public const float PHI = 1.61803398875f ;
15
-
14
+ public const float PHI = 1.61803398875f ;
15
+
16
16
public const float PINFINITY = float . PositiveInfinity ;
17
17
public const float NINFINITY = float . NegativeInfinity ;
18
18
public const double PINFINITY_DBL = double . PositiveInfinity ;
19
19
public const double NINFINITY_DBL = double . NegativeInfinity ;
20
+
21
+
22
+ // Translated from https://github.com/JJ/p6-math-constants/blob/master/lib/Math/Constants.pm6
23
+ // Update physical constants from https://nist.gov/cuu/Constants -- CODATA 2018 recommendations
24
+
25
+ // Physical Constants
26
+ public const float plancks_h = 6.626_070_015e-34f ;
27
+ public const float plancks_reduced_h = 1.054_571_817e-34f ;
28
+ public const float speed_of_light_vacuum = 299792458f ;
29
+ public const float standard_acceleration_gravity = 9.80665f ;
30
+ public const float gravitation = 6.67430e-11f ;
31
+ public const float gas = 8.314462618f ;
32
+ public const float faraday = 96485.33212f ;
33
+ public const float electron_mass = 9.1093837015e-31f ;
34
+ public const float proton_mass = 1.67262192369e-27f ;
35
+ public const float neutron_mass = 1.67492749804e-27f ;
36
+ public const float alpha_particle_mass = 6.6446573357e-27f ;
37
+ public const float quantum_ratio = 2.417989242e14f ;
38
+ public const float planck_mass = 2.176434e-8f ;
39
+ public const float planck_time = 5.391247e-44f ;
40
+ public const float planck_length = 1.616255e-35f ;
41
+ public const float planck_temperature = 1.416784e+32f ;
42
+ public const float kg_amu = 6.02214076e23f ;
43
+ public const float coulomb = 8.9875517887e9f ;
44
+ public const float fine_structure = 0.0072973525693f ;
45
+ public const float elementary_charge = 1.602176634e-19f ;
46
+ public const float vacuum_permittivity = 8.8541878128e-12f ;
47
+ public const float magnetic_permeability = 12.5663706212e-7f ;
48
+ public const float boltzmann = 1.380649e-23f ; // was in eV, now in J K^-1
49
+ public const float electron_volt = 1.602176634e-19f ;
50
+ public const float vacuum_permeability = 12.5663706212e-7f ;
51
+
52
+ // # Mathematical constants
53
+ // # REF: https://en.wikipedia.org/wiki/Mathematical_constant
54
+
55
+ public const float phi = 1.61803398874989e0f ;
56
+ public const float alpha_feigenbaum = 2.502907875095892822283e0f ;
57
+ public const float delta_feigenbaum = 4.669201609102990e0f ;
58
+ public const float apery = 1.2020569031595942853997381e0f ;
59
+ public const float conway = 1.303577269034e0f ;
60
+ public const float khinchin = 2.6854520010e0f ;
61
+ public const float glaisher_kinkelin = 1.2824271291e0f ;
62
+ public const float golomb_dickman = 0.62432998854355e0f ;
63
+ public const float catalan = 0.915965594177219015054603514e0f ;
64
+ public const float mill = 1.3063778838630806904686144e0f ;
65
+ public const float gauss = 0.8346268e0f ;
66
+ public const float euler_mascheroni_gamma = 0.57721566490153286060e0f ;
67
+ public const float sierpinski_gamma = 2.5849817595e0f ;
68
+
69
+ // Standard short names when available
70
+
71
+ public const float A = glaisher_kinkelin ;
72
+ public const float c = speed_of_light_vacuum ;
73
+ public const float eV = electron_volt ;
74
+ public const float F = faraday ;
75
+ public const float G = gravitation ;
76
+ public const float g = standard_acceleration_gravity ;
77
+ public const float ℎ = plancks_h ;
78
+ public const float ℏ = plancks_reduced_h ;
79
+ public const float K0 = coulomb ;
80
+ public const float k0 = khinchin ;
81
+ public const float k = sierpinski_gamma ;
82
+ public const float L = kg_amu ;
83
+ public const float lp = planck_length ;
84
+ public const float mp = planck_mass ;
85
+ public const float q = elementary_charge ;
86
+ public const float Tp = planck_temperature ;
87
+ public const float tp = planck_time ;
88
+ public const float α = fine_structure ;
89
+ public const float γ = euler_mascheroni_gamma ;
90
+ public const float δ = delta_feigenbaum ;
91
+ public const float ε0 = vacuum_permittivity ;
92
+ public const float λ = conway ;
93
+ public const float μ0 = vacuum_permeability ;
94
+ public const float φ = phi ;
20
95
}
21
96
}
0 commit comments