做机械原理作业时发现求转动角很麻烦,故编此程序,勿笑我:)
#include<stdio.h> #include<math.h> main() { double angle,a,b,c,m,degree; /*ab为邻边,c为对边*/ printf("\na=,b=,c=\n"); scanf("%f,%f,%f",&a,&b,&c); m=(a*a+b*b-c*c)/(2*a*b); angle=acos(m); degree=57.29577951*angle; printf("angle=%f\ndegree=%f",angle,degree); }
|
阅读(1865) | 评论(0) | 转发(0) |