From fcf6f71abf5803b7701c130715615130878b5ec3 Mon Sep 17 00:00:00 2001 From: F K <54195004+fredjk-gh@users.noreply.github.com> Date: Wed, 23 Mar 2022 06:44:42 -0400 Subject: [PATCH] Distinguish Close Belt proximity and Close Ring proximity criteria (#70) If it's a belt, report it as a belt instead of a ring. See 7c209efb9f1e4eeb248b36d65463aa10e6f2f70e for context. --- ObservatoryExplorer/DefaultCriteria.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ObservatoryExplorer/DefaultCriteria.cs b/ObservatoryExplorer/DefaultCriteria.cs index 5dc5579..da271f3 100644 --- a/ObservatoryExplorer/DefaultCriteria.cs +++ b/ObservatoryExplorer/DefaultCriteria.cs @@ -70,7 +70,9 @@ namespace Observatory.Explorer var separation = Math.Min(Math.Abs(scan.SemiMajorAxis - ring.OuterRad), Math.Abs(ring.InnerRad - scan.SemiMajorAxis)); if (separation < scan.Radius * 10) { - results.Add("Close Ring Proximity", $"Orbit: {scan.SemiMajorAxis / 1000:N0}km, Radius: {scan.Radius / 1000:N0}km, Distance from ring: {separation / 1000:N0}km"); + var ringTypeName = ring.Name.Contains("Belt") ? "Belt" : "Ring"; + results.Add($"Close {ringTypeName} Proximity", + $"Orbit: {scan.SemiMajorAxis / 1000:N0}km, Radius: {scan.Radius / 1000:N0}km, Distance from {ringTypeName.ToLower()}: {separation / 1000:N0}km"); } } }