阅读量:0
- 计算acos(0.5)的值:
#include <stdio.h> #include <math.h> int main() { double x = 0.5; double result = acos(x); printf("acos(0.5) = %f\n", result); return 0; }
- 计算角度的反余弦值:
#include <stdio.h> #include <math.h> int main() { double angle = 45; // 角度值 double x = cos(angle * M_PI / 180); // 将角度转换为弧度 double result = acos(x); // 计算反余弦值 printf("The arccosine of %f is %f degrees\n", x, result * 180 / M_PI); // 将弧度值转换为角度值输出 return 0; }