私は新しい解決策があるかもしれないと思う。
- 現在の軌道(楕円)の4つの点をプロットします。
- これらの点をターゲット軌道(トーラス)の平面に投影します。
- ターゲットの軌道傾斜を平面の法線として使用して、ターゲット軌道上の各(正規化された)点と、円周の引数 の間の角度を計算します。
- この角度を平均異常として使用し、同等の偏心異常を計算します。
- これらの偏心的な異常を使用して、ターゲット軌道上の4つの点をプロットします。これは、他の軌道に最も近い点です。
- これらのポイント間の距離を確認してください。
ここでの難しさは、角度を計算し、それを他の軌道上の異常に変換することに由来します。これは再帰関数よりも正確で速いはずです。私はこれを試したときに更新されます。
編集:
// The Four Locations we will use for the checks
TArray<FVector> CurrentOrbit_CheckPositions;
TArray<FVector> TargetOrbit_ProjectedPositions;
CurrentOrbit_CheckPositions.SetNum(4);
TargetOrbit_ProjectedPositions.SetNum(4);
// We first work out the plane of the target orbit.
const FVector Target_LANVector = FVector::ForwardVector.RotateAngleAxis(TargetOrbit.LongitudeAscendingNode, FVector::UpVector); // Vector pointing to Longitude of Ascending Node
const FVector Target_INCVector = FVector::UpVector.RotateAngleAxis(TargetOrbit.Inclination, Target_LANVector); // Vector pointing up the inclination axis (orbit normal)
const FVector Target_AOPVector = Target_LANVector.RotateAngleAxis(TargetOrbit.ArgumentOfPeriapsis, Target_INCVector); // Vector pointing towards the periapse (closest approach)
// Geometric plane of the orbit, using the inclination vector as the normal.
const FPlane ProjectionPlane = FPlane(Target_INCVector, 0.f); // Plane of the orbit. We only need the 'normal', and the plane origin is the Earths core (periapse focal point)
// Plot four points on the current orbit, using an equally-divided eccentric anomaly.
const float ECCAngle = PI/2.f;
for (int32 i = 0; i < 4; i++)
{
// Plot the point, then project it onto the plane
CurrentOrbit_CheckPositions[i] = PosFromEccAnomaly(i * ECCAngle, CurrentOrbit);
CurrentOrbit_CheckPositions[i] = FVector::PointPlaneProject(CurrentOrbit_CheckPositions[i], ProjectionPlane);
// TODO: Distance from the plane is the 'Depth'. If the Depth is > Acceptance Radius, we are outside the torus and can early-out here
// Normalize the point to find it's direction in world-space (origin in our case is always 0,0,0)
const FVector PositionDirectionWS = CurrentOrbit_CheckPositions[i].GetSafeNormal();
// Using the Inclination as the comparison plane - find the angle between the direction of this vector, and the Argument of Periapse vector of the Target orbit
// TODO: we can probably compute this angle once, using the Periapse vectors from each orbit, and just multiply it by the Index 'I'
float Angle = FMath::Acos(FVector::DotProduct(PositionDirectionWS, Target_AOPVector));
// Compute the 'Sign' of the Angle (-180.f - 180.f), using the Cross Product
const FVector Cross = FVector::CrossProduct(PositionDirectionWS, Target_AOPVector);
if (FVector::DotProduct(Cross, Target_INCVector) > 0)
{
Angle = -Angle;
}
// Using the angle directly will give us the position at th eccentric anomaly. We want to take advantage of the Mean Anomaly, and use it as the ecc anomaly
// We can use this to plot a point on the target orbit, as if it was the eccentric anomaly.
Angle = Angle - TargetOrbit.Eccentricity * FMathD::Sin(Angle);
TargetOrbit_ProjectedPositions[i] = PosFromEccAnomaly(Angle, TargetOrbit);}
コメントがこの動作の仕組みを説明してくれることを願っています。最後に数ヶ月の頭を悩ませて解決しました。皆さんありがとう!
2次元の点から楕円までの距離を見つける方法を知っていれば、3Dで簡単です。楕円の平面に点を投影し、その平面内の投影された点からの距離を求めます。楕円のターゲットポイントから、元のポイントまで測定しやすい直線を作成できます。乾杯! –
楕円は楕円か円ですか?トーラスは円形か楕円形ですか?彼らは同じセンターを持っていますか? [通常は、楕円軌道は惑星の中心に集中していません] –
こんにちは@YvesDaoust - 両方のオブジェクトは実際には円ではなく楕円であり、同じ起点を共有します。 –