First commit

This commit is contained in:
moxitech 2024-08-30 22:44:45 +07:00
commit 2b0a3a87c7
7 changed files with 177 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
bin
obj

BIN
DecimalEx.dll Normal file

Binary file not shown.

22
ISS.c#.correctorj1.csproj Normal file
View File

@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>ISS.c_.correctorj1</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Content Include="RealCoordinatesCalculation.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Reference Include="RealCoordinatesCalculation">
<HintPath>RealCoordinatesCalculation.dll</HintPath>
</Reference>
</ItemGroup>
</Project>

25
ISS.c#.correctorj1.sln Normal file
View File

@ -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

9
Makefile Normal file
View File

@ -0,0 +1,9 @@
run:
dotnet run
build:
echo build

119
Program.cs Normal file
View File

@ -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<Vector3D>();
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);
}

Binary file not shown.