-
Notifications
You must be signed in to change notification settings - Fork 585
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
Add a few new WeatherHelper functions #1941
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Improve comments, add constants
if (windSpeed < Speed.FromKilometersPerHour(1)) | ||
{ | ||
// otherwise, the result is unusable, because the second and third terms of the equation are 0, resulting in a constant offset from the input temperature | ||
windSpeed = Speed.FromKilometersPerHour(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it make sense to just return temperature here instead? (might make function non-continous, you might want to check math)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, because if the wind speed is low, the returned temperature is above the input temperature. This is expected and explained in the documentation. Only if the wind speed is zero or almost zero, the formula gets completely off. So this condition basically limits the output temperature to be at most about 2 degrees over the input temperature.
This PR adds some new functions to the
WeatherHelper
class.Microsoft Reviewers: Open in CodeFlow