Write the code for this function with input parameter CoordPair as type Coordinates , and a return value of type Point. Task 4b: Right click anywhere within the CoordinatePairToCartesianPair function in Airports.vb and add a unit test to the unit test framework. Modify the code to set CoordPair.Lat = 33.63944, CoordPair.Lon=84.42806, expected.X = 486, and expected.Y=265. You may want to test each component of the actual value separately, but you don’t need to since a delta isn’t required. Task 4c: Run the unit tests to make sure they all run. Task 4d: Check out the master copy of the project and install your changes.

Task 6: Create a function named MidCoordinatePair that calculates the midpoint between two points on a sphere. This task requires the prior completion of Tasks 2 and 3. Task 6a: Create a function MidCoordinatePair and add the following comment: ‘ Formula for the midpoint between two points on a sphere ‘ Ed Williams, “Aviation Formulary V1.46” ‘ at williams.best.vwh.net/avform.htm ‘ Bx = cos(lat2) ∙ cos(Δlong) ‘ By = cos(lat2) ∙ sin(Δlong) ‘ latm = atan2(sin(lat1) + sin(lat2), √((cos(lat1) + Bx)² + By²)) ‘ lonm = lon1 + atan2(By, cos(lat1) + Bx) ‘ (Note that angles need to be in radians to pass to trig functions).

Write the code for this function with input parameters index1 and index2 as type Integer, and a return value of type Coordinates. Use the function IndexToCoordinatePair to return the coordinates from the Hubs array for index1 and index2 and the function DegreesToRadians to convert the individual components of the two Coordinate pairs to Radians in order to do the calculation. After the calculation is complete, call the function RadiansToDegrees to convert the latitude and longitude back to degrees before returning the coordinate pair. Task6b: Right click anywhere within the MidCoordinatePair function in Airports.vb and add a unit test to the unit test framework. Add the line, target.LoadData(), to MidCoordinatePairTest immediately after the Dim statements. Modify the code to set index1 = 0, index2 = 1, expected.lat = 38.19098, and expected.lon=78.12139. You will need to test each component of the actual value separately. Set delta in each Assert.AreEqual call to 0.00001 to allow for rounding error. Task 6c: Run the unit tests to make sure they all run. Task 6d: Check out the master copy of the project and install your changes.

Task 7: Create a subroutine named Plot that plots a curved line on the US Map Form representing the shortest distance between two airport hubs. Task7a: Create a subroutine Plot and write code that plots a curved line on the US Map Form (Map) using the DrawCurve method of the CreateGraphics library. This will require the parameters Pen.Black and an array of points containing the xy coordinates of the starting point, midpoint, and ending point of the curve. No value for the third parameter, tension, is necessary. Task7b: In the same subroutine use the DrawRectangle method of the CreateGraphics library to draw small squares at the starting and ending points. Task 7c: Run the unit tests to make sure they all run. Task 7d: Check out the master copy of the project and install your changes.

Task 8: Add a button to the form Airports that plots a curved line on the US Map Form representing the shortest distance between two airport hubs. This task requires the prior completion of Task 7. Task8a: Create a button on the form Airports named ShowMapButton. Change the text property to “Show Map”. Task8b: In the event handler of the Click event for ShowMapButton, add code to build an array of points named XYPairs of type point that contains xy values for the starting point, midpoint, and ending point of the curve to be plotted on the US Map Form (Map). Be sure to Show Map before calling the subroutine Plot. Task 8c: Run the unit tests to make sure they all run. Task 8d: Check out the master copy of the project and install your changes.

Attachments

Write the code for this function with input parameter CoordPair as type Coordinates , and a return value of type Point. Task 4b: Right click anywhere within the CoordinatePairToCartesianPair function in Airports.vb and add a unit test to the unit test framework. Modify the code to set CoordPair.Lat = 33.63944, CoordPair.Lon=84.42806, expected.X = 486, and expected.Y=265. You may want to test each component of the actual value separately, but you don’t need to since a delta isn’t required. Task 4c: Run the unit tests to make sure they all run. Task 4d: Check out the master copy of the project and install your changes.