1、#include #include #define PI 3.14159#define E1 1e-3#define E0 1e-9#define m 4 #define N0 500 /double F(double xm,double t2,int n) /double pm;p0=0.4*cos(t2*PI/180)+1.650*cos(x0)+1.0*cos(x1)-x3;p1=0.4*sin(t2*PI/180)+1.650*sin(x0)-1.0*sin(x1)-0.360;p2=0.4*cos(t2*PI/180)+1.650*cos(x0)+0.6*cos(x1)-0.800*
2、cos(x2)-1.0p3=0.4*sin(t2*PI/180)+1.650*sin(x0)-0.6*sin(x1)-0.800*sin(x2); return pn;double A(double xm,int i,int j) /double pmm;p00=-1.650*sin(x0);p01=-1.0*sin(x1);p02=0;p03=-1;p10=1.650*cos(x0);p11=-1.0*cos(x1);p12=0;p13=0;p20=-1.650*sin(x0);p21=-0.600*sin(x1);p22=0.800*sin(x2);p23=0;p30=1.650*cos(
3、x0);p31=-0.600*cos(x1);p32=-0.800*cos(x2);p33=0;return pij;double G(double amm,int n,double bm) /int i,j,k,i1,j1;double temp;int row_maxmod;double element_maxmod;for(j=0;j=0;i-) /for(j=3;ji;j-)bi-=aij*bj;return bn;double C(double xm,double vm, double t2,int n) /double pm;p0=0.400*cos(t2*PI/180)+1.65
4、0*v0*v0*cos(x0)+1.000*v1*v1*cos(x1);p1=0.400*sin(t2*PI/180)+1.650*v0*v0*sin(x0)-1.000*v1*v1*sin(v1);p2=0.400*cos(t2*PI/180)+1.650*v0*v0*cos(x0)+0.600*v1*v1*cos(x1)-0.800*v2*v2*cos(v2);p3=0.400*sin(t2*PI/180)+11.650*v0*v0*sin(x0)-0.600*v1*v1*sin(x1)-0.800*v2*v2*sin(v2);return pn;int main()int i1=0,i,
5、j;double x4,a44,b4;double s4,v4,p4,c4;double t2;printf(“t a2(rad) a3(rad) a4(rad) Ln“);x0=54.9*PI/180;x1=98.4*PI/180;x2=70.9*PI/180;x3=1204.2;for(t2=0.0;t2E1 | fabs(b1)E1 | fabs(b2)E1 | fabs(b3)E1) elseprintf(“ “);for(i=0;i4;i+)printf(“%-15.3f“,xi);printf(“n“);for(i=0;i4;i+)for(j=0;j4;j+)aij=A(x,i,j
6、);b0=0.400*sin(t2*PI/180);b1=-0.400*cos(t2*PI/180);b2=0.400*sin(t2*PI/180);b3=-0.400*cos(t2*PI/180);for(i=0;i4;i+)vi=G(a,i,b);printf(“ “);for(j=0;j4;j+)printf(“%-15.3f“,vj);printf(“n“);for(j=0;j4;j+)cj=C(x,v,t2,j);printf(“ “);for(i=0;i4;i+)pi=G(a,i,c);for(j=0;j4;j+)printf(“%-15.3f“,pj);printf(“n“);return 0;