当前位置: 首页>>代码示例>>C#>>正文


C# Orbit.getPositionFromTrueAnomaly方法代码示例

本文整理汇总了C#中Orbit.getPositionFromTrueAnomaly方法的典型用法代码示例。如果您正苦于以下问题:C# Orbit.getPositionFromTrueAnomaly方法的具体用法?C# Orbit.getPositionFromTrueAnomaly怎么用?C# Orbit.getPositionFromTrueAnomaly使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Orbit的用法示例。


在下文中一共展示了Orbit.getPositionFromTrueAnomaly方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FindClosestPoints

 public static void FindClosestPoints(Orbit p, Orbit s, ref double CD, ref double CCD, ref double FFp, ref double FFs, ref double SFp, ref double SFs, double epsilon, int maxIterations, ref int iterationCount)
 {
     double num = p.inclination * OrbitDBG.Deg2Rad;
     double num2 = s.inclination * OrbitDBG.Deg2Rad;
     double num3 = num - num2;
     Vector3d vector3d = Vector3d.Cross(s.h, p.h);
     Debug.DrawRay(ScaledSpace.LocalToScaledSpace(p.referenceBody.position), vector3d.xzy * 1000.0, Color.white);
     double x = 1.0 / Math.Sin(num3) * (Math.Sin(num) * Math.Cos(num2) - Math.Sin(num2) * Math.Cos(num) * Math.Cos(p.LAN * OrbitDBG.Deg2Rad - s.LAN * OrbitDBG.Deg2Rad));
     double y = 1.0 / Math.Sin(num3) * (Math.Sin(num2) * Math.Sin(p.LAN * OrbitDBG.Deg2Rad - s.LAN * OrbitDBG.Deg2Rad));
     double num4 = Math.Atan2(y, x);
     double x2 = 1.0 / Math.Sin(num3) * (Math.Sin(num) * Math.Cos(num2) * Math.Cos(p.LAN * OrbitDBG.Deg2Rad - s.LAN * OrbitDBG.Deg2Rad) - Math.Sin(num2) * Math.Cos(num));
     double y2 = 1.0 / Math.Sin(num3) * (Math.Sin(num) * Math.Sin(p.LAN * OrbitDBG.Deg2Rad - s.LAN * OrbitDBG.Deg2Rad));
     double num5 = Math.Atan2(y2, x2);
     FFp = num4 - p.argumentOfPeriapsis * OrbitDBG.Deg2Rad;
     FFs = num5 - s.argumentOfPeriapsis * OrbitDBG.Deg2Rad;
     if (p.eccentricity == 0.0)
     {
         if (s.eccentricity == 0.0)
         {
             CD = Vector3d.Distance(p.getPositionFromTrueAnomaly(FFp), s.getPositionFromTrueAnomaly(FFs));
             CCD = CD;
         }
     }
     CD = OrbitDBG.SolveClosestBSP(ref FFp, ref FFs, num3, 3.1415926535897931, p, s, 0.0001, maxIterations, ref iterationCount);
     Debug.DrawLine(ScaledSpace.LocalToScaledSpace(p.referenceBody.position), ScaledSpace.LocalToScaledSpace(p.getPositionFromTrueAnomaly(FFp)), Color.green);
     Debug.DrawLine(ScaledSpace.LocalToScaledSpace(s.referenceBody.position), ScaledSpace.LocalToScaledSpace(s.getPositionFromTrueAnomaly(FFs)), Color.grey);
     SFp = FFp + 3.1415926535897931;
     SFs = FFs + 3.1415926535897931;
     CCD = OrbitDBG.SolveClosestBSP(ref SFp, ref SFs, num3, 1.5707963267948966, p, s, 0.0001, maxIterations, ref iterationCount);
     Debug.DrawLine(ScaledSpace.LocalToScaledSpace(p.referenceBody.position), ScaledSpace.LocalToScaledSpace(p.getPositionFromTrueAnomaly(SFp)), Color.cyan);
     Debug.DrawLine(ScaledSpace.LocalToScaledSpace(s.referenceBody.position), ScaledSpace.LocalToScaledSpace(s.getPositionFromTrueAnomaly(SFs)), Color.magenta);
     CD = Math.Sqrt(CD);
     CCD = Math.Sqrt(CCD);
 }
开发者ID:Kerbas-ad-astra,项目名称:ThrottleControlledAvionics,代码行数:34,代码来源:OrbitDBG.cs


注:本文中的Orbit.getPositionFromTrueAnomaly方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。