commit 2b0a3a87c7f9cf59f99e2979da623e6560a7412e Author: moxitech Date: Fri Aug 30 22:44:45 2024 +0700 First commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8d4a6c0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +bin +obj \ No newline at end of file diff --git a/DecimalEx.dll b/DecimalEx.dll new file mode 100644 index 0000000..138e561 Binary files /dev/null and b/DecimalEx.dll differ diff --git a/ISS.c#.correctorj1.csproj b/ISS.c#.correctorj1.csproj new file mode 100644 index 0000000..f15d3bf --- /dev/null +++ b/ISS.c#.correctorj1.csproj @@ -0,0 +1,22 @@ + + + + Exe + net8.0 + ISS.c_.correctorj1 + enable + enable + + + + PreserveNewest + + + + + + RealCoordinatesCalculation.dll + + + + diff --git a/ISS.c#.correctorj1.sln b/ISS.c#.correctorj1.sln new file mode 100644 index 0000000..741e706 --- /dev/null +++ b/ISS.c#.correctorj1.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.002.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ISS.c#.correctorj1", "ISS.c#.correctorj1.csproj", "{D62B6028-A86D-4515-B93C-299D46A4F2BA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D62B6028-A86D-4515-B93C-299D46A4F2BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D62B6028-A86D-4515-B93C-299D46A4F2BA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D62B6028-A86D-4515-B93C-299D46A4F2BA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D62B6028-A86D-4515-B93C-299D46A4F2BA}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {FA648F5C-E2D8-4219-A883-715C819FC2A5} + EndGlobalSection +EndGlobal diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6e3c4c3 --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ + + + +run: + dotnet run + + +build: + echo build \ No newline at end of file diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..01f60ef --- /dev/null +++ b/Program.cs @@ -0,0 +1,119 @@ +using System.ComponentModel.DataAnnotations; +using System.Numerics; +using System.Runtime.InteropServices; +using System.Security.Cryptography; +using System.Xml.XPath; +using RealCoordinatesCalculation; +using RealCoordinatesCalculation.Models; + +// | TODO | +// ================= +// Подгрузка M1, M2 +// Подгрузка PA.TA.HA.TC.PC + +// ДИАПАЗОНЫ ВЫЧИСЛЕНИЙ +const double NG_PREDEL_LOW = 1.494452; +const double NG_PREDEL_HIGHT = 1.506247; +const double BETA_PREDEL_LOW = -15; +const double BETA_PREDEL_HIGHT = 15; + +// ПРЕДОПРЕДЕЛЕННЫЕ КОНСТАНТЫ ВЫЧИСЛЕНИЙ +const double LAMBDA = 1.550; +const double ALPHA = 0.001383; +const double DGM = 60.00; + +// КОЛИЧЕСТВО ЭКСПЕРИМЕНТОВ +const int COUNT_EXPERIMENTS = 6; + + +//DELETE AFTER PARSER IS GOING TO UP +var XYZ = new Vector3D(5944.787, -1758.92, 3885.021); +var M1 = new Vector3D(3472.706, 2543.101, 952.0311); +var M2 = new Vector3D(-1847.56, 2517.044, -2771.21); +const double PA = 743.056; +const double TA = 27.106; +const double HA = 46.676; +const double PC = 743.12; +const double TC = 26.6; + +Console.WriteLine("[*] Start process of calculation"); + +Console.WriteLine("[1] Layer 1 :: Correcting coordinate is ended"); + +Console.WriteLine("[2] Layer 2 :: Calculate Distance is resolved"); + +Console.WriteLine("[3] Layer 3 :: Calculate DELTA is ended"); + +StartCalc(); +// Запуск процесса вычислений +void StartCalc() { + var STEP_NG = (NG_PREDEL_HIGHT - NG_PREDEL_LOW) / 30; + var STEP_BETA = (NG_PREDEL_HIGHT - NG_PREDEL_LOW) / 30; + + var CorrectedCoords = new List(); + + for (int i = 0; i < COUNT_EXPERIMENTS; i++) { + var res = RunDivergenceCorrectForCoordinate(NG_PREDEL_LOW + (STEP_NG * i), (int)(BETA_PREDEL_LOW + (STEP_BETA * i)), PA, TA, HA, PC, TC, M1, M2, XYZ); + System.Console.WriteLine($"[LOG] ITERATION {i} in {COUNT_EXPERIMENTS} :: POINT {"J1.1"} :: " + res); + + } + + // === Уточняем координаты точек + var J1_1 = RunDivergenceCorrectForCoordinate(NG_PREDEL_LOW, (int)BETA_PREDEL_LOW, PA, TA, HA, PC, TC, M1, M2, XYZ); + var J1_2 = RunDivergenceCorrectForCoordinate(NG_PREDEL_LOW, (int)BETA_PREDEL_LOW, PA, TA, HA, PC, TC, M1, M2, XYZ); + var J1_3 = RunDivergenceCorrectForCoordinate(NG_PREDEL_LOW, (int)BETA_PREDEL_LOW, PA, TA, HA, PC, TC, M1, M2, XYZ); + var J2_1 = RunDivergenceCorrectForCoordinate(NG_PREDEL_LOW, (int)BETA_PREDEL_LOW, PA, TA, HA, PC, TC, M1, M2, XYZ); + var J2_2 = RunDivergenceCorrectForCoordinate(NG_PREDEL_LOW, (int)BETA_PREDEL_LOW, PA, TA, HA, PC, TC, M1, M2, XYZ); + var J2_3 = RunDivergenceCorrectForCoordinate(NG_PREDEL_LOW, (int)BETA_PREDEL_LOW, PA, TA, HA, PC, TC, M1, M2, XYZ); + var J3_1 = RunDivergenceCorrectForCoordinate(NG_PREDEL_LOW, (int)BETA_PREDEL_LOW, PA, TA, HA, PC, TC, M1, M2, XYZ); + var J3_2 = RunDivergenceCorrectForCoordinate(NG_PREDEL_LOW, (int)BETA_PREDEL_LOW, PA, TA, HA, PC, TC, M1, M2, XYZ); + var J3_3 = RunDivergenceCorrectForCoordinate(NG_PREDEL_LOW, (int)BETA_PREDEL_LOW, PA, TA, HA, PC, TC, M1, M2, XYZ); + + // === Считаем искомые расстояния + var J1_12 = CalculateDistance(J1_1, J1_2); + var J1_23 = CalculateDistance(J1_2, J1_3); + var J1_13 = CalculateDistance(J1_1, J1_3); + + + var J2_12 = CalculateDistance(J2_1, J2_2); + var J2_23 = CalculateDistance(J2_2, J2_3); + var J2_13 = CalculateDistance(J2_1, J2_3); + + var J3_12 = CalculateDistance(J3_1, J3_2); + var J3_23 = CalculateDistance(J3_2, J3_3); + var J3_13 = CalculateDistance(J3_1, J3_3); + // === Оцениваем отклонения найденных значений от истинного + +} + + +// Корректировка координат для 1 вектора +Vector3D RunDivergenceCorrectForCoordinate(double NG, int BETA, double PA, double TA, double HA, double PC, double TC, Vector3D M1, Vector3D M2, Vector3D XYZ) { + var option = new CalculationSettings + { + NA = null, + NC = null, + NG = (decimal)NG, + Alpha = (decimal)ALPHA, + Dgm = (decimal)DGM, + PA = (decimal)PA, + TA = (decimal)TA, + HA = (decimal)HA, + Lambda = (decimal)LAMBDA, + Beta = BETA, + TC = (decimal)TC, + PC = (decimal)PC, + }; + var calcLogger = new CalculateVectorCore(option); + var CALCULATED = calcLogger.CalculateData( + XYZ, + M1, + M2 + ); + return CALCULATED; +} + +// Вычисление длинны вектора +double CalculateDistance(Vector3D JI_1, Vector3D JI_2) { + return (double)Vector3D.Length(JI_1, JI_2); +} diff --git a/RealCoordinatesCalculation.dll b/RealCoordinatesCalculation.dll new file mode 100644 index 0000000..f6ff7a0 Binary files /dev/null and b/RealCoordinatesCalculation.dll differ