Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed Limit interface km/h to MPH unit conversion is wrong #988

Closed
Glenwing opened this issue Aug 8, 2020 · 2 comments · Fixed by #1224 · May be fixed by #991
Closed

Speed Limit interface km/h to MPH unit conversion is wrong #988

Glenwing opened this issue Aug 8, 2020 · 2 comments · Fixed by #1224 · May be fixed by #991
Labels
BUG Defect detected
Milestone

Comments

@Glenwing
Copy link

Glenwing commented Aug 8, 2020

The speed limit conversions to MPH are incorrect. For example the speed limit interface gives:

  • 120 km/h = 77 MPH (should be 75)
  • 130 km/h = 83 MPH (should be 81)
  • 140 km/h = 90 MPH (should be 87)

and so forth.

I believe the problem is in Constants.cs Line 27:
public const float SPEED_TO_MPH = 32.06f; // 50 km/h converted to mph
50 km/h is 31.06 mph, not 32.06 (actually would be 31.07 if rounding; the exact conversion is 31.06856).

https://www.google.com/search?q=50+km%2Fh+to+mph

@Glenwing Glenwing added BUG Defect detected triage Awaiting issue categorisation labels Aug 8, 2020
@kvakvs
Copy link
Collaborator

kvakvs commented Aug 8, 2020

I will include this constant change into the new speed limits UI merge request.

originalfoo added a commit that referenced this issue Dec 9, 2021
User @Glenwing reported in #988 that the speed constant was wrong; should be `31.06f` (not `32.06f`).

Fixes #988
@originalfoo
Copy link
Member

oops, lol, didn't notice your commit

kvakvs pushed a commit that referenced this issue Dec 9, 2021
User @Glenwing reported in #988 that the speed constant was wrong; should be `31.06f` (not `32.06f`).

Fixes #988
@originalfoo originalfoo added this to the 11.6.0 milestone Dec 9, 2021
@originalfoo originalfoo modified the milestones: 11.6.0, 11.6.2 Jan 18, 2022
originalfoo added a commit that referenced this issue Feb 6, 2022
originalfoo added a commit that referenced this issue Feb 6, 2022
- [Meta] TM:PE 11.6.4-hotfix-7
- [Meta] Bugfix for default speeds which affects speed limits tool, overlays, and roundabout curvature speed
- [Fixed] Default netinfo speed should only inspect customisable lanes #1362 #1346 (aubergine18)
- [Fixed] Fix `SPEED_TO_MPH` value in `ApiConstants.cs` #1364 #1363 #988 (aubergine18)
- [Removed] Obsolete: `SPEED_TO_MPH` and `SPEED_TO_KMPH` in `Constants.cs` #1364 #1363 (aubergine18)
@originalfoo originalfoo removed the triage Awaiting issue categorisation label Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG Defect detected
Projects
None yet
3 participants