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()