From bfe64d8bbcafbc5f4810ec3c178aeb5b1a48bab8 Mon Sep 17 00:00:00 2001 From: Elyahu Date: Mon, 6 May 2024 19:25:06 -0600 Subject: [PATCH] another bug fix --- KosherSwiftNew.podspec | 2 +- Sources/KosherSwift/util/GeoLocation.swift | 2 +- Tests/KosherSwiftTests/KosherSwiftTests.swift | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/KosherSwiftNew.podspec b/KosherSwiftNew.podspec index 20cd842..fb6b719 100644 --- a/KosherSwiftNew.podspec +++ b/KosherSwiftNew.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |spec| spec.name = "KosherSwiftNew" - spec.version = "1.0.6" + spec.version = "1.0.7" spec.summary = "KosherJava Zmanim API / Library ported to Swift." spec.description = "This Zmanim library is an API for a specialized calendar that can calculate different astronomical times including sunrise and sunset and Jewish zmanim or religious times for prayers and other Jewish religious duties. diff --git a/Sources/KosherSwift/util/GeoLocation.swift b/Sources/KosherSwift/util/GeoLocation.swift index c18326b..05d3a0f 100644 --- a/Sources/KosherSwift/util/GeoLocation.swift +++ b/Sources/KosherSwift/util/GeoLocation.swift @@ -523,7 +523,7 @@ public class GeoLocation { } public func toRadians(degrees:Double) -> Double { - return Double.pi / 180.0 + return degrees * Double.pi / 180.0 } public func toDegrees(radians:Double) -> Double { diff --git a/Tests/KosherSwiftTests/KosherSwiftTests.swift b/Tests/KosherSwiftTests/KosherSwiftTests.swift index 89e60a5..9d43bfa 100644 --- a/Tests/KosherSwiftTests/KosherSwiftTests.swift +++ b/Tests/KosherSwiftTests/KosherSwiftTests.swift @@ -201,6 +201,14 @@ class KosherSwiftTests: XCTestCase { XCTAssertEqual(hebrewDateFormatter.formatDayOfWeek(jewishCalendar: jewishCalendar), "Tuesday") } + func testRhumbLineBearing() { + let denver = GeoLocation(locationName: "Denver", latitude: 39.6272082, longitude: -104.8800718, timeZone: TimeZone.current) + let jer = GeoLocation(locationName: "Jerusalem", latitude: 31.778015, longitude: 35.235413, timeZone: TimeZone.current) + + let bearing = denver.getRhumbLineBearing(location: jer) + XCTAssertEqual(bearing, 93.9525489160192) + } + func testDafYomis() { jewishCalendar.setGregorianDate(year: 2023, month: 12, dayOfMonth: 21) var dafYomi = jewishCalendar.getDafYomiBavli()