/************习题4-1凸轮轮廓曲线绘制程序**********/
#include
#include
#define PI 3.1415926
void main()
{
double e=10.0,ro=40.0,rt=10.0,h=20.0,phi1=150.0,phis=30.0,phi_1=120.0,phi_s=60;
/*各字母含义:e偏距,基圆半径ro,滚子半径rt,行程h,推程运动角phi1,远休止角phis,回程运动角phi_1,近休止角phi_s*/
double s,alp[73],x[73],y[73],x1,y1,xr[73],yr[73];
/*分别代表从动件位移,压力角,理论轮廓曲线点的位置x,y,x,y对运动角的微分,实际轮廓曲线的位置x,y*/
double ic,ic1,ic2,ic3,ic4,so,s1,cop,sip,phi,gam,bel,del=5.0,q,t; /*定义变量*/
int i;
gam=phi1+phis;
bel=phi1+phis+phi_1;
ic=(int)(360.0/del);
ic1=(int)(phi1/del);
ic2=(int)(gam/del);
ic3=(int)((phi1+phis+phi_1/2.0)/del);
ic4=(int)(bel/del);
so=sqrt(ro*ro-e*e);
printf("\n No THETA Theoreti