本文整理汇总了C#中Orbit.GetDTforTrueAnomaly方法的典型用法代码示例。如果您正苦于以下问题:C# Orbit.GetDTforTrueAnomaly方法的具体用法?C# Orbit.GetDTforTrueAnomaly怎么用?C# Orbit.GetDTforTrueAnomaly使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Orbit
的用法示例。
在下文中一共展示了Orbit.GetDTforTrueAnomaly方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TimeAtOpposition
/// <summary>
/// Calculates the earliest universal time after <paramref name="after"/> when <paramref name="destination"/> will be 180 degrees from the <paramref name="origin"/> position.
/// </summary>
/// <returns>The universal time when <paramref name="destination"/> will be in opposition to <paramref name="origin"/>.</returns>
/// <param name="origin">Origin position.</param>
/// <param name="destination">Destination orbit.</param>
/// <param name="after">Universal time after which to find the opposition.</param>
public static double TimeAtOpposition(Vector3d origin, Orbit destination, double after = 0)
{
Vector3d normal = destination.GetOrbitNormal().normalized;
double trueAnomaly = TrueAnomaly(destination, Vector3d.Exclude(normal, -origin));
double ut = Planetarium.GetUniversalTime() + destination.GetDTforTrueAnomaly(trueAnomaly, 0);
if (ut <= after) {
ut += destination.period * Math.Floor((after - ut) / destination.period + 1);
}
return ut;
}