1、作业二已知如图,求各主点里程及坐标。 (线路起点里程 0Km)21R=800m l01=60ml02=60m0编写程序如下:#include#include#define PI 3.14159main()double x0,y0,K0,x2,y2,K2,x1,y1,R,l01,l02;double A,A12,A01;double b01,b02,p1,p2,m1,m2,b1;double T1,T2,L,r1,r2,E0;double D01,D02,KZH,KHY,KQZ,KYH,KHZ;double XZH,YZH,XHZ,YHZ,xHY,yHY,XHY,YHY,XYH,YYH;doub
2、le KZ1=0.0,KH1=10.0,KY=0.0,KH2=0.0,KZ2=0.0;double X60,Y60,x60,y60,dr60;double l10,l20;int i=1,j,k;x0=0.0;y0=0.0;K0=0.0;x2=5156.0;y2=8316.0;x1=4000.0;y1=4000.0;R=800.0;l01=60.0;l02=60.0;printf(“计算转角 n“);A12=atan(y2-y1)/(x2-x1);A01=atan(y1-y0)/(x1-x0);A=(A12-A01)*180/PI;/*把 A 从弧度转为 */ if(A0) printf(“
3、曲线右转n“);if(A0)XHY=XZH+(sqrt(xHY*xHY+yHY*yHY)*cos(A01+atan(yHY/xHY);YHY=YZH+(sqrt(xHY*xHY+yHY*yHY)*sin(A01+atan(yHY/xHY);XYH=XHZ+(sqrt(xHY*xHY+yHY*yHY)*cos(A12+PI-atan(yHY/xHY);YYH=YHZ+(sqrt(xHY*xHY+yHY*yHY)*sin(A12+PI-atan(yHY/xHY);if(A0)Xi=XZH+(sqrt(xi*xi+yi*yi)*cos(A01+atan(yi/xi);Yi=YZH+(sqrt(xi*
4、xi+yi*yi)*sin(A01+atan(yi/xi);if(A0)Xi=XHY+2*R*sin(dri)*cos(A01+b1+dri);Yi=YHY+2*R*sin(dri)*sin(A01+b1+dri);if(A0)Xi=XHZ+(sqrt(xi*xi+yi*yi)*cos(A12+PI-atan(yi/xi);Yi=YHZ+(sqrt(xi*xi+yi*yi)*sin(A12+PI-atan(yi/xi);if(A0;j-)printf(“ X%d=%.3f,Y%d=%.3fn“,i-k,Xj,i-k-,Yj); printf(“n“);/*-第二直线段-*/printf(“ -
5、第二直线段 100 米桩-n“);i=1;KZ2=KHZ;while(KZ2K2) Xi=XHZ+(KZ2-KHZ)*cos(A12);Yi=YHZ+(KZ2-KHZ)*sin(A12);printf(“ X%d=%.3f,Y%d=%.3f“,i,Xi,i,Yi);if(i%2=0) printf(“n“);KZ2+=100; i+;printf(“n“);程序运行结果:计算转角曲线右转计算曲线要素缓和曲线常数b01=2.148594 b02=2.148594 p1=0.188 p2=0.188 m1=29.999 m2=29.999曲线综合要素T1=244.452 T2=244.452 L=
6、478.960 r1=74.997161 r2=74.997161 E0=28.426计算各主点里程点距离的计算D01=5656.854, D02=4468.131曲线各主点里程KZH=5412.403 KHY=5472.403 KQZ=5472.627 KYH=5831.363 KHZ=5891.363 K2=10115.042直角坐标下 HY 点的坐标xHY=59.992 yHY=0.750计算各主点坐标ZH、HZ 点坐标XZH=3827.147 YZH=3827.147 XHZ=4063.245 YHZ=4236.129HY、YH 点坐标XHY=3869.037 YHY=3870.097
7、 XYH=4046.999 YYH=4178.374计算逐桩坐标-第一直线段 100 米桩-X1=0.000,Y1=0.000 X2=70.711,Y2=70.711X3=141.421,Y3=141.421 X4=212.132,Y4=212.132X5=282.843,Y5=282.843 X6=353.553,Y6=353.553X7=424.264,Y7=424.264 X8=494.975,Y8=494.975X9=565.685,Y9=565.685 X10=636.396,Y10=636.396X11=707.107,Y11=707.107 X12=777.817,Y12=777
8、.817X13=848.528,Y13=848.528 X14=919.239,Y14=919.239X15=989.949,Y15=989.949 X16=1060.660,Y16=1060.660X17=1131.371,Y17=1131.371 X18=1202.082,Y18=1202.082X19=1272.792,Y19=1272.792 X20=1343.503,Y20=1343.503X21=1414.214,Y21=1414.214 X22=1484.924,Y22=1484.924X23=1555.635,Y23=1555.635 X24=1626.346,Y24=1626
9、.346X25=1697.056,Y25=1697.056 X26=1767.767,Y26=1767.767X27=1838.478,Y27=1838.478 X28=1909.188,Y28=1909.188X29=1979.899,Y29=1979.899 X30=2050.610,Y30=2050.610X31=2121.320,Y31=2121.320 X32=2192.031,Y32=2192.031X33=2262.742,Y33=2262.742 X34=2333.452,Y34=2333.452X35=2404.163,Y35=2404.163 X36=2474.874,Y3
10、6=2474.874X37=2545.584,Y37=2545.584 X38=2616.295,Y38=2616.295X39=2687.006,Y39=2687.006 X40=2757.716,Y40=2757.716X41=2828.427,Y41=2828.427 X42=2899.138,Y42=2899.138X43=2969.848,Y43=2969.848 X44=3040.559,Y44=3040.559X45=3111.270,Y45=3111.270 X46=3181.981,Y46=3181.981X47=3252.691,Y47=3252.691 X48=3323.
11、402,Y48=3323.402X49=3394.113,Y49=3394.113 X50=3464.823,Y50=3464.823X51=3535.534,Y51=3535.534 X52=3606.245,Y52=3606.245X53=3676.955,Y53=3676.955 X54=3747.666,Y54=3747.666X55=3818.377,Y55=3818.377-第一缓和曲线段 10 米桩-X1=3834.203,Y1=3834.232 X2=3841.230,Y2=3841.347X3=3848.226,Y3=3848.492 X4=3855.193,Y4=3855.
12、665X5=3862.130,Y5=3862.867 X6=3869.037,Y6=3870.097-圆曲线段 20 米桩-X1=3882.454,Y1=3884.928 X2=3895.496,Y2=3900.090X3=3908.156,Y3=3915.573 X4=3920.424,Y4=3931.367X5=3932.294,Y5=3947.464 X6=3943.757,Y6=3963.852X7=3954.808,Y7=3980.521 X8=3965.438,Y8=3997.461X9=3975.641,Y9=4014.662 X10=3985.411,Y10=4032.113X
13、11=3994.742,Y11=4049.802 X12=4003.628,Y12=4067.719X13=4012.063,Y13=4085.853 X14=4020.043,Y14=4104.192X15=4027.561,Y15=4122.724 X16=4034.614,Y16=4141.439X17=4041.197,Y17=4160.324 -第二缓和曲线段 10 米桩-X1=4046.999,Y1=4178.374X2=4049.807,Y2=4187.970X3=4052.575,Y3=4197.579X4=4055.302,Y4=4207.200X5=4057.990,Y5=
14、4216.831X6=4060.637,Y6=4226.474-第二直线段 100 米桩-X1=4063.245,Y1=4236.129 X2=4089.117,Y2=4332.724X3=4114.989,Y3=4429.319 X4=4140.861,Y4=4525.914X5=4166.733,Y5=4622.509 X6=4192.605,Y6=4719.105X7=4218.478,Y7=4815.700 X8=4244.350,Y8=4912.295X9=4270.222,Y9=5008.890 X10=4296.094,Y10=5105.485X11=4321.966,Y11=5
15、202.081 X12=4347.838,Y12=5298.676X13=4373.710,Y13=5395.271 X14=4399.582,Y14=5491.866X15=4425.454,Y15=5588.461 X16=4451.327,Y16=5685.057X17=4477.199,Y17=5781.652 X18=4503.071,Y18=5878.247X19=4528.943,Y19=5974.842 X20=4554.815,Y20=6071.437X21=4580.687,Y21=6168.033 X22=4606.559,Y22=6264.628X23=4632.431
16、,Y23=6361.223 X24=4658.304,Y24=6457.818X25=4684.176,Y25=6554.413 X26=4710.048,Y26=6651.009X27=4735.920,Y27=6747.604 X28=4761.792,Y28=6844.199X29=4787.664,Y29=6940.794 X30=4813.536,Y30=7037.389X31=4839.408,Y31=7133.985 X32=4865.280,Y32=7230.580X33=4891.153,Y33=7327.175 X34=4917.025,Y34=7423.770X35=4942.897,Y35=7520.366 X36=4968.769,Y36=7616.961X37=4994.641,Y37=7713.556 X38=5020.513,Y38=7810.151X39=5046.385,Y39=7906.746 X40=5072.257,Y40=8003.342X41=5098.129,Y41=8099.937 X42=5124.002,Y42=8196.532X43=5149.874,Y43=8293.127Press any key to continue线路工程计算机辅助设计程序作业姓名:马青福班级:土木 074 班学号:200702141