Skip to content

Commit 7868123

Browse files
Qbyte248parkera
Qbyte248
authored andcommitted
Changed coefficients of UnitAngle to more exact values (#618)
The provided values were not as exact as they could be. In fact the value for "revolutions" was completely wrong (2π instead of 360°).
1 parent accc9e6 commit 7868123

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Foundation/Unit.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -277,11 +277,11 @@ open class UnitAngle : Dimension {
277277

278278
private struct Coefficient {
279279
static let degrees = 1.0
280-
static let arcMinutes = 0.016667
281-
static let arcSeconds = 0.00027778
282-
static let radians = 57.2958
280+
static let arcMinutes = 1.0 / 60.0
281+
static let arcSeconds = 1.0 / 3600.0
282+
static let radians = 180.0 / .pi
283283
static let gradians = 0.9
284-
static let revolutions = 6.28319
284+
static let revolutions = 360.0
285285
}
286286

287287
private init(symbol: String, coefficient: Double) {
@@ -816,11 +816,11 @@ open class UnitElectricResistance : Dimension {
816816
*/
817817

818818
private struct Symbol {
819-
static let megaohms = "MΩ"
820-
static let kiloohms = "kΩ"
821-
static let ohms = ""
822-
static let milliohms = "mΩ"
823-
static let microohms = "µΩ"
819+
static let megaohms = ""
820+
static let kiloohms = ""
821+
static let ohms = "Ω"
822+
static let milliohms = ""
823+
static let microohms = "µΩ"
824824
}
825825

826826
private struct Coefficient {

0 commit comments

Comments
 (0)