Sec 01/02 School of Engineering A. Tabrizi

Sec 01/02 School of Engineering A. Tabrizi

<p>ENGR 103 S.F.S.U. Spring 2007 Sec 01/02 School of Engineering A. Tabrizi</p><p>Assignment NO 4</p><p>A point on a sphere can be characterized by two angles, the polar angle  and the azimuthal angle  (as shown). These angles are related to longitude and latitude as follows:</p><p> = 90o – Latitude (if North)  = 90o + Latitude (if South)</p><p> = Longitude (if West )  = 360o - Longitude (if East ) </p><p>Furthermore, if the angle of the separation between two points on the sphere is  12 then the expression for the cosine of this angle is:</p><p>COS( 12 ) = COS( 1) . COS( 2) + SIN( 1) . SIN( 2) . SIN(  2 -  1 ) and once the angle is determined, the surface distance between the two points is given by D = ( 12).R , where R is the radius of the sphere.</p><p>Write a C++ program that will convert the coordinates of a point on the earth given in terms of latitude and longitude in degree into coordinates in terms of the angle ( ,  ) in radian. The input angles should be in the form:</p><p>Latitude if north (e.g. xx xxN) use: + xx.xx south (e.g. xx xxS) use: - xx.xx Longitude if west (e.g. xx xxW) use: + xx.xx East (e.g. xx xxE) use: - xx.xx</p><p>Write a function that will return the surface distance between 2 points on the earth whose coordinates are given in a terms of angles ( 1 ,  1 ), </p><p>( 2 ,  2 ) . The radius of the earth is 3,958.89 miles. Sort the distances in ascending order and verity the cities along with it. In addition display which two cities in the given list have the largest surface separation.</p><p>Given data:</p><p>Latitude Longitude Vienna 48 15 N 16 22 E Brussels 50 48 N 4 21 E Brasilia 15 52 S 47 55 W Melbourne 37 49 S 144 58 E Cairo 29 52 N 31 20 E Helsinki 60 10 N 24 57 E Bombay 18 54 N 72 49 E Istanbul 40 58 N 28 50 E</p><p>Extra credit: For extra credit do the followings: a) Create external files and read the given data from external file (s) b) Not only your out-put should be displayed on the screen, also the same out-put should be copied to another external file.</p><p>Display your interactive out-put as well as all the external files. </p>

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    2 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us