private CurveItem GetSunCurve(TerrainPatch patch, Point pt, math.Vector3d sun, Color color) { patch.FillPointsAndMatrices(LunarHorizon.Terrain); patch.GetAzEl(sun, pt.X, pt.Y, out float az_rad, out float el_rad); { var horizon = patch.GetHorizon(pt.Y, pt.X); var frac = (byte)(255f * horizon.SunFraction2(az_rad * 180f / 3.141592653589f, el_rad * 180f / 3.141592653589f)); Console.WriteLine($"patch.id={patch.Id} pt=[{pt.X},{pt.Y}] Sun frac={frac}"); } var az_deg = az_rad * 180f / 3.141592565589f; var el_deg = el_rad * 180f / 3.141592565589f; const int count = 12; const double radius = 32d / 60d; var points = new PointPairList(); for (var i = 0; i <= count; i++) { var ang = i * 2d * Math.PI / count; points.Add(az_deg + radius * Math.Cos(ang), el_deg + radius * Math.Sin(ang)); } return(new LineItem(null, points, color, SymbolType.None)); }