Skip to content

Commit 0339295

Browse files
committed
In Cross wind section use rounding rather than ceiling. Ceiling was not always consistent with the results.
1 parent 4fe688c commit 0339295

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

myFlightInfo/CrossWind.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ private void btn_calc_wind_Click(object sender, EventArgs e)
5252

5353
//from UI data
5454
double RunwayHeading1 = double.Parse(results.Item1);
55-
double crossWind1 = Math.Ceiling(double.Parse(results.Item2));
56-
double headwind1 = Math.Ceiling(double.Parse(results.Item3));
55+
double crossWind1 = Math.Round(double.Parse(results.Item2),0);
56+
double headwind1 = Math.Round(double.Parse(results.Item3),0);
5757

5858
//from reciprocal to UI data
5959
double RunwayHeading2 = double.Parse(results.Item4);
60-
double crossWind2 = Math.Ceiling(double.Parse(results.Item5));
61-
double headwind2 = Math.Ceiling(double.Parse(results.Item6));
60+
double crossWind2 = Math.Round(double.Parse(results.Item5),0);
61+
double headwind2 = Math.Round(double.Parse(results.Item6),0);
6262

6363
double crosswind3 = 0;
6464
double headwind3 = 0;

myFlightInfo/crosswind/Crosswind.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class Crosswind
77
public static (string, string, string, string, string, string) CalculateWind(string magnitude, string direction, string runway_heading)
88
{
99
string crosswind1 = Math.Round((Double.Parse(magnitude)*
10-
Math.Sin(Math.PI * (Double.Parse(direction) - Double.Parse(runway_heading)*10)/180)),2).ToString();
10+
Math.Sin(Math.PI * (Double.Parse(direction) - Double.Parse(runway_heading)*10)/180)), 2).ToString();
1111
string headwind1 = Math.Round((Double.Parse(magnitude) *
1212
Math.Cos(Math.PI * (Double.Parse(direction) - Double.Parse(runway_heading)*10) / 180)), 2).ToString();
1313

0 commit comments

Comments
 (0)