0% found this document useful (0 votes)
25 views2 pages

Test 2 - C++

This C++ program calculates the misclosure of a traverse survey by taking in distance, bearing, and coordinate data from multiple survey stations. It calculates the latitudinal and departural distances from each station using trigonometry. It then sums the distances, latitudes, and departures over all stations. Finally, it calculates the misclosure as the square root of the sum of the squared latitude and departures divided by the total distance traveled. The results, including total misclosure, individual misclosure, summed distances, latitudes, and departures are output.

Uploaded by

Syuk Ablil
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views2 pages

Test 2 - C++

This C++ program calculates the misclosure of a traverse survey by taking in distance, bearing, and coordinate data from multiple survey stations. It calculates the latitudinal and departural distances from each station using trigonometry. It then sums the distances, latitudes, and departures over all stations. Finally, it calculates the misclosure as the square root of the sum of the squared latitude and departures divided by the total distance traveled. The results, including total misclosure, individual misclosure, summed distances, latitudes, and departures are output.

Uploaded by

Syuk Ablil
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

#include<iostream.

h>

#include<math.h>

#include<conio.h>

#include<iomanip.h>

main()

double sumlatit,sumdipat,sumdist,misclose,tmisclose;

double brg[50],dist[50],deg[50],min[50],sec[50];

double latit[50],dipat[50];

const double pi=3.1415926535897932384626433832795;

int i,stn;

sumdist=0;

sumlatit=0;

sumdipat=0;

cout<< "enter number station : ";

cin>>stn;

for(i = 1; i <= stn; i++)

cout<<"\n pls enter dist : ";

cin>>dist[i];

cout<<"\n pls enter brg : [deg|min|sec]: ";

cin>>deg[i]>>min[i]>>sec[i];

for(i = 1; i <= stn; i++)

brg[i]=deg[i]+min[i]/60.0+sec[i]/3600.0;
brg[i]=brg[i]*pi/180.0;

latit[i]=dist[i]*cos(brg[i]);

dipat[i]=dist[i]*sin(brg[i]);

for(i = 1; i <= stn; i++)

sumlatit=sumlatit+latit[i];

sumdipat=sumdipat+dipat[i];

sumdist=sumdist+dist[i];

misclose=sqrt(pow(sumlatit,2)+pow(sumdipat,2)/sumdist);

tmisclose=1.0/misclose;

cout<< setiosflags(ios ::fixed|ios::showpoint)<<setprecision(3);

cout<< "\n total misclose = 1 : "<<tmisclose;

cout<< "\n your misclose = "<<misclose;

cout<< "\n sum distance = "<<sumdist;

cout<< "\n sum latit = "<<sumlatit;

cout<< "\n sum dipat = "<<sumdipat;

return 0;

You might also like