public Coordinate(double seconds) { double deg = Math.Floor(AstroMath.GetDegFromSeconds(seconds)); seconds -= AstroMath.GetSecondsFromGeg(deg); double min = Math.Floor(AstroMath.GetMinFromSeconds(seconds)); seconds -= AstroMath.GetSecondsFromMin(min); degrees = (int)deg; Minutes = (int)min; Seconds = (int)seconds; }
private void PrepareForm() { lblName.Text = star.Name; if (IO.LoadImage(star.Url, pBoxPhoto, false)) { pBoxPhoto.Image = Properties.Resources.star; } lblConstellation.Text = Filter.GetConstellationFromStar(star, sky).ToString(); lblDist.Text = $"{Editor.Round(star.Distance, 3)} Пк"; lblMagn.Text = $"{Editor.Round(star.Magnitude, 3)} m"; lblAbsMagn.Text = $"{Editor.Round(star.AbsMagnitude, 3)} M"; lblDecl.Text = star.Location.Declination.ToString(); lblRA.Text = star.Location.RightAscension.ToString(); HorizontalCS horCS = star.GetCurrLocation(human); lblAzimuth.Text = horCS.Azimuth.ToString(); lblAltitude.Text = horCS.Altitude.ToString(); if (!star.IsEverVisible(human)) { lblVisibility.Text = "Всегда невидима для вашей местности"; } else if (star.IsAlwaysVisible(human)) { lblVisibility.Text = "Всегда над горизонтом"; } else if (AstroMath.IsStarVisible(horCS)) { lblVisibility.Text = "Сейчас над горизонтом"; } else { lblVisibility.Text = "Сейчас не видно"; } }