From c52e58877b68e9253ea99b58322ba537a2bf2630 Mon Sep 17 00:00:00 2001 From: Levin Li Date: Thu, 3 Oct 2024 18:46:44 -0700 Subject: [PATCH] Fix incorrect ra/dec --- CelestiaUI/Core/AppCore.swift | 12 ++++++------ MobileCelestia.xcodeproj/project.pbxproj | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CelestiaUI/Core/AppCore.swift b/CelestiaUI/Core/AppCore.swift index 07f605c6..54d18e12 100644 --- a/CelestiaUI/Core/AppCore.swift +++ b/CelestiaUI/Core/AppCore.swift @@ -279,10 +279,10 @@ public extension AppCore { let eqPos = AstroUtils.ecliptic(toEquatorial: AstroUtils.cel(toJ2000Ecliptic: celPos)) let sph = AstroUtils.rect(toSpherical: eqPos) - let hms = DMS(decimal: sph.dx) + let hms = DMS(decimal: AstroUtils.deg(fromRad: sph.dx)) lines.append(String.localizedStringWithFormat(CelestiaString("RA: %@h %@m %@s", comment: "Equatorial coordinate"), formatter.string(from: hms.hmsHours), formatter.string(from: hms.hmsMinutes), formatter.string(from: hms.hmsSeconds))) - let dms = DMS(decimal: sph.dy) + let dms = DMS(decimal: AstroUtils.deg(fromRad: sph.dy)) lines.append(String.localizedStringWithFormat(CelestiaString("DEC: %@° %@′ %@″", comment: "Equatorial coordinate"), formatter.string(from: dms.degrees), formatter.string(from: dms.minutes), formatter.string(from: dms.seconds))) return lines.joined(separator: "\n") @@ -305,19 +305,19 @@ public extension AppCore { let eqPos = AstroUtils.ecliptic(toEquatorial: AstroUtils.cel(toJ2000Ecliptic: celPos)) var sph = AstroUtils.rect(toSpherical: eqPos) - let hms = DMS(decimal: sph.dx) + let hms = DMS(decimal: AstroUtils.deg(fromRad: sph.dx)) lines.append(String.localizedStringWithFormat(CelestiaString("RA: %@h %@m %@s", comment: "Equatorial coordinate"), formatter.string(from: hms.hmsHours), formatter.string(from: hms.hmsMinutes), formatter.string(from: hms.hmsSeconds))) - var dms = DMS(decimal: sph.dy) + var dms = DMS(decimal: AstroUtils.deg(fromRad: sph.dy)) lines.append(String.localizedStringWithFormat(CelestiaString("DEC: %@° %@′ %@″", comment: "Equatorial coordinate"), formatter.string(from: dms.degrees), formatter.string(from: dms.minutes), formatter.string(from: dms.seconds))) let galPos = AstroUtils.equatorial(toGalactic: eqPos) sph = AstroUtils.rect(toSpherical: galPos) - dms = DMS(decimal: sph.dx) + dms = DMS(decimal: AstroUtils.deg(fromRad: sph.dx)) lines.append(String.localizedStringWithFormat(CelestiaString("L: %@° %@′ %@″", comment: "Galactic coordinates"), formatter.string(from: dms.degrees), formatter.string(from: dms.minutes), formatter.string(from: dms.seconds))) - dms = DMS(decimal: sph.dy) + dms = DMS(decimal: AstroUtils.deg(fromRad: sph.dy)) lines.append(String.localizedStringWithFormat(CelestiaString("B: %@° %@′ %@″", comment: "Galactic coordinates"), formatter.string(from: dms.degrees), formatter.string(from: dms.minutes), formatter.string(from: dms.seconds))) return lines.joined(separator: "\n") diff --git a/MobileCelestia.xcodeproj/project.pbxproj b/MobileCelestia.xcodeproj/project.pbxproj index 25ecf100..e19111eb 100644 --- a/MobileCelestia.xcodeproj/project.pbxproj +++ b/MobileCelestia.xcodeproj/project.pbxproj @@ -1604,8 +1604,8 @@ MACOSX_DEPLOYMENT_TARGET = 11.0; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; - SHARED_BUILD_NUMBER = 501; - SHARED_BUILD_VERSION = 1.7.7; + SHARED_BUILD_NUMBER = 505; + SHARED_BUILD_VERSION = 1.7.8; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_STRICT_CONCURRENCY = targeted; @@ -1664,8 +1664,8 @@ IPHONEOS_DEPLOYMENT_TARGET = 14.0; MACOSX_DEPLOYMENT_TARGET = 11.0; SDKROOT = iphoneos; - SHARED_BUILD_NUMBER = 501; - SHARED_BUILD_VERSION = 1.7.7; + SHARED_BUILD_NUMBER = 505; + SHARED_BUILD_VERSION = 1.7.8; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_STRICT_CONCURRENCY = targeted;