|
@@ -0,0 +1,94 @@
|
|
|
+#include "modules/Elliptic_integrals.h"
|
|
|
+#include <iomanip>
|
|
|
+#include <string>
|
|
|
+
|
|
|
+
|
|
|
+void PrintEF(int index)
|
|
|
+{
|
|
|
+ Elliptic_Integrals EL;
|
|
|
+ std::cout << "------------------------------------------------------------------------------------------" << std::endl;
|
|
|
+ std::cout << std::setw(2) << "alpha/phi";
|
|
|
+ for (int j=0; j <=6; j++)
|
|
|
+ {
|
|
|
+ std::cout << std::setw(11) << std::right << std::setprecision(6) << j * 5;
|
|
|
+ }
|
|
|
+ std::cout << std::endl;
|
|
|
+ // std::cout << " ";
|
|
|
+ for (double alpha = 0; alpha <= 90; alpha = alpha + 2)
|
|
|
+ {
|
|
|
+ double k = sin(alpha * M_PI / 180);
|
|
|
+ if ((int) alpha % 10 == 0 && alpha != 0)
|
|
|
+ {
|
|
|
+ std::cout << std::endl;
|
|
|
+ }
|
|
|
+ std::cout << std::setw(9) << int(alpha) << ' ';
|
|
|
+ for (double phi = 0; phi <= 30; phi = phi + 5)
|
|
|
+ {
|
|
|
+ std::vector<double> res = EL.Elliptic(phi, k);
|
|
|
+ std::cout << std::fixed << std::setprecision(8) << res[index] << " ";
|
|
|
+ }
|
|
|
+ std::cout << std::endl;
|
|
|
+ }
|
|
|
+
|
|
|
+ std::cout << "------------------------------------------------------------------------------------------" << std::endl;
|
|
|
+
|
|
|
+ std::cout << std::setw(2) << "alpha/phi";
|
|
|
+ for (int j=7; j <=12; j++)
|
|
|
+ {
|
|
|
+ std::cout << std::setw(11) << std::right << std::setprecision(6) << j * 5;
|
|
|
+ }
|
|
|
+ std::cout << std::endl;
|
|
|
+ // std::cout << " ";
|
|
|
+ for (double alpha = 0; alpha <= 90; alpha = alpha + 2)
|
|
|
+ {
|
|
|
+ double k = sin(alpha * M_PI / 180);
|
|
|
+ if ((int) alpha % 10 == 0 && alpha != 0)
|
|
|
+ {
|
|
|
+ std::cout << std::endl;
|
|
|
+ }
|
|
|
+ std::cout << std::setw(9) << int(alpha) << ' ';
|
|
|
+ for (double phi = 35; phi <= 60; phi = phi + 5)
|
|
|
+ {
|
|
|
+ std::vector<double> res = EL.Elliptic(phi, k);
|
|
|
+ std::cout << std::fixed << std::setprecision(8) << res[index] << " ";
|
|
|
+ }
|
|
|
+ std::cout << std::endl;
|
|
|
+ }
|
|
|
+ std::cout << "------------------------------------------------------------------------------------------" << std::endl;
|
|
|
+
|
|
|
+ std::cout << std::setw(2) << "alpha/phi";
|
|
|
+ for (int j=13; j <=18; j++)
|
|
|
+ {
|
|
|
+ std::cout << std::setw(11) << std::right << std::setprecision(6) << j * 5;
|
|
|
+ }
|
|
|
+ std::cout << std::endl;
|
|
|
+ // std::cout << " ";
|
|
|
+ for (double alpha = 0; alpha <= 90; alpha = alpha + 2)
|
|
|
+ {
|
|
|
+ double k = sin(alpha * M_PI / 180);
|
|
|
+ if ((int) alpha % 10 == 0 && alpha != 0)
|
|
|
+ {
|
|
|
+ std::cout << std::endl;
|
|
|
+ }
|
|
|
+ std::cout << std::setw(9) << int(alpha) << ' ';
|
|
|
+ for (double phi = 65; phi <= 90; phi = phi + 5)
|
|
|
+ {
|
|
|
+ std::vector<double> res = EL.Elliptic(phi, k);
|
|
|
+ std::cout << std::fixed << std::setprecision(8) << res[index] << " ";
|
|
|
+ }
|
|
|
+ std::cout << std::endl;
|
|
|
+ }
|
|
|
+ std::cout << "------------------------------------------------------------------------------------------" << std::endl;
|
|
|
+}
|
|
|
+
|
|
|
+int main()
|
|
|
+{
|
|
|
+ std::cout << "------------------------------------------------------------------------------------------" << std::endl;
|
|
|
+ std::cout << "Elliptic integral of the first kind F(phi, sin(alpha))" << std::endl;
|
|
|
+ std::cout << "------------------------------------------------------------------------------------------" << std::endl;
|
|
|
+ PrintEF(0);
|
|
|
+ std::cout << "------------------------------------------------------------------------------------------" << std::endl;
|
|
|
+ std::cout << "Elliptic integral of the second kind E(phi, sin(alpha))" << std::endl;
|
|
|
+ std::cout << "------------------------------------------------------------------------------------------" << std::endl;
|
|
|
+ PrintEF(1);
|
|
|
+}
|