diff --git a/QPong/Utils.cpp b/QPong/Utils.cpp index a597a94754c6346b55b49f0ac5c989ff213758ca..4e0ae381cfb07507aecb67fe2ffe137198f25928 100644 --- a/QPong/Utils.cpp +++ b/QPong/Utils.cpp @@ -118,15 +118,29 @@ void calculateGaussBox(float *potential, double *xAt, double *yAt, int arrayElem void calculateH2Box(float *potential, double *xAt, double *yAt, int arrayElements) { - constexpr double grow = 1.0; - constexpr double scalePotential = 0.005; + constexpr double grow = 0.001; for (int i{0}; i < arrayElements; ++i) { auto x = xAt[i] * grow; auto y = yAt[i] * grow; - auto d = sqrt(pow2(x) + pow2(y)); - auto V = d; - V *= scalePotential; - potential[i] = V; + auto d = sqrt(pow2(x) + pow2(y)) + 0.1; + auto V = 0.10035 / d; + potential[i] = 1.0 - V; } } + + +// void Kegel(float *potential, double *xAt, double *yAt, int arrayElements) +// { +// constexpr double grow = 1.0; +// constexpr double scalePotential = 0.005; +// for (int i{0}; i < arrayElements; ++i) +// { +// auto x = xAt[i] * grow; +// auto y = yAt[i] * grow; +// auto d = sqrt(pow2(x) + pow2(y)); +// auto V = d; +// V *= scalePotential; +// potential[i] = V; +// } +// } \ No newline at end of file