Skip to content

Commit

Permalink
Simple Smith chart scales shouldn't go to 45 degree points (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfikes authored Jan 15, 2024
1 parent 62ee4d6 commit a45057c
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions Impedance Converter/Impedance Converter/SmithChartView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ struct SmithChartContentView: View {
if (scalePreference == "1-2-5") {
return [0.2, 0.5, 1, 2, 5]
} else if (scalePreference == "Simple") {
return [sqrt(2) - 1, 1, sqrt(2) + 1]
return [0.5, 1, 2]
} else {
return [0.2, 0.5, 1, 1.4, 4]
}
Expand Down Expand Up @@ -381,18 +381,22 @@ struct SmithChartContentView: View {
return Angle(degrees: 30*X.signum())
case 3.0:
return Angle(degrees: 45*X.signum())
case sqrt(2) + 1:
return Angle(degrees: 45*X.signum())
case 2.0:
return Angle(degrees: 60*X.signum())
if scalePreference == "Simple" {
return Angle(degrees: 45*X.signum())
} else {
return Angle(degrees: 60*X.signum())
}
case 1.4:
return Angle(degrees: 60*X.signum())
case 1.0:
return Angle(degrees: 90*X.signum())
case 0.5:
return Angle(degrees: 120*X.signum())
case sqrt(2) - 1:
return Angle(degrees: 135*X.signum())
if scalePreference == "Simple" {
return Angle(degrees: 135*X.signum())
} else {
return Angle(degrees: 120*X.signum())
}
case 1.0/3.0:
return Angle(degrees: 135*X.signum())
case 0.2:
Expand Down

0 comments on commit a45057c

Please # to comment.