Skip to content

Commit

Permalink
Fix incorrect ra/dec
Browse files Browse the repository at this point in the history
  • Loading branch information
levinli303 committed Oct 4, 2024
1 parent 711f7d7 commit c52e588
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions CelestiaUI/Core/AppCore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
Expand Down
8 changes: 4 additions & 4 deletions MobileCelestia.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c52e588

Please sign in to comment.