本文整理汇总了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);
}