降落矩阵 拉散

This commit is contained in:
szdot 2024-01-05 21:22:17 +08:00
parent 04c82c4c75
commit 9999891cde
43 changed files with 2304 additions and 1 deletions

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{626A9BFA-07DE-4063-A178-360EB7057ED6}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>FlightRouteV2</RootNamespace>
<AssemblyName>FlightRouteV2</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="FlightRouteV2.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("FlyBase")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FlyBase")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("626a9bfa-07de-4063-a178-360eb7057ed6")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

154
FlightRouteV2/Vector3.cs Normal file
View File

@ -0,0 +1,154 @@
using System;
namespace FlyBase
{
public struct Vector3
{
public double X { get; set; }
public double Y { get; set; }
public double Z { get; set; }
/// <summary>
/// 构造 初始化
/// </summary>
/// <param name="x">x坐标</param>
/// <param name="y">y坐标</param>
/// <param name="z">z坐标</param>
public Vector3(double x, double y, double z)
{
this.X = x;
this.Y = y;
this.Z = z;
}
//重载二元坐标加法+
public static Vector3 operator +(Vector3 v1, Vector3 v2)
{
return new Vector3(v1.X + v2.X, v1.Y + v2.Y, v1.Z + v2.Z);
}
//重载一元坐标加法+
public static Vector3 operator +(Vector3 v1, double i)
{
return new Vector3(v1.X + i, v1.Y + i, v1.Z + i);
}
//重载一元坐标加法+
public static Vector3 operator +(Vector3 v1, int i)
{
return new Vector3(v1.X + (double)i, v1.Y + (double)i, v1.Z + (double)i);
}
//重载二元坐标减法-
public static Vector3 operator -(Vector3 v1, Vector3 v2)
{
return new Vector3(v1.X - v2.X, v1.Y - v2.Y, v1.Z - v2.Z);
}
//重载一元坐标加法-
public static Vector3 operator -(Vector3 v1, double i)
{
return new Vector3(v1.X - i, v1.Y - i, v1.Z - i);
}
//重载一元坐标加法-
public static Vector3 operator -(Vector3 v1, int i)
{
return new Vector3(v1.X - (double)i, v1.Y - (double)i, v1.Z - (double)i);
}
//重载一元坐标乘法*
public static Vector3 operator *(Vector3 v1, double i)
{
return new Vector3(v1.X * i, v1.Y * i, v1.Z * i);
}
//重载一元坐标乘法*
public static Vector3 operator *(Vector3 v1, int i)
{
return new Vector3(v1.X * (double)i, v1.Y * (double)i, v1.Z * (double)i);
}
//重载一元坐标除法/
public static Vector3 operator /(Vector3 v1, double i)
{
return new Vector3(v1.X / i, v1.Y / i, v1.Z / i);
}
//重载一元坐标除法/
public static Vector3 operator /(Vector3 v1, int i)
{
return new Vector3(v1.X / (double)i, v1.Y / (double)i, v1.Z / (double)i);
}
//重载==
public static bool operator ==(Vector3 v1, Vector3 v2)
{
if (v1.X == v2.X && v1.Y == v2.Y && v1.Z == v2.Z) return true;
return false;
}
//重载!=
public static bool operator !=(Vector3 v1, Vector3 v2)
{
if (v1.X != v2.X || v1.Y != v2.Y || v1.Z != v2.Z) return true;
return false;
}
//模长
public double GetMag()
{
return Math.Sqrt(Math.Pow(this.X, 2) + Math.Pow(this.Y, 2) + Math.Pow(this.Z, 2));
}
/// <summary>
/// 标准化坐标
/// </summary>
/// <param name="multiple">标准化单位</param>
public void Normalize(double multiple = 1.0)
{
double magSq = Math.Pow(this.X, 2) + Math.Pow(this.Y, 2) + Math.Pow(this.Z, 2);
if (magSq > 0)
{
double oneOverMag = multiple / Math.Sqrt(magSq);
this.X *= oneOverMag;
this.Y *= oneOverMag;
this.Z *= oneOverMag;
}
}
/// <summary>
/// 标准化 返回一个标准化之后的值 不改变自身
/// </summary>
/// <param name="multiple">标准化单位</param>
/// <returns>标准化之后的值</returns>
public Vector3 NormalizEd(double multiple = 1.0)
{
Vector3 re = new Vector3();
double magSq = Math.Pow(this.X, 2) + Math.Pow(this.Y, 2) + Math.Pow(this.Z, 2);
if (magSq > 0)
{
double oneOverMag = multiple / Math.Sqrt(magSq);
re.X = this.X * oneOverMag;
re.Y = this.Y * oneOverMag;
re.Z = this.Z * oneOverMag;
}
return re;
}
//归零 改变自身数值 一般配合归位使用
public void SetZero(Vector3 v2)
{
this.X -= v2.X;
this.Y -= v2.Y;
this.Z -= v2.Z;
}
//归零 返回一个归零值 不改变自身
public Vector3 SetZeroEd(Vector3 v2)
{
Vector3 re = new Vector3(this.X - v2.X, this.Y - v2.Y, this.Z - v2.Z);
return re;
}
//归位
public void SetFormerly(Vector3 v2)
{
this.X += v2.X;
this.Y += v2.Y;
this.Z += v2.Z;
}
/// <summary>
/// 打印坐标
/// </summary>
/// <returns>坐标字符串</returns>
public string PosToString()
{
string x = Convert.ToString(this.X);
string y = Convert.ToString(this.Y);
string z = Convert.ToString(this.Z);
return string.Format($"X轴:{x} Y轴:{y} Z轴:{z}");
}
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]

View File

@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]

View File

@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]

View File

@ -0,0 +1 @@
254d0916f0a94457ded9d42398d6e5648a952309

View File

@ -0,0 +1,12 @@
F:\company\flyCube\repos\FlyCube\FlyBase\bin\Debug\FlightRouteV2.dll
F:\company\flyCube\repos\FlyCube\FlyBase\bin\Debug\FlightRouteV2.pdb
F:\company\flyCube\repos\FlyCube\FlyBase\obj\Debug\FlightRouteV2.csproj.AssemblyReference.cache
F:\company\flyCube\repos\FlyCube\FlyBase\obj\Debug\FlightRouteV2.csproj.CoreCompileInputs.cache
F:\company\flyCube\repos\FlyCube\FlyBase\obj\Debug\FlightRouteV2.dll
F:\company\flyCube\repos\FlyCube\FlyBase\obj\Debug\FlightRouteV2.pdb
F:\company\flyCube\repos\FlyCube\FlightRouteV2\bin\Debug\FlightRouteV2.dll
F:\company\flyCube\repos\FlyCube\FlightRouteV2\bin\Debug\FlightRouteV2.pdb
F:\company\flyCube\repos\FlyCube\FlightRouteV2\obj\Debug\FlightRouteV2.csproj.AssemblyReference.cache
F:\company\flyCube\repos\FlyCube\FlightRouteV2\obj\Debug\FlightRouteV2.csproj.CoreCompileInputs.cache
F:\company\flyCube\repos\FlyCube\FlightRouteV2\obj\Debug\FlightRouteV2.dll
F:\company\flyCube\repos\FlyCube\FlightRouteV2\obj\Debug\FlightRouteV2.pdb

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
65dcdc626d7d72bd83a6dbfb060115196969f69e

View File

@ -0,0 +1,12 @@
F:\company\flyCube\repos\fly\FlyBase\bin\Debug\FlyBase.dll
F:\company\flyCube\repos\fly\FlyBase\bin\Debug\FlyBase.pdb
F:\company\flyCube\repos\fly\FlyBase\obj\Debug\FlyBase.csproj.AssemblyReference.cache
F:\company\flyCube\repos\fly\FlyBase\obj\Debug\FlyBase.csproj.CoreCompileInputs.cache
F:\company\flyCube\repos\fly\FlyBase\obj\Debug\FlyBase.dll
F:\company\flyCube\repos\fly\FlyBase\obj\Debug\FlyBase.pdb
F:\company\flyCube\repos\FlyCube\FlyBase\bin\Debug\FlyBase.dll
F:\company\flyCube\repos\FlyCube\FlyBase\bin\Debug\FlyBase.pdb
F:\company\flyCube\repos\FlyCube\FlyBase\obj\Debug\FlyBase.csproj.CoreCompileInputs.cache
F:\company\flyCube\repos\FlyCube\FlyBase\obj\Debug\FlyBase.dll
F:\company\flyCube\repos\FlyCube\FlyBase\obj\Debug\FlyBase.pdb
F:\company\flyCube\repos\FlyCube\FlyBase\obj\Debug\FlyBase.csproj.AssemblyReference.cache

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]

View File

@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]

View File

@ -0,0 +1 @@
1aaa80ef5aa2c66232cf0fd45d64bc898b5ea44e

View File

@ -0,0 +1,6 @@
F:\company\flyCube\repos\FlyCube\FlightRouteV2\bin\Release\FlightRouteV2.dll
F:\company\flyCube\repos\FlyCube\FlightRouteV2\bin\Release\FlightRouteV2.pdb
F:\company\flyCube\repos\FlyCube\FlightRouteV2\obj\Release\FlightRouteV2.csproj.AssemblyReference.cache
F:\company\flyCube\repos\FlyCube\FlightRouteV2\obj\Release\FlightRouteV2.csproj.CoreCompileInputs.cache
F:\company\flyCube\repos\FlyCube\FlightRouteV2\obj\Release\FlightRouteV2.dll
F:\company\flyCube\repos\FlyCube\FlightRouteV2\obj\Release\FlightRouteV2.pdb

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
a7be80f0590ce7e3d3292f0020daba81f87a9940

View File

@ -0,0 +1,6 @@
F:\company\flyCube\repos\FlyCube\FlyBase\bin\Release\FlyBase.dll
F:\company\flyCube\repos\FlyCube\FlyBase\bin\Release\FlyBase.pdb
F:\company\flyCube\repos\FlyCube\FlyBase\obj\Release\FlyBase.csproj.AssemblyReference.cache
F:\company\flyCube\repos\FlyCube\FlyBase\obj\Release\FlyBase.csproj.CoreCompileInputs.cache
F:\company\flyCube\repos\FlyCube\FlyBase\obj\Release\FlyBase.dll
F:\company\flyCube\repos\FlyCube\FlyBase\obj\Release\FlyBase.pdb

Binary file not shown.

Binary file not shown.

View File

@ -35,6 +35,12 @@ namespace FlyCube
InitializeComponent(); InitializeComponent();
//创建一个 主画布对象 //创建一个 主画布对象
TopCanvas = new MainCanvas(this.LayerPlane); TopCanvas = new MainCanvas(this.LayerPlane);
Vector3 A = new Vector3(0,0,0);
Vector3 B = new Vector3(0, 0, 10);
Vector3 C = new Vector3(10, 0, 0);
Vector3 D = new Vector3(10, 0, 10);
Vector3 P = new Vector3(10, 0, 10);
//MessageBox.Show(FlyVecFun.IsPointBetweenLines(A, B, C, D, P).ToString());
} }
/// <summary> /// <summary>
/// 3D绕行 /// 3D绕行
@ -51,7 +57,7 @@ namespace FlyCube
Vector3[] aVecs = abVecs[0].ToArray(); Vector3[] aVecs = abVecs[0].ToArray();
Vector3[] bVecs = abVecs[1].ToArray(); Vector3[] bVecs = abVecs[1].ToArray();
//Vector3[] new_bVecs = FlyVecFun.ContactABOut(aVecs, bVecs, StrPrint); //Vector3[] new_bVecs = FlyVecFun.ContactABOut(aVecs, bVecs, StrPrint);
Vector3[] new_bVecs = FlyVecFun.NormalPull(aVecs, bVecs); Vector3[] new_bVecs = FlyVecFun.NormalPull(aVecs, bVecs, StrPrintAsync);
//Task<List<List<Vector3>>> reTask = Task.Run(() => FlyVecFun.ABypassB(aVecs, bVecs, StrPrintAsync, GetVal)); //Task<List<List<Vector3>>> reTask = Task.Run(() => FlyVecFun.ABypassB(aVecs, bVecs, StrPrintAsync, GetVal));
//List<List<Vector3>> re = await reTask; //List<List<Vector3>> re = await reTask;