From 95b9d90ca67a747d29312d86b62cdd3938f3d866 Mon Sep 17 00:00:00 2001 From: thorwin99 Date: Sun, 12 Feb 2023 21:55:25 +0100 Subject: [PATCH] Fixed a bug that set planet positions with elevation angle of 90 to NAN --- .../StarSystemDesigner/MyStarSystemDesignerOrbitMenu.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SEWorldGenPlugin/GUI/AdminMenu/SubMenus/StarSystemDesigner/MyStarSystemDesignerOrbitMenu.cs b/SEWorldGenPlugin/GUI/AdminMenu/SubMenus/StarSystemDesigner/MyStarSystemDesignerOrbitMenu.cs index ff47192..661aec3 100644 --- a/SEWorldGenPlugin/GUI/AdminMenu/SubMenus/StarSystemDesigner/MyStarSystemDesignerOrbitMenu.cs +++ b/SEWorldGenPlugin/GUI/AdminMenu/SubMenus/StarSystemDesigner/MyStarSystemDesignerOrbitMenu.cs @@ -166,7 +166,7 @@ protected void SetOrbitProperties() } double elevation = MathHelperD.ToDegrees(Math.Asin(parentRel.Z / radius)); - double orbitPos = MathHelperD.ToDegrees(Math.Acos(parentRel.X / Math.Cos(MathHelperD.ToRadians(elevation)) / radius)); + double orbitPos = elevation == 90 ? 0 : MathHelperD.ToDegrees(Math.Acos(parentRel.X / Math.Cos(MathHelperD.ToRadians(elevation)) / radius)); if (parentRel.Y < 0) { orbitPos = 360 - orbitPos;